/* ──────────────────────────────────────────────────────────
   Atlas Tonight — overlay skin for the globe
   Re-skin chrome + add live ticker, without touching JS logic.
   Override on top of globe.css + enhancements.css.
   ────────────────────────────────────────────────────────── */

:root {
  --at-bg:        #060209;
  --at-ink:       #ffffff;
  --at-ink-2:     rgba(255, 255, 255, 0.78);
  --at-mute:      rgba(255, 255, 255, 0.45);
  --at-gold:      #ffb020;
  --at-gold-hi:   #ffc66b;
  --at-amber:     #ff7a3c;
  --at-coral:     #ff5d3a;
  --at-rose:      #ff3d7f;
  --at-glass:     rgba(20, 16, 32, 0.62);
  --at-glass-hi:  rgba(30, 22, 44, 0.78);
  --at-border:    rgba(255, 255, 255, 0.08);
  --at-border-hi: rgba(255, 176, 32, 0.32);
  --at-font-display: 'Instrument Serif', Georgia, serif;
}

/* ── Floating glass nav (top center) — consolidates brand + title ── */
.brand-back {
  position: fixed !important;
  top: 20px !important;
  bottom: auto !important;
  right: auto !important;
  left: 20px !important;
  z-index: 50 !important;
  height: auto !important;
  width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 18px !important;
  background: var(--at-glass) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--at-border) !important;
  border-radius: 999px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  color: var(--at-ink-2) !important;
  text-decoration: none !important;
  transition: border-color .2s, color .2s !important;
}
.brand-back:hover { border-color: var(--at-border-hi) !important; color: var(--at-ink) !important; }
.brand-back .arrow { color: var(--at-gold) !important; font-size: 14px !important; }

/* Hide old chrome we're replacing */
#globe-title { display: none !important; }

/* ── Search bar — glass pill, centered, rangée 2 sous la nav modes ── */
#search-wrap {
  top: 96px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  background: var(--at-glass) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--at-border) !important;
  border-radius: 999px !important;
  z-index: 50 !important;
  width: 360px !important;
  max-width: 90vw !important;
  padding: 6px 14px !important;
}
#search-wrap:focus-within { border-color: var(--at-border-hi) !important; }
#search-icon { font-size: 12px !important; opacity: 0.7 !important; }
#search-input {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  color: var(--at-ink) !important;
}
#search-input::placeholder { color: var(--at-mute) !important; letter-spacing: 0.04em !important; }
#search-results {
  margin-top: 8px !important;
  background: var(--at-glass-hi) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid var(--at-border) !important;
  border-radius: 14px !important;
}

/* Sun/Moon widgets redundant with ticker — hide on desktop, keep UTC clock */
#sun-info, #moon-widget { display: none !important; }

/* ── UTC clock — glass pill, right-aligned ── */
#utc-clock {
  background: var(--at-glass) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid var(--at-border) !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 11px !important;
  z-index: 50 !important;
}
#utc-clock { top: 20px !important; right: 20px !important; }
#utc-clock .label {
  color: var(--at-mute) !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  font-weight: 600 !important;
  font-size: 9px !important;
  margin-right: 6px !important;
}
#utc-clock .time {
  color: var(--at-ink) !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 500 !important;
}

/* ── Stage pill (top center, under search) — "the sun is setting in..." ── */
#at-stage-pill {
  position: fixed;
  top: 164px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 22px;
  background: var(--at-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--at-border-hi);
  border-radius: 999px;
  font-size: 12px;
  z-index: 50;
  color: var(--at-ink-2);
  font-family: var(--at-font-display);
  font-style: italic;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
}
#at-stage-pill.visible { opacity: 1; }
#at-stage-pill strong {
  font-family: var(--at-font-display);
  font-style: normal;
  color: var(--at-gold);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}
