/* ===================================================================
   SMYC — Show Me Your Country
   Shared styles · all pages
   =================================================================== */

:root {
    --bg: #F8F7F5;
    --bg-warm: #f0ede5;
    --bg-deep: #ECE8DD;
    --ink: #1A1A1A;
    --ink-soft: #3a3a3a;
    --ink-mute: #6a6a6a;
    --line: #DCD6CA;
    --line-strong: #BFB8A8;
    --card: #ffffff;
    --gold: #C4A552;
    --gold-dark: #9d8240;
    --gold-light: #e8d9a8;
    --accent: #FFCC33;
    --shadow-sm: 0 2px 8px rgba(26,26,26,.06);
    --shadow-md: 0 8px 24px rgba(26,26,26,.09);
    --shadow-lg: 0 24px 60px rgba(26,26,26,.18);
    --shadow-xl: 0 40px 100px rgba(26,26,26,.28);
    --ease: cubic-bezier(.2,.8,.2,1);
    --radius: 6px;
    --radius-lg: 10px;
    --max: 1900px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; overflow-x: clip; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 17px;
    line-height: 1.6;
    font-weight: 400;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body[dir="rtl"] { font-family: 'Amiri', 'Inter', serif; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, -100px);
    background: var(--ink);
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    z-index: 9999;
    font-weight: 600;
    transition: transform .25s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* =========== HEADER =========== */
header {
    position: relative;
    z-index: 100;
    background: rgba(248,247,245,.92);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom: 1px solid var(--line);
    padding: 16px 32px;
}
/* Sticky header only on About + Tourism Board pages */
body.sticky-header header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}
body.sticky-header { padding-top: 72px; }
.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
}
.brand-mark {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -1px;
    box-shadow: 0 4px 14px rgba(196,165,82,.4);
}
.brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1;
}
.brand-sub {
    font-size: 11px;
    color: var(--ink-mute);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-top: 3px;
    font-weight: 500;
}
.nav-links {
    display: flex;
    gap: 28px;
    margin: 0 auto;
}
.nav-links a {
    color: var(--ink-soft);
    font-size: 15px;
    font-weight: 500;
    transition: color .2s var(--ease);
    position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
}
@media (max-width: 880px) { .nav-links { display: none; } }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.lang-switch {
    display: flex;
    background: rgba(255,255,255,.7);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
    font-size: 13px;
    font-weight: 600;
}
.lang-switch button {
    border: none;
    background: transparent;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--ink-mute);
    transition: all .25s var(--ease);
    min-height: 32px;
}
.lang-switch button.active { background: var(--ink); color: #fff; }

.cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    transition: all .25s var(--ease);
}
.cta:hover { background: var(--gold-dark); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(196,165,82,.35); }
.cta-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--ink);
}
.cta-ghost:hover { background: var(--ink); color: #fff; }

/* =========== HERO (homepage) =========== */
.hero {
    position: relative;
    height: min(50vh, 480px);
    min-height: 360px;
    overflow: hidden;
    background: #161616;
}
.hero-featured {
    position: absolute;
    inset: 0;
    cursor: pointer;
}
.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .6s ease-in-out;
}
.hero-img.fading { opacity: 0; }
.hero-text-wrap {
    transition: opacity .35s ease-in-out;
}
.hero-text-wrap.fading { opacity: 0; }

.hero-dots {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 10px;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(8px);
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
}
.hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all .25s var(--ease);
}
.hero-dot.active {
    background: var(--accent);
    width: 28px;
    border-radius: 4px;
}
.hero-dot:hover { background: rgba(255,255,255,.7); }
.hero-dot.active:hover { background: var(--accent); }
@media (max-width: 700px) {
    .hero-dots { bottom: auto; top: calc(56vh - 36px); }
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, transparent 30%, transparent 45%, rgba(0,0,0,.6) 80%, rgba(0,0,0,.92) 100%);
}
.hero-inner {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 32px 44px;
    color: #fff;
    pointer-events: none;
    z-index: 2;
}
.hero-inner > * { pointer-events: auto; }
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
}
.kicker-bar { width: 40px; height: 6px; background: var(--accent); display: inline-block; }
.hero-headline {
    font-family: 'Playfair Display', serif;
    font-size: clamp(40px, 5.6vw, 72px);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -1.5px;
    max-width: 17ch;
    text-shadow: 0 2px 28px rgba(0,0,0,.55);
    margin-bottom: 14px;
}
.hero-headline em { color: var(--accent); font-style: italic; font-weight: 700; }
.hero-meta {
    font-size: 15px;
    color: rgba(255,255,255,.92);
    font-weight: 500;
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.hero-meta::before {
    content: '';
    width: 24px; height: 1px;
    background: var(--gold);
}
.hero-lede {
    font-size: 18px;
    line-height: 1.55;
    color: rgba(255,255,255,.92);
    max-width: 580px;
    margin-bottom: 26px;
    font-weight: 400;
}
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.hero-actions .cta-ghost {
    color: #fff;
    border-color: rgba(255,255,255,.55);
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
}
.hero-actions .cta-ghost:hover { background: rgba(255,255,255,.18); border-color: #fff; }
@media (max-width: 700px) {
    .hero { height: auto; min-height: 0; overflow: visible; }
    .hero-featured { position: relative; height: 56vh; }
    .hero-overlay { background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.6) 100%); }
    .hero-inner { position: relative; padding: 22px 20px 26px; color: var(--ink); background: var(--bg); }
    .kicker, .hero-headline, .hero-meta, .hero-lede { color: var(--ink); text-shadow: none; }
    .hero-meta { color: var(--ink-soft); }
    .hero-meta::before { background: var(--gold); }
    .hero-lede { color: var(--ink-soft); }
    .hero-actions .cta-ghost { color: var(--ink); border-color: var(--line-strong); background: transparent; }
}

