/* Midnight Column (library: midnight-editorial-deck). The default style.
   A near-black page set like a literary magazine at night: serif display,
   one parchment accent, hairline rules, no boxes or card fills.

   Dark-native: this file never reads [data-theme]. DEFAULT_THEME is "light",
   so "the visitor chose light" and "no cookie at all" look the same from
   here, and flipping on a light data-theme would hand every anonymous
   visitor a light Midnight, i.e. the default would stop being Midnight.

   Contrast on --ground #101114 (WCAG 2.x relative luminance, alpha
   composited on the ground): --ink 15.6:1, --accent 8.2:1 (safe for body
   text), --ink-dim 6.5:1. --deco (rose, 3.5:1) is decoration only, never
   text. There is no --ink-faint: .28 alpha measured 2.3:1. Recompute these
   from the hex values after any palette change; do not budget against them.

   Fonts: Fraunces / Source Serif 4 are self-hosted Latin subsets
   (static/fonts/fonts.css); CJK falls through to Noto Serif TC, then the
   system serifs, so the page is finished with no font file at all. */

html[data-discover-style="midnight"] {
  color-scheme: dark;
  --ground: #101114;
  --ground-2: #2E2438;
  --ink: #EDE9DF;
  --ink-dim: rgba(237, 233, 223, .62);
  --accent: #C9A66B;
  --accent-ink: #101114;
  --link-ink: #C9A66B;
  --deco: #8C5D62;
  --rule: rgba(237, 233, 223, .16);
  --focus: #C9A66B;
  --radius: 0;
  --shadow: none;
  --row-bg: transparent;
  --font-display: 'Fraunces', 'Noto Serif TC', 'Songti TC', 'PingFang TC', serif;
  --font-body: 'Source Serif 4', 'Noto Serif TC', 'PingFang TC', 'Heiti TC', 'Microsoft JhengHei', serif;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;

  /* style.css's tokens, re-pinned so the maps dialog and anything inherited
     from the app shell sit on this ground instead of the app theme's. */
  --bg: #101114;
  --bg-soft: #17181C;
  --surface: #17181C;
  --surface-alt: #1F2026;
  --text: #EDE9DF;
  --text-soft: #EDE9DF;
  --text-muted: rgba(237, 233, 223, .62);
  --text-faint: rgba(237, 233, 223, .62);
  --border: rgba(237, 233, 223, .16);
  --border-strong: rgba(237, 233, 223, .32);
  --divider: rgba(237, 233, 223, .10);
  --accent-hover: #D8BB86;
  --accent-text: #101114;
  --link: #C9A66B;
  --backdrop: rgba(6, 6, 7, .72);
  --shadow-sm: rgba(0, 0, 0, .5);
  --shadow-md: rgba(0, 0, 0, .6);
}

html[data-discover-style="midnight"] body.disc { font-size: 17px; -webkit-font-smoothing: antialiased; }
html[data-discover-style="midnight"] .disc h1,
html[data-discover-style="midnight"] .disc h2,
html[data-discover-style="midnight"] .disc h3 { font-weight: 500; letter-spacing: -.005em; }

/* top bar: a quiet byline, the pin in parchment */
html[data-discover-style="midnight"] .brand { font-style: italic; font-weight: 500; font-size: 1.05rem; }
html[data-discover-style="midnight"] .topbar-login { color: var(--ink-dim); }
html[data-discover-style="midnight"] .topbar-login:hover { color: var(--ink); }
html[data-discover-style="midnight"] .sw-btn[aria-pressed="true"] { box-shadow: none; }

/* masthead: the oversized quotation glyph sits off-grid above the kicker */
html[data-discover-style="midnight"] .masthead { position: relative; padding-top: 38px; }
html[data-discover-style="midnight"] .masthead::before {
  content: "\201C"; position: absolute; top: 4px; left: -3px;
  font-family: var(--font-display); font-style: italic; font-size: 48px; line-height: 1;
  color: var(--accent); pointer-events: none;
}
/* the kicker: tracked caps behind a 22px rose rule. text-transform, not
   font-variant-caps: Chrome synthesizes small caps on the CJK fallback by
   shrinking the glyphs, which printed 大家最近收藏的店 at about 10px. */
html[data-discover-style="midnight"] .kicker {
  display: inline-flex; align-items: center; gap: .6em;
  text-transform: uppercase; letter-spacing: .16em; font-size: .78rem;
}
html[data-discover-style="midnight"] .kicker::before {
  content: ""; width: 22px; height: 1px; flex: none; background: var(--deco);
}
html[data-discover-style="midnight"] .masthead h1 { max-width: 16ch; line-height: 1.08; }
html[data-discover-style="midnight"] .lede { font-size: 1.02rem; }

/* entry: parchment solid, and the quiet door as an underlined word */
html[data-discover-style="midnight"] .cta { letter-spacing: .03em; font-weight: 500; }
html[data-discover-style="midnight"] .cta:hover { background: transparent; color: var(--accent); }
html[data-discover-style="midnight"] .cta-quiet {
  border: 0; border-bottom: 1px solid var(--rule); padding: 0 2px; color: var(--ink-dim);
}
html[data-discover-style="midnight"] .cta-quiet:hover { color: var(--ink); border-color: var(--ink-dim); }
html[data-discover-style="midnight"] .cta-band { border-top: 0; gap: 12px 24px; align-items: center; padding: 24px 0; }
html[data-discover-style="midnight"] .cta-band > .cta-quiet { flex: 0 0 auto; }

