/* ══ VARIABLES ════════════════════════════════════════════════════════════════ */
:root {
    --bg:          #fafaf7;
    --ink:         #1a1a1a;
    --ink-dim:     #4a4a4a;
    --ink-faint:   #888;
    --accent:      #c2410c;
    --accent-pale: #fef3ee;
    --green:       #65a30d;
    --orange:      #ea580c;
    --ticker-bg:   #111111;
    --ticker-fg:   #f0f0ec;
    --border:      2px solid #1a1a1a;
    --dash:        1.5px dashed #ccc;
    --r:           4px;

    /* layout heights */
    --h-header:  80px;
    --h-kiosko:  230px;
    --h-ticker:  68px;
    /* main fills the rest: 1080 - 80 - 230 - 68 = 702px */

    /* fonts */
    --f-display: 'Space Grotesk', sans-serif;
    --f-body:    'DM Sans', sans-serif;
    --f-mono:    'Space Mono', monospace;
}

/* ══ RESET ════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width:  1920px;
    height: 1080px;
    overflow: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f-body);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: none;
    /* Improve rendering at distance */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.cursor-active { cursor: default; }

/* ══ PAGE GRID ════════════════════════════════════════════════════════════════ */
body {
    display: flex;
    flex-direction: column;
}

/* ══ HEADER ══════════════════════════════════════════════════════════════════ */
header {
    height: var(--h-header);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: var(--border);
    background: var(--bg);
    position: relative;
    z-index: 10;
}

.hdr-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 30px;
    letter-spacing: -0.5px;
    color: var(--ink);
}

.hdr-right {
    display: flex;
    align-items: center;
    gap: 44px;
}

/* ── Camera + Search buttons (header) — mismo tamaño que .fc-day ────────── */
.cam-btn {
    background: transparent;
    border: 1.5px solid var(--ink-faint);
    border-radius: var(--r);
    min-width: 68px;
    font-size: 18px;
    cursor: pointer;
    color: var(--ink-dim);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}
.cam-btn:hover,
.cam-btn:focus { border-color: var(--accent); color: var(--accent); outline: none; }

.search-btn {
    background: transparent;
    border: 1.5px solid var(--ink-faint);
    border-radius: var(--r);
    min-width: 68px;
    font-size: 18px;
    cursor: pointer;
    color: var(--ink-dim);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;   /* se estira al alto del forecast strip */
}
.search-btn:hover,
.search-btn:focus { border-color: var(--ink); color: var(--ink); outline: none; }

/* ══ SEARCH OVERLAY ══════════════════════════════════════════════════════════ */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,5,5,0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 130;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.search-overlay.open { opacity: 1; pointer-events: auto; }

.so-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg);
    padding: 0;
}

/* Input bar */
.so-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 32px;
    border-bottom: var(--border);
    flex-shrink: 0;
}

.so-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--accent-pale);
    border: 2px solid var(--ink-faint);
    border-radius: var(--r);
    padding: 10px 20px;
    transition: border-color 0.15s;
}
.so-input-wrap:focus-within { border-color: var(--accent); }

.so-input-icon { font-size: 20px; opacity: 0.6; }

.so-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: var(--f-display);
    font-size: 22px;
    font-weight: 500;
    color: var(--ink);
    outline: none;
    -webkit-appearance: none;
}
.so-input::placeholder { color: var(--ink-faint); }
.so-input::-webkit-search-cancel-button { display: none; }

.so-count {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--ink-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Body: list + viewer */
.so-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Results list */
.so-list {
    width: 42%;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: var(--border);
    scroll-behavior: smooth;
}
.so-list::-webkit-scrollbar { width: 4px; }
.so-list::-webkit-scrollbar-thumb { background: var(--ink-faint); border-radius: 2px; }

.so-empty {
    padding: 40px 28px;
    font-family: var(--f-display);
    font-size: 15px;
    color: var(--ink-faint);
    letter-spacing: 1px;
}

.so-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 14px 24px;
    border-bottom: var(--dash);
    cursor: pointer;
    transition: background 0.12s;
}
.so-item:hover { background: var(--accent-pale); }
.so-item--focused {
    background: var(--accent-pale);
    border-left: 4px solid var(--accent);
    padding-left: 20px;
}

.so-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.so-item-title {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 15px;
    color: var(--ink);
    line-height: 1.35;
}
.so-item--focused .so-item-title { color: var(--ink); }

