/* The 1776 Post: restrained brick accents and review fixes. Loaded only by this platform. */
body .header a.header-button,
.ed-support .ed-button,
.ed-membership .ed-m-cta {
    background: var(--ed-accent);
    color: #fff !important;
}
body .header .mobile-account-btn a { background: var(--ed-accent) !important; }
.ed-label { background: var(--ed-accent); }
.ed-kicker { color: var(--ed-accent) !important; }
.ed-article__body blockquote { border-left-color: var(--ed-accent); }
body .ed-article .read-more-button-link {
    background: var(--ed-accent) !important;
    position: relative;
    z-index: 1;
}
body .ed-article .read-more-button-wrap::before {
    top: -180px;
    background: linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--ed-paper, #fff) 96%, transparent) 55%, var(--ed-paper, #fff) 82%) !important;
}
body .ed-rail #donation-widget .gform_wrapper .gform_footer .gform_button,
body #donation-popup .gform_footer .gform_button {
    background: var(--ed-accent) !important;
    color: #fff !important;
}

/* Keep the masthead centered when the membership CTA is omitted. */
@media (min-width: 1121px) {
    body .header .right-link.main-nav { margin: 0; }
    body .header .container:has(> .right-link.main-nav)::before { content: ""; display: block; order: 1; flex: 1 1 0; min-width: 0; }
}

/* A real button replaces the legacy menu anchor; no jQuery dependency. */
.ed-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ed-primary);
    cursor: pointer;
}
body .header .ed-menu-toggle svg { width: 28px; height: 28px; fill: currentColor; }
@media (max-width: 1120px) {
    body .header .container:has(.mobile-account-btn)::before { content: none; display: none; }
    body .header .menu-btn { display: block; order: 0; flex: 0 0 48px; }
    body .header .logo { order: 1; }
    body .header .mobile-account-btn { order: 2; }
    html.ed-navigation-ready body .mobile-nav { display: none !important; }
    html.ed-navigation-ready body.ed-navigation-open .mobile-nav { display: block !important; }
    body .mobile-nav .container { display: block; padding: 0 16px; }
    body .mobile-nav ul { display: block; }
    body .mobile-nav ul li { display: block; margin: 0; border-bottom: 1px solid var(--ed-rule); }
    body .mobile-nav ul li:last-child { border-bottom: 0; }
    body .mobile-nav a { display: block; padding: 8px 12px; line-height: 32px; min-height: 48px; box-sizing: border-box; }
}

/* The column paints the full article height; only its inner content sticks.
   Taller forms follow the page until their bottom fits. There is no nested scroll box. */
@media (min-width: 901px) {
    body .ed-rail:not(.ed-rail--light) {
        position: relative;
        top: auto;
        align-self: stretch;
        width: 100%;
        max-width: var(--ed-rail);
        box-shadow: none;
        clip-path: none;
        max-height: none;
        overflow: visible;
        overscroll-behavior: auto;
        padding: 32px;
    }
    .ed-rail__inner {
        position: sticky;
        top: var(--ed-rail-top, 32px);
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
        text-align: left;
    }
}
@media (max-width: 900px) {
    .ed-rail__inner { position: static; max-width: 520px; margin: 0 auto; }
}

/* A compact invitation keeps the discussion visible. The existing donation popup
   remains the payment flow, with a contribution-page link as its fallback. */