/* chips: hairline outlines on the ground, the count in full ink */
html[data-discover-style="midnight"] .chip { color: var(--ink-dim); font-size: .86rem; letter-spacing: .02em; }
html[data-discover-style="midnight"] .chip .n { color: var(--ink); }
html[data-discover-style="midnight"] .chip:hover { border-color: var(--accent); color: var(--ink); }
html[data-discover-style="midnight"] .chips .lbl { text-transform: uppercase; letter-spacing: .12em; }

/* section head: display serif over one rule */
html[data-discover-style="midnight"] .sec-head {
  justify-content: space-between; margin-top: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
html[data-discover-style="midnight"] .sec-head h2 { font-size: 1.4rem; }

/* rows: no card, only hairlines, and an italic index numeral in its own
   column. The counter lives on .feed, so it keeps counting across the
   .cta-band that splits the list after row 8. */
html[data-discover-style="midnight"] .venue {
  grid-template-columns: 28px minmax(0, 1fr) 44px; column-gap: 10px;
  padding: 16px 0; border-top: 0; border-bottom: 1px solid var(--rule);
}
html[data-discover-style="midnight"] .venue::before {
  counter-increment: v; content: counter(v, decimal-leading-zero);
  align-self: start; padding-top: 2px;
  font-family: var(--font-display); font-style: italic; font-size: 1.05rem; line-height: 1.35;
  color: var(--ink-dim); font-variant-numeric: tabular-nums;
}
html[data-discover-style="midnight"] .venue-name { font-size: 1.14rem; font-weight: 500; }
html[data-discover-style="midnight"] .venue .meta { font-size: .82rem; letter-spacing: .02em; }
html[data-discover-style="midnight"] .venue .count { color: var(--ink); }
html[data-discover-style="midnight"] .maps-trigger.is-icon:hover { color: var(--accent); }

/* crumbs and list heads */
html[data-discover-style="midnight"] .crumb a { color: var(--ink-dim); }
html[data-discover-style="midnight"] .crumb a:hover { color: var(--accent); }
html[data-discover-style="midnight"] .list-head { padding-bottom: 20px; }

/* venue page */
html[data-discover-style="midnight"] .v-head h1 { font-size: clamp(1.8rem, 1.3rem + 2.4vw, 2.9rem); line-height: 1.1; }
html[data-discover-style="midnight"] .facts li > * { color: var(--ink-dim); }
html[data-discover-style="midnight"] .facts li > a:hover { color: var(--ink); border-color: var(--accent); }
html[data-discover-style="midnight"] .intro { font-size: 1.05rem; }
html[data-discover-style="midnight"] .nearby-sec h2,
html[data-discover-style="midnight"] .posts-sec h2,
html[data-discover-style="midnight"] .style-foot h2 { font-style: italic; }
html[data-discover-style="midnight"] .nearby li:last-child,
html[data-discover-style="midnight"] .posts li:last-child { border-bottom: 1px solid var(--rule); }
html[data-discover-style="midnight"] .nm { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; }
html[data-discover-style="midnight"] .save { border-color: var(--rule); }

/* the maps chooser: same ground, square, one hairline instead of a shadow */
html[data-discover-style="midnight"] #dlg-maps {
  border: 1px solid var(--rule); border-radius: 0; box-shadow: none; background: var(--ground);
}
html[data-discover-style="midnight"] #dlg-maps .maps-chooser-list a,
html[data-discover-style="midnight"] #dlg-maps button { border-radius: 0; }
html[data-discover-style="midnight"] #dlg-maps .maps-chooser-list a:hover { border-color: var(--accent); color: var(--accent); }

/* tablet: more air, larger numerals */
@media (min-width: 768px) {
  html[data-discover-style="midnight"] .masthead { padding-top: 72px; }
  html[data-discover-style="midnight"] .masthead::before { font-size: 96px; top: 0; left: -8px; }
  html[data-discover-style="midnight"] .venue { grid-template-columns: 44px minmax(0, 1fr) 44px; padding: 20px 0; }
  html[data-discover-style="midnight"] .venue::before { font-size: 1.3rem; }
  html[data-discover-style="midnight"] .venue-name { font-size: 1.28rem; }
}

/* desktop: the quote hangs in the margin, the ticker cycles beside the
   headline behind one vertical rule, and the index feed runs as two columns */
@media (min-width: 1200px) {
  html[data-discover-style="midnight"] .masthead { padding-top: 88px; }
  html[data-discover-style="midnight"] .masthead::before { font-size: 132px; top: 8px; left: -52px; }
  html[data-discover-style="midnight"] .mh-side { border-left: 1px solid var(--rule); padding: 4px 0 6px 28px; }
  html[data-discover-style="midnight"] .ticker-lead { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
  html[data-discover-style="midnight"] .ticker {
    position: relative; height: 1.6em; font-family: var(--font-display); font-style: italic; font-size: 1.35rem;
  }
  html[data-discover-style="midnight"] .ticker li:not(.dup) {
    position: absolute; inset: 0; opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    animation: midnight-tick 8s linear infinite;
  }
  html[data-discover-style="midnight"] .ticker li:nth-child(2) { animation-delay: 2s; }
  html[data-discover-style="midnight"] .ticker li:nth-child(3) { animation-delay: 4s; }
  html[data-discover-style="midnight"] .ticker li:nth-child(4) { animation-delay: 6s; }
  html[data-discover-style="midnight"] .disc--index .venues {
    grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px;
  }
}

@keyframes midnight-tick {
  0% { opacity: 0; transform: translateY(6px); }
  4%, 21% { opacity: 1; transform: none; }
  25%, 100% { opacity: 0; transform: translateY(-6px); }
}

/* Reduced motion: base.css stops the animation; hold the first name still
   instead of leaving an empty line. */
@media (prefers-reduced-motion: reduce) {
  html[data-discover-style="midnight"] .ticker li:first-child { opacity: 1; }
}