/* =========== TOP RAIL =========== */
.top-rail {
    max-width: var(--max);
    margin: 24px auto 0;
    padding: 0 24px;
}
.top-rail-head {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.top-rail-head h3 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -.6px;
}
.top-rail-head .sub {
    font-size: 13px;
    color: var(--ink-mute);
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 700;
}
.top-rail-head .see-all {
    margin-inline-start: auto;
    font-size: 15px;
    color: var(--gold-dark);
    font-weight: 600;
}
.top-rail-head .see-all:hover { text-decoration: underline; }
.top-rail-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 760px) { .top-rail-list { grid-template-columns: 1fr; } }

.tr-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px 16px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
    color: var(--ink);
    min-height: 140px;
}
.tr-card:hover { border-color: var(--gold); box-shadow: var(--shadow-md); }
.tr-rank {
    font-family: 'Playfair Display', serif;
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
    min-width: 56px;
    text-align: center;
    color: var(--gold);
}
.tr-rank.r1 { color: #d4a017; }
.tr-rank.r2 { color: #9aa0a6; }
.tr-rank.r3 { color: #b87333; }
.tr-thumb {
    width: 120px; height: 120px;
    border-radius: 12px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
    flex-shrink: 0;
}
.tr-info { flex: 1; min-width: 0; }
.tr-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    letter-spacing: -.3px;
}
.tr-meta {
    font-size: 14px;
    color: var(--ink-mute);
    font-weight: 500;
}
.tr-votes {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 7px;
}
.tr-votes::before { content: '♥'; font-size: 18px; color: var(--gold); }

/* =========== FILTER BAR =========== */
.filter-bar {
    max-width: var(--max);
    margin: 0 auto;
    padding: 32px 24px 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}
.filters {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}
.filters::-webkit-scrollbar { height: 6px; }
.filters::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.filter-btn {
    padding: 12px 22px;
    background: #fff;
    border: 1.5px solid var(--line-strong);
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
    flex-shrink: 0;
    transition: all .2s var(--ease);
    min-height: 46px;
    letter-spacing: .2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.filter-btn:hover {
    border-color: var(--gold);
    color: var(--ink);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196,165,82,0.18);
}
.filter-btn.active {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.sponsor-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(196,165,82,.1);
    border: 1.5px dashed var(--gold);
    border-radius: 999px;
    font-size: 14px;
    color: var(--gold-dark);
    font-weight: 600;
    min-height: 46px;
}
.sponsor-slot::before { content: '⊛'; font-size: 18px; }

/* =========== SECTION HEAD =========== */
.section-head {
    max-width: var(--max);
    margin: 28px auto 18px;
    padding: 0 24px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
}
.section-head h2 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
}
.section-head .head-sub {
    font-size: 13px;
    color: var(--ink-mute);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

/* =========== GRID =========== */
.grid {
    max-width: var(--max);
    margin: 0 auto;
    padding: 16px 24px 48px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 26px;
}
.card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .35s var(--ease);
    color: var(--ink);
    display: block;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-img {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: #1a1a1a;
}
.card-img.no-img::after,
.featured.no-img::after {
    content: attr(data-title);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.95);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 24px;
    padding: 24px;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.card-badges {
    position: absolute;
    top: 14px; left: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
body[dir="rtl"] .card-badges { left: auto; right: 14px; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}
.badge-trending { background: rgba(255,82,82,.95); color: #fff; }
.badge-audio { background: rgba(255,255,255,.92); color: var(--ink); }
.badge-country {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(0,0,0,.65);
    color: #fff;
    padding: 5px 11px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}
body[dir="rtl"] .badge-country { right: auto; left: 14px; }
.card-body {
    padding: 18px 20px 20px;
    border-top: 3px solid var(--gold);
}
.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.4px;
    margin-bottom: 6px;
    line-height: 1.2;
}
.card-by {
    font-size: 14px;
    color: var(--ink-mute);
    margin-bottom: 14px;
}
.card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--ink-soft);
}
.vote-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-warm);
    border-radius: 999px;
    font-weight: 600;
}
.vote-pill.voted { background: rgba(255,82,82,.12); color: #c53030; }

/* =========== LEADERBOARD =========== */
.leaderboard-section {
    background: var(--ink);
    color: #fff;
    padding: 72px 0;
    margin-top: 48px;
}
.leaderboard-section .section-head h2 { color: #fff; }
.leaderboard-section .section-head .head-sub { color: var(--gold-light); }
.lb-tabs {
    max-width: var(--max);
    margin: 0 auto 24px;
    padding: 0 24px;
    display: flex;
    gap: 8px;
}
.lb-tab {
    padding: 11px 20px;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.7);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s var(--ease);
    min-height: 42px;
}
.lb-tab.active { background: var(--gold); color: var(--ink); border-color: var(--gold); font-weight: 700; }
.lb-list {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    color: #fff;
    transition: all .2s var(--ease);
}
.lb-row:hover { background: rgba(255,255,255,.08); border-color: var(--gold); }
.lb-rank {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    min-width: 50px;
    text-align: center;
}
.lb-rank.top { color: var(--gold-light); }
.lb-thumb {
    width: 64px; height: 64px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--gold-dark);
}
.lb-info { flex: 1; min-width: 0; }
.lb-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-meta {
    font-size: 12px;
    color: rgba(255,255,255,.55);
    letter-spacing: .5px;
}
.lb-votes {
    text-align: end;
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--gold);
}
.lb-votes-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(255,255,255,.4);
    font-weight: 600;
    text-transform: uppercase;
}