#at-stage-pill .at-dot {
  width: 8px; height: 8px;
  background: var(--at-gold);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--at-gold);
  animation: at-pulse 2s infinite;
}
@keyframes at-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.3); }
}
#at-stage-pill .at-tz {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--at-mute);
  font-style: normal;
  padding-left: 8px;
  border-left: 1px solid var(--at-border);
  margin-left: 4px;
}

/* ── Ticker — "Setting now · live" (left side, vertical) ── */
#at-ticker {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 270px;
  max-height: 60vh;
  background: var(--at-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--at-border);
  border-radius: 18px;
  z-index: 30;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  color: var(--at-ink);
  opacity: 0;
  transition: opacity .5s;
}
#at-ticker.visible { opacity: 1; }
.at-ticker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--at-border);
}
.at-cap {
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--at-mute);
}
.at-ticker-count {
  font-size: 11px;
  color: var(--at-gold);
  letter-spacing: 0.08em;
}
.at-ticker-list {
  overflow-y: auto;
  flex: 1;
}
.at-ticker-list::-webkit-scrollbar { width: 4px; }
.at-ticker-list::-webkit-scrollbar-track { background: transparent; }
.at-ticker-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.10); border-radius: 2px; }
.at-ticker-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 10px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--at-border);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.at-ticker-row:hover { background: rgba(255, 255, 255, 0.04); }
.at-ticker-row.active { background: rgba(255, 176, 32, 0.08); border-left: 2px solid var(--at-gold); padding-left: 16px; }
.at-tk-flag { font-size: 10px; color: var(--at-mute); letter-spacing: 0.06em; font-weight: 600; }
.at-tk-name { font-size: 13px; color: var(--at-ink); font-weight: 500; }
.at-tk-d {
  font-size: 10px;
  color: var(--at-amber);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.at-ticker-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--at-border);
  text-align: center;
}

/* ── Popup — re-skin existing #loc-popup with Atlas Tonight glass + animation ── */
@keyframes at-popup-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
#loc-popup:not(.loc-hidden) {
  animation: at-popup-in .25s cubic-bezier(.2,.8,.2,1) both;
}
#loc-popup {
  background: var(--at-glass-hi) !important;
  backdrop-filter: blur(28px) !important;
  -webkit-backdrop-filter: blur(28px) !important;
  border: 1px solid var(--at-border) !important;
  border-radius: 22px !important;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}
