/* Tasse reviews site — layout styles. Tokens come from colors_and_type.css */

:root {
  --site-max: 1240px;
  --site-pad: 48px;
  --density: 1;
}

/* Responsiveness is container-query driven so pages render correctly
   both full-bleed and inside fixed-width artboards. */
.site-root { container-type: inline-size; width: 100%; overflow-x: clip; }

html, body { margin: 0; padding: 0; }
body {
  background: var(--bg-1);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
a { color: inherit; }

.shell {
  max-width: var(--site-max);
  margin: 0 auto;
  padding-left: var(--site-pad);
  padding-right: var(--site-pad);
}

/* ── Nav ─────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: color-mix(in srgb, var(--bg-1) 80%, transparent);
  border-bottom: 1px solid var(--border-hairline);
}
.site-nav-inner {
  display: flex; align-items: center; gap: calc(28px * var(--density));
  height: 64px;
}
.nav-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; cursor: pointer; }
.nav-wordmark {
  font-family: var(--font-titling);
  font-size: 21px; letter-spacing: 0.18em; color: var(--fg-1);
  transform: translateY(1px);
}
.nav-links { display: flex; align-items: center; gap: calc(24px * var(--density)); flex: 1; }
.nav-link {
  font-size: var(--fs-sm); font-weight: 600; color: var(--fg-2);
  text-decoration: none; cursor: pointer;
  transition: color 180ms var(--ease-steam);
}
.nav-link:hover { color: var(--fg-accent); }
.nav-cta-row { display: flex; align-items: center; gap: 12px; }

.nav-lang { position: relative; }
.nav-lang-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: none; border: none; border-radius: var(--r-sm);
  color: var(--fg-2); cursor: pointer;
  transition: color 180ms var(--ease-steam), background 180ms var(--ease-steam);
}
.nav-lang-toggle:hover { color: var(--fg-accent); background: rgba(31, 20, 14, 0.05); }
.nav-lang-menu {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px; max-height: 320px; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  box-shadow: var(--shadow-e1); padding: 6px; z-index: 50;
}
.nav-lang-toggle[aria-expanded="true"] + .nav-lang-menu { display: block; }
.nav-lang-menu form { margin: 0; }
.nav-lang-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: none; border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: var(--fs-sm); color: var(--fg-2);
  padding: 8px 10px; cursor: pointer;
}
.nav-lang-menu button:hover { background: rgba(31, 20, 14, 0.05); color: var(--fg-1); }
.nav-lang-menu button[aria-current="true"] { color: var(--fg-1); font-weight: 700; }

/* ── Language suggestion banner ─────────────────────── */
.lang-suggestion {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 10px var(--site-pad);
  background: var(--bg-2); border-bottom: 1px solid var(--border-hairline);
  font-size: var(--fs-sm);
}
.lang-suggestion-form { margin: 0; display: inline; }
.lang-suggestion-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600;
  color: var(--fg-accent); text-decoration: underline;
}
.lang-suggestion-dismiss {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  background: none; border: none; border-radius: var(--r-sm);
  font-size: var(--fs-md); line-height: 1; color: var(--fg-2); cursor: pointer;
}
.lang-suggestion-dismiss:hover { color: var(--fg-1); background: rgba(31, 20, 14, 0.05); }

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 700;
  border: none; cursor: pointer; text-decoration: none;
  transition: transform 80ms var(--ease-steam), background 180ms var(--ease-steam),
    color 180ms var(--ease-steam), border-color 180ms var(--ease-steam);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid rgba(107, 68, 35, 0.5); outline-offset: 2px; }
