:root {
    --org-blue: #1565c0;
    --org-green: #2e7d32;
    --org-red: #c62828;
    --org-text: #2f2f2f;
    --org-muted: #666;
    --org-border: #d7d7d7;
    --org-bg: #e6e6e6;
    --org-card: #fff;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--org-bg);
    color: var(--org-text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}
a { color: var(--org-blue); }
.org-shell { max-width: 980px; margin: 0 auto; padding: 18px 14px 50px; }
.org-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 11px 14px;
    background: #222;
    color: #fff;
    border-radius: 7px;
}
.org-topbar-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: bold; }
.org-topbar-actions { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; margin-left: auto; }
.org-topbar-button {
    display: inline-block;
    background: #fff;
    color: #3c3c3c;
    border: 1px solid #e2e2e2;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    padding: 4px 11px;
}
.org-topbar-button:hover { background: #d2d2d2; }
.org-hero-card, .org-card, .org-service-card {
    background: var(--org-card);
    border: 1px solid var(--org-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.org-hero-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 20px;
    margin-bottom: 22px;
}
.org-kicker {
    color: var(--org-muted);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.org-hero-card h1 { margin: 0; font-size: clamp(24px, 5vw, 32px); line-height: 1.1; }
.org-subtitle { margin-top: 4px; font-size: 14px; color: var(--org-muted); }
.org-section { margin-top: 18px; }
.org-section h2 { margin: 0 0 6px; font-size: 18px; }
.org-section-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.org-text-link { font-size: 14px; font-weight: bold; text-decoration: none; }
.org-list { display: grid; gap: 10px; }
.org-card { padding: 14px 16px; }
.org-event-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.org-event-main { min-width: 0; }
.org-event-name { display: block; font-size: 19px; line-height: 1.2; font-weight: bold; text-decoration: none; }
.org-event-date { margin-top: 2px; color: var(--org-muted); font-size: 14px; }
.org-event-meta { margin-top: 2px; color: var(--org-muted); font-size: 14px; }
.org-status {
    display: inline-block;
    margin-top: 7px;
    border-radius: 999px;
    padding: 3px 11px;
    font-size: 12px;
    font-weight: bold;
}
.org-status.is-open { background: #dbf5dc; color: var(--org-green); border: 1px solid #a5d6a7; }
.org-status.is-closed { background: #ffe1e5; color: var(--org-red); border: 1px solid #ef9a9a; }
.org-event-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.org-button {
    display: inline-block;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    border-radius: 5px;
    padding: 5px 12px;
}
.org-button.is-primary { background: var(--org-green); color: #fff; border: 1px solid var(--org-green); }
.org-button.is-primary:hover { background: #dbf5dc; color: var(--org-green); border-color: #a5d6a7; }
.org-button.is-secondary { background: #d6eaf8; color: var(--org-blue); border: 1px solid #90caf9; }
.org-button.is-secondary:hover { background: #b1d8f3; color: #333; }
.org-service-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.org-service-card { padding: 15px; }
.org-service-title { font-size: 18px; font-weight: bold; margin-bottom: 4px; }
.org-service-copy { color: var(--org-muted); font-size: 14px; margin-bottom: 11px; }
.org-season-links { display: flex; flex-wrap: wrap; gap: 8px; }
.org-season-link {
    display: inline-block;
    background: #fff;
    border: 1px solid var(--org-border);
    border-radius: 6px;
    padding: 7px 11px;
    font-weight: bold;
    text-decoration: none;
}
.org-season-link:hover { background: #f4f4f4; }
.org-loading, .org-empty { color: #777; font-style: italic; }
.org-message { margin-top: 16px; padding: 12px 14px; border-radius: 6px; }
.org-message.is-error { background: #ffe1e5; border: 1px solid #ef9a9a; color: var(--org-red); }
.org-footer { color: #777; font-size: 12px; text-align: center; padding-top: 28px; }
@media (max-width: 650px) {
    .org-shell { padding: 8px 8px 35px; }
    .org-topbar { align-items: center; }
    .org-hero-card { padding: 15px; }
    .org-event-card { flex-direction: column; }
    .org-event-actions { justify-content: flex-start; }
}

/* Phase 3H-D — public organization following control. */
button.org-topbar-button {
    font: inherit;
    line-height: 1.45;
    cursor: pointer;
}

.org-follow-button.is-following {
    background: #e8f5e9;
    color: #256029;
    border-color: #9dcc9f;
}
.org-follow-button.is-following .org-follow-action-icon { fill: currentColor; }

.org-follow-button:disabled {
    opacity: .65;
    cursor: default;
}

/* Phase 3H-G2 — public event availability + registered-user actions. */
.org-public-page-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid #c7cdd1;
    background: #f2f4f5;
    color: #5f686e;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
}

.org-button.is-edit {
    background: var(--org-green);
    color: #fff;
    border: 1px solid var(--org-green);
}
.org-button.is-edit:hover {
    background: #1b5e20;
    color: #fff;
    border-color: #1b5e20;
}

/* Phase 3H-I1 — organization profile identity. */
.org-profile-image-wrap {
    flex: 0 0 auto;
    width: 112px;
    height: 112px;
}
.org-profile-image,
.org-profile-image-placeholder {
    width: 112px;
    height: 112px;
    border-radius: 10px;
    border: 1px solid var(--org-border);
    background: #f3f3f3;
}
.org-profile-image { display: block; object-fit: contain; object-position: center; background: #fff; }
.org-profile-image[hidden],
.org-profile-image-placeholder[hidden] {
    display: none !important;
}
.org-profile-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 42px;
    font-weight: bold;
}
.org-hero-main { min-width: 0; flex: 1 1 auto; }
.org-profile-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.org-profile-fact {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid #c7dff2;
    background: #eef5fb;
    color: #36556e;
    font-size: 12px;
    font-weight: bold;
}
.org-about-card { white-space: pre-wrap; }
@media (max-width: 650px) {
    /* Phase 3K-B.2 — keep organization identity text beside the profile image. */
    .org-hero-card {
        align-items: flex-start;
        flex-wrap: nowrap;
    }
    .org-profile-image-wrap {
        flex: 0 0 82px;
        width: 82px;
        height: 82px;
    }
    .org-profile-image,
    .org-profile-image-placeholder {
        width: 82px;
        height: 82px;
    }
    .org-profile-image-placeholder { font-size: 32px; }
    .org-hero-main {
        flex: 1 1 0;
        width: 0;
        min-width: 0;
    }
    .org-hero-card h1 {
        max-width: 100%;
        overflow-wrap: break-word;
    }
    .org-hero-actions:empty { display: none; }
}


/* Phase 3K-B — organization secondary navigation + public follow/email actions. */
.org-secondary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: -12px 0 22px;
    padding: 9px 12px;
    border: 1px solid var(--org-border);
    border-radius: 8px;
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.org-secondary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex-wrap: wrap;
}
.org-secondary-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 6px;
    color: #36556e;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}
a.org-secondary-nav-link:hover { background: #e7edf2; color: #1f3d56; }
.org-secondary-nav-link.is-current { background: #e7edf2; color: #1f3d56; }
.org-secondary-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}
.org-organization-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    margin: 0;
    padding: 6px;
    border: 1px solid #c4cbd1;
    border-radius: 7px;
    background: #fff;
    color: #34434f;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
.org-organization-action:hover { background: #eef2f5; border-color: #aeb8c0; }
.org-organization-action-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.org-organization-action[hidden] { display: none !important; }
@media (max-width: 650px) {
    .org-secondary-bar {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        margin-top: -12px;
    }
    .org-secondary-nav { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 1px; }
    .org-secondary-nav-link { white-space: nowrap; }
    .org-secondary-actions { justify-content: flex-start; flex-wrap: wrap; }
}


/* Phase 5D.1.1 — compact organization identity header for interior public pages.
   The full organization Home page keeps the original hero treatment. */
.pb-public-org-header.is-compact .org-hero-card {
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 18px;
}
.pb-public-org-header.is-compact .org-profile-image-wrap {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
}
.pb-public-org-header.is-compact .org-profile-image,
.pb-public-org-header.is-compact .org-profile-image-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
}
.pb-public-org-header.is-compact .org-profile-image-placeholder {
    font-size: 27px;
}
.pb-public-org-header.is-compact .org-hero-card h1 {
    font-size: clamp(20px, 3vw, 27px);
    line-height: 1.08;
}
.pb-public-org-header.is-compact .org-subtitle {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.3;
}
.pb-public-org-header.is-compact .org-secondary-bar {
    margin-top: -10px;
}
@media (max-width: 650px) {
    .pb-public-org-header.is-compact .org-hero-card {
        gap: 10px;
        padding: 10px 11px;
        margin-bottom: 17px;
    }
    .pb-public-org-header.is-compact .org-profile-image-wrap {
        width: 54px;
        height: 54px;
        flex-basis: 54px;
    }
    .pb-public-org-header.is-compact .org-profile-image,
    .pb-public-org-header.is-compact .org-profile-image-placeholder {
        width: 54px;
        height: 54px;
    }
    .pb-public-org-header.is-compact .org-profile-image-placeholder {
        font-size: 23px;
    }
    .pb-public-org-header.is-compact .org-hero-card h1 {
        font-size: clamp(19px, 6vw, 24px);
    }
    .pb-public-org-header.is-compact .org-subtitle {
        font-size: 12px;
    }
}


/* Phase 3I — Organization News / Announcements. */
.org-news-list { display: grid; gap: 10px; }
/* Phase 5D.3 — Organization Home is a preview surface, not the full news archive.
   auto-fit/minmax lets 1–3 cards share a row when room exists without a viewport breakpoint. */
.org-home-news-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); }
.org-home-news-list .org-news-card { min-width: 0; }
.org-home-news-list .org-news-card.has-image { grid-template-columns: 1fr; }
.org-home-news-list .org-news-image-link { width: 100%; }
.org-home-news-list .org-news-body {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}
.org-news-card h3 { margin: 2px 0 8px; font-size: 19px; line-height: 1.25; }
.org-news-date { color: var(--org-muted); font-size: 12px; font-weight: bold; text-transform: uppercase; letter-spacing: .035em; }
.org-news-body { color: #444; font-size: 14px; line-height: 1.55; }
.org-news-card:target { outline: 2px solid #90caf9; outline-offset: 2px; }

/* Phase 3I.4 — News preview cards + full article presentation. */
.org-news-card.has-image {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.org-news-card-copy { min-width: 0; }
.org-news-card h3 a { color: var(--org-text); text-decoration: none; }
.org-news-card h3 a:hover { color: var(--org-blue); text-decoration: underline; }
.org-news-image-link {
    display: block;
    overflow: hidden;
    border-radius: 6px;
    border: 1px solid var(--org-border);
    background: #f5f5f5;
}
.org-news-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #f5f5f5;
}
.org-news-actions { margin-top: 9px; }
.org-news-article-card { padding: 20px; }
.org-news-article-heading { margin-bottom: 14px; }
.org-news-article-heading h1 { margin: 3px 0 6px; font-size: clamp(26px, 5vw, 38px); line-height: 1.13; }
.org-news-article-image {
    display: block;
    width: min(100%, 900px);
    max-height: 560px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto 18px;
    border-radius: 8px;
    border: 1px solid var(--org-border);
    background: #fff;
}
.org-news-article-summary {
    margin: 0 0 18px;
    padding: 11px 13px;
    border-left: 4px solid #90caf9;
    background: #f4f9fd;
    color: #46545f;
    font-size: 15px;
    line-height: 1.55;
}
.org-news-article-body { color: #333; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.org-news-article-back { margin-top: 20px; }
@media (max-width: 650px) {
    .org-news-card.has-image { grid-template-columns: 1fr; }
    .org-news-image-link { max-width: 100%; }
    .org-news-article-card { padding: 15px; }
}


/* Phase 3J-A — organization email subscription control. */
.org-email-subscribe-button.is-subscribed {
    background: #e9f2fc;
    color: #1859a9;
    border-color: #9fc1ed;
}

.org-email-subscribe-button:disabled {
    opacity: .65;
    cursor: default;
}


/* Phase 3K-A — unified public account/login menu. */
.org-account-menu { position: relative; }
.org-account-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 270px;
    cursor: pointer;
    font: inherit;
    line-height: 1.45;
}
.org-account-menu-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.org-account-name-full,
.org-account-name-compact {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.org-account-name-compact { display: none; }
.org-account-menu-chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .15s ease;
}
.org-account-menu-button.is-open .org-account-menu-chevron { transform: rotate(180deg); }
.org-account-dropdown {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    padding: 6px;
    border: 1px solid #c9c9c9;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(0,0,0,.18);
}
.org-account-dropdown[hidden] { display: none !important; }
.org-account-dropdown-item {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #2f2f2f;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.org-account-dropdown-item:hover,
.org-account-dropdown-item:focus { background: #ededed; color: #111; }
@media (max-width: 720px) {
    .org-account-name-full { display: none; }
    .org-account-name-compact { display: inline; }
}
@media (max-width: 650px) {
    .org-account-menu { display: flex; flex-direction: column; align-items: flex-end; }
    .org-account-dropdown {
        right: 0;
        min-width: 155px;
    }
}

/* Phase 3J-A.1 — hidden topbar controls must remain hidden even though
   .org-topbar-button defines its own display value. */
.org-topbar-button[hidden] {
    display: none !important;
}

/* ========================================================================== */
/* PHASE 5B.4 — PUBLIC MEMBERSHIP PURCHASE ENTRY POINTS                       */
/* ========================================================================== */
.org-service-kicker {
    margin-bottom: 3px;
    color: #6a7680;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.org-membership-service-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.org-membership-service-card .org-service-copy {
    margin-bottom: 8px;
}

.org-service-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 11px;
    color: var(--org-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.org-service-action {
    margin-top: auto;
}

.org-service-status {
    display: inline-block;
    color: var(--org-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

/* ========================================================================== */
/* PUBLIC ORGANIZATION NAVIGATION — CONTENT-AWARE DESKTOP / MOBILE MENU       */
/* ========================================================================== */
.public-org-navigation {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

.public-org-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex-wrap: wrap;
}

/* The Home page keeps conditional links in the DOM and toggles the hidden
   attribute after public organization data loads. Keep author display rules
   from overriding that content-aware state. */
.public-org-nav-links .org-secondary-nav-link[hidden] {
    display: none !important;
}

.public-org-menu-toggle {
    display: none;
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 6px 11px;
    border: 1px solid #c4cbd1;
    border-radius: 7px;
    background: #fff;
    color: #34434f;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}

.public-org-menu-toggle:hover,
.public-org-menu-toggle:focus-visible {
    background: #eef2f5;
    border-color: #aeb8c0;
}

.public-org-menu-icon {
    font-size: 17px;
    line-height: 1;
}

@media (max-width: 650px) {
    /* Keep the mobile organization controls in the same compact bar: Menu on
       the left, organization actions on the right. They may wrap naturally
       only when the available width is genuinely too small. */
    .org-secondary-bar {
        align-items: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .public-org-navigation {
        width: auto;
        flex: 0 0 auto;
        overflow: visible;
    }

    .org-secondary-actions {
        margin-left: auto;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .public-org-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
    }

    .public-org-nav-links {
        display: none;
        position: absolute;
        z-index: 40;
        top: calc(100% + 6px);
        left: 0;
        width: min(280px, calc(100vw - 32px));
        max-height: min(70vh, 420px);
        overflow-y: auto;
        padding: 6px;
        border: 1px solid #c9d0d6;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(0,0,0,.16);
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .public-org-navigation.is-open .public-org-nav-links {
        display: flex;
    }

    .public-org-nav-links .org-secondary-nav-link {
        display: flex;
        width: 100%;
        min-height: 36px;
        padding: 8px 10px;
        white-space: normal;
    }

    .public-org-nav-links .org-secondary-nav-link[hidden] {
        display: none !important;
    }

    .public-org-nav-links .org-secondary-nav-link.is-current {
        background: #e7edf2;
    }
}