/* =========== MODAL =========== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: radial-gradient(ellipse at center, rgba(8,8,12,.96) 0%, rgba(0,0,0,1) 100%);
    backdrop-filter: blur(32px) saturate(150%);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2vh 2vw;
    opacity: 0;
    transition: opacity .35s var(--ease);
    perspective: 1600px;
}
.modal.active { display: flex; opacity: 1; }
.modal-content {
    position: relative;
    width: min(96vw, 1700px);
    height: min(94vh, 1050px);
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 18px;
    transform-style: preserve-3d;
    transform: scale(.7) translateY(40px);
    opacity: 0;
    transition: transform .6s var(--ease), opacity .4s var(--ease);
}
.modal.active .modal-content { transform: scale(1) translateY(0); opacity: 1; }
@media (max-width: 920px) {
    .modal { padding: 0; perspective: 1000px; }
    .modal-content {
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 0;
        width: 100vw; height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }
}
.modal-img-wrap {
    position: relative;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(60px);
    box-shadow:
        0 80px 140px -20px rgba(0,0,0,.9),
        0 40px 80px -10px rgba(196,165,82,.3),
        0 0 80px rgba(196,165,82,.15),
        0 0 0 1px rgba(196,165,82,.22);
}
@media (max-width: 920px) { .modal-img-wrap { border-radius: 0; transform: none; box-shadow: none; } }
.modal-img-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
}
.modal-photo-meta {
    position: absolute;
    bottom: 22px; left: 26px;
    z-index: 3;
    color: rgba(255,255,255,.92);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,.6);
    display: flex; align-items: center; gap: 10px;
}
.modal-photo-meta .dot { width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }
.modal-close {
    position: absolute;
    top: 22px; right: 22px;
    z-index: 5;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(12px);
    color: #fff;
    border: 1px solid rgba(255,255,255,.12);
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    transition: all .25s var(--ease);
}
.modal-close:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
body[dir="rtl"] .modal-close { right: auto; left: 22px; }
.modal-body {
    padding: 22px 32px;
    background: linear-gradient(180deg, rgba(26,26,28,.92) 0%, rgba(14,14,16,.97) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(196,165,82,.15);
    border-radius: 14px;
    color: #f0eee5;
    transform: translateZ(30px);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.7);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1.3fr) minmax(0, 1.4fr) auto;
    gap: 28px;
    align-items: center;
}
@media (max-width: 920px) {
    .modal-body { border-radius: 0; transform: none; border: none; grid-template-columns: 1fr; gap: 16px; padding: 20px; }
}
.mb-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.mb-col.actions { flex-direction: row; gap: 10px; align-items: center; }
.modal-eyebrow {
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
}
.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.8px;
    line-height: 1.1;
    color: #fff;
}
body[dir="rtl"] .modal-title { font-family: 'Amiri', serif; letter-spacing: 0; line-height: 1.3; font-size: 28px; }
.modal-meta-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,.7);
}
.modal-meta-inline .meta-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

/* Audio */
.audio-box {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(196,165,82,.2);
    border-radius: 10px;
    padding: 14px 16px;
}
.audio-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.audio-title {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-light);
    font-weight: 700;
}
.lang-pills {
    display: flex;
    background: rgba(255,255,255,.1);
    border-radius: 999px;
    padding: 2px;
    font-size: 12px;
    font-weight: 600;
}
.lang-pill {
    border: none;
    background: transparent;
    color: rgba(255,255,255,.6);
    padding: 5px 12px;
    border-radius: 999px;
    transition: all .2s var(--ease);
}
.lang-pill.active { background: var(--gold); color: var(--ink); }
.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}
.play-btn {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--ink);
    border: none;
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s var(--ease);
    flex-shrink: 0;
}
.play-btn:hover { transform: scale(1.08); box-shadow: 0 0 24px rgba(196,165,82,.6); }
.progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,.18);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill { height: 100%; background: var(--gold); width: 0%; transition: width .15s linear; }
.audio-time {
    font-size: 12px;
    color: rgba(255,255,255,.7);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
}
.story-text {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255,255,255,.85);
    font-style: italic;
    padding-left: 16px;
    border-left: 2px solid var(--gold);
    max-height: 100px;
    overflow-y: auto;
}
body[dir="rtl"] .story-text {
    font-family: 'Amiri', serif;
    font-size: 18px;
    padding-left: 0;
    padding-right: 16px;
    border-left: none;
    border-right: 2px solid var(--gold);
    line-height: 1.8;
}
.action-btn {
    padding: 12px 18px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    transition: all .2s var(--ease);
}
.action-btn:hover { background: rgba(255,255,255,.12); border-color: var(--gold); }
.action-btn.voted { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.share-menu { position: relative; }
.share-pop {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #1f1f22;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,.6);
    padding: 6px;
    display: none;
    min-width: 200px;
    z-index: 10;
}
.share-pop.active { display: block; }
.share-pop button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: transparent;
    border: none;
    font-size: 14px;
    color: rgba(255,255,255,.9);
    border-radius: 6px;
    text-align: start;
}
.share-pop button:hover { background: rgba(196,165,82,.15); color: #fff; }

/* =========== UPLOAD MODAL =========== */
.upload-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(20,20,20,.85);
    backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity .3s var(--ease);
}
.upload-modal.active { display: flex; opacity: 1; }
.upload-content {
    background: var(--bg);
    border-radius: 14px;
    max-width: 600px;
    width: 100%;
    max-height: 92vh;
    padding: 0;
    position: relative;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.upload-content > h2,
.upload-content > .upload-sub { padding-left: 40px; padding-right: 40px; }
.upload-content > h2 { padding-top: 40px; }
.upload-content > .upload-sub { padding-bottom: 20px; }
.upload-content form { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.upload-content form > *:not(.upload-footer) { padding-left: 40px; padding-right: 40px; }
/* Scrollable form body: everything above the footer scrolls */
.upload-content form { overflow-y: auto; }
.upload-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 18px 40px 28px;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(0,0,0,.05);
    margin-top: auto;
    z-index: 5;
}
.upload-footer .submit-btn { width: 100%; }
.upload-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.5px;
    margin-bottom: 8px;
}
.upload-sub {
    color: var(--ink-mute);
    font-size: 15px;
    margin-bottom: 28px;
}
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ink-mute);
    font-weight: 700;
    margin-bottom: 8px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--card);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    transition: border-color .2s var(--ease);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(196,165,82,.15);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.photo-drop {
    border: 2px dashed var(--line-strong);
    border-radius: 10px;
    padding: 36px 16px;
    text-align: center;
    transition: all .2s var(--ease);
    margin-bottom: 18px;
}
.photo-drop:hover { border-color: var(--gold); background: rgba(196,165,82,.05); }
.photo-drop.has-file { padding: 8px; border-style: solid; border-color: var(--gold); }
.photo-drop img { width: 100%; max-height: 220px; object-fit: contain; border-radius: 8px; background: var(--bg-warm); }
.photo-drop-text { font-size: 15px; color: var(--ink-soft); margin-bottom: 5px; font-weight: 500; }
.photo-drop-hint { font-size: 12px; color: var(--ink-mute); letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; }
.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .5px;
    transition: all .2s var(--ease);
    margin-top: 10px;
}
.submit-btn:hover { background: var(--gold-dark); transform: translateY(-1px); }

