/* ============================================================================
   KOSIS — assets/css/kosis-brand-extensions.css
   ----------------------------------------------------------------------------
   v2.0 · Full rewrite · 20 May 2026

   WHAT CHANGED (vs v1.2)
   ----------------------------------------------------------------------------
   · Removed sidebar-width override (--kosis-sidebar-width: 210px). The single
     source of truth now lives in kosis-dashboard.css (260px / 88px / 0px).

   · Added .ks-setlist-feature and its children — fixes the giant music-note
     SVG that filled the content area on the Set Lists page.
     [Brand Book §07 — Hero card surface]

   · Added .ks-devotional and children — used by Messages and Polls for the
     parchment-coloured devotional block. [§07 — Scripture card]

   · Added .ks-tabs and .ks-tab — horizontal tab strip used by Messages.

   · Added .ks-inline-scripture — italic gold pull-quote used by Set Lists.

   · Added .ks-h1/h2/h3 + .ks-h*--invert with the brand gold-underline motif.
     [§08 — "The single most-repeated brand element"]

   · Added .ks-h2 size 18px / .ks-h3 size 14px per type scale. [§06]

   · Hardened load order — assumes brand.css and dashboard.css have already
     loaded, so this file only ADDS components, never resets tokens.

   LOAD ORDER (head-dashboard.php)
     1. kosis-brand.css            ← design tokens
     2. kosis-dashboard.css        ← layout + chrome
     3. kosis-brand-extensions.css ← THIS FILE
   ========================================================================= */


/* ── 1. Page content wrapper (1280px LEFT-aligned column) ─────────────────── */
/* Left-aligned (margin-right:auto) so content hugs the sidebar instead of
   floating in the centre of ultra-wide monitors with a large empty left band.
   Matches .main > * in kosis-dashboard.css §12. */
.kosis-page-content {
    max-width: 1280px;
    margin: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--ks-space-lg);
}


/* ── 2. Headings — gold underline motif (§08) ────────────────────────────── */
.ks-h1,
.ks-h2,
.ks-h3 {
    font-family: var(--ks-font-serif);
    font-weight: 500;
    color: var(--ks-navy);
    line-height: 1.2;
    margin: 0 0 var(--ks-space-md);
    padding-bottom: 8px;
    position: relative;
}

.ks-h1 { font-size: 22px; }       /* §06 type scale */
.ks-h2 { font-size: 18px; }
.ks-h3 { font-size: 14px; }

.ks-h1::after,
.ks-h2::after,
.ks-h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 32px;
    height: 1.5px;
    background: var(--ks-gold);
}

.ks-h1--invert,
.ks-h2--invert,
.ks-h3--invert { color: var(--ks-cream); }


/* ── 3. Cards (foundational surface) ─────────────────────────────────────── */
.ks-card {
    background: #ffffff;
    border: 0.5px solid var(--ks-border);
    border-radius: var(--ks-radius-md);
    padding: var(--ks-space-lg);
    margin-bottom: 0;            /* Spacing handled by parent gap */
    box-sizing: border-box;
}

/* Hero card — navy background, cream text, faint kinnor watermark */
.ks-card--hero {
    background: var(--ks-navy);
    color: var(--ks-cream);
    border: none;
    position: relative;
    overflow: hidden;
}

.ks-card--hero p,
.ks-card--hero h1,
.ks-card--hero h2,
.ks-card--hero h3 { color: var(--ks-cream); }

.ks-card--hero::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 56px;
    height: 56px;
    background-image: url('/assets/brand/kosis-sidebar.svg');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.12;
    pointer-events: none;
}

/* Empty state — dashed border, muted text */
.ks-card--empty {
    background: transparent;
    border: 0.8px dashed var(--ks-border);
    text-align: center;
    color: var(--ks-slate);
    padding: var(--ks-space-lg);
}

/* Italic gold pull-quote inside any card */
.ks-quote {
    display: block;
    font-family: var(--ks-font-serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ks-gold);
    margin-top: var(--ks-space-md);
}


/* ── 4. About stats (3 tiles inside about card) ──────────────────────────── */
.ks-about-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--ks-space-sm);
    margin-top: var(--ks-space-md);
}

