body.CommunityLight {
    background-color: #f4f4f4 !important;
}

/* ── Community index page ── */
.comm-page {
    max-width: 1225px;
    margin: 30px auto 60px;
    padding: 0 24px;
}

.comm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.comm-panel {
    background: #fff;
    border: 1px solid #c4c3c3;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.comm-panel-header {
    background: linear-gradient(135deg, #0d1526 0%, #1e2f52 100%);
    padding: 16px 20px;
    border-bottom: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.comm-panel-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 2px;
}

.comm-panel-caption {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    display: block;
}

.comm-panel-body {
    padding: 20px;
}

.comm-empty {
    color: #6b7280;
    font-size: 0.9rem;
    padding: 12px 0;
}

@media (max-width: 720px) {
    .comm-grid {
        grid-template-columns: 1fr;
    }
}

.CommunityShell {
    max-width: 1225px;
    margin: 50px auto 50px;
    padding: 24px;
    background-color: #ffffff;
    border: 1px solid #c4c3c3;
    border-radius: 6px;
}

.community-highlights {
    background-color: #fff;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.community-highlights .CommunityShell {
    margin: 0 auto 0;
    width: 100%;
    max-width: 1100px;
}

.community-highlights .CommunityShell .PageContainer {
    width: auto;
}

.community-highlights .CommunityHeader {
    background: linear-gradient(135deg, #0d1526 0%, #1e2f52 100%);
    padding: 14px 20px;
    border-radius: 6px 6px 0 0;
    margin: -20px -20px 20px;
    gap: 4px;
}

.community-highlights .CommunitySectionTitle {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0;
}

.community-highlights .CommunitySectionCaption {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.CommunityHero {
    background-image: url('/images/communityhero.jpg?v=507c225d24');
    background-size: cover;
    background-position: center;
    min-height: 60vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 20px 60px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.CommunityHero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(10, 15, 35, 0.25) 0%, rgba(10, 15, 35, 0.6) 100%);
}

.CommunityHeroContent {
    position: relative;
    z-index: 1;
    padding: 28px;
    text-align: center;
    width: 90%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.CommunityHeroEyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--antique-gold);
    margin-bottom: 14px;
}

.CommunityHero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.05;
    margin: 0 0 16px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.CommunityHero p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
    margin: 0;
    line-height: 1.6;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.CommunityHeroSpacer {
    height: 24px;
}

/* Compact hero for community sub-pages (events calendar, newsletters) */
.CommunityHero--sub {
    min-height: 34vh;
    padding: 110px 20px 48px;
}

.CommunityHero--sub h1 {
    font-size: 2.2rem;
}

.CommunityHero--sub p {
    font-size: 1rem;
}

/* "View All" footer link on community index panels */
.comm-panel-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.comm-view-all {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1e40af;
    text-decoration: none;
    padding: 9px 22px;
    border: 1.5px solid #1e40af;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.comm-view-all:hover {
    background: #1e40af;
    color: #fff;
}

/* Back button on community sub-pages — mirrors .nav-back-btn from listing.css
   (values resolved from its --slate/--navy vars, which aren't loaded here) */
.cal-topbar .nav-back-btn,
.nl-topbar .nav-back-btn {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7590;
    padding: 7px 14px;
    border: 1.5px solid #d0d4dc;
    border-radius: 8px;
    transition: all .2s;
    text-decoration: none;
}

.cal-topbar .nav-back-btn:hover,
.nl-topbar .nav-back-btn:hover {
    color: #0d1526;
    border-color: #1e2f52;
    background: #f4f5f7;
    transform: translateY(-3px);
}

.cal-topbar .nav-back-btn:active,
.nl-topbar .nav-back-btn:active {
    transform: translateY(3px);
}

.cal-topbar .nav-back-btn svg,
.nl-topbar .nav-back-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.CommunityShell .PageContainer {
    width: 900px;
    max-width: 100%;
    align-items: stretch;
}

.CommunityShell .PageContainer > * {
    width: 100%;
}

.CommunityShell .PageContainer form,
.CommunityShell .PageContainer .form-group,
.CommunityShell .PageContainer .form-group input,
.CommunityShell .PageContainer .form-group textarea,
.CommunityShell .PageContainer .form-group select {
    width: 100%;
    box-sizing: border-box;
}

.CommunityPage {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

.CommunityHeader {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.CommunitySection {
    margin: 20px 0 40px;
}

.CommunitySplit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
}

.CommunityPanel {
    background-color: #ffffff;
    border: 1px solid #c4c3c3;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.CommunitySection.CommunityPanel {
    margin: 0;
}

.CommunityColumn {
    margin: 0;
}

.CommunitySectionTitle {
    font-size: 28px;
    margin-bottom: 8px;
}

.CommunitySectionCaption {
    color: #555;
}

.CommunityGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.community-card .card-body {
    align-items: flex-start;
}

.community-card .card-title {
    text-align: left;
    min-height: auto;
    color: #1f2d3d;
}

.community-card .card-text {
    text-align: left;
}

.CommunityMeta {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 10px;
}

.CommunityBadge {
    display: inline-block;
    background: #1d4ed8;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    margin-top: 10px;
}

.EventGroups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.EventGroup {
    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 10px;
    padding: 16px;
}

.EventGroupTitle {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: #1f2d3d;
}

.EventList {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.EventItem {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.EventItem:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.EventTitle {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2d3d;
    text-decoration: none;
}

.EventTitle:hover {
    text-decoration: underline;
}

.EventMeta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: #6c757d;
    font-size: 0.9rem;
}

.EventTag {
    background: #f1f4f8;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.CommunityDetail {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px 50px;
}

.ListingActionBar {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.back-arrow-button {
    display: inline-block;
    background: #1e40af;
    color: white;
    text-decoration: none;
    padding: 10px 25px 10px 45px;
    position: relative;
    border-radius: 4px;
    border: 1.5px solid #6f6f6f;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px #03020233;
    transition: background 0.2s ease, transform 0.2s ease;
}

.back-arrow-button::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background-color: white;
    clip-path: polygon(100% 0%, 0% 50%, 100% 100%);
    border-radius: 4px;
}

.back-arrow-button:hover {
    background: #1e40af;
    transform: translateY(-3px);
}

.listingButtons {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.listingButtons form,
.listingButtons .inline-form {
    margin: 0;
}

.form-group .hint {
    display: block;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 6px;
}

label.hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-weight: 500;
    color: #4a4a4a;
}

label.hint input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.CommunityImagePreview {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.CommunityImagePreview img {
    max-width: 260px;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #c4c3c3;
}

.CommunityPreviewGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.CommunityPreviewGrid img {
    max-width: 100%;
}

.Delete {
    display: flex;
    background-color: red !important;
}

.CommunityDetailTitle {
    font-size: 32px;
    margin-bottom: 10px;
    color: #1f2d3d;
}

.CommunityDetailMeta {
    color: #6c757d;
    margin-bottom: 20px;
}

.CommunityCarousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.CommunityCarousel img {
    max-height: 320px;
    border-radius: 12px;
    border: 1px solid #d6d6d6;
    object-fit: cover;
}

.CommunityImageCarousel {
    margin: 20px auto;
    max-width: 760px;
}

.CommunityImageCarousel .MainImageContainer {
    position: relative;
    width: 100%;
    max-width: 760px;
    height: auto;
    overflow: hidden;
    background-color: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #c4c3c3;
}

.CommunityImageCarousel .MainImg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
}

.CommunityImageCarousel .ImageCount {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    z-index: 16;
}

.CommunityImageCarousel .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(72, 71, 71, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    font-size: 1.5rem;
}

.CommunityImageCarousel .left-arrow {
    left: 10px;
}

.CommunityImageCarousel .right-arrow {
    right: 10px;
}

.CommunityCarouselSources {
    display: none;
}

.CommunityBody {
    font-size: 1rem;
    line-height: 1.7;
    color: #1f2d3d;
}

.CommunityBody p {
    margin: 0 0 1rem;
}

.CommunityBody p:last-child {
    margin-bottom: 0;
}

.CommunityBody ul,
.CommunityBody ol {
    margin: 0 0 1rem 1.25rem;
}

.CommunityBody blockquote {
    margin: 1rem 0;
}

.CommunityBody h1,
.CommunityBody h2,
.CommunityBody h3,
.CommunityBody h4 {
    margin-top: 20px;
}

.CommunityBody blockquote {
    border-left: 3px solid #1d4ed8;
    padding-left: 16px;
    color: #4a4a4a;
}

@media (max-width: 720px) {
    .CommunityShell .PageContainer {
        min-width: 0;
    }

    .CommunitySplit {
        grid-template-columns: 1fr;
    }

    .CommunitySectionTitle {
        font-size: 24px;
    }

    .CommunityDetailTitle {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .CommunityHero h1 {
        font-size: 2.4rem;
    }

    .CommunityHero p {
        font-size: 0.95rem;
    }

    .CommunityHero {
        padding: 80px 16px 40px;
    }

    .comm-page {
        padding: 0 12px;
        margin-top: 16px;
    }

    .comm-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ── Community Detail Pages (modern redesign) ── */

body.community-detail-page {
    background-color: #f4f4f4;
}



/* Action bar */
.cd-action-bar {
    margin-top: 80px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #0d1526 0%, #1e2f52 100%);
    border-bottom: none;
}


.cd-action-bar .hero-back-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 8px !important;
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.cd-action-bar .hero-back-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: none !important;
}

.cd-admin-btns {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cd-admin-btns .action-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1.5px solid transparent;
    transition: all .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
}

.cd-admin-btns .btn-edit   { background: #0d1526; color: #fff; }
.cd-admin-btns .btn-edit:hover { background: #1e2f52; color: #fff; }
.cd-admin-btns .btn-delete { background: #da1515; color: #fff; }
.cd-admin-btns .btn-delete:hover { filter: brightness(.92); color: #fff; }

.cd-admin-form { display: contents; }

.btn-delete-community {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

/* Page wrapper */
.cd-page {
    /* The card's padding, named so the blue header below can pull itself out
       to the card's edges by exactly this much at every width. */
    --cd-pad-y: 32px;
    --cd-pad-x: 24px;
    max-width: 1100px;
    margin: 24px auto 48px;
    padding: var(--cd-pad-y) var(--cd-pad-x) 60px;
    min-height: calc(100vh - 200px);
    background: #f8f9fb;
    border: 1px solid #c4c3c3;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Blue page header banner */
.cd-blue-header {
    background: linear-gradient(135deg, #0d1526 0%, #1e2f52 100%);
    color: #fff;
    /* Out to the card's edges — by the card's own padding, never a literal:
       a literal -24px overshot the card by 10px a side once phones padded it
       14px (UAT #155 follow-up, 2026-09-26). */
    margin: calc(-1 * var(--cd-pad-y)) calc(-1 * var(--cd-pad-x)) 28px;
    padding: 36px 32px 52px;
    border-radius: 7px 7px 0 0;
}

.cd-blue-header .cd-title {
    color: #fff;
    margin-bottom: 10px;
}

.cd-blue-header .cd-meta {
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0;
    margin-top: 10px;
}

.cd-blue-header .cd-meta-dot {
    color: rgba(255, 255, 255, 0.45);
}

.cd-blue-header .cd-meta-link,
.cd-blue-header .cd-meta-link--light {
    color: #bfdbfe;
}

.cd-blue-header .cd-meta-link:hover,
.cd-blue-header .cd-meta-link--light:hover {
    color: #fff;
    text-decoration: underline;
}

.cd-blue-header .cd-event-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    margin-bottom: 12px;
}

/* Shared title / meta */
.cd-title {
    font-size: 2rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin: 0 0 10px;
}

.cd-meta {
    font-size: 0.88rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 20px;
}

.cd-meta-dot { color: #d1d5db; }

.cd-meta-link { color: #1e40af; text-decoration: none; }
.cd-meta-link:hover { text-decoration: underline; }

/* Newsletter article layout */
.cd-article {
    max-width: 780px;
    margin: 0 auto;
}

.cd-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.cd-blue-header.cd-header {
    border-bottom: none;
    margin-bottom: 0;
}

/* Carousel */
.cd-carousel {
    margin: 0 0 28px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Body prose */
.cd-body {
    font-size: 1rem;
    line-height: 1.75;
    color: #1f2937;
}

/* Event layout */
.cd-event-header {
    margin-bottom: 28px;
}

.cd-event-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.cd-event-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

.cd-event-main { min-width: 0; }

/* Info card */
.cd-info-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 100px;
}

.cd-info-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cd-info-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.cd-info-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #111827;
}

.cd-info-sub {
    font-size: 0.82rem;
    color: #6b7280;
    margin-top: 2px;
}

.cd-map-link {
    font-size: 0.82rem;
    color: #1e40af;
    text-decoration: none;
    margin-top: 3px;
    display: inline-block;
}
.cd-map-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .cd-page { --cd-pad-y: 20px; --cd-pad-x: 16px; padding-bottom: 48px; }
    .cd-title { font-size: 1.5rem; }
    .cd-event-layout {
        grid-template-columns: 1fr;
    }
    .cd-info-card { position: static; }
    .cd-event-sidebar { order: -1; }
}

@media (max-width: 480px) {
    .cd-action-bar { padding: 10px 14px; }
    .cd-title { font-size: 1.3rem; }
}

/* ── Detail pages: the Markdown body's own type scale, and phone spacing
   (UAT #155). The body is rendered Markdown, and .CommunityBody set no
   heading sizes, so a "#" line took the browser's h1 and the same post read
   at three sizes depending on what was typed. ── */
.CommunityBody h1,
.CommunityBody h2,
.CommunityBody h3,
.CommunityBody h4 { line-height: 1.3; margin: 20px 0 8px; color: inherit; }
.CommunityBody h1 { font-size: 1.5rem; }
.CommunityBody h2 { font-size: 1.3rem; }
.CommunityBody h3 { font-size: 1.15rem; }
.CommunityBody h4 { font-size: 1.05rem; }
.CommunityBody p,
.CommunityBody li { font-size: 1rem; }
.CommunityBody img { max-width: 100%; height: auto; }

@media (max-width: 720px) {
  /* The 80px bar clears the fixed header; everything under it tightens. */
  .cd-action-bar { padding: 8px 12px; }
  .cd-page { --cd-pad-y: 16px; --cd-pad-x: 14px; margin: 10px 10px 28px; padding-bottom: 32px; min-height: 0; }
  .cd-blue-header { padding: 24px 16px 32px; margin-bottom: 16px; }
  .cd-event-header { margin-bottom: 16px; }
  .cd-title { font-size: 1.5rem; }
}