/* =========== FOOTER =========== */
footer {
    background: var(--ink);
    color: rgba(255,255,255,.7);
    padding: 56px 32px 32px;
    margin-top: 64px;
}
.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
}
@media (max-width: 820px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand .brand-text { color: #fff; font-size: 26px; }
.footer-brand .brand-sub { color: rgba(255,255,255,.5); }
.footer-tagline {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.5;
    max-width: 280px;
}
.footer-col h4 {
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,.95);
    font-weight: 700;
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
    color: rgba(255,255,255,.7);
    font-size: 14px;
    transition: color .2s var(--ease);
}
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
    max-width: var(--max);
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    color: rgba(255,255,255,.5);
    flex-wrap: wrap;
}

/* =========== TOAST =========== */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--ink);
    color: #fff;
    padding: 16px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 300;
    opacity: 0;
    transition: all .35s var(--ease);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* =========== ABOUT / SPONSOR PAGES =========== */
.page-hero {
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
    padding: 80px 32px 64px;
    text-align: center;
}
.page-hero-inner { max-width: 800px; margin: 0 auto; }
.page-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin: 16px 0 20px;
}
.page-hero h1 em { color: var(--gold-dark); font-style: italic; }
.page-hero .lede {
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 640px;
    margin: 0 auto;
}
.page-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 64px 32px;
}
.page-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.5px;
    margin: 48px 0 16px;
}
.page-content h2:first-child { margin-top: 0; }
.page-content p {
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink-soft);
    margin-bottom: 18px;
}
.page-content p strong { color: var(--ink); font-weight: 600; }
.page-content ul { margin: 18px 0; padding-inline-start: 24px; }
.page-content li { font-size: 17px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 10px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin: 40px 0;
}
.feature-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 28px 24px;
}
.feature-card .feature-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 18px;
}
.feature-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}
.feature-card p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-mute);
    margin: 0;
}

