/* ========================================================= */
/* LumoLynx Time Station                                       */
/* time.css                                                    */
/* ========================================================= */

/* Time-local aliases to the Lumo shell tokens — same pattern
   weather.css, solar.css, tides.css, and fire-smoke.css use under
   their own station ids. */
#time-station{
    --soft:var(--soft-text);
    --glass-primary:var(--glass);
    --border-soft:var(--glass-border);
    --r-lg:var(--radius-large);
    --transition:var(--transition-fast);
    --ultra-t2:var(--text);
    --ultra-t3:var(--soft-text);
    --ultra-border:var(--glass-border);
    width:100%;
    max-width:580px;
    margin-left:auto;
    margin-right:auto;
}

/* ── Time's own identity — gold-family palette ── */
#time-station{
    --time-border:#DDBA4C;
    --time-label:#E9D17B;
    --time-accent:#F4E08A;
    /* --time-caret-blue: the same bright blue value Tides uses for
       its location-selector caret (see --tides-caret-blue) — this is
       becoming the shared cross-Station standard for "this opens a
       location selector," independent of each Station's own accent
       family (gold here, blue in Tides). Declared locally since
       custom properties don't cross station scopes. */
    --time-caret-blue:#2F8FFF;
}

/* ── Time Utility Bar — collapsed lens (unchanged) ── */
.time-utility-bar{position:relative;width:100%;background:var(--glass-primary);border:1.5px solid rgba(221,186,76,0.60);border-radius:var(--r-lg);padding:8px 16px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;font-family:inherit;-webkit-tap-highlight-color:transparent;transition:background var(--transition)}
.time-utility-bar:hover{background:var(--glass-primary)}
.time-utility-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;width:100%}

.time-city-col{display:flex;flex-direction:column;align-items:center;min-width:0}
.time-city-name{font-size:14px;font-weight:500;letter-spacing:0;color:var(--soft);white-space:nowrap;text-align:center;line-height:1.2;margin:0 0 6px}
.time-city-time{font-size:14px;font-weight:500;color:var(--text);letter-spacing:0;text-align:center;line-height:1.2;margin:0 0 3px}
.time-city-date{font-size:11px;font-weight:500;color:var(--soft);letter-spacing:0;text-align:center;line-height:1.2;margin:0}

/* Center icon column — owns only the icon and its glow. The outer
   bar owns expansion and the caret; the caret is not nested here.

   This column is not guaranteed to be the tallest thing in its row
   — Time's city columns are 3 lines (name/time/date) and can be
   taller than the 50px icon. justify-content:center is a deliberate
   change from the icon's previous flex-end (date-line-baseline)
   alignment: true centering within the collapsed shell takes
   priority over baseline-matching the flanking city text. */
.time-utility-center{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center}
.time-utility-center::before{content:'';position:absolute;width:48px;height:48px;border-radius:50%;background:rgba(244,224,138,.14);filter:blur(10px);top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:0}
.time-icon{display:block;width:50px;height:50px;position:relative;z-index:1}

/* Center caret — direct child of .time-utility-bar (the station
   shell), not nested inside .time-utility-center. Matches Moon's
   .moon-bar-caret / .moon-bar-content sibling relationship. */
#time-sky-caret{position:absolute;left:50%;bottom:-22px;transform:translateX(-50%);z-index:5}
#time-sky-caret .time-expand-icon{transition:transform var(--transition)}
#time-sky-caret.open .time-expand-icon{transform:rotate(180deg)}

/* ── Time Expand Panel ── */
.time-expand-panel{position:relative;display:none;border:1px solid var(--border-soft);border-top:none;border-radius:0 0 var(--r-lg) var(--r-lg);background:var(--glass-primary)}
.time-expand-panel.open{display:block}
.time-expand-panel .expand-inner{padding:12px 16px 10px;min-height:1px}

/* Close button — upper-right corner of the expand panel. Matches
   Tides' #tides-expand-close-btn in sizing and behavior (always
   closes, never toggles); the focus ring uses Time's own accent
   (--time-border) rather than Tides', per Time's existing
   focus-visible convention throughout this file. Offset from the
   corner is slightly larger than Tides' (14px vs 10px) — position
   only, not size or styling — for clearance from the first city
   row's header, which sits immediately below with no reserved gap
   of its own. */
.time-expand-close-btn{position:absolute;top:12px;right:12px;z-index:2;display:flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;background:none;border:0;border-radius:50%;color:var(--ultra-t3);cursor:pointer;transition:background var(--transition),color var(--transition)}
.time-expand-close-btn:hover{background:var(--glass-hover);color:var(--ultra-t2)}
.time-expand-close-btn:focus-visible{outline:2px solid var(--time-border);outline-offset:1px}