.ks-stat-tile {
    background: var(--ks-parchment);
    border-radius: var(--ks-radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ks-stat-tile__label {
    font-family: var(--ks-font-sans);
    font-size: 9px;
    letter-spacing: 1.2px;
    color: var(--ks-gold);
    text-transform: uppercase;
    font-weight: 600;
}

.ks-stat-tile__value {
    font-family: var(--ks-font-sans);
    font-size: 12px;
    color: var(--ks-navy);
    font-weight: 500;
    line-height: 1.3;
}


/* ── 5. Stat card (big number, e.g. Members count) ───────────────────────── */
.ks-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    color: var(--ks-navy);
}

.ks-stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--ks-radius-sm);
    background: var(--ks-sage);
    color: var(--ks-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 4px;
}

.ks-stat-card__icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.ks-stat-card__number {
    font-family: var(--ks-font-serif);
    font-size: 28px;
    font-weight: 600;
    color: var(--ks-navy);
    line-height: 1;
}

.ks-stat-card__label {
    font-family: var(--ks-font-sans);
    font-size: 10px;
    letter-spacing: 1.2px;
    color: var(--ks-slate);
    text-transform: uppercase;
    font-weight: 500;
}

.ks-stat-card__action {
    color: var(--ks-sage);
    font-size: 11px;
    margin-top: 8px;
    font-family: var(--ks-font-sans);
}


/* ── 6. Pill badge (EVENT, NONE, etc.) ───────────────────────────────────── */
.ks-pill-badge {
    background: var(--ks-parchment);
    color: var(--ks-gold);
    font-family: var(--ks-font-sans);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}


/* ── 7. Document list ────────────────────────────────────────────────────── */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--ks-space-sm);
    padding: 8px 10px;
    border-radius: var(--ks-radius-sm);
    color: var(--ks-navy);
    font-family: var(--ks-font-sans);
    font-size: 12px;
    text-decoration: none;
    transition: background 120ms ease;
}

.doc-item:hover {
    background: var(--ks-parchment);
    text-decoration: none;
}

.doc-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ks-navy);
}

.doc-left svg {
    color: var(--ks-slate);
    stroke: currentColor;
    fill: none;
}

.doc-item .external {
    color: var(--ks-muted);
    font-size: 11px;
}


/* ── 8. Grid utilities ───────────────────────────────────────────────────── */
.ks-grid {
    display: grid;
    gap: var(--ks-space-md);
}

.ks-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ks-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1100px) {
    .ks-grid--3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .ks-grid--2,
    .ks-grid--3 { grid-template-columns: 1fr; }
}


/* ── 9. Welcome banner (2-up: hero + about) ──────────────────────────────── */
.welcome-banner {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: var(--ks-space-md);
}

.welcome-banner .ks-card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1100px) {
    .welcome-banner { grid-template-columns: 1fr; }
}


/* ── 10. Footer scripture band ───────────────────────────────────────────── */
.ks-footer-scripture {
    background: var(--ks-parchment);
    border: 0.5px solid var(--ks-border);
    border-radius: var(--ks-radius-md);
    padding: var(--ks-space-md) var(--ks-space-lg);
    text-align: center;
    margin-top: var(--ks-space-md);
}

.ks-footer-scripture__quote {
    font-family: var(--ks-font-serif);
    font-style: italic;
    font-size: 13px;
    color: var(--ks-navy);
    margin: 0 0 6px;
    line-height: 1.5;
}

.ks-footer-scripture__ref {
    display: inline-block;
    font-family: var(--ks-font-serif);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--ks-gold);
    text-transform: uppercase;
}


/* ── 11. Page marker (bottom of every page) ──────────────────────────────── */
.ks-page-marker {
    text-align: center;
    font-family: var(--ks-font-sans);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--ks-muted);
    text-transform: uppercase;
    padding: var(--ks-space-md) 0;
    margin-top: var(--ks-space-lg);
    border-top: 0.5px solid var(--ks-border);
}


/* ── 12. Set list feature card (FIXES THE GIANT SVG BUG) ─────────────────── */
.ks-setlist-feature {
    display: flex;
    align-items: center;
    gap: var(--ks-space-md);   /* was --ks-space-lg: tightened icon<->title gap */
}