:root {
  --btn-bg: var(--bg-inverse);
  --btn-bg-hover: #3D2817;
  --btn-fg: var(--fg-on-dark);
  --solid-bg: var(--bg-inverse);
  --solid-fg: var(--fg-on-dark);
}
.on-dark, [data-theme="dark"], .on-mocha, [data-theme="mocha"], .on-latte, [data-theme="latte"] {
  --btn-bg: var(--crema);
  --btn-bg-hover: #F0E5CB;
  --btn-fg: var(--espresso);
  --solid-bg: var(--crema);
  --solid-fg: var(--espresso);
}
.btn-primary {
  background: var(--btn-bg); color: var(--btn-fg);
  border-radius: var(--r-pill); padding: 12px 24px;
}
.btn-primary:hover { background: var(--btn-bg-hover); }
.btn-secondary {
  background: transparent; color: var(--fg-1);
  border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: 11px 18px;
}
.btn-secondary:hover { background: rgba(31, 20, 14, 0.05); }
.on-dark .btn-secondary:hover, [data-theme] .btn-secondary:hover { background: rgba(245, 237, 224, 0.08); }
.btn-lg { font-size: var(--fs-md); padding: 15px 32px; }
.btn-sm { font-size: var(--fs-xs); padding: 8px 14px; }
.btn-quiet {
  background: none; border: none; color: var(--fg-3); font-weight: 600;
  padding: 6px 8px; border-radius: var(--r-sm);
}
.btn-quiet:hover { color: var(--fg-accent); }

/* ── Chips ───────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--fg-2);
  background: transparent; border: 1px solid var(--border-soft);
  border-radius: var(--r-pill); padding: 8px 16px; cursor: pointer;
  transition: all 180ms var(--ease-steam);
  font-family: var(--font-body);
}
.chip:hover { border-color: var(--border-strong); }
.chip.chip-on {
  background: var(--solid-bg); color: var(--solid-fg);
  border-color: var(--solid-bg);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.note-pill {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--bg-3); color: var(--fg-2);
  border-radius: var(--r-pill); padding: 4px 11px;
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--bg-2); border-radius: var(--r-lg);
  box-shadow: var(--inner-highlight), var(--shadow-e1);
}

/* ── Cafe hero ───────────────────────────────────── */
.cafe-hero-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: calc(var(--s-8) * var(--density)); align-items: end;
  padding-top: calc(var(--s-8) * var(--density));
  padding-bottom: calc(var(--s-7) * var(--density));
}
.cafe-title {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(44px, 5.4cqw, 72px); line-height: var(--lh-tight);
  letter-spacing: -0.01em; margin: 14px 0 18px; text-wrap: balance;
}
.cafe-photo {
  border-radius: var(--r-md); overflow: hidden; position: relative;
  aspect-ratio: 4 / 3; box-shadow: var(--shadow-e1);
}
.cafe-photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
.cafe-photo-thumb {
  display: block; aspect-ratio: 1 / 1; border-radius: var(--r-md); overflow: hidden;
  background-size: cover; background-position: center; box-shadow: var(--shadow-e1);
}
@container (max-width: 720px) { .cafe-photo-grid { grid-template-columns: repeat(2, 1fr); } }
.hero-meta-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 22px; color: var(--fg-3); font-size: var(--fs-sm); font-weight: 600;
}
.hero-meta-row .mi { display: inline-flex; align-items: center; gap: 7px; }

/* ── Two-column content ─────────────────────────── */
.content-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: calc(var(--s-8) * var(--density));
  padding-bottom: calc(var(--s-9) * var(--density));
  align-items: start;
}
.aside-sticky { position: sticky; top: 88px; display: grid; gap: var(--s-5); }

/* ── Bar strip ───────────────────────────────────── */
.bar-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
}
.bar-cell { padding: calc(20px * var(--density)) 0; }
.bar-cell + .bar-cell { border-left: 1px solid var(--border-hairline); padding-left: calc(24px * var(--density)); }
.bar-value { font-family: var(--font-mono); font-size: var(--fs-lg); font-weight: 500; margin-top: 6px; }