/* ── Time Converter ── */
.time-converter{margin-bottom:0}
.time-converter-title{font-size:14px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--time-label);margin-bottom:6px}

.time-converter-selectors{display:flex;align-items:center;gap:6px;margin-bottom:6px}
.time-converter-city-select{flex:1 1 0;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:6px;background:var(--glass-primary);border:1px solid var(--border-soft);border-radius:var(--r-lg);padding:4px 11px;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.time-converter-city-select:focus-visible{outline:2px solid var(--time-border);outline-offset:2px}
.time-converter-city-name{font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.time-converter-city-chevron{font-size:12px;color:var(--time-caret-blue);flex-shrink:0}

/* The ⇄ swap control — row 1 only, centered between the two city
   selectors. Never repeated near the cards below. */
.time-converter-swap{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:var(--glass-primary);border:1px solid var(--border-soft);color:var(--time-border);cursor:pointer;padding:0;transition:background var(--transition)}
.time-converter-swap:hover{background:var(--glass-hover)}
.time-converter-swap:focus-visible{outline:2px solid var(--time-border);outline-offset:2px}

.time-converter-cards{display:flex;gap:6px;margin-bottom:6px}
.time-converter-card{flex:1 1 0;min-width:0;position:relative;background:var(--glass-primary);border:1px solid var(--border-soft);border-radius:var(--r-lg);padding:8px}
.time-converter-card-display{display:flex;flex-direction:column;background:transparent;border:0;padding:0;margin:0;font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;width:100%}
.time-converter-card-display:focus-visible{outline:2px solid var(--time-border);outline-offset:2px}
.time-converter-card-time{font-size:13px;font-weight:500;color:var(--time-accent)}
.time-converter-card-date{font-size:11px;font-weight:500;color:var(--text);margin-top:1px}
.time-converter-card-tz{font-size:10px;font-weight:500;color:var(--soft);margin-top:1px}

/* Sibling of time-converter-card-display, not nested inside it — see
   time.html's own note on why. Styled to match the display button's
   time line as closely as a native control allows. */
.time-converter-time-input{width:100%;background:transparent;border:0;padding:0;margin:0;font-family:inherit;font-size:18px;font-weight:700;color:var(--time-accent)}
.time-converter-time-input:focus-visible{outline:2px solid var(--time-border);outline-offset:2px}

.time-converter-add-btn{width:100%;display:flex;align-items:center;justify-content:center;gap:7px;background:transparent;border:1.5px solid var(--time-border);border-radius:999px;padding:7px 16px;font-size:13px;font-weight:700;color:var(--time-label);cursor:pointer;font-family:inherit;transition:background var(--transition)}
.time-converter-add-btn:hover{background:var(--glass-hover)}
.time-converter-add-btn:focus-visible{outline:2px solid var(--time-border);outline-offset:2px}

/* ── World Cities ── */
/* Section-transition rhythm reused verbatim from Solar's
   .expand-alarm (border-top + padding-top:10px + margin-top:2px) —
   this is the shared "how one subsection hands off to the next"
   token, applied to the existing wrapper with no HTML change. */
.time-world-cities{border-top:1px solid var(--border-soft);padding-top:10px;margin-top:2px}
.time-world-title{font-size:14px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--time-label);margin-bottom:6px}

/* Fixed 2x2 — never expandable, never variable height. min-height
   floor keeps all four cards visually identical regardless of
   whether a given city's DST block is the full status+toggle
   version or the shorter "No Daylight Saving" version. */
.time-world-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.time-world-card{display:flex;flex-direction:column;min-height:140px;background:var(--glass-primary);border:1px solid var(--border-soft);border-radius:var(--r-lg);padding:8px}

.time-world-card-header{display:flex;align-items:center;gap:7px;margin-bottom:4px}
.time-world-card-num{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:var(--glass-hover);color:var(--time-label);font-size:10px;font-weight:700}
.time-world-card-city-select{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:4px;background:transparent;border:0;padding:0;font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
.time-world-card-city-select:focus-visible{outline:2px solid var(--time-border);outline-offset:2px;border-radius:4px}
.time-world-card-city-name{font-size:13px;font-weight:600;color:var(--time-label);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.time-world-card-city-chevron{font-size:11px;color:var(--time-caret-blue);flex-shrink:0}

.time-world-card-time{font-size:13px;font-weight:500;color:var(--time-accent)}
.time-world-card-date{font-size:11px;font-weight:500;color:var(--text);margin-top:1px}
.time-world-card-tz{font-size:10px;font-weight:500;color:var(--soft);margin-top:1px}

/* Pinned to the bottom of the card via margin-top:auto — keeps the
   Notify row anchored at the same position across all four cards
   regardless of how much status text sits above it. */
.time-world-card-dst{margin-top:auto;padding-top:4px}

/* Label left, changing value right — reclaims the row the old
   single-line "Daylight Saving · until Nov 1, 2:00 AM" format used
   to wrap onto at this card width. Value may wrap onto its own
   second line (right-aligned) without affecting the label. */
.time-world-card-dst-status{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:2px}
.time-world-card-dst-label{font-size:13px;font-weight:600;color:var(--soft);flex:1 1 auto;min-width:0}
.time-world-card-dst-value{font-size:13px;font-weight:500;color:var(--soft);text-align:right;flex:0 1 auto}

/* Notify at changeover — label left, toggle flush right. Built by
   appendDstControlRows() in time.js, into each World Cities card's
   .time-world-card-dst. Deliberately de-emphasized: smaller,
   lighter text than the DST status line above it, so the toggle
   itself — not the sentence — carries the visual weight here. */
.time-detail-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.time-detail-row-label{font-size:11px;font-weight:700;color:var(--soft)}

/* ── City Picker ── */
/* Self-contained to Time Station. Every color/radius/shadow value
   here is an existing token already used elsewhere in this file or
   in the shared global tokens (--glass-hover, --radius-medium,
   --shadow-large from styles.css) — nothing new introduced. */
.time-picker-backdrop{position:fixed;inset:0;z-index:500;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;padding:20px}
.time-picker-backdrop[hidden]{display:none}

.time-picker-modal{width:100%;max-width:360px;max-height:80vh;display:flex;flex-direction:column;background:var(--glass-primary);border:1px solid var(--border-soft);border-radius:var(--r-lg);box-shadow:var(--shadow-large);overflow:hidden}

.time-picker-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px}
.time-picker-title{font-size:14px;font-weight:700;color:var(--text);margin:0}
.time-picker-close{width:28px;height:28px;flex-shrink:0;border-radius:999px;border:1px solid var(--border-soft);background:transparent;color:var(--soft);font-size:16px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;font-family:inherit}
.time-picker-close:hover{background:var(--glass-hover)}
.time-picker-close:focus-visible{outline:2px solid var(--time-border);outline-offset:2px}

.time-picker-search{display:block;width:calc(100% - 32px);margin:0 16px 10px;padding:8px 12px;font-size:13px;font-family:inherit;color:var(--text);background:var(--glass-primary);border:1px solid var(--border-soft);border-radius:var(--r-lg)}
.time-picker-search:focus-visible{outline:2px solid var(--time-border);outline-offset:2px}

.time-picker-results{list-style:none;margin:0;padding:0 8px 12px;overflow-y:auto}
.time-picker-hint,.time-picker-empty{padding:14px 8px;font-size:12px;color:var(--soft);text-align:center}

.time-picker-result{width:100%;display:flex;flex-direction:column;align-items:flex-start;gap:1px;padding:8px;background:transparent;border:0;border-radius:var(--radius-medium);cursor:pointer;font-family:inherit;text-align:left}
.time-picker-result:hover{background:var(--glass-hover)}
.time-picker-result:focus-visible{outline:2px solid var(--time-border);outline-offset:-2px}
.time-picker-result-name{font-size:13px;font-weight:600;color:var(--text)}
.time-picker-result-region{font-size:11px;font-weight:500;color:var(--soft)}

/* ── Light mode ── */
body.light-mode .time-expand-panel{background:rgba(232,225,245,0.72)}
body.light-mode .time-city-time{color:#2E3138}

/* ── Ultra mode ── */
body.ultra-mode .time-expand-panel{background:rgba(0,0,0,0.92)}
body.ultra-mode .time-city-time{color:var(--ultra-t2)}
body.ultra-mode .time-picker-close{border-color:var(--ultra-border);color:var(--ultra-t3)}
body.ultra-mode .time-picker-search{border-color:var(--ultra-border)}

/* ── Mobile refinement ── */
/* Collapsed lens only. */
@media (max-width:520px){

    .time-city-name{font-size:12px}
    .time-city-time{font-size:12px}
    .time-city-date{font-size:10px}

}

@media (max-width:390px){

    .time-city-name{font-size:11px}
    .time-city-time{font-size:11px}
    .time-city-date{font-size:9px}

}