/* Viewer panel */
.so-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px 40px;
    overflow-y: auto;
}

.so-viewer-img-wrap {
    width: 100%;
    border-radius: var(--r);
    overflow: hidden;
    max-height: 340px;
    background: var(--accent-pale);
    flex-shrink: 0;
}
.so-viewer-img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: top;
    display: block;
}

.so-viewer-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}
.so-viewer-source {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1px;
    color: var(--ink-dim);
}
.so-viewer-time { color: var(--ink-faint); font-size: 13px; }

.so-viewer-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 28px;
    line-height: 1.25;
    color: var(--ink);
    letter-spacing: -0.5px;
}

.so-viewer-desc {
    font-family: var(--f-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink-dim);
}

.so-viewer-url {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink-faint);
    word-break: break-all;
}

.so-viewer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--f-display);
    font-size: 16px;
    color: var(--ink-faint);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.5;
}

/* Footer */
.so-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 32px;
    border-top: var(--dash);
    font-family: var(--f-display);
    font-size: 13px;
    color: var(--ink-faint);
    flex-shrink: 0;
}
.so-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    background: var(--ink);
    color: var(--bg);
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Extended forecast strip — header center */
.forecast-strip {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fc-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 5px 14px 6px;
    border: 1.5px solid var(--ink-faint);
    border-radius: var(--r);
    min-width: 68px;
}