.cta-banner {
    background: var(--ink);
    color: #fff;
    padding: 64px 32px;
    text-align: center;
    margin-top: 48px;
}
.cta-banner h2 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -.5px;
    margin-bottom: 14px;
    color: #fff;
}
.cta-banner p {
    font-size: 17px;
    color: rgba(255,255,255,.75);
    max-width: 540px;
    margin: 0 auto 28px;
}
.cta-banner .cta { background: var(--gold); color: var(--ink); }
.cta-banner .cta:hover { background: var(--gold-light); }

/* =========== PHOTO DETAIL PAGE — photo dominates, light & readable =========== */
.photo-page {
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at top, rgba(196,165,82,.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
    color: var(--ink);
    min-height: 100vh;
    padding: 10px 0 24px;
}
.photo-page-back {
    max-width: 96vw;
    margin: 0 auto 8px;
    padding: 0 24px;
}
.photo-page-back a {
    color: var(--ink-soft);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.85);
    border: 1px solid var(--line);
    transition: all .2s var(--ease);
    font-weight: 600;
}
.photo-page-back a:hover { color: var(--ink); background: #fff; border-color: var(--gold); }

.photo-detail {
    max-width: 95vw;
    margin: 0 auto;
    padding: 0 2.5vw;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    height: calc(100vh - 180px);
    max-height: 880px;
}
.photo-detail-img {
    background: var(--bg-warm);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    box-shadow:
        0 40px 90px -20px rgba(26,26,26,.28),
        0 20px 50px -10px rgba(196,165,82,.16),
        0 0 0 1px rgba(196,165,82,.1);
}
.photo-detail-img img { width: 100%; height: 100%; object-fit: contain; background: transparent; display: block; }

/* INFO STRIP — compact, light card, dark text, immediately readable */
.photo-detail-side {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 22px;
    color: var(--ink);
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1.1fr) minmax(0, 1.5fr) auto;
    gap: 20px;
    align-items: center;
    box-shadow: 0 8px 24px rgba(26,26,26,.06);
}
@media (max-width: 920px) {
    .photo-detail { height: auto; }
    .photo-detail-img { aspect-ratio: 3/2; height: auto; }
    .photo-detail-side { grid-template-columns: 1fr; gap: 14px; padding: 16px; }
}

.photo-detail-side .col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.photo-detail-side .col.actions { flex-direction: row; gap: 8px; align-items: center; }
.photo-detail-side .eyebrow {
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 800;
}
.photo-detail-side h1 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.1;
    color: var(--ink);
    margin: 0;
}
body[dir="rtl"] .photo-detail-side h1 { font-family: 'Amiri', serif; font-size: 22px; letter-spacing: 0; line-height: 1.3; }
.photo-detail-meta {
    font-size: 13px;
    color: var(--ink-soft);
    margin: 0;
    font-weight: 500;
}

/* Audio box on light bg — dark interior, compact */
.photo-detail-side .audio-box {
    background: var(--ink);
    border: 1px solid var(--ink);
    margin: 0;
    width: 100%;
    color: #fff;
    padding: 8px 12px;
}
.photo-detail-side .audio-head { margin-bottom: 6px; }
.photo-detail-side .audio-title { font-size: 10px; }
.photo-detail-side .lang-pill { padding: 3px 9px; font-size: 11px; }
.photo-detail-side .play-btn { width: 36px; height: 36px; font-size: 14px; }
.photo-detail-side .audio-time { font-size: 11px; min-width: 32px; }

.photo-detail-side .story-text {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    font-style: italic;
    padding-left: 12px;
    border-left: 3px solid var(--gold);
    max-height: 56px;
    overflow-y: auto;
    margin: 0;
    font-weight: 500;
}
body[dir="rtl"] .photo-detail-side .story-text {
    font-family: 'Amiri', serif;
    font-size: 15px;
    padding-left: 0;
    padding-right: 12px;
    border-left: none;
    border-right: 3px solid var(--gold);
    line-height: 1.6;
    max-height: 64px;
}
/* Action buttons on the light card */
.photo-detail-side .action-btn {
    background: var(--bg-warm);
    border: 1.5px solid var(--line-strong);
    color: var(--ink);
    font-size: 13px;
    padding: 9px 14px;
}
.photo-detail-side .action-btn:hover {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}
.photo-detail-side .action-btn.voted {
    background: var(--gold);
    color: var(--ink);
    border-color: var(--gold);
}
.photo-detail-side .share-pop {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
}
.photo-detail-side .share-pop button {
    color: var(--ink-soft);
}
.photo-detail-side .share-pop button:hover {
    background: var(--bg-warm);
    color: var(--ink);
}