/* ── Review cards ────────────────────────────────── */
.review-list { display: grid; gap: var(--s-4); }
.review-card { padding: calc(var(--s-5) * var(--density)) calc(var(--s-5) * var(--density)) calc(var(--s-4) * var(--density)); }
.review-head { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  color: var(--parchment); filter: grayscale(0.2);
}
.review-body {
  margin: 14px 0 0; color: var(--fg-2); font-size: 15.5px; text-wrap: pretty;
}
.review-brewline {
  font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-3);
  letter-spacing: 0.03em; margin-top: 14px;
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
}
.review-foot {
  display: flex; align-items: center; gap: 4px; margin-top: 10px;
  border-top: 1px solid var(--border-hairline); padding-top: 8px;
}

/* ── Distribution ────────────────────────────────── */
.dist-row { display: grid; grid-template-columns: 44px 1fr 30px; gap: 12px; align-items: center; }
.dist-track { height: 6px; border-radius: 3px; background: rgba(31,20,14,0.07); overflow: hidden; }
.on-dark .dist-track, [data-theme] .dist-track { background: rgba(245,237,224,0.12); }
.dist-fill { height: 100%; border-radius: 3px; background: var(--accent); }

/* ── Forms ───────────────────────────────────────── */
.field-label { font-weight: 700; font-size: var(--fs-md); }
.field-hint { color: var(--fg-3); font-size: var(--fs-sm); margin-top: 3px; }
.text-input, .text-area {
  width: 100%; font-family: var(--font-body); font-size: var(--fs-md);
  color: var(--fg-1); background: var(--bg-2);
  border: 1px solid var(--border-soft); border-radius: var(--r-md);
  padding: 13px 16px; transition: border-color 180ms var(--ease-steam);
}
.text-input:focus, .text-area:focus {
  outline: 2px solid rgba(107, 68, 35, 0.5); outline-offset: 2px;
  border-color: var(--border-strong);
}
.text-area { min-height: 140px; resize: vertical; line-height: var(--lh-body); }
.mono-input { font-family: var(--font-mono); font-size: var(--fs-sm); }
::placeholder { color: var(--fg-4); }

/* Score slider */
.score-slider { width: 100%; appearance: none; -webkit-appearance: none; height: 36px; background: transparent; cursor: pointer; }
.score-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill, 50%), rgba(31,20,14,0.12) var(--fill, 50%));
}
.score-slider::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--accent);
  margin-top: -11px; box-shadow: var(--shadow-e1);
}
.score-slider::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(31,20,14,0.12); }
.score-slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--accent); }
.score-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--accent); box-shadow: var(--shadow-e1);
}

/* ── Sections ────────────────────────────────────── */
.section-pad { padding-top: calc(var(--s-7) * var(--density)); padding-bottom: calc(var(--s-7) * var(--density)); }
.h-display {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(30px, 3.2cqw, 42px); line-height: var(--lh-snug);
  letter-spacing: -0.01em; margin: 10px 0 8px; text-wrap: balance;
}
.lede { color: var(--fg-2); font-size: var(--fs-lg); max-width: 620px; text-wrap: pretty; }

/* ── QR banner (arrival) ─────────────────────────── */
.qr-banner {
  background: var(--bg-3); border-bottom: 1px solid var(--border-hairline);
}
.qr-banner-inner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 14px; padding-bottom: 14px;
}

/* ── Print kit ───────────────────────────────────── */
.kit-stage {
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border-radius: var(--r-lg);
  padding: 40px 24px; min-height: 360px;
  box-shadow: var(--inner-highlight);
}
.kit-showcase-grid {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: calc(var(--s-7) * var(--density));
}
.kit-showcase-companions {
  display: flex; flex-direction: column; gap: calc(var(--s-6) * var(--density));
}

