/* FT26 — Family Tree Styles
   @created 2026-03-21
   @updated 2026-03-21 — CSS custom properties for theming */

/* Theme variables live in /css/ft-theme.css (loaded before this file).
   To change colors/fonts/etc., edit ft-theme.css. */

/* ═══════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════ */
body { font-family: var(--ft-font); font-size: var(--ft-font-size); margin: 0; background: var(--ft-bg); }
.ft-main { max-width: 1920px; margin: 0 auto; padding: 12px 16px; min-height: calc(100vh - 150px); }

/* ── Body + Rcol split (uses aw-row for RTL/LTR auto-direction) ── */
@media (max-width: 768px) {
    .ft-page-rcol { width: 100% !important; max-width: 100% !important; }
    .ft-page-body { width: 100% !important; max-width: 100% !important; }
}

/* ── Mobile-emphasis: back buttons, section headers — small screens only ──
   Applied via class .ft-m-emph. Desktop stays unchanged. */
@media (max-width: 768px) {
    .ft-m-emph {
        font-weight: 700 !important;
        font-size: 1.05em !important;
        background: var(--ft-primary) !important;
        color: #fff !important;
        padding: 8px 14px !important;
        border: none !important;
    }
    .ft-m-emph:hover { background: #16a085 !important; color: #fff !important; }
    .ft-m-emph i { font-size: 1.15em; margin-inline-end: 4px; }

    /* Fixed Back on mobile — pill matching the toolbar's +V button size, pinned below navbar.
       position:fixed avoids position:sticky failures caused by flex/overflow ancestors. */
    .ft-m-back {
        position: fixed !important;
        top: 54px;                 /* clears the sticky navbar */
        inset-inline-start: 8px;
        z-index: 90;               /* under navbar's 100, over everything else */
        height: 32px !important;
        padding: 0 14px !important;
        border-radius: 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
        font-size: 0.88em !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
    }
    .ft-m-back i { font-size: 1em !important; margin: 0 !important; }
    /* Reserve space so the fixed Back doesn't overlap the first content block.
       /albums/<id> opts out — its content already starts with a dense compact header
       that doesn't need the extra reservation. */
    main.ft-main:has(.ft-m-back) { padding-top: 44px; }
    body.pg-albums.pg-albums-detail main.ft-main { padding-top: 0 !important; }
}

/* ── Board section submenu (RCOL, sticky) ──
   Layout: "All" full-width on row 1, then 6 sections in a 3-col grid. */
.bd-sections-col {
    display:flex; flex-direction:column; gap:3px;
}
.bd-section-grid {
    display:grid; grid-template-columns:repeat(3, 1fr); gap:3px;
}
.bd-section-btn {
    display:flex; align-items:center; gap:6px;
    padding:6px 8px; border-radius:5px; background:transparent; border:none;
    cursor:pointer; font-size:0.78em; color:#555; text-align:start;
    text-decoration:none; transition:all 0.15s; width:100%;
    min-width:0;
}
.bd-section-btn i { font-size:0.95em; width:14px; text-align:center; flex-shrink:0; }
.bd-section-btn span {
    flex:1; min-width:0;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.bd-section-btn:hover { background:#f4f4f4; color:#222; }
.bd-section-btn.on { background:var(--ft-primary); color:#fff; }
.bd-section-btn.on i { color:#fff; }
/* "All" variant is the full-width row above the grid */
.bd-section-btn.bd-section-all {
    font-weight:700; padding:7px 8px;
}
/* Grid cells — compact, center-aligned */
.bd-section-btn.bd-section-cell {
    flex-direction:column; gap:2px; padding:5px 2px;
    text-align:center; font-size:0.74em;
}
.bd-section-btn.bd-section-cell i { font-size:1.05em; width:auto; }

/* Sticky positioning for RCOL cards that should stay visible while scrolling */
.rcol-sticky {
    position:sticky;
    top:8px;
    z-index:5;
}

/* ── Unified tribe filter (compact single-row card in RCOL) ── */
.tf-btn {
    background: none; border: 1px solid var(--ft-border);
    border-radius: 4px; padding: 2px 6px; cursor: pointer;
    color: var(--ft-text-muted); font-size: 0.9em;
}
.tf-btn:hover { background: var(--ft-primary); color: #fff; border-color: var(--ft-primary); }
.tf-chips {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 2px 0 2px;
}
.tf-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px;
    border: 2px solid #d0d0d0; background: #fff;
    cursor: pointer; opacity: 0.5; transition: all 0.15s;
    position: relative; box-sizing: border-box;
}
.tf-chip:hover { opacity: 0.9; border-color: #95a5a6; }
.tf-chip.on { opacity: 1; border-color: var(--ft-primary); background: #e8f8f5; }
.tf-chip.on::after {
    content: '✓'; position: absolute; bottom: -4px; inset-inline-end: -4px;
    background: var(--ft-primary); color: #fff; border-radius: 50%;
    width: 14px; height: 14px; font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.tf-chip img { width: 22px; height: 22px; display: block; }
.tf-chip i.fas { font-size: 16px; color: var(--ft-text-muted); }
.tf-chip.on i.fas { color: var(--ft-primary); }

/* ── Rcol collapsible section headers ── */
.ft-rcol-hdr {
    font-weight: 700; color: #1abc9c; font-size: 0.8em;
    padding: 5px 8px; cursor: pointer; user-select: none;
    display: flex; align-items: center; gap: 4px;
}
.ft-rcol-hdr:hover { background: #f5f5f5; border-radius: 4px; }
.ft-rcol-arrow { margin-inline-start: auto; font-size: 0.9em; color: #aaa; }
.ft-rcol-evt-hdr {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 8px; font-size: 0.82em; font-weight: 600; color: #fff;
    cursor: pointer; user-select: none;
    border-radius: 4px 4px 0 0;
}
.ft-rcol-evt-hdr:hover { opacity: 0.9; }
.ft-rcol-evt-hdr i { color: #fff !important; }

/* ── Alpha index grid (tight, 2 rows on 300px rcol) ── */
.ft-alpha-grid { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.ft-alpha-grid a {
    width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #1abc9c; color: white !important; text-decoration: none;
    font-weight: 700; font-size: 0.78em; transition: background 0.15s;
}
.ft-alpha-grid a:hover { background: #16a085; }
.ft-alpha-grid .ft-alpha-en {
    width: auto; padding: 0 8px; border-radius: 12px; font-size: 0.75em;
}

/* ── Thin date/lang bar ── */
.ft-dateline {
    background: var(--ft-dark-deep); color: var(--ft-text-on-dark); padding: 2px 16px;
    font-size: 0.8em; line-height: 1.8; overflow: hidden;
}
.ft-dateline-link { color: var(--ft-text-on-dark) !important; text-decoration: none; padding: 0 4px; }
.ft-dateline-link:hover { color: var(--ft-text-on-dark) !important; text-decoration: underline; }

/* ── Navbar ── */
.ft-navbar {
    background: var(--ft-dark) !important; color: var(--ft-text-on-dark-2);
    position: sticky; top: 0; z-index: 100;
}
.ft-navbar a, .ft-navbar span { color: var(--ft-text-on-dark-2) !important; }
.ft-menu-item { padding: 10px 14px !important; font-size: 0.92em; font-weight: 700; transition: background 0.2s; }
.ft-menu-item:hover { background: var(--ft-hover-light) !important; }
.ft-active { border-bottom: 3px solid var(--ft-primary) !important; background: rgba(255,255,255,0.05) !important; }

/* ── Mobile Quick Nav ── */
.ft-mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background: #fff;
    gap: 2px;
    padding: 2px 4px;
    border-bottom: 1px solid var(--ft-dark);
    border-top: 1px solid var(--ft-dark);
}
.ft-mobile-nav a {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 1px;
    padding: 2px 2px;
    color: var(--ft-dark);
    background: transparent;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}
.ft-mobile-nav a i { font-size: 1.1em; line-height: 1; }
.ft-mobile-nav a span {
    font-size: 0.7em; font-weight: 600; line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%;
}
.ft-mobile-nav a:hover { background: #f4f4f4; }
.ft-mobile-nav a.active {
    background: var(--ft-primary);
    color: #fff;
}

/* ── Footer ── */
.ft-footer { background: var(--ft-dark); color: var(--ft-text-on-dark); padding: 0; margin-bottom: 50px; }
.ft-footer-link { color: var(--ft-text-on-dark) !important; text-decoration: none; padding: 0 6px; font-size: 0.9em; }
.ft-footer-link:hover { color: var(--ft-text-on-dark-2) !important; }

/* ── Section headers ── */
.ft-section-header {
    font-size: 1.1em; font-weight: 600; padding: 10px 16px; margin: 16px 0 8px;
    border-right: 4px solid var(--ft-primary);
}

/* ═══════════════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════════════ */
/* Stats circle buttons */
.ft-stat-circles {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
}
.ft-stat-circ {
    width: 76px; height: 76px; padding: 6px 0 !important;
    font-size: 0.72em; line-height: 1.2; cursor: default;
}
.ft-stat-circ b { font-size: 1.3em; }
.ft-stat-circ span { font-size: 0.85em; }
.ft-stat-circ i { font-size: 1.1em; }

/* Family name tag cloud */
.ft-name-cloud {
    display: flex; flex-wrap: wrap; justify-content: center;
    align-items: baseline; gap: 0 5px; line-height: 1.4;
}
.ft-cloud-tag {
    display: inline-block; padding: 0 2px; border-radius: 3px;
    cursor: default; white-space: nowrap; transition: background 0.2s;
}
.ft-cloud-tag:hover { background: #e0f2f1; }
.ft-cloud-more { color: #999; font-size: 1.2em; padding: 0 4px; }

/* ═══════════════════════════════════════════════
   PERSON ELEMENTS
   ═══════════════════════════════════════════════ */
.ft-person-thumb {
    display: inline-block; width: 110px; text-align: center;
    margin: 4px; vertical-align: top; cursor: pointer;
    transition: transform 0.15s;
}
.ft-person-thumb:hover { transform: scale(1.05); }
.ft-person-thumb img { width: 80px; }
.ft-person-thumb .name { font-size: 0.88em; font-weight: 700; margin-top: 4px; line-height: 1.2; color: var(--ft-text); }
.ft-person-thumb .meta { font-size: 0.8em; color: var(--ft-text-light); }

/* ── Gender borders — rounded square ── */
.rndM  { border: 3px solid var(--ft-male); border-radius: var(--ft-border-radius); }
.rndF  { border: 3px solid var(--ft-female); border-radius: var(--ft-border-radius); }
.deadM { border: 3px outset var(--ft-male-dead) !important; border-radius: var(--ft-border-radius); }
.deadF { border: 3px outset var(--ft-female-dead) !important; border-radius: var(--ft-border-radius); }

/* ── Person card (Vue) ── */
.person-card { display: inline-block; width: 120px; text-align: center; margin: 4px; vertical-align: top; cursor: pointer; }
.person-card img { width: 90px; }
.person-card .name { font-size: 0.9em; font-weight: 700; margin-top: 4px; color: var(--ft-text); }
.person-card .dates { font-size: 0.8em; color: var(--ft-text-light); }

/* ═══════════════════════════════════════════════
   TREE VIEWS
   ═══════════════════════════════════════════════ */

/* ── Person header with vertical view tabs ── */
.ft-header-card {
    display: flex; align-items: stretch; margin-top: 12px;
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
.ft-view-tabs {
    display: flex; flex-direction: column; justify-content: center;
    background: var(--ft-dark); min-width: 110px;
}
.ft-view-tab {
    padding: 5px 14px; text-align: start;
    color: var(--ft-text-inactive) !important; text-decoration: none;
    font-size: 0.82em; font-weight: 600;
    transition: background 0.2s; border: none;
    line-height: 1.3;
}
.ft-view-tab:hover { background: var(--ft-hover-light); color: var(--ft-text-on-dark-2) !important; }
.ft-view-active {
    color: var(--ft-text-on-dark) !important;
    background: var(--ft-primary) !important;
}
.ft-view-tab.ft-view-disabled {
    opacity: 0.35; pointer-events: none;
}
.ft-header-person {
    display: flex; align-items: center; gap: 12px;
    padding: 0 16px; flex: 1;
}
.ft-header-person > img {
    align-self: stretch; width: 75px; object-fit: cover; cursor: pointer;
}
/* ── Report title bar ── */
.ft-rpt-title {
    padding: 7px 16px; font-size: 1em; font-weight: 700;
    background: var(--ft-primary); color: #fff;
    border-radius: 6px; margin-top: 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.ft-sort-btn {
    background: rgba(255,255,255,0.2); border: none; color: #fff;
    padding: 3px 10px; border-radius: 4px; cursor: pointer;
    font-size: 0.82em; font-weight: 600;
}
.ft-sort-btn:hover { background: rgba(255,255,255,0.35); }

/* ── Generation headers ── */
.gen-header { padding: 8px 16px; margin: 8px 0 4px; font-size: 1.05em; font-weight: bold; border-radius: 4px; }

/* ── Generation person tile ── */
.ft-gen-person {
    width: 130px; text-align: center; margin: 4px; vertical-align: top;
    cursor: default; background: var(--ft-card-bg); border-radius: 8px; padding: 4px;
}
@media (max-width: 600px) { .ft-gen-person { width: 100px; } }

/* Separator between different mate groups of the same parent */
.ft-mate-sep {
    display: flex; align-items: center; justify-content: center;
    width: 20px; color: #aaa; font-size: 10px;
    align-self: stretch; margin: 4px 0;
    border-left: 2px dotted #ccc;
}

/* ── Pedigree tree ── */
.ped-tree { display: inline-block; min-width: 100%; }
.ped-row { display: flex; align-items: center; }
.ped-parents { display: flex; flex-direction: column; }
.ped-branch { flex: 1; display: flex; align-items: center; }
.ped-connector { width: 20px; border-top: 2px solid var(--ft-border-mid); margin: 0 -1px; position: relative; align-self: center; }
.ped-connector::before {
    content: ''; position: absolute; inset-inline-end: 0; top: 25%; bottom: 25%;
    border-inline-end: 2px solid var(--ft-border-mid);
}
.ped-person {
    padding: 6px 8px; border-radius: 10px; text-align: center;
    cursor: pointer; min-width: 65px; white-space: nowrap;
    transition: transform 0.15s; align-self: center;
}
.ped-person:hover { transform: scale(1.05); }
.ped-m { background: var(--ft-male-bg); border: 2px solid var(--ft-male); }
.ped-f { background: var(--ft-female-bg); border: 2px solid var(--ft-female); }
.ped-dead-m { background: var(--ft-male-dead-bg); border: 2px solid var(--ft-male-dead); }
.ped-dead-f { background: var(--ft-female-dead-bg); border: 2px solid var(--ft-female-dead); }
.ped-name { font-weight: 700; font-size: 0.95em; line-height: 1.2; color: var(--ft-text); }
.ped-date { font-size: 0.8em; color: var(--ft-text-light); }
.ped-empty { width: 60px; min-height: 40px; }
.ped-empty-person { width: 65px; min-height: 50px; }

/* ═══════════════════════════════════════════════
   MATES SLIDESHOW
   ═══════════════════════════════════════════════ */
.ft-slide-frame {
    position: relative; overflow: hidden; border-radius: 12px;
    border: 3px solid #1abc9c; aspect-ratio: 4/3; background: #f5f5f5;
}
.ft-slide-frame img {
    width: 100%; height: 100%; object-fit: cover;
    transition: opacity 0.6s ease-in-out;
}
.ft-slide-frame img.ft-slide-out { opacity: 0; position: absolute; top: 0; left: 0; }
/* Zoom on hover — single photo or paused */
.ft-slide-frame.ft-zoomable:hover img { transform: scale(1.4); transition: transform 0.3s; }
.ft-slide-frame.ft-zoomable { cursor: zoom-in; }
/* Nav arrows */
.ft-slide-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(0,0,0,0.35); color: white; border: none; border-radius: 50%;
    width: 28px; height: 28px; font-size: 0.85em; cursor: pointer;
    display: none; align-items: center; justify-content: center;
}
.ft-slide-frame:hover .ft-slide-nav { display: flex; }
.ft-slide-prev { left: 4px; }
.ft-slide-next { right: 4px; }
/* Category label overlay */
.ft-slide-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.55));
    color: white; font-size: 0.75em; padding: 12px 8px 4px; text-align: center;
}
/* F T G indicator buttons */
.ft-cat-btns { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.ft-cat-btn {
    border: none; border-radius: 4px; padding: 2px 8px; font-size: 0.72em;
    font-weight: 700; cursor: pointer; opacity: 0.5; transition: opacity 0.2s, transform 0.2s;
}
.ft-cat-btn.active { opacity: 1; transform: scale(1.1); }
.ft-cat-btn:hover { opacity: 0.9; }
.ft-cat-btn-f { background: #2ecc71; color: white; }
.ft-cat-btn-t { background: #3498db; color: white; }
.ft-cat-btn-g { background: #95a5a6; color: white; }
.ft-cat-btn-m { background: #1abc9c; color: white; }

/* Hover zoom overlay (shared) */
.ft-hover-zoom {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
    z-index: 200; pointer-events: none;
}
.ft-hover-zoom img {
    max-width: 80vw; max-height: 80vh; border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════════
   CONTENT ELEMENTS
   ═══════════════════════════════════════════════ */

/* ── Photo captions ── */
.ft-cap { font-size: 0.95em; font-weight: 700; margin-top: 3px; line-height: 1.3; color: var(--ft-text); }
.ft-cap-date { font-size: 0.85em; color: var(--ft-text-light); font-weight: 500; }

/* ── Relationship badge ── */
.ft-rel-badge {
    position: absolute; top: 2px; right: 2px;
    font-size: 1.2em; font-weight: 700; text-shadow: 0 0 3px white;
}

/* ── Birthday list ── */
.ft-bday-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; }
.ft-bday-row img { width: 45px; border-radius: var(--ft-border-radius); }
.ft-bday-days {
    min-width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9em; color: var(--ft-text-on-dark);
}

/* ── Directory ── */
.ft-letter-bar { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; }
.ft-letter-bar a {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 4px; text-decoration: none; font-weight: 600; font-size: 0.9em;
}

/* ── Ring icons ── */
.ft-ring { color: var(--ft-ring); }
.ft-ring-ended { color: var(--ft-ring-ended); text-decoration: line-through; }

/* ── Stories ── */
.ft-story-card { border-right: 4px solid var(--ft-primary); margin-bottom: 12px; }

/* ── Fixed bottom bar ── */
.ft-bottom-bar {
    background: var(--ft-dark); padding: 4px 0; z-index: 90;
}
.ft-bottom-btn {
    display: inline-block; padding: 6px 16px; color: var(--ft-text-on-dark) !important;
    font-size: 1.3em; border-radius: 8px; text-decoration: none;
    transition: background 0.2s;
}
.ft-bottom-btn:hover { background: var(--ft-hover-dark); }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 600px) {
    .ft-main { padding: 8px; }
    .ft-person-thumb { width: 90px; }
    .ft-person-thumb img { width: 65px; }
    .ft-stat-num { font-size: 1.5em; }
    .ft-root-stat-num { font-size: 1em; }
}

/* ═══ Unlink button (small x on kid cards) ═══ */
.ft-unlink-btn {
    position: absolute;
    top: 2px;
    right: 6px;
    z-index: 5;
    cursor: pointer;
    color: #ccc;
    font-size: 1.1em;
    font-weight: bold;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}
.ft-unlink-btn:hover { color: #e74c3c; }
*:hover > .ft-unlink-btn { opacity: 1; }

/* ═══ Rcol tab panels ═══ */
.rcol-tab {
    background: none; border: none; cursor: pointer;
    padding: 3px 8px; font-size: 0.75em; font-weight: 700; color: #888;
    border-bottom: 2px solid transparent;
}
.rcol-tab:hover { color: #1abc9c; }
.rcol-tab-active { color: #1abc9c; border-bottom-color: #1abc9c; }
.rcol-panel { padding: 4px 8px; font-size: 0.82em; max-height: 200px; overflow-y: auto; }
.rcol-panel a { color: #1abc9c; text-decoration: none; }
.rcol-panel a:hover { text-decoration: underline; }
.rcol-tl-item { display: flex; gap: 6px; padding: 3px 0; border-bottom: 1px solid #f0f0f0; }
.rcol-tl-year { min-width: 40px; font-weight: 700; color: #1abc9c; text-align: center; }
.rcol-tl-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.rcol-tl-text { flex: 1; }


.event-bday-today  { background-color: var(--ev-bday-today-bg);  color: var(--ev-bday-today-fg); }
.event-bday-recent { background-color: var(--ev-bday-recent-bg); color: var(--ev-bday-recent-fg); }
.event-bday-soon   { background-color: var(--ev-bday-soon-bg);   color: var(--ev-bday-soon-fg); }

.event-memo-today  { background-color: var(--ev-memo-today-bg);  color: var(--ev-memo-today-fg); }
.event-memo-recent { background-color: var(--ev-memo-recent-bg); color: var(--ev-memo-recent-fg); }
.event-memo-soon   { background-color: var(--ev-memo-soon-bg);   color: var(--ev-memo-soon-fg); }

.event-anniv-today  { background-color: var(--ev-anniv-today-bg);  color: var(--ev-anniv-today-fg); }
.event-anniv-recent { background-color: var(--ev-anniv-recent-bg); color: var(--ev-anniv-recent-fg); }
.event-anniv-soon   { background-color: var(--ev-anniv-soon-bg);   color: var(--ev-anniv-soon-fg); }

.event-yahr-today  { background-color: var(--ev-yahr-today-bg);  color: var(--ev-yahr-today-fg); }
.event-yahr-recent { background-color: var(--ev-yahr-recent-bg); color: var(--ev-yahr-recent-fg); }
.event-yahr-soon   { background-color: var(--ev-yahr-soon-bg);   color: var(--ev-yahr-soon-fg); }
/* ═══ Board mobile UX (≤768px) ═══
   Consolidates RCOL board controls on mobile:
   - 6-icon ptype grid → horizontal scrolling chip strip, sticky under navbar
   - 4 colored droplists → hidden (redundant with main digest view)
   - Admin announcement banner → tighter padding, sticky under chip strip */
@media (max-width: 768px) {
    /* Chip strip: flatten column + grid into one horizontal scrolling row */
    #rcolBoardControls {
        position: sticky; top: 0; z-index: 6;
        margin-top: 4px !important;
        padding: 4px 6px !important;
        border-radius: 6px;
    }
    #rcolBoardControls .bd-sections-col {
        flex-direction: row;
        overflow-x: auto; overflow-y: hidden;
        gap: 4px;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    #rcolBoardControls .bd-sections-col::-webkit-scrollbar { display: none; }
    #rcolBoardControls .bd-section-grid {
        display: contents;  /* flatten grid so its children become siblings in the flex row */
    }
    #rcolBoardControls .bd-section-btn {
        flex: 0 0 auto;
        width: auto !important;           /* defeat base rule's width:100% that was forcing one-per-row */
        flex-direction: row !important;
        gap: 4px !important;
        padding: 4px 9px !important;
        border-radius: 12px !important;
        /* Tinted background from the ptype color set by --pt-c inline */
        background: color-mix(in srgb, var(--pt-c, #888) 14%, #fff) !important;
        color: var(--pt-c, #444) !important;
        border: 1px solid color-mix(in srgb, var(--pt-c, #888) 30%, #fff) !important;
        white-space: nowrap;
        font-size: 0.72em !important;
        font-weight: 600 !important;
    }
    #rcolBoardControls .bd-section-btn.bd-section-all {
        font-weight: 700 !important; padding: 4px 10px !important;  /* override bd-section-all's full-width styling */
    }
    #rcolBoardControls .bd-section-btn i {
        font-size: 0.9em !important; width: auto !important;
        color: var(--pt-c, inherit) !important;
    }
    #rcolBoardControls .bd-section-btn span { flex: 0 0 auto; }
    #rcolBoardControls .bd-section-btn.on {
        background: var(--pt-c, var(--ft-primary)) !important;
        border-color: var(--pt-c, var(--ft-primary)) !important;
        color: #fff !important;
    }
    #rcolBoardControls .bd-section-btn.on i { color: #fff !important; }

    /* Post count chip tucked next to the label — hidden when zero/unknown */
    #rcolBoardControls .bd-section-count:empty { display: none; }
    #rcolBoardControls .bd-section-count {
        display: inline-flex; align-items: center; justify-content: center;
        min-width: 16px; padding: 0 5px; height: 15px;
        border-radius: 8px; font-size: 0.82em; font-weight: 700;
        background: rgba(255,255,255,0.75); color: var(--pt-c, #555);
    }
    #rcolBoardControls .bd-section-btn.on .bd-section-count {
        background: rgba(255,255,255,0.28); color: #fff;
    }

    /* Fade gradient on the scroll-end edge as a visual cue that more chips exist */
    #rcolBoardControls { position: sticky; top: 0; z-index: 6; }
    #rcolBoardControls::after {
        content: ''; position: absolute; top: 0; bottom: 0;
        inset-inline-end: 0; width: 24px; pointer-events: none;
        background: linear-gradient(to var(--fade-dir, left), #fff, rgba(255,255,255,0));
    }
    [dir="rtl"] #rcolBoardControls::after { background: linear-gradient(to right, #fff, rgba(255,255,255,0)); }
    [dir="ltr"] #rcolBoardControls::after { background: linear-gradient(to left,  #fff, rgba(255,255,255,0)); }

    /* Hide the colored droplists — redundant with the main feed's digest view */
    #rcolBoardDroplists { display: none !important; }

    /* ── Board mobile toolbar (collapses search + tribes + actions into one row) ──
       Hides the 3 cards by default; toolbar button taps reveal one card at a time. */
    body.pg-board #rcolBoardToolbar {
        display: flex !important;
        position: sticky; top: 0; z-index: 7;
        align-items: center; gap: 6px;
        margin-top: 4px; padding: 5px 8px;
    }
    body.pg-board .rbt-btn {
        position: relative;
        flex: 0 0 auto;
        background: #f0f0f0; color: #333; border: 1px solid #dcdcdc;
        width: 36px; height: 32px; border-radius: 16px;
        display: inline-flex; align-items: center; justify-content: center;
        cursor: pointer; font-size: 0.95em;
        transition: background 0.15s;
    }
    body.pg-board .rbt-btn:hover { background: #e4e4e4; }
    body.pg-board .rbt-btn-primary {
        background: var(--ft-primary); color: #fff; border-color: var(--ft-primary);
        width: auto; padding: 0 10px;
    }
    body.pg-board .rbt-btn-primary:hover { background: #16a085; }
    body.pg-board .rbt-badge {
        position: absolute; top: -4px; inset-inline-end: -4px;
        min-width: 16px; height: 16px; padding: 0 4px;
        border-radius: 8px; background: var(--ft-primary); color: #fff;
        font-size: 0.7em; font-weight: 700; line-height: 16px;
        text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    }
    body.pg-board .rbt-actions { position: relative; margin-inline-start: auto; }
    body.pg-board .rbt-menu {
        display: none; position: absolute; top: calc(100% + 4px);
        inset-inline-end: 0; min-width: 180px;
        background: #fff; border: 1px solid #ddd; border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 8;
        padding: 4px 0;
    }
    body.pg-board.rbt-open-actions .rbt-menu { display: block; }
    body.pg-board .rbt-menu-item {
        display: flex; align-items: center; gap: 8px;
        padding: 8px 12px; color: #333; text-decoration: none;
        font-size: 0.88em; white-space: nowrap;
    }
    body.pg-board .rbt-menu-item:hover { background: #f4f4f4; }

    /* Hide the 3 cards by default on board mobile; reveal when their panel is open */
    body.pg-board #rcolSearchCard { display: none !important; }
    body.pg-board.rbt-open-search #rcolSearchCard { display: block !important; }
    body.pg-board #rcolTribeFilter { display: none !important; }
    body.pg-board.rbt-open-tribes #rcolTribeFilter { display: block !important; }
    /* Board actions card stays hidden — the toolbar dropdown replaces it on mobile */
    body.pg-board #rcolBoardActions { display: none !important; }

    /* Tighten announcement banner on mobile */
    .bd-announce-item { padding: 8px 10px; gap: 8px; }
    .bd-announce-icon { width: 28px; height: 28px; font-size: 0.85em; }
    .bd-announce-title { font-size: 0.95em; }
    .bd-announce-text { font-size: 0.85em; }
    /* Reserve space for the dismiss button on mobile so long titles don't overlap */
    .bd-announce-banner .bd-announce-item:first-child .bd-announce-body { padding-inline-end: 28px; }

    /* ── Posts mobile toolbar (reuses the board .rbt-* classes for pills/menu) ── */
    body.pg-posts #rcolPostsToolbar {
        display: flex !important;
        position: sticky; top: 0; z-index: 7;
        align-items: center; gap: 6px;
        margin-top: 4px; padding: 5px 8px;
    }
    body.pg-posts .rbt-btn {
        position: relative;
        flex: 0 0 auto;
        background: #f0f0f0; color: #333; border: 1px solid #dcdcdc;
        width: 36px; height: 32px; border-radius: 16px;
        display: inline-flex; align-items: center; justify-content: center;
        cursor: pointer; font-size: 0.95em;
    }
    body.pg-posts .rbt-btn-primary {
        background: var(--ft-primary); color: #fff; border-color: var(--ft-primary);
    }
    body.pg-posts .rbt-badge {
        position: absolute; top: -4px; inset-inline-end: -4px;
        min-width: 16px; height: 16px; padding: 0 4px;
        border-radius: 8px; background: var(--ft-primary); color: #fff;
        font-size: 0.7em; font-weight: 700; line-height: 16px;
        text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    }
    body.pg-posts .rbt-actions { position: relative; margin-inline-start: auto; }

    /* Hide the RCOL cards; reveal only via toolbar tap */
    body.pg-posts #rcolSearchCard    { display: none !important; }
    body.pg-posts.rpt-open-search #rcolSearchCard { display: block !important; }
    body.pg-posts #rcolTribeFilter   { display: none !important; }
    body.pg-posts.rpt-open-tribes #rcolTribeFilter { display: block !important; }
    body.pg-posts #rcolPostsControls { display: none !important; }  /* view toggle moved into toolbar */
    body.pg-posts #rcolPostsList     { display: none !important; }  /* redundant — the main feed IS the list */

    /* Category filter → horizontal scrolling strip, sticky under toolbar */
    body.pg-posts .posts-cats {
        position: sticky; top: 42px;
        z-index: 5;
        flex-wrap: nowrap !important;
        overflow-x: auto; overflow-y: hidden;
        gap: 4px !important;
        padding: 4px 6px !important;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    body.pg-posts .posts-cats::-webkit-scrollbar { display: none; }
    body.pg-posts .posts-cat-btn {
        flex: 0 0 auto;
        padding: 3px 9px !important;
        font-size: 0.72em !important;
        white-space: nowrap;
    }
    body.pg-posts .posts-cat-btn .cnt { margin-inline-start: 2px; }

    /* Condense the "Stories (3) | Tribes: …" title bar */
    body.pg-posts .posts-title-bar { padding: 4px 6px; margin: 2px 0 4px; }
    body.pg-posts .posts-title-h   { font-size: 1em; }

    /* ── Compact row cards on mobile — small thumb next to title/meta ── */
    body.pg-posts .posts-grid {
        grid-template-columns: 1fr !important;    /* one per row */
        gap: 6px !important;
    }
    body.pg-posts .post-card {
        display: flex !important;
        flex-direction: row;
        align-items: stretch;
        gap: 8px;
        padding: 0;
        overflow: hidden;
    }
    body.pg-posts .post-card > img,
    body.pg-posts .post-card > .post-card-img,
    body.pg-posts .post-card > div:first-child:not(.post-card-body) {
        flex: 0 0 88px;
        width: 88px !important;
        height: 88px !important;
        aspect-ratio: auto !important;
        object-fit: cover;
        border-radius: 8px 0 0 8px;
    }
    [dir="ltr"] body.pg-posts .post-card > img,
    [dir="ltr"] body.pg-posts .post-card > .post-card-img,
    [dir="ltr"] body.pg-posts .post-card > div:first-child:not(.post-card-body) {
        border-radius: 8px 0 0 8px;
    }
    body.pg-posts .post-card-body {
        flex: 1 1 0; min-width: 0;
        padding: 6px 8px !important;
        display: flex; flex-direction: column;
        justify-content: center; gap: 2px;
    }
    body.pg-posts .post-card-title {
        font-size: 0.9em !important; line-height: 1.25;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        overflow: hidden;
    }
    body.pg-posts .post-card-sub {
        font-size: 0.75em !important;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    body.pg-posts .post-card-meta {
        font-size: 0.66em !important;
        margin-top: 2px !important;
        gap: 4px !important;
    }
    body.pg-posts .post-card-meta .post-card-cat { padding: 0 5px; font-size: 0.95em; }

    /* Line (text-only) view — thumbnail hidden, single compact row */
    body.pg-posts[data-posts-view="line"] .post-card > img,
    body.pg-posts[data-posts-view="line"] .post-card > .post-card-img,
    body.pg-posts[data-posts-view="line"] .post-card > div:first-child:not(.post-card-body) {
        display: none !important;
    }
    body.pg-posts[data-posts-view="line"] .post-card { padding: 0; }
    body.pg-posts[data-posts-view="line"] .post-card-body {
        padding: 6px 10px !important;
        flex: 1 1 auto;
    }
    body.pg-posts[data-posts-view="line"] .post-card-title {
        -webkit-line-clamp: 1;
        font-size: 0.92em !important;
    }
    body.pg-posts[data-posts-view="line"] .post-card-sub { display: none; }

    /* ── Albums mobile toolbar (mirrors /posts toolbar) ── */
    /* Only on the LIST page — JS adds .pg-albums-detail on /albums/<id> to suppress it */
    body.pg-albums:not(.pg-albums-detail) #rcolAlbumsToolbar {
        display: flex !important;
        position: sticky; top: 0; z-index: 7;
        align-items: center; gap: 6px;
        margin-top: 4px; padding: 5px 8px;
    }
    body.pg-albums.pg-albums-detail #rcolAlbumsToolbar { display: none !important; }
    body.pg-albums .rbt-btn {
        position: relative;
        flex: 0 0 auto;
        background: #f0f0f0; color: #333; border: 1px solid #dcdcdc;
        width: 36px; height: 32px; border-radius: 16px;
        display: inline-flex; align-items: center; justify-content: center;
        cursor: pointer; font-size: 0.95em;
    }
    body.pg-albums .rbt-btn-primary {
        background: var(--ft-primary); color: #fff; border-color: var(--ft-primary);
    }
    body.pg-albums .rbt-badge {
        position: absolute; top: -4px; inset-inline-end: -4px;
        min-width: 16px; height: 16px; padding: 0 4px;
        border-radius: 8px; background: var(--ft-primary); color: #fff;
        font-size: 0.7em; font-weight: 700; line-height: 16px;
        text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    }
    body.pg-albums .rbt-actions { position: relative; margin-inline-start: auto; }

    /* Hide RCOL cards unless their panel is open */
    body.pg-albums #rcolSearchCard   { display: none !important; }
    body.pg-albums.rat-open-search #rcolSearchCard { display: block !important; }
    body.pg-albums #rcolTribeFilter  { display: none !important; }
    body.pg-albums.rat-open-tribes #rcolTribeFilter { display: block !important; }

    /* Page-body chrome compaction on /albums */
    /* Hide the redundant page header (icon + title + "+ New" button) — toolbar replaces it */
    body.pg-albums .albums-header { display: none !important; }
    /* Keep the My/Albums tabs but tighten */
    body.pg-albums .view-tabs { margin-bottom: 6px; }
    body.pg-albums .view-tab { padding: 6px 10px; font-size: 0.85em; }
    /* Hide filter row by default; reveal via toolbar filter button */
    body.pg-albums .album-filters { display: none !important; }
    body.pg-albums.rat-open-filters .album-filters {
        display: flex !important;
        padding: 6px; margin-bottom: 6px;
        background: #fff; border: 1px solid #ddd; border-radius: 8px;
    }
    body.pg-albums .album-filters input,
    body.pg-albums .album-filters select { font-size: 0.82em; }

    /* Category chips → horizontal scrolling sticky strip */
    body.pg-albums .albums-cats-row {
        position: sticky; top: 42px; z-index: 5;
        flex-wrap: nowrap !important;
        overflow-x: auto; overflow-y: hidden;
        gap: 4px !important;
        padding: 4px 6px !important;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
        margin-bottom: 6px !important;
    }
    body.pg-albums .albums-cats-row::-webkit-scrollbar { display: none; }
    body.pg-albums .albums-cats-row > button {
        flex: 0 0 auto; white-space: nowrap; font-size: 0.72em !important; padding: 3px 9px !important;
    }

    /* Compact row card (like /posts) */
    body.pg-albums .albums-grid {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }
    body.pg-albums .album-card {
        display: flex !important;
        flex-direction: row;
        align-items: stretch;
        gap: 0;
        padding: 0;
        overflow: hidden;
        position: relative;
    }
    body.pg-albums .album-card > img,
    body.pg-albums .album-card > div:first-child:not(.album-card-body) {
        flex: 0 0 88px;
        width: 88px !important;
        height: 88px !important;
        aspect-ratio: auto !important;
        object-fit: cover;
    }
    body.pg-albums .album-card-body {
        flex: 1 1 0; min-width: 0;
        padding: 6px 10px !important;
        display: flex; flex-direction: column; justify-content: center; gap: 2px;
    }
    body.pg-albums .album-card-title {
        font-size: 0.9em !important; line-height: 1.25;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        overflow: hidden;
    }
    body.pg-albums .album-card-sub {
        font-size: 0.75em !important;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    body.pg-albums .album-card-meta {
        font-size: 0.66em !important;
        margin-top: 2px !important; gap: 4px !important;
    }
    /* Photo-count badge — bottom-END corner of the card (far from the thumbnail,
       matches the cnt=127 position in al6.jpg). Small self-sized pill, not a bar. */
    body.pg-albums .album-card-badge {
        top: auto !important;
        bottom: 4px !important;
        inset-inline-start: auto !important;
        inset-inline-end: 4px !important;
        font-size: 0.62em !important;
        padding: 1px 5px !important;
    }

    /* ── Album DETAIL view (/albums/<id>) — compact header so photo grid is above the fold ── */
    body.pg-albums .av-header {
        gap: 4px; margin-bottom: 6px;
    }
    body.pg-albums .av-header h3 {
        font-size: 1em !important;
        line-height: 1.2;
    }
    /* Alternate-language subtitle is duplicate info on small screens — hide it */
    body.pg-albums .av-header > div > div[dir] { display: none !important; }
    /* Clamp long descriptions to 2 lines */
    body.pg-albums .av-header > div > div:not([dir]):not(.av-meta) {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 0.82em !important;
        color: #666;
        margin-top: 2px !important;
    }
    body.pg-albums .av-meta {
        font-size: 0.72em !important;
        gap: 6px !important;
        margin-top: 2px !important;
    }
    /* Admin action buttons row — smaller, icon-forward */
    body.pg-albums .av-header .av-btn {
        padding: 4px 8px !important;
        font-size: 0.75em !important;
        gap: 3px !important;
    }
    body.pg-albums .av-header .av-btn i { font-size: 0.9em; }
    /* Segment tabs row */
    body.pg-albums .av-sec-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto; overflow-y: hidden;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
        margin-bottom: 6px;
    }
    body.pg-albums .av-sec-tabs::-webkit-scrollbar { display: none; }
    body.pg-albums .av-sec-tab {
        flex: 0 0 auto;
        padding: 3px 9px;
        font-size: 0.75em;
        white-space: nowrap;
    }
    /* Segment header ("כללי (107)") */
    body.pg-albums .av-sec-header {
        margin: 6px 0 4px !important;
    }
    body.pg-albums .av-sec-title { font-size: 0.95em; }
}

/* ═══════════════════════════════════════════════
   POST BODY TRUNCATION — "read more / read less"
   @created 2026-04-22
   Threshold in window.FT_CFG.truncateChars (layout.tpl).
   Applied by Vue as the .ft-tr class on body containers:
     .bd-body        — /board feed (both mobile and desktop)
     .bdv-body       — /board/post/<id>  single view (mobile only, gated in JS)
     .post-single-body — /posts/<id>     single view (mobile only, gated in JS)
   ═══════════════════════════════════════════════ */
.ft-tr {
    max-height: 20em;
    overflow: hidden;
    position: relative;
}
.ft-tr::after {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    height: 3.5em;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--ft-card-bg) 100%);
    pointer-events: none;
}
.ft-tr-toggle {
    display: inline-block;
    margin-top: 6px;
    background: transparent;
    border: none;
    color: var(--ft-primary);
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    padding: 4px 0;
}
.ft-tr-toggle:hover {
    color: var(--ft-primary-dark);
    text-decoration: underline;
}