.ks-setlist-feature__icon {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;             /* CRITICAL — was filling parent before */
    border-radius: 50%;
    background: rgba(212, 169, 85, 0.12);
    color: var(--ks-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ks-setlist-feature__icon svg {
    width: 28px;                /* Fixed size, not 100% */
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ks-setlist-feature__body {
    flex: 1;
    min-width: 0;
}

.ks-setlist-feature__title {
    font-family: var(--ks-font-serif);
    font-size: 22px;
    font-weight: 500;
    color: var(--ks-cream);
    margin: 0 0 6px;
    line-height: 1.2;
}

.ks-setlist-feature__meta {
    font-family: var(--ks-font-sans);
    font-size: 12px;
    color: var(--ks-muted);
    margin: 0 0 8px;
}

.ks-setlist-feature__quote {
    display: block;
    font-family: var(--ks-font-serif);
    font-style: italic;
    font-size: 12px;
    color: var(--ks-gold);
    margin-top: 6px;
}


/* ── 13. Devotional block (Messages / Polls) ─────────────────────────────── */
.ks-devotional {
    background: var(--ks-parchment);
    border: 0.5px solid var(--ks-border);
    border-radius: var(--ks-radius-md);
    padding: var(--ks-space-md) var(--ks-space-lg);
    margin-top: var(--ks-space-md);
    display: flex;
    align-items: flex-start;
    gap: var(--ks-space-md);
}

.ks-devotional__icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    background-image: url('/assets/brand/kosis-sidebar.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.7;
}

.ks-devotional__body {
    flex: 1;
    min-width: 0;
}

.ks-devotional__title {
    font-family: var(--ks-font-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--ks-navy);
    margin: 0 0 4px;
}

.ks-devotional__text {
    font-family: var(--ks-font-sans);
    font-size: 12px;
    color: var(--ks-slate);
    margin: 0 0 6px;
    line-height: 1.5;
}

.ks-devotional__scripture {
    display: block;
    font-family: var(--ks-font-serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ks-gold);
}


/* ── 14. Tab strip (Messages page) ───────────────────────────────────────── */
.ks-tabs {
    display: flex;
    flex-wrap: nowrap;   /* keep the tab strip on a single row */
    gap: var(--ks-space-xs);
    background: #ffffff;
    border: 0.5px solid var(--ks-border);
    border-radius: var(--ks-radius-md);
    padding: 6px;
    margin-bottom: var(--ks-space-md);
}

.ks-tab {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
    border-radius: var(--ks-radius-sm);
    font-family: var(--ks-font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--ks-slate);
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
    white-space: nowrap;
}

.ks-tab:hover {
    background: var(--ks-parchment);
    color: var(--ks-navy);
    text-decoration: none;
}

.ks-tab--active {
    background: var(--ks-navy);
    color: var(--ks-cream);
}

.ks-tab--active:hover {
    background: var(--ks-navy);
    color: var(--ks-cream);
}

@media (max-width: 640px) {
    /* Keep the tabs as an equal-width segmented control on phones (filling the
       bar) rather than shrinking to small left-aligned pills with empty space
       beside them. The whole strip never wraps; each tab takes an equal share
       and its label ellipsizes if a future tab name is very long. */
    .ks-tabs { flex-wrap: nowrap; gap: 4px; padding: 4px; }
    .ks-tab {
        flex: 1 1 0;
        min-width: 0;
        font-size: 11px;
        padding: 9px 8px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}


/* ── 15. Inline scripture (Set Lists "Build your library...") ────────────── */
.ks-inline-scripture {
    display: block;
    font-family: var(--ks-font-serif);
    font-style: italic;
    font-size: 11px;
    color: var(--ks-gold);
    margin-top: var(--ks-space-md);
    text-align: center;
}


/* ── 16. Helper: small group title used in members.php ───────────────────── */
.group-title {
    font-family: var(--ks-font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ks-slate);
    margin: var(--ks-space-md) 0 var(--ks-space-sm);
}
/* ── Uniform gold ring on the ACTIVE tab across every .ks-tabs strip (2026-09) ──
   The active tab now always carries the gold square border so all tab strips in
   Kosis (Events List/Calendar, Messages, etc.) look identical — not just when a
   tab happens to be keyboard-focused. Uses inset box-shadow so there is no
   layout shift. */
.ks-tab--active,
.ks-tab--active:hover {
    box-shadow: inset 0 0 0 1.5px var(--ks-gold);
}