#loc-popup .loc-city {
  font-family: var(--at-font-display) !important;
  font-weight: 400 !important;
  font-size: 30px !important;
  letter-spacing: -0.02em !important;
  color: var(--at-ink) !important;
}
#loc-popup .loc-coords {
  font-family: 'Schibsted Grotesk', 'Inter', sans-serif !important;
  font-size: 10px !important;
  color: var(--at-mute) !important;
  letter-spacing: 0.08em !important;
}
#loc-popup .loc-status {
  background: rgba(255, 176, 32, 0.92) !important;
  color: #1a0e02 !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  letter-spacing: 0.12em !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
}
#loc-popup .loc-val {
  font-family: var(--at-font-display) !important;
  font-weight: 400 !important;
  font-size: 18px !important;
  color: var(--at-ink) !important;
  font-variant-numeric: tabular-nums !important;
}
#loc-popup .loc-golden .loc-val { color: var(--at-gold) !important; }
#loc-popup .loc-label {
  font-size: 10px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.16em !important;
  color: var(--at-mute) !important;
  font-weight: 600 !important;
}
#loc-popup .loc-score-num {
  font-family: var(--at-font-display) !important;
  font-size: 28px !important;
  color: var(--at-gold) !important;
  font-weight: 400 !important;
}
#loc-popup .loc-btn {
  background: linear-gradient(180deg, var(--at-gold-hi), var(--at-gold) 50%, var(--at-amber)) !important;
  color: #1a0e02 !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  font-size: 11px !important;
  border-radius: 999px !important;
  box-shadow: 0 14px 40px rgba(216, 162, 83, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

/* ── Mobile / small screens ── */
@media (max-width: 820px) {
  #at-ticker { display: none; }
  /* Héro scrollable : la pastille live ne peut plus s'ancrer en bas (elle
     tomberait au bas du document sous la liste) → masquée sur mobile. */
  #at-stage-pill { display: none !important; }
  #sun-info, #moon-widget { display: none !important; }
}

/* ── Chrome du héro — deux rangées ──────────────────────────────────────
   r1 (top 20)  : marque (gauche) · nav modes (centre) · Partager (droite)
   r2 (top ~96) : stats live (gauche) · recherche (centre) · Calques (droite)
   La pastille live (« le soleil se couche sur… ») flotte sous la rangée 2. */
#stat-strip { top: 96px !important; left: 20px !important; }

/* La rangée 2 se resserre avec la fenêtre : les 3 stats (~418px) toucheraient
   la recherche centrée (360px) dès ~1240px → on retire la déclinaison solaire,
   l'info la moins actionnable. */
@media (max-width: 1240px) and (min-width: 960px) {
  #stat-strip .stat:nth-child(5),
  #stat-strip .stat-sep:nth-child(4) { display: none; }
}

/* 721–959px : la nav modes (640px centrée) chevauche la marque en rangée 1
   → stack vertical façon mobile ; les stats (redondantes avec le badge de la
   section liste) disparaissent. */
@media (max-width: 959px) and (min-width: 721px) {
  #mode-switcher { top: 66px !important; }
  #search-wrap   { top: 152px !important; }
  #layers-panel  { top: 152px !important; }
  #at-stage-pill { top: 220px; }
  #stat-strip    { display: none !important; }
}

/* Sous 720px la recherche centrée (90vw) recouvre la marque (gauche) et
   Partager (droite) : stack mobile, recherche pleine largeur.
     r1 = marque (gauche) + Partager (droite) · r2 = modes · r3 = recherche
     · r4 = stat-strip (gauche) + Calques (droite). */
@media (max-width: 720px) {
  #search-wrap {
    top: 108px !important;
    left: 16px !important;
    right: 16px !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
  }
  .brand-back    { top: 16px !important; bottom: auto !important; left: 16px !important; }
  #mode-switcher { top: 60px !important; }
  #stat-strip    { top: 172px !important; left: 12px !important; }
  #layers-panel  { top: 172px !important; }
}

/* La rangée stats + Calques ne loge plus les 3 compteurs : on dégrade
   déclinaison puis UTC, le compte golden hour reste toujours affiché. */
@media (max-width: 600px) {
  #stat-strip .stat:nth-child(5),
  #stat-strip .stat-sep:nth-child(4) { display: none; }
}
@media (max-width: 340px) {
  #stat-strip .stat:nth-child(3),
  #stat-strip .stat-sep:nth-child(2) { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════
   Modèle scrollable : le globe occupe le premier écran entier (héro), la
   liste des villes vit en section normale EN DESSOUS. La molette scrolle la
   page (le zoom-molette du globe est retiré en JS) ; le glissement tourne
   toujours le globe.
   ══════════════════════════════════════════════════════════════════════ */
html, body {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
main[role="main"] {
  position: relative !important;   /* ancre #time-ctrl / légende au héro */
  height: 100vh !important;
  height: 100dvh !important;
  overflow: hidden !important;
}
/* Ces éléments flottaient en fixed → ils resteraient collés par-dessus la
   liste au scroll. On les ancre au flux du héro pour qu'ils défilent avec. */
.brand-back { position: absolute !important; }
#at-ticker  { position: absolute !important; }
#at-stage-pill { position: absolute !important; }

/* Golden Hour : section liste en flux normal, pleine largeur, sous le héro. */
#golden-panel {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--at-border) !important;
  background: var(--at-glass-hi, rgba(8, 12, 24, 0.94)) !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}
#golden-panel .gh-header {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 8px !important;
}
.gh-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 2px 20px !important;
  max-height: none !important;
  overflow: visible !important;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 16px 48px !important;
}
.gh-list.is-scrollable {
  -webkit-mask-image: none !important;
          mask-image: none !important;
}