.fc-label {
    font-family: var(--f-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.fc-icon { font-size: 18px; line-height: 1.2; }

.fc-temps {
    font-family: var(--f-mono);
    font-size: 12px;
    color: var(--ink);
    white-space: nowrap;
}

.fc-lo { color: var(--ink-faint); }

/* Weather */
.weather-widget {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--f-display);
}

.w-icon { font-size: 30px; line-height: 1; }
.w-temp { font-size: 34px; font-weight: 700; letter-spacing: -1px; }
.w-city { font-size: 18px; font-weight: 500; color: var(--ink-dim); }

/* Clock */
.clock-widget { text-align: right; }

.clock-time {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 50px;
    line-height: 1;
    letter-spacing: -2px;
}

.clock-date {
    font-family: var(--f-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--ink-dim);
    text-transform: capitalize;
    letter-spacing: 0.2px;
    margin-top: 1px;
}

/* ══ MAIN (Hero + Rail) ══════════════════════════════════════════════════════ */
main {
    flex: 1;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    overflow: hidden;
    min-height: 0;
    position: relative; /* needed for loading-screen absolute positioning */
}

/* ══ LOADING SCREEN ══════════════════════════════════════════════════════════ */
.loading-screen {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.8s ease;
    /* span both grid columns */
    grid-column: 1 / -1;
    pointer-events: none;
}
.loading-screen.gone { opacity: 0; }

.ls-time {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 200px;
    letter-spacing: -10px;
    line-height: 1;
    color: var(--ink);
    animation: ls-pulse 2.4s ease-in-out infinite;
}

@keyframes ls-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

.ls-label {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.ls-d1, .ls-d2, .ls-d3 { animation: dot-in 1.5s infinite; }
.ls-d2 { animation-delay: 0.25s; }
.ls-d3 { animation-delay: 0.5s; }
@keyframes dot-in {
    0%, 60%, 100% { opacity: 0; }
    30%            { opacity: 1; }
}

/* ── Featured (left) ─────────────────────────────────────────────────────── */
.featured {
    display: flex;
    flex-direction: column;
    padding: 24px 32px 20px;
    border-right: var(--border);
    overflow: hidden;
    gap: 10px;
}

.feat-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.feat-badge {
    background: var(--accent);
    color: #fff;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2.5px;
    padding: 4px 12px 3px;
    border-radius: var(--r);
    flex-shrink: 0;
    text-transform: uppercase;
}

.feat-source {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.feat-time {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--ink-faint);
}

/* Image */
.feat-img-wrap {
    width: 100%;
    flex-shrink: 0;
    border: var(--border);
    background: #eae9e4;
    overflow: hidden;
    position: relative;
    height: 290px;
}

.feat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.feat-img.hidden { display: none; }

/* Image placeholder */
.img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.img-placeholder svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.img-placeholder-label {
    font-family: var(--f-body);
    font-size: 15px;
    color: var(--ink-faint);
    position: relative;
}

/* Headline & dek */
.feat-headline {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 46px;
    line-height: 1.15;
    color: var(--ink);
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.5px;
}

.feat-dek {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: 19px;
    color: var(--ink-dim);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── News Rail (right) ──────────────────────────────────────────────────── */
.news-rail {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Rail tabs ───────────────────────────────────────────────────────────── */
.rail-tabs {
    display: flex;
    align-items: stretch;
    border-bottom: var(--border);
    flex-shrink: 0;
    height: 54px;
}

.rail-tab {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0 22px;
    display: flex;
    align-items: center;
    color: var(--ink-dim);
    border-right: var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.rail-tab--active {
    color: var(--ink);
    background: var(--accent-pale);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.rail-hdr-hint {
    font-family: var(--f-body);
    font-size: 13px;
    color: var(--ink-faint);
    padding: 0 16px;
    margin-left: auto;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

/* ── Rail sliding panels ─────────────────────────────────────────────────── */
.rail-panels {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

.rail-track {
    display: flex;
    width: 400%;
    height: 100%;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.rail-panel {
    width: 25%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-dot {
    color: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

.rail-list {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: var(--dash);
    flex-shrink: 0;
}

.rail-item:last-child { border-bottom: none; }

.rail-time {
    font-family: var(--f-mono);
    font-size: 14px;
    color: var(--ink-faint);
    min-width: 52px;
    flex-shrink: 0;
    padding-top: 2px;
}

.rail-pill {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 1.5px solid var(--ink);
    border-radius: var(--r);
    padding: 3px 8px 2px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 78px;
    text-align: center;
}

.rail-title {
    font-family: var(--f-body);
    font-weight: 400;
    font-size: 17px;
    line-height: 1.45;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ══ KIOSKO STRIP ════════════════════════════════════════════════════════════ */
.kiosko-strip {
    height: var(--h-kiosko);
    flex-shrink: 0;
    border-top: var(--border);
    overflow: hidden;
}

.kiosko-track {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px;
    animation: kiosko-scroll 90s linear infinite;
    width: max-content;
    will-change: transform;
}

.kiosko-track:hover { animation-play-state: paused; }

@keyframes kiosko-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Cover card */
.cover-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.cover-img-wrap {
    width:  140px;
    height: 184px;
    border: 2px solid var(--ink);
    overflow: hidden;
    background: #e8e7e2;
    position: relative;
    flex-shrink: 0;
}

.cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Cover placeholder */
.cover-ph {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cover-ph svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.cover-ph-label {
    font-family: var(--f-body);
    font-size: 12px;
    color: var(--ink-faint);
    position: relative;
    text-align: center;
    padding: 0 6px;
}

.cover-caption {
    width: 140px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cover-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    color: var(--ink);
    letter-spacing: 0.3px;
}

.cover-city {
    font-family: var(--f-mono);
    font-size: 10px;
    color: var(--ink-faint);
}

/* ══ KIOSKO — focus state ════════════════════════════════════════════════════ */
.cover-card { cursor: pointer; }

.cover-card--focused .cover-img-wrap {
    outline: 4px solid var(--accent);
    outline-offset: 3px;
}
.cover-card--focused .cover-name { color: var(--accent); }

/* Strip glows when in kiosko navigation zone */
.kiosko-strip--active {
    box-shadow: inset 0 4px 0 var(--accent);
}

/* ══ FORECAST OVERLAY ════════════════════════════════════════════════════════ */
.forecast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4,4,4,0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.forecast-overlay.open { opacity: 1; pointer-events: auto; }

/* Panel is always dark — weather panels read better on dark */
.fo-panel {
    background: #0e0e0d;
    width: min(1620px, 96vw);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 16px;
    padding: 44px 52px 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    box-shadow: 0 48px 120px rgba(0,0,0,0.85);
}

/* Override the shared ao-close style for the dark panel */
.fo-panel .ao-close {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
}
.fo-panel .ao-close:hover,
.fo-panel .ao-close:focus {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ── Current conditions header ──────────────────────────────────────────── */
.fo-header {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.fo-current {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
}

.fo-now-icon {
    font-size: 76px;
    line-height: 1;
}

.fo-now-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fo-now-location {
    font-family: var(--f-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

.fo-now-temp {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 96px;
    letter-spacing: -5px;
    color: #fff;
    line-height: 0.9;
}

.fo-now-feels {
    font-family: var(--f-body);
    font-size: 15px;
    color: rgba(255,255,255,0.4);
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* Stat boxes — humidity & wind */
.fo-now-stats {
    display: flex;
    gap: 14px;
    margin-left: auto;
}

.fo-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 22px 30px;
    min-width: 120px;
}

.fo-stat-icon { font-size: 28px; line-height: 1; }

.fo-stat-value {
    font-family: var(--f-mono);
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.fo-stat-label {
    font-family: var(--f-display);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}

/* ── Section label ──────────────────────────────────────────────────────── */
.fo-section-label {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.25);
    margin-bottom: -16px;
}

/* ── Day cards ──────────────────────────────────────────────────────────── */
.fo-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.fo-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 26px 10px 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    text-align: center;
    transition: border-color 0.18s, background 0.18s, transform 0.18s, box-shadow 0.18s;
}

/* "Hoy" card gets a brighter top bar */
.fo-day:first-child {
    border-top: 3px solid rgba(255,255,255,0.22);
}

.fo-day--focused {
    border-color: var(--accent);
    border-top-color: var(--accent);
    background: rgba(220,40,30,0.13);
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}

.fo-day-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
}

.fo-day--focused .fo-day-name { color: var(--accent); }

.fo-day-icon { font-size: 44px; line-height: 1.1; }

.fo-day-temps {
    font-family: var(--f-mono);
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.fo-day-lo { color: rgba(255,255,255,0.3); font-weight: 400; }

/* Rain probability bar */
.fo-day-rain-bar {
    width: 80%;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}
.fo-day-rain-fill {
    height: 100%;
    background: #60a5fa;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.fo-day-extra {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: var(--f-body);
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    line-height: 1.6;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.fo-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    font-family: var(--f-display);
    font-size: 13px;
    color: rgba(255,255,255,0.2);
    padding-top: 8px;
}

.fo-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.55);
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ MARKETS OVERLAY ════════════════════════════════════════════════════════ */
.markets-overlay {
    position: fixed;
    inset: 0;
    background: #080809;
    z-index: 120;   /* above all other overlays */
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.markets-overlay.open { opacity: 1; pointer-events: auto; }

.mo-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 28px 16px;
    gap: 14px;
}

.mo-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.mo-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

/* 4×2 chart grid */
.mo-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
    min-height: 0;
}

.mo-chart-cell {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* TradingView widget fills the cell */
.mo-chart-cell .tradingview-widget-container,
.mo-chart-cell .tradingview-widget-container__widget {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* Hide TradingView copyright bar to save space */
.mo-chart-cell .tradingview-widget-copyright { display: none !important; }

.mo-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--f-display);
    font-size: 13px;
    color: rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.mo-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 11px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ COVER OVERLAY ═══════════════════════════════════════════════════════════ */
.cover-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.94);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.cover-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.co-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.co-img-wrap {
    /* image sizes itself; constrain to fit screen */
}

.co-img {
    max-height: 820px;
    max-width:  560px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 24px 80px rgba(0,0,0,0.8);
    border: 3px solid rgba(255,255,255,0.12);
}

.co-meta {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

.co-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 28px;
    color: #f0efe8;
    letter-spacing: -0.3px;
}

.co-city {
    font-family: var(--f-mono);
    font-size: 16px;
    color: #888;
}

.co-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--f-display);
    font-size: 15px;
    color: #666;
}

.co-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    background: rgba(255,255,255,0.15);
    color: #f0efe8;
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ TICKER ══════════════════════════════════════════════════════════════════ */
.ticker-bar {
    height: var(--h-ticker);
    flex-shrink: 0;
    background: var(--ticker-bg);
    color: var(--ticker-fg);
    display: flex;
    align-items: center;
    overflow: hidden;
    transition: box-shadow 0.15s;
    cursor: pointer;
}

.ticker-bar--active {
    box-shadow: inset 0 3px 0 var(--accent), inset 0 -3px 0 var(--accent);
}

.ticker-label {
    background: var(--accent);
    color: #fff;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2.5px;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    border-right: 1px solid #333;
    text-transform: uppercase;
}

.ticker-overflow {
    flex: 1;
    overflow: hidden;
    height: 100%;
    position: relative;
}

.ticker-track {
    display: flex;
    align-items: center;
    height: 100%;
    animation: ticker-scroll 70s linear infinite;
    will-change: transform;
    white-space: nowrap;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Quote pill */
.q-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    height: 100%;
    border-right: 1px solid #222;
    flex-shrink: 0;
    transition: background 0.6s ease;
}

.q-sym {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.5px;
    color: #777;
    text-transform: uppercase;
}

.q-price {
    font-family: var(--f-mono);
    font-size: 22px;
    color: var(--ticker-fg);
    letter-spacing: -0.5px;
}

.q-chg {
    font-family: var(--f-mono);
    font-size: 14px;
    letter-spacing: -0.3px;
}

.q-up   { color: var(--green); }
.q-dn   { color: var(--orange); }
.q-flat { color: #555; }

/* Flash animations on price change */
@keyframes flash-up { 0%,100%{background:transparent} 40%{background:#162b06} }
@keyframes flash-dn { 0%,100%{background:transparent} 40%{background:#2d1200} }

.flash-up { animation: flash-up 0.9s ease; }
.flash-dn { animation: flash-dn 0.9s ease; }

/* ══ DARK THEME (default) — key D toggles, ?theme=light overrides ═══════════ */
body.dark {
    --bg:          #0f0f0e;
    --ink:         #f0efe8;
    --ink-dim:     #9a9990;
    --ink-faint:   #55544f;
    --accent-pale: #1e0d06;
    --border:      2px solid #f0efe8;
    --dash:        1.5px dashed #2a2a28;
}
body.dark .feat-img-wrap,
body.dark .ao-img-wrap,
body.dark .cover-img-wrap  { background: #1c1b18; }
body.dark .rail-item:hover:not(.rail-item--focused) { background: #191815; }
body.dark .ao-sep          { color: #444; }

/* ══ STALE DATA INDICATOR ════════════════════════════════════════════════════ */
.stale { opacity: 0.5; }

/* ══ CATEGORY PILLS — colored fills in rail ══════════════════════════════════ */
.cat-pill--cordoba   { background: #0369a1; color: #fff; border-color: #0369a1; }
.cat-pill--nacional  { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.cat-pill--bitcoin   { background: #f7931a; color: #fff; border-color: #f7931a; }
.cat-pill--tech      { background: #0d9488; color: #fff; border-color: #0d9488; }
.cat-pill--default   { background: #6b7280; color: #fff; border-color: #6b7280; }

/* ══ CATEGORY BADGES — feat-badge + ao-badge ═════════════════════════════════ */
.cat-badge--cordoba   { background: #0369a1; color: #fff; }
.cat-badge--nacional  { background: #7c3aed; color: #fff; }
.cat-badge--bitcoin   { background: #f7931a; color: #fff; }
.cat-badge--tech      { background: #0d9488; color: #fff; }
.cat-badge--default   { background: #6b7280; color: #fff; }

/* ── Bitcoin tab accent ──────────────────────────────────────────────────────── */
.rail-tab--bitcoin       { color: #f7931a; }
.rail-tab--bitcoin.rail-tab--active { background: #f7931a; color: #fff; }

/* ── Tech tab accent ─────────────────────────────────────────────────────────── */
.rail-tab--tech       { color: #0d9488; }
.rail-tab--tech.rail-tab--active { background: #0d9488; color: #fff; }

/* ══ RAIL FOCUS — remote control navigation ══════════════════════════════════ */
.rail-item { cursor: pointer; transition: background 0.12s; }
.rail-item:hover:not(.rail-item--focused) { background: #f4f3ef; }

.rail-item--focused {
    background: var(--accent-pale);
    box-shadow: inset 6px 0 0 var(--accent);
    border-bottom-color: transparent;
}
.rail-item--focused .rail-time  { color: var(--ink-dim); }
.rail-item--focused .rail-title { color: var(--ink); font-weight: 500; }

/* Featured is also clickable */
.featured { cursor: pointer; }

/* Tabs zone: news block is "selected" — visible accent border before entering */
.news-rail--selected {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}

/* List zone: actively navigating inside the list */
.news-rail--active {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
    box-shadow: inset 4px 0 0 var(--accent);
}

/* Forecast strip: focused state (forecast zone) */
.forecast-strip--focused {
    outline: 3px solid var(--accent);
    outline-offset: 5px;
    border-radius: var(--r);
}

/* Individual forecast day: focused */
.fc-day--focused {
    border-color: var(--accent) !important;
    background: var(--accent-pale);
}

/* ══ ARTICLE OVERLAY ═════════════════════════════════════════════════════════ */
.article-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.92);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.article-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Panel */
.ao-panel {
    background: var(--bg);
    width: 1680px;
    max-height: 880px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 36px 52px 28px;
    gap: 18px;
    box-shadow: 0 32px 100px rgba(0,0,0,0.6);
}

/* Header row */
.ao-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    padding-bottom: 18px;
    border-bottom: var(--border);
}

.ao-badge {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 2.5px;
    padding: 5px 14px 4px;
    border-radius: var(--r);
    flex-shrink: 0;
    text-transform: uppercase;
    background: #6b7280;
    color: #fff;
}

.ao-source {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ao-time {
    font-family: var(--f-mono);
    font-size: 15px;
    color: var(--ink-faint);
}

.ao-close {
    margin-left: auto;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: transparent;
    border: 2px solid var(--ink);
    border-radius: var(--r);
    padding: 8px 22px;
    cursor: pointer;
    color: var(--ink);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.ao-close:hover,
.ao-close:focus { background: var(--ink); color: var(--bg); outline: none; }

/* Body */
.ao-body {
    display: flex;
    gap: 44px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    align-items: flex-start;
}

.ao-img-wrap {
    width: 480px;
    height: 330px;
    flex-shrink: 0;
    border: var(--border);
    background: #eae9e4;
    overflow: hidden;
}

.ao-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ao-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow: hidden;
}

.ao-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 48px;
    line-height: 1.12;
    letter-spacing: -0.5px;
    color: var(--ink);
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ao-desc {
    font-family: var(--f-body);
    font-size: 21px;
    line-height: 1.65;
    color: var(--ink-dim);
    flex: 1;
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ao-url {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--ink-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-top: 10px;
    border-top: var(--dash);
    flex-shrink: 0;
}

/* Footer */
.ao-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-family: var(--f-display);
    font-size: 15px;
    color: var(--ink-faint);
    letter-spacing: 0.3px;
    flex-shrink: 0;
    padding-top: 14px;
    border-top: var(--dash);
}

.ao-sep { color: #ccc; }

.ao-footer strong {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 13px;
    background: var(--ink);
    color: var(--bg);
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ══ CAMERA OVERLAY ══════════════════════════════════════════════════════════ */
.camera-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5,5,5,0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 125;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.camera-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cam-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 28px 40px 20px;
    gap: 16px;
    overflow: hidden;
}

.cam-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.cam-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.3px;
    color: var(--ink);
}

.cam-status {
    font-family: var(--f-mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.5px;
    flex: 1;
}

/* 4-column grid; images keep 4:3 ratio */
.cam-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: var(--ink-faint) transparent;
}

.cam-card {
    position: relative;
    border-radius: calc(var(--r) + 2px);
    border: 2px solid var(--ink-faint);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #111;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.cam-card--focused {
    border-color: var(--accent);
    transform: scale(1.03);
    z-index: 1;
    box-shadow: 0 0 0 2px var(--accent);
}
.cam-card:hover { border-color: var(--ink-dim); }

.cam-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cam-img--error {
    opacity: 0.25;
    filter: grayscale(1);
}

.cam-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 18px 10px 7px;
    background: linear-gradient(transparent, rgba(0,0,0,0.82));
    font-family: var(--f-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    line-height: 1.3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.cam-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    font-family: var(--f-display);
    font-size: 13px;
    color: var(--ink-faint);
    letter-spacing: 0.3px;
    padding-top: 12px;
    border-top: var(--dash);
}
.cam-attr {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.5;
}

/* ══ CAMERA FULLSCREEN ═══════════════════════════════════════════════════════ */
.cam-full-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 135;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.cam-full-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cam-full-img {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    object-fit: contain;
    display: block;
}

.cam-full-name {
    font-family: var(--f-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-top: 14px;
    text-align: center;
    letter-spacing: -0.2px;
}

.cam-full-footer {
    position: absolute;
    bottom: 18px;
    left: 0; right: 0;
    text-align: center;
    font-family: var(--f-display);
    font-size: 13px;
    color: var(--ink-faint);
}