/* ── Footer ──────────────────────────────────────── */
.site-footer { background: var(--espresso); color: var(--parchment); }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--s-6); padding-top: var(--s-8); padding-bottom: var(--s-7);
}
.footer-col-h {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: rgba(245,237,224,0.5);
  margin-bottom: 14px;
}
.footer-link { display: block; color: rgba(245,237,224,0.8); text-decoration: none; font-size: var(--fs-sm); padding: 5px 0; cursor: pointer; }
.footer-link:hover { color: var(--crema); }
.footer-base {
  border-top: 1px solid rgba(245,237,224,0.12);
  padding-top: 20px; padding-bottom: 28px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: rgba(245,237,224,0.45); text-transform: uppercase;
}

/* ── Entering elements ───────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .fade-lift { animation: fadeLift 480ms var(--ease-steam) both; }
  @keyframes fadeLift { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ── For cafes page ───────────────────────────── */
.kit-hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr;
  gap: calc(var(--s-7) * var(--density)); align-items: center;
  padding-top: calc(var(--s-8) * var(--density));
  padding-bottom: calc(var(--s-8) * var(--density));
}
.kit-contrast-grid {
  display: grid; grid-template-columns: 1fr 420px;
  gap: calc(var(--s-8) * var(--density)); align-items: center;
  padding-top: 72px; padding-bottom: 72px;
}
.kit-quote-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: calc(var(--s-8) * var(--density)); margin-top: 36px;
}