.ed-comments-page .ed-comment-donation-ready .donation-widget-form,
.ed-comments-page .ed-comment-donation-ready .donation-widget-slider { display: none !important; }
.ed-comments-page .sidebar-fake-for-donation:has(.ed-comment-donation-ready) { width: auto; max-width: 100%; }
.ed-comment-support {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(860px, calc(100% - 48px));
    margin: 20px auto;
    padding: 18px 24px;
    box-sizing: border-box;
    border-top: 3px solid var(--ed-accent);
    background: color-mix(in srgb, var(--ed-accent) 6%, #fff);
}
.ed-comment-support__title { margin: 0; font-family: var(--ed-headline); font-size: 22px; line-height: 1.3; color: var(--ed-ink); }
.ed-comment-support .ed-button { flex: 0 0 auto; background: var(--ed-accent); color: #fff !important; }
.ed-comments-page .ed-archive { padding-top: 12px; }
.ed-comments-page .ed-archive__title { font-size: clamp(24px, 3vw, 32px); margin-bottom: 20px; }
@media (max-width: 640px) {
    body .ed-article .read-more-button-wrap::before { top: -160px; }
    .ed-comment-support { width: calc(100% - 32px); padding: 14px 16px; margin: 16px auto; gap: 12px; }
    .ed-comment-support__title { font-size: 18px; }
    .ed-comment-support .ed-button { padding: 0 16px; font-size: 16px; }
}

/* Member Profile: editorial typography, quiet surfaces and brick account actions.
   All selectors stay inside this page; shared account/payment behavior is unchanged. */
html body .member-profile-page { max-width: 960px; padding: 40px 0 64px; color: var(--ed-ink); }
html body .member-profile-page .form-container { background: #fff; border: 1px solid var(--ed-rule) !important; border-top: 4px solid var(--ed-accent) !important; border-radius: 2px !important; padding: 36px 40px; box-shadow: 0 10px 32px rgba(37, 43, 39, .05); }
html body .member-profile-page .page-header { align-items: center; gap: 20px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--ed-rule); }
html body .member-profile-page .header-content { min-width: 0; }
html body .member-profile-page .header-content h3 { margin: 0; font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -.025em; }
html body .member-profile-page .header-actions { margin: 0; }
html body .member-profile-page :is(.subscriptions-section, .perks-section) { margin-bottom: 32px; }
html body .member-profile-page :is(.subscriptions-section, .perks-section) > h4 { font-size: 24px; line-height: 1.25; border: 0; padding: 0; margin: 0 0 20px; }
html body .member-profile-page .perks-section { padding-top: 28px; border-top: 1px solid var(--ed-rule); }
html body .member-profile-page :is(.no-subscriptions-text, .no-subscription-content, .perk-content) h4 { border: 0; padding-bottom: 0; }
html body .member-profile-page .perk-content h4 { font-size: 20px; line-height: 1.35; }
html body .member-profile-page .step-content strong { color: var(--ed-ink); }
html body .member-profile-page .subscriptions-list { gap: 14px; }
html body .member-profile-page .subscription-item { padding: 22px 24px; border: 1px solid var(--ed-rule); border-left: 3px solid var(--ed-accent); border-radius: 2px; background: #fff; box-shadow: none; gap: 20px; }
html body .member-profile-page .subscription-info { min-width: 0; }
html body .member-profile-page .subscription-name { font-size: 20px; line-height: 1.3; flex-wrap: wrap; overflow-wrap: anywhere; }
html body .member-profile-page .subscription-details { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
html body .member-profile-page .subscription-expires { color: #555b56; font-size: 15px; line-height: 1.5; }
html body .member-profile-page .subscription-status { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 2px; font-size: 12px; line-height: 1.35; letter-spacing: .06em; background: #f1f2ef; color: #555b56; }
html body .member-profile-page .subscription-status.active { background: #edf5ef; color: #27633c; }
html body .member-profile-page .subscription-status.expired { background: #fff6df; color: #795b19; }
html body .member-profile-page :is(.subscription-status.cancelled, .subscription-status.inactive) { background: color-mix(in srgb, var(--ed-accent) 8%, #fff); color: var(--ed-accent); }
html body .member-profile-page .contribution-note { font-size: 15px; line-height: 1.6; color: #555b56; max-width: 40rem; }
html body .member-profile-page .contribution-note.warning { color: var(--ed-accent); font-weight: 600; }
html body .member-profile-page .subscription-actions { gap: 10px; flex-wrap: wrap; }
html body .member-profile-page :is(.subscription-icon, .no-subscriptions-icon, .no-subscription-icon) { display: none; }
html body .member-profile-page :is(.customer-portal-btn, .manage-subscription-btn, .primary-btn, .secondary-btn, .change-avatar-btn, .logout-btn) { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; box-sizing: border-box; font-family: var(--ed-ui) !important; font-size: 16px; line-height: 1.25; font-weight: 600; text-transform: none; letter-spacing: 0; border-radius: 2px !important; text-decoration: none !important; transform: none !important; filter: none !important; box-shadow: none; transition: background-color .15s, border-color .15s, color .15s; }
html body .member-profile-page :is(.customer-portal-btn, .manage-subscription-btn, .primary-btn) { background: var(--ed-accent) !important; border: 1px solid var(--ed-accent) !important; color: #fff !important; }
html body .member-profile-page :is(.customer-portal-btn, .manage-subscription-btn, .primary-btn):hover { background: color-mix(in srgb, var(--ed-accent) 88%, #000) !important; border-color: color-mix(in srgb, var(--ed-accent) 88%, #000) !important; }
html body .member-profile-page :is(.secondary-btn, .change-avatar-btn, .logout-btn) { margin-left: 0; background: #fff !important; border: 1px solid #bfc4bf; color: var(--ed-ink) !important; }
html body .member-profile-page :is(.secondary-btn, .change-avatar-btn, .logout-btn):hover { background: var(--ed-paper, #fff) !important; border-color: var(--ed-accent); color: var(--ed-accent) !important; }
html body .member-profile-page :is(.btn, .manage-subscription-btn, .customer-portal-btn, .logout-btn, .change-avatar-btn):focus-visible { outline: 3px solid var(--ed-accent); outline-offset: 3px; }
html body .member-profile-page :is(.no-subscriptions, .no-active-subscription) { text-align: left; padding: 28px; border: 1px solid var(--ed-rule); border-radius: 2px; background: color-mix(in srgb, var(--ed-accent) 4%, #fff); }
html body .member-profile-page :is(.no-subscriptions-text, .no-subscription-content) h4 { margin: 0 0 10px; font-size: 22px; }
html body .member-profile-page :is(.no-subscriptions-text, .no-subscription-content) p { margin: 0; color: #555b56; font-size: 16px; line-height: 1.6; }
html body .member-profile-page .perk-item { border: 1px solid var(--ed-rule); border-radius: 2px; margin-bottom: 18px; }
html body .member-profile-page .perk-header { background: #f7f7f3; padding: 14px 20px; border-bottom: 1px solid var(--ed-rule); }
html body .member-profile-page .perk-toggle { position: relative; min-height: 48px; }
html body .member-profile-page .perk-title { font-family: var(--ed-ui) !important; font-size: 17px; font-weight: 600; line-height: 1.45; }
html body .member-profile-page .perk-toggle input[type=checkbox] { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
html body .member-profile-page .perk-toggle:focus-within { outline: 3px solid var(--ed-accent); outline-offset: 4px; }
html body .member-profile-page .toggle-switch { width: 46px; min-width: 46px; background: #d1d5d0; margin-right: 14px; }
html body .member-profile-page .perk-toggle input:checked + .toggle-switch { background: var(--ed-accent); }
html body .member-profile-page .perk-toggle input:checked + .toggle-switch::after { left: 22px; }
html body .member-profile-page .perk-content { padding: 24px; }
html body .member-profile-page .section-description { color: #555b56; font-size: 16px; line-height: 1.6; margin-bottom: 24px; }
html body .member-profile-page .form-control { height: 48px; padding: 10px 14px; box-sizing: border-box; border: 1px solid #bfc4bf; border-radius: 2px; font-size: 16px; line-height: 1.5; background: #fff; color: var(--ed-ink); }
html body .member-profile-page .form-control:focus { border-color: var(--ed-accent); outline: 3px solid color-mix(in srgb, var(--ed-accent) 20%, transparent); outline-offset: 1px; }
html body .member-profile-page .form-control[readonly] { background: #f5f5f1; }
html body .member-profile-page .form-text { font-size: 14px; line-height: 1.5; color: #626862; margin-top: 8px; }
html body .member-profile-page .avatar-editor { border: 1px dashed #bfc4bf; border-radius: 2px; background: #fafaf7; padding: 24px; }
html body .member-profile-page .avatar-preview img { border: 2px solid var(--ed-rule) !important; border-radius: 50% !important; }
html body .member-profile-page :is(.primary-badge-method, .badge-status-awarded, .form-help) { background: #f7f7f3; border-color: var(--ed-rule); border-radius: 2px; box-shadow: none; }
html body .member-profile-page :is(.badge-info p, .primary-badge-method p) { color: var(--ed-ink); }
html body .member-profile-page .step-number { background: var(--ed-accent) !important; }
html body .member-profile-page .form-actions { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--ed-rule); text-align: left; }
html body .member-profile-page .form-actions .primary-btn { min-width: 180px; }
html body .member-profile-page :is(.success-message, .error-message) { border-radius: 2px; line-height: 1.6; }
@media (max-width: 640px) {
    html body .member-profile-page { padding: 24px 0 40px; }
    html body .member-profile-page .form-container { padding: 24px 16px; }
    html body .member-profile-page .page-header { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 20px; }
    html body .member-profile-page .header-actions { display: block; margin: 0; }
    html body .member-profile-page .logout-btn { padding: 10px 14px; }
    html body .member-profile-page .subscription-item { display: block; padding: 18px 16px; }
    html body .member-profile-page .subscription-name { font-size: 19px; flex-direction: row; gap: 8px; }
    html body .member-profile-page .subscription-actions { margin-top: 16px; width: 100%; justify-content: flex-start; }
    html body .member-profile-page .subscription-actions .manage-subscription-btn { flex: 1 1 auto; }
    html body .member-profile-page .perk-header { padding: 12px 16px; }
    html body .member-profile-page .perk-title { font-size: 16px; }
    html body .member-profile-page .perk-content { padding: 20px 16px; }
    html body .member-profile-page .avatar-editor { padding: 16px; }
    html body .member-profile-page .upload-placeholder { padding: 16px 8px; }
    html body .member-profile-page .form-actions .primary-btn { width: 100%; }
}

/* End-of-article author card; other platforms keep their original author box. */
.ed-author {
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--ed-rule);
    border-radius: 12px;
    background: #f7f7f7;
    box-sizing: border-box;
}
.ed-author__image { flex: 0 0 96px; }
.ed-author__image img { display: block; width: 96px; height: 96px; }
.ed-author__label { margin: 0 0 8px; color: #666; font-size: 14px; line-height: 1.4; }
.ed-author__name { margin: 0 0 10px; font-size: 20px; line-height: 1.4; }
.ed-author__bio { line-height: 1.65; }
@media (max-width: 640px) {
    .ed-author { flex-direction: column; gap: 16px; padding: 20px; }
    .ed-author__image { flex-basis: auto; }
}

/* Fixed-sidebar desktop mode: one bounded column at the actual window edge.
   The page reserves its width; no shadow or paint extends across the right gutter. */
@media (min-width: 1280px) {
    body.the1776-fixed-rail {
        --ed-rail: 400px;
        padding-right: var(--ed-rail);
        box-sizing: border-box;
    }
    body.the1776-fixed-rail .ed-article-layout--fixed-sidebar {
        display: block;
        max-width: var(--ed-text);
        margin: 0 auto;
    }
    body.the1776-fixed-rail .ed-article-layout--fixed-sidebar > .ed-rail {
        position: fixed;
        inset: 0 0 0 auto;
        width: var(--ed-rail);
        max-width: var(--ed-rail);
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        max-height: none;
        padding: 32px 24px;
        box-sizing: border-box;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: var(--ed-primary);
        box-shadow: none;
        clip-path: none;
        z-index: 100;
    }
    body.the1776-fixed-rail .ed-rail .ed-rail__inner { position: static; top: auto; max-width: none; }
    body.the1776-fixed-rail .ed-rail__tagline {
        font-family: "Source Serif 4", Georgia, "Times New Roman", "Liberation Serif", "Nimbus Roman", serif;
    }
    body.admin-bar.the1776-fixed-rail .ed-article-layout--fixed-sidebar > .ed-rail { top: 32px; height: calc(100dvh - 32px); }
}