/* Related section: matches main bg, no jarring transition */
.photo-related {
    background: transparent;
    color: var(--ink);
    padding: 64px 0 32px;
    margin-top: 64px;
}
.photo-related .grid { padding: 16px 32px 32px; }

/* =========== THEMED PHOTO PAGE — uses CSS variables set by applyPalette() =========== */
body[data-theme] .photo-page {
    background: var(--page-bg, var(--bg)) !important;
    color: var(--page-text, var(--ink)) !important;
    transition: background .4s ease, color .4s ease;
}
body[data-theme] .photo-detail-side {
    background: var(--card-bg, #fff) !important;
    color: var(--card-text, var(--ink)) !important;
    border-color: var(--card-border, var(--line)) !important;
    transition: background .4s ease, color .4s ease;
}
body[data-theme] .photo-detail-side h1,
body[data-theme] .photo-detail-side .story-text,
body[data-theme] .photo-detail-meta { color: var(--card-text, var(--ink)) !important; }
body[data-theme] .photo-detail-side .eyebrow { color: var(--accent-color, var(--gold-dark)) !important; }
body[data-theme] .photo-detail-side .story-text { border-color: var(--accent-color, var(--gold)) !important; }
body[data-theme] .photo-detail-img { border-color: var(--img-border, var(--line)) !important; }
body[data-theme] .photo-page-back a {
    background: var(--back-bg, rgba(255,255,255,.85)) !important;
    color: var(--back-text, var(--ink-soft)) !important;
    border-color: var(--back-border, var(--line)) !important;
}

/* =========== FLOATING THEME PICKER =========== */
.theme-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 280;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    border: 2px solid rgba(255,255,255,.2);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.theme-fab:hover { transform: scale(1.06); box-shadow: 0 14px 36px rgba(0,0,0,.45); }
.theme-fab-dot {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #E8F1F8, #0B3D2E, #1A1A1A, #0F1A2E, #DDE3D8, #3D1F25, #E8DAD4, #F8F7F5, #E8F1F8);
    box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4);
}
body[dir="rtl"] .theme-fab { right: auto; left: 28px; }

.theme-panel {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 281;
    width: 280px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,.3);
    padding: 16px;
    transform: translateY(20px) scale(.95);
    opacity: 0;
    pointer-events: none;
    transition: all .25s var(--ease);
    color: var(--ink);
}
.theme-panel.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
body[dir="rtl"] .theme-panel { right: auto; left: 28px; }

.theme-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.theme-panel-title {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
.theme-panel-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-warm);
    color: var(--ink);
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s var(--ease);
}
.theme-panel-close:hover { background: var(--ink); color: #fff; }

.theme-swatches {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.theme-swatch {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: start;
    transition: all .15s var(--ease);
    color: var(--ink);
}
.theme-swatch:hover { background: var(--bg-warm); }
.theme-swatch.active { border-color: var(--gold); background: rgba(196,165,82,.08); }
.theme-swatch-dot {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
    flex-shrink: 0;
}
.theme-swatch-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.theme-admin {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--line-strong);
}
.theme-admin-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 800;
    margin-bottom: 8px;
}
.theme-admin-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background .15s var(--ease);
}
.theme-admin-btn:hover { background: var(--gold-dark); }
.theme-admin-btn.theme-admin-clear { background: transparent; color: var(--ink-mute); border: 1px solid var(--line); }
.theme-admin-btn.theme-admin-clear:hover { color: var(--ink); border-color: var(--ink); }

/* =========== FILTER PILL — two lines: country + count =========== */
.filter-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    line-height: 1.15;
    padding: 10px 20px;
    min-height: 58px;
}
.filter-btn .fb-label {
    font-size: 16px;
    font-weight: 700;
    color: inherit;
    letter-spacing: 0.1px;
}
.filter-btn .fb-count {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 600;
    opacity: .85;
}
.filter-btn.active .fb-count { color: rgba(255,255,255,.7); }