/* ── Mobile (container-driven) ───────────────────── */
@container (max-width: 880px) {
  .site-root > * { --site-pad: 24px; }
  .nav-links { display: none; }
  .site-nav-inner { height: 58px; }
  .cafe-hero-grid { grid-template-columns: 1fr; gap: var(--s-6); padding-top: var(--s-6); padding-bottom: var(--s-6); }
  .content-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .aside-sticky { position: static; }
  .bar-strip { grid-template-columns: 1fr 1fr; }
  .bar-cell { padding: 16px 0; }
  .bar-cell + .bar-cell { border-left: none; padding-left: 0; }
  .bar-cell:nth-child(even) { border-left: 1px solid var(--border-hairline); padding-left: 20px; }
  .bar-cell:nth-child(n+3) { border-top: 1px solid var(--border-hairline); }
  .kit-showcase-grid { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .kit-hero-grid { grid-template-columns: 1fr; gap: var(--s-5); padding-top: var(--s-6); padding-bottom: var(--s-7); }
  .kit-hero-grid > div:last-child { transform: scale(0.82); transform-origin: top center; margin: -20px 0 -90px; }
  .kit-contrast-grid { grid-template-columns: 1fr; gap: var(--s-6); padding-top: 56px; padding-bottom: 56px; }
  .kit-quote-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .hide-mobile { display: none !important; }
}
@container (min-width: 881px) { .hide-desktop { display: none !important; } }

/* ============================================================
   Atlas — the location-aware cafe discovery page (/cafes).
   Colorway canvases mirror the four kit colorways in
   internal/art/kit.go; the 25%-darkened stop is precomputed.
   ============================================================ */

/* The Atlas toggles visibility with the [hidden] attribute; several of its
   elements set display via a class, which would otherwise win over the UA
   [hidden] rule — make hidden authoritative. */
[hidden] { display: none !important; }

/* Score discs rebuilt by atlas.js when the hero cafe swaps — visually match
   the server-rendered "score"/"score-lg" partials (reviewcard.html). */
.atlas-score, .atlas-score-lg {
  display: inline-flex; align-items: baseline; flex: none;
  background: var(--bg-3); border-radius: var(--r-pill);
  font-family: var(--font-mono); font-weight: 600; color: var(--fg-1);
}
.atlas-score    { padding: 4px 12px; font-size: 15px; }
.atlas-score-lg { padding: 8px 18px; font-size: 26px; }

/* ── Colorway canvases ───────────────────────────── */
.atlas-cw-parchment  { background: linear-gradient(135deg, #F5EDE0, #B8B2A8); color: #1F140E; }
.atlas-cw-espresso   { background: linear-gradient(135deg, #1F140E, #170F0B); color: #E8D9B8; }
.atlas-cw-moss       { background: linear-gradient(135deg, #5A6B4A, #445038); color: #F5EDE0; }
.atlas-cw-terracotta { background: linear-gradient(135deg, #B85C3C, #8A452D); color: #F5EDE0; }

.atlas-canvas-eyebrow {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: inherit; opacity: 0.72;
}
.atlas-canvas-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(32px, 4cqw, 52px); line-height: 0.98;
  letter-spacing: -0.015em; color: inherit;
}
.atlas-canvas-detail {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: inherit; opacity: 0.72; margin-top: 8px;
}

/* "New" tag — adapts to whatever canvas ink it sits on. */
.atlas-new {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: currentColor;
  padding: 7px 12px; border-radius: var(--r-pill);
  background: color-mix(in srgb, currentColor 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 40%, transparent);
}

/* ── Hero ────────────────────────────────────────── */
.atlas-hero { padding-top: 64px; padding-bottom: 8px; }
.atlas-hero-grid {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: 56px; align-items: start;
}
.atlas-headline {
  font-size: clamp(42px, 6cqw, 76px); line-height: 0.98;
  letter-spacing: -0.02em; margin-top: 20px;
}
.atlas-headline em { font-style: italic; font-weight: 500; color: var(--bean); }

/* Soft-ask card */
.atlas-ask {
  background: var(--linen); border-radius: var(--r-xl); padding: 26px;
  box-shadow: inset 0 0 0 1px var(--border-soft);
  align-self: start; max-width: 360px;
  /* Explicit placement, shared with .atlas-skel-ask below: the skeleton is
     an extra grid child inserted right before this one in the markup, so
     without pinning both to the same cell, auto-placement would push this
     card into a new row instead of the two simply stacking (one hidden). */
  grid-column: 2; grid-row: 1;
}
.atlas-ask-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--parchment); color: var(--bean);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-e1);
}
.atlas-ask-title {
  font-family: var(--font-display); font-weight: 700; font-size: 23px;
  color: var(--fg-1); margin-top: 14px; letter-spacing: -0.01em; line-height: 1.1;
}
.atlas-ask-body { font-size: 13.5px; line-height: 1.5; color: var(--fg-3); margin-top: 10px; }
.atlas-ask-btn { margin-top: 16px; }
.atlas-ask-note {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em;
  color: var(--fg-3); margin-top: 14px; text-transform: uppercase;
}
.atlas-ask-error {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em;
  color: var(--terracotta-ink); background: var(--terracotta-soft);
  border-radius: var(--r-sm); padding: 8px 11px; margin-top: 12px;
}

/* Located chip (replaces the ask card once granted) */
.atlas-located {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--fg-3);
  background: var(--linen); padding: 10px 16px; border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--border-soft); max-width: 100%;
}
.atlas-located-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--moss); flex: none; }
.atlas-reset { color: var(--bean); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Personalize crossfade — for the "Use my location" BUTTON path only:
   atlas.js fades the headline/hero/near-row/city-grid out before rewriting
   them, then back in, so a click-triggered update reads as deliberate
   rather than an instant jump. (The silent on-load re-personalize for
   returning visitors uses the skeleton below instead — see its comment for
   why a fade isn't the right answer there.) The headline lives outside the
   hero card in the DOM (it's the page's own <h1>, not part of
   .atlas-hero-card) — easy to leave out of this list by only looking at the
   hero card's markup; it still needs the same fade, since setHeadline()
   rewrites it in the same personalize() pass. */
[data-atlas="headline"], [data-atlas="hero"], [data-atlas="near-row"], [data-atlas="cities"] {
  transition: opacity 220ms var(--ease-steam);
}
.atlas-fading { opacity: 0; }

/* Locating skeleton — for the SILENT on-load path: a returning visitor who
   granted location before never sees the generic default headline/hero at
   all. cafes.html's inline script sets .atlas-locating on <html> before
   they're ever painted; atlas.js removes it once the real (personalized)
   content is ready. No amount of fading the default→personalized swap
   reads as "not broken" — the fix is to never show the default in the
   first place when we already know it's about to be replaced. */
.atlas-skel { display: none; }
.atlas-locating [data-atlas="headline"],
.atlas-locating [data-atlas="lede"],
.atlas-locating [data-atlas="hero"],
.atlas-locating [data-atlas="ask"] {
  display: none;
  /* Failsafe: if atlas.js never clears .atlas-locating (fails to load,
     geolocation hangs past its own timeout, ...) the browser reveals the
     default content on its own — a visitor should never be stuck looking
     at a skeleton forever just because our JS didn't run. atlas.js's own
     timeout fires well before this; this is the last-resort backstop. */
  animation: atlas-locating-reveal 0s 4s forwards;
}
.atlas-locating .atlas-skel {
  display: block;
  animation: atlas-skel-hide 0s 4s forwards;
}
@keyframes atlas-locating-reveal { to { display: block; } }
@keyframes atlas-skel-hide { to { display: none; } }

.atlas-skel-bar {
  border-radius: 6px; background: var(--bg-3);
  animation: atlas-skel-pulse 1.3s ease-in-out infinite;
}
.atlas-skel-bar-lg { width: 70%; height: 44px; margin-top: 14px; }
.atlas-skel-bar-md { width: 45%; height: 20px; margin-top: 18px; }
.atlas-skel-card {
  margin-top: 44px; height: 340px; border-radius: var(--r-xl);
  background: var(--bg-3);
  animation: atlas-skel-pulse 1.3s ease-in-out infinite;
}
.atlas-skel-ask {
  height: 100%; min-height: 220px; border-radius: var(--r-xl);
  background: var(--bg-3);
  animation: atlas-skel-pulse 1.3s ease-in-out infinite;
  grid-column: 2; grid-row: 1;
}
@keyframes atlas-skel-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Hero cafe card */
.atlas-hero-card {
  background: var(--parchment); border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-e2);
  display: grid; grid-template-columns: 1.15fr 0.85fr;
}
.atlas-canvas {
  position: relative; padding: 34px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 380px;
  background-size: cover; background-position: center;
}
/* atlas-canvas-photo: added only when the hero has a HeroImage (cafes.html).
   A photo's own colors can't be relied on to contrast with the colorway
   text color, so pin the text to a fixed light color and scrim the bottom
   of the canvas — transparent at top so the image still reads, opaque
   enough at bottom for the name/detail/score to stay legible over any
   photo. */
.atlas-canvas-photo { color: var(--crema); }
.atlas-canvas-photo::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  /* Transparent at top (name/detail/score sit at the bottom and get their
     contrast from this), never opaque, so the photo reads through. The
     rank-line eyebrow up top gets its own badge background below instead
     of relying on this gradient reaching that far. */
  background: linear-gradient(180deg, rgba(31,20,14,0) 45%, rgba(31,20,14,0.78) 100%);
}
/* Stacked-context escape hatch: an absolutely-positioned pseudo-element
   paints above static in-flow siblings regardless of source order, so the
   scrim above would otherwise cover this text. Making these positioned
   too (z-index:auto) puts them in the same paint bucket, ordered by tree
   position — all come after ::before in the DOM, so they land on top.
   .atlas-card-score is the Atlas grid card's equivalent of the hero's
   .atlas-canvas-foot (same shared .atlas-canvas-photo class, different
   card shape) — without this, a photo'd cafe's score pill sits under the
   scrim the moment it also has reviews (a photo-only cafe shows the
   .atlas-new badge instead, which happened to read fine anyway). */
.atlas-canvas-photo > .atlas-canvas-eyebrow,
.atlas-canvas-photo > .atlas-canvas-foot,
.atlas-canvas-photo > .atlas-card-score { position: relative; }
/* The eyebrow sits in the gradient's untouched top zone, so it needs its
   own contrast fix: a solid label chip tightly around the text, like a
   text-selection highlight, rather than more scrim. */
.atlas-canvas-photo > .atlas-canvas-eyebrow {
  display: inline-block; opacity: 1;
  background: rgba(31,20,14,0.72); padding: 4px 8px; border-radius: 3px;
}
.atlas-canvas-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.atlas-hero-panel { padding: 32px 34px; display: flex; flex-direction: column; }
.atlas-hero-blurb {
  font-family: var(--font-display); font-style: italic; font-size: 18.5px;
  line-height: 1.5; color: var(--fg-2); margin-top: 14px;
}
.atlas-hero-links {
  display: flex; gap: 20px; margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--border-hairline); flex-wrap: wrap;
}
.atlas-extlink {
  font-size: 14px; font-weight: 600; color: var(--bean);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.atlas-extlink:hover { color: var(--bean-2); }
.atlas-hero-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.atlas-hero-reviews {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--fg-3); text-transform: uppercase;
}

/* Hero image variant (docs/dev-design/cafe-atlas-page.md §8) — same
   .atlas-hero-card grid, image takes the left column instead of the
   colorway canvas. */
.atlas-hero-image { position: relative; min-height: 380px; }
.atlas-hero-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atlas-hero-image-name {
  font-family: var(--font-display); font-weight: 600; font-size: 30px;
  line-height: 1.05; color: var(--fg-1); margin-top: 10px;
}

/* ── Hero A/B experiment (docs/dev-design/atlas-hero-ab-test.md) ── */
.atlas-hero-overlay {
  display: flex; flex-direction: column; justify-content: flex-end;
  position: relative; min-height: 480px;
}
.atlas-hero-overlay-backdrop {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.atlas-hero-overlay-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(31,20,14,0.10) 0%, rgba(31,20,14,0.05) 30%, rgba(31,20,14,0.82) 100%);
}
.atlas-hero-overlay-body { position: relative; padding: 32px 34px; color: var(--crema); }
.atlas-hero-overlay-eyebrows { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.atlas-hero-overlay-eyebrows .eyebrow,
.atlas-hero-overlay-eyebrows .atlas-canvas-eyebrow { color: var(--crema); opacity: 0.85; }
.atlas-hero-overlay-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 10px;
}
.atlas-hero-overlay-name {
  font-family: var(--font-display); font-weight: 700; color: var(--foam);
  font-size: clamp(28px, 3.4cqw, 42px); line-height: 1.02; letter-spacing: -0.015em;
}
.atlas-hero-overlay .atlas-canvas-detail { color: var(--crema); opacity: 0.85; }
.atlas-hero-overlay-blurb {
  font-family: var(--font-display); font-style: italic; font-size: 16px; line-height: 1.5;
  color: var(--crema); margin-top: 10px; max-width: 460px;
}
.atlas-hero-overlay .atlas-hero-links { border-top-color: rgba(245,237,224,0.20); }
.atlas-hero-overlay .atlas-extlink,
.atlas-hero-overlay .atlas-hero-reviews { color: var(--crema); }