/* =========== VOICE RECORDER (upload modal) =========== */
.recorder {
    background: var(--bg-warm);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.rec-btn {
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .25s var(--ease);
}
.rec-btn:hover { background: var(--gold-dark); }
.rec-btn.recording {
    background: #c53030;
}
.rec-btn.recording:hover { background: #9b2c2c; }
.rec-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #fff;
    animation: rec-pulse 1s ease-in-out infinite;
}
@keyframes rec-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(.85); }
}
.rec-status {
    font-size: 13px;
    color: var(--ink-mute);
    font-weight: 600;
    letter-spacing: .5px;
}
.rec-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--line);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}
.rec-bar {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width .1s linear, background .25s var(--ease);
    border-radius: 3px;
}
.rec-time {
    position: absolute;
    top: 12px;
    right: 0;
    font-size: 12px;
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.rec-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.rec-preview audio {
    flex: 1;
    min-width: 240px;
    max-width: 400px;
}
.rec-clear {
    background: transparent;
    color: var(--ink-mute);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.rec-clear:hover { color: #c53030; border-color: #c53030; }

/* Mic badge on photo cards/modal indicating recorded voice exists */
.badge-voice {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =========== REACTIONS =========== */
.reaction-strip {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.reaction-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 20px;
    border: 1.5px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.7);
    border-radius: 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-soft, #555);
    text-transform: uppercase;
    transition: all 0.18s ease;
}
.reaction-btn .rx-emoji { font-size: 22px; line-height: 1; }
.reaction-btn .rx-label { font-size: 10px; letter-spacing: 0.5px; }
.reaction-btn .rx-count { font-size: 13px; font-weight: 800; color: var(--ink, #1a1814); margin-top: 1px; }
.reaction-btn:hover { background: #fff; border-color: rgba(0,0,0,0.18); transform: translateY(-1px); }
.reaction-btn.active { background: linear-gradient(135deg, #FFF6E0, #FFE9C2); border-color: var(--gold, #C4A552); color: var(--ink, #1a1814); box-shadow: 0 4px 12px rgba(196,165,82,0.3); }
.reaction-btn.active[data-reaction="love"] { background: linear-gradient(135deg, #ffe5e5, #ffd1d1); border-color: #e8718f; box-shadow: 0 4px 12px rgba(232,113,143,0.3); }
.reaction-btn.active[data-reaction="visit"] { background: linear-gradient(135deg, #e0f2ff, #c2e4ff); border-color: #4a90d9; box-shadow: 0 4px 12px rgba(74,144,217,0.3); }

/* Grid card dual pills */
.vote-pill.love-pill { background: rgba(232,113,143,0.08); color: #c53055; }
.vote-pill.love-pill.voted { background: rgba(232,113,143,0.18); color: #b8294c; font-weight: 700; }
.vote-pill.visit-pill { background: rgba(74,144,217,0.08); color: #2962a8; }
.vote-pill.visit-pill.voted { background: rgba(74,144,217,0.18); color: #1f4d8a; font-weight: 700; }
.card-foot { gap: 6px; flex-wrap: wrap; }
.card-time { margin-left: auto; color: var(--ink-mute, #888); font-size: 12px; }

/* =========== PREVIEW BANNER (draft mode) =========== */
.preview-banner {
    position: sticky;
    top: 0;
    z-index: 90;
    background: linear-gradient(135deg, #FFF6E0, #FFE9C2);
    border-bottom: 2px solid var(--gold, #C4A552);
    box-shadow: 0 4px 14px rgba(196,165,82,0.25);
    padding: 14px 24px;
}
.preview-banner-inner {
    max-width: var(--max, 1900px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.preview-banner-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 280px;
    font-size: 15px;
    color: var(--ink, #1A1A1A);
}
.preview-banner-icon { font-size: 22px; }
.preview-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.preview-edit-btn, .preview-publish-btn {
    padding: 11px 22px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.preview-edit-btn {
    background: transparent;
    color: var(--ink-soft, #555);
    border: 1.5px solid rgba(0,0,0,0.15);
}
.preview-edit-btn:hover {
    background: rgba(0,0,0,0.04);
    color: var(--ink, #1A1A1A);
}
.preview-publish-btn {
    background: linear-gradient(135deg, var(--ink, #1A1A1A), #2a2a2a);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.preview-publish-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
@media (max-width: 700px) {
    .preview-banner-inner { flex-direction: column; align-items: stretch; gap: 12px; }
    .preview-banner-actions { justify-content: stretch; }
    .preview-banner-actions button { flex: 1; }
}

/* =========== UPLOAD CONFIRM CHECKBOX =========== */
.upload-confirm {
    padding: 10px 40px 14px;
    margin-top: 8px;
}
.confirm-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ink-soft, #555);
    cursor: pointer;
    padding: 14px 16px;
    background: var(--card, #fff);
    border: 1.5px solid var(--line, #DCD6CA);
    border-radius: 10px;
    transition: border-color 0.2s ease;
}
.confirm-row:hover { border-color: var(--gold, #C4A552); }
.confirm-row input[type="checkbox"] {
    width: 18px; height: 18px;
    margin-top: 1px;
    accent-color: var(--gold-dark, #9d8240);
    cursor: pointer;
    flex-shrink: 0;
}
.confirm-row a {
    color: var(--gold-dark, #9d8240);
    text-decoration: underline;
    font-weight: 600;
}

/* =========== REPORT BUTTON =========== */
.report-menu { position: relative; }
.action-btn-quiet {
    background: transparent;
    color: var(--ink-mute, #888);
    border: 1px solid rgba(0,0,0,0.1);
    font-size: 13px;
}
.action-btn-quiet:hover {
    background: #fff;
    color: var(--ink, #1A1A1A);
    border-color: rgba(0,0,0,0.2);
}
.report-pop {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid var(--line, #DCD6CA);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    display: none;
    z-index: 50;
    min-width: 260px;
}
.report-pop.active { display: block; }
.report-pop-head {
    padding: 8px 12px 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ink-mute, #888);
    border-bottom: 1px solid var(--line, #DCD6CA);
    margin-bottom: 4px;
}
.report-pop button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink, #1A1A1A);
    cursor: pointer;
    font-family: inherit;
}
.report-pop button:hover { background: #f5f1e8; }

/* === Audio recording warning === */
.rec-warning {
    font-size: 12px;
    color: var(--ink-soft, #555);
    background: rgba(196,165,82,0.08);
    border-left: 3px solid var(--gold, #C4A552);
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0 0 12px;
    line-height: 1.4;
}

/* =========== COUNTRY RANK TOGGLE (re-added after CSS sync issue) =========== */
.rank-section {
    max-width: var(--max, 1900px);
    margin: 48px auto 18px;
    padding: 0 48px 0 32px;
}
.rank-head {
    display: flex;
    align-items: baseline;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.rank-head h3 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.8px;
}
.rank-sub {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--ink-mute);
    font-weight: 700;
}
.rank-toggle {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.rank-tab {
    padding: 11px 22px;
    background: #fff;
    border: 1.5px solid var(--line-strong);
    border-radius: 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.rank-tab:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196,165,82,0.18);
}
.rank-tab.active {
    background: linear-gradient(135deg, var(--ink), #2a2a2a);
    color: #fff;
    border-color: var(--ink);
    box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}
/* Rank badge (gold/silver/bronze) when not in Overall mode */
.filter-btn { position: relative; }
.fb-rank {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    border: 2px solid #fff;
    z-index: 2;
}
.fb-rank-1 { background: linear-gradient(135deg, #FFD700, #C9A227); box-shadow: 0 3px 8px rgba(196,165,82,0.5); }
.fb-rank-2 { background: linear-gradient(135deg, #C0C0C0, #919191); box-shadow: 0 3px 8px rgba(150,150,150,0.5); }
.fb-rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); box-shadow: 0 3px 8px rgba(139,69,19,0.5); }

.filter-bar { margin-top: 6px; }

/* =========== CONTACT MODAL =========== */
.contact-modal { position: fixed; inset: 0; background: rgba(20,18,14,0.78); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 24px; }
.contact-modal.open { display: flex; }
.contact-content { position: relative; background: var(--bg-warm, #fdfaf5); color: var(--ink, #1a1814); width: 100%; max-width: 480px; border-radius: 18px; padding: 36px 32px 32px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); border: 1px solid var(--line, #e8e1d4); }
.contact-email-box { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line-strong, #d8cfbe); border-radius: 12px; padding: 12px 14px; margin: 0 0 18px; }
.contact-email { flex: 1; font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600; color: var(--ink, #1a1814); overflow-wrap: anywhere; }
.contact-copy { background: var(--gold, #c9a24b); color: #1a1814; border: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s; }
.contact-copy:hover { background: var(--gold-dark, #a8852f); }
.contact-mail-cta { display: inline-block; margin-top: 4px; }

/* =========== MOBILE FIXES (added: photo size, upload tap, modal scroll) =========== */
/* Reliable file input — works on iOS Safari which ignores `hidden` */
.visually-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 700px) {
    /* Photo detail — photo dominates the screen */
    .photo-detail-img { aspect-ratio: auto !important; min-height: 60vh; max-height: 75vh; }
    .photo-detail-img img { object-fit: cover; }
    .photo-detail-side { padding: 18px !important; }

    /* Reaction buttons — wider tap targets, two-column on phone */
    .reaction-strip { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; }
    .reaction-btn { width: 100%; padding: 14px 8px; }
    .reaction-btn .rx-emoji { font-size: 26px; }
    .reaction-btn .rx-label { font-size: 11px; }

    /* Upload modal — full-screen feel on phone, less wasted padding */
    .upload-modal { padding: 0; }
    .upload-content { max-height: 100vh; max-height: 100dvh; border-radius: 0; height: 100vh; height: 100dvh; }
    .upload-content > h2 { padding: 22px 20px 4px !important; font-size: 26px !important; }
    .upload-content > .upload-sub { padding: 0 20px 14px !important; font-size: 13px !important; }
    .upload-content form > *:not(.upload-footer) { padding-left: 20px !important; padding-right: 20px !important; }
    .upload-footer { padding: 14px 20px 22px !important; }
    .upload-confirm { padding: 10px 20px 14px !important; }

    /* Photo drop — bigger tap area, more visible on mobile */
    .photo-drop { padding: 56px 16px !important; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    .photo-drop-text { font-size: 17px !important; font-weight: 600 !important; }
    .photo-drop-hint { font-size: 12px !important; }
    .photo-drop img { max-height: 280px !important; }

    /* Form rows stack on mobile */
    .form-row { grid-template-columns: 1fr !important; }
}

/* Tap-friendly targets on all small touch devices */
@media (pointer: coarse) {
    .reaction-btn, .cta, .btn-mini, .submit-btn, .rec-btn { min-height: 44px; }
}