/* ── Search + chips ──────────────────────────────── */
.atlas-search-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: nowrap;
  padding-top: 24px; padding-bottom: 8px;
}
.atlas-search {
  flex: 0 1 380px; display: flex; align-items: center; gap: 10px;
  background: var(--linen); border-radius: var(--r-pill); padding: 12px 18px;
  box-shadow: inset 0 0 0 1px var(--border-soft); color: var(--fg-3);
}
.atlas-search input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font-family: var(--font-body); font-size: 14px; color: var(--fg-1);
}
.atlas-chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.atlas-chip-row::-webkit-scrollbar { display: none; }
.atlas-chip {
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  white-space: nowrap; padding: 9px 15px; border-radius: var(--r-pill);
  background: var(--linen); color: var(--fg-1); border: none; cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border-soft);
  display: inline-flex; align-items: center; gap: 7px;
}
.atlas-chip-muted { background: transparent; color: var(--stone); box-shadow: inset 0 0 0 1px var(--border-hairline); cursor: default; }
.atlas-chip-on { background: var(--espresso); color: var(--parchment); box-shadow: none; }

/* ── Near you row ────────────────────────────────── */
.atlas-near { padding-top: 34px; }
.atlas-near-track {
  display: flex; gap: 14px; overflow-x: auto; padding: 16px 0 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.atlas-near-track::-webkit-scrollbar { display: none; }
.atlas-near-card {
  flex: none; width: 250px; background: var(--parchment); border-radius: var(--r-lg);
  box-shadow: var(--shadow-e1); padding: 16px; text-decoration: none; color: var(--fg-1);
  display: flex; flex-direction: column; gap: 10px;
}
.atlas-near-head { display: flex; align-items: center; justify-content: space-between; }
.atlas-near-sq { width: 36px; height: 36px; border-radius: 11px; min-height: 0; padding: 0; }
.atlas-near-dist { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--fg-3); text-transform: uppercase; }
.atlas-near-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.005em; }
.atlas-near-detail { font-size: 12px; color: var(--fg-3); margin-top: 3px; }

/* ── City sections ───────────────────────────────── */
.atlas-city { padding-top: 48px; padding-bottom: 32px; }
.atlas-city-h { font-size: clamp(30px, 3.2cqw, 46px); line-height: 1.05; letter-spacing: -0.015em; margin-top: 10px; }
.atlas-card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 32px; }
.atlas-card {
  background: var(--parchment); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-e1); text-decoration: none; color: var(--fg-1); display: block;
  transition: transform 180ms var(--ease-steam), box-shadow 180ms var(--ease-steam);
}
.atlas-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-e2); }
.atlas-card-canvas {
  position: relative; height: 132px; padding: 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
  background-size: cover; background-position: center;
}
.atlas-card-score { align-self: flex-end; }
.atlas-card-body { padding: 16px 18px 18px; }
.atlas-card-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -0.01em; margin-top: 6px; }
.atlas-blurb {
  font-family: var(--font-display); font-style: italic; font-size: 14.5px;
  color: var(--fg-2); margin-top: 7px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.atlas-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.atlas-card-meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--fg-3); text-transform: uppercase; }
.atlas-card-view { font-size: 13px; font-weight: 600; color: var(--bean); white-space: nowrap; }
.atlas-dist {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  white-space: nowrap; padding: 6px 11px; border-radius: var(--r-pill);
  color: var(--fg-2); background: var(--linen);
  box-shadow: inset 0 0 0 1px var(--border-soft);
}
.atlas-empty { color: var(--fg-3); padding: 32px 0 64px; }

/* ── Growing strip ───────────────────────────────── */
.atlas-grow { background: var(--espresso); color: var(--parchment); margin-top: 48px; }
.atlas-grow-inner { padding-top: 96px; padding-bottom: 96px; text-align: center; }
.atlas-grow-cities { display: flex; justify-content: center; gap: 28px; margin-top: 24px; flex-wrap: wrap; }
.atlas-grow-cities span { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.16em; color: var(--crema); text-transform: uppercase; }
.atlas-grow-lede { color: var(--crema); margin: 22px auto 0; max-width: 560px; text-align: center; }

/* ── Responsive ──────────────────────────────────── */
@container (max-width: 900px) {
  .atlas-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .atlas-ask, .atlas-skel-ask { max-width: none; grid-column: 1; grid-row: auto; }
  .atlas-hero-card { grid-template-columns: 1fr; }
  .atlas-canvas { min-height: 230px; padding: 22px; }
  .atlas-hero-panel { padding: 22px; }
}
@container (max-width: 720px) {
  .atlas-card-grid { grid-template-columns: 1fr; }
  .atlas-search-row { flex-wrap: wrap; }
  .atlas-search { flex: 1 1 100%; }
}
