/*
 * The reading surface: every guide, hub and place page, the homepage, search and events.
 *
 * Built from a handful of pieces, so a new page is composed rather than styled: breadcrumbs, the
 * answer box, the stat bar, topic cards (with a photo) and entries (text only, the way a place is
 * listed), section heads with their 01/02/03 numbers, and the FAQ. Tokens only: nothing here defines
 * a colour of its own, which is what lets dark mode work by re-pointing tokens.
 */

/* ------------------------------------------------------------- Page frame --- */
.page { padding-block: 24px 8px; }
.page-head, .page__notice { max-width: var(--measure); }
.page__notice { margin-bottom: 20px; }
.page__children { margin: 8px 0 48px; }
/* The lead photograph spans the reading column, not the whole container, and is cropped for display
   so a portrait original cannot push the article a screen down. */
.figure--lead { max-width: var(--measure); }
.figure--lead img { max-height: 460px; object-fit: cover; }

/* ------------------------------------------------------------ Breadcrumbs --- */
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--border-input); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--spark); }
.breadcrumbs [aria-current] { color: var(--bone-bright); font-weight: 600; }

/* --------------------------------------------------------------- Page head --- */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 12px; }
.page-head__kind { font-size: 15px; font-weight: 700; color: var(--spark); margin: 0 0 8px; text-transform: capitalize; }
.page-head__question { font-size: 18px; color: var(--muted); margin: 0 0 4px; }
.page-head .lede { margin: 0; }

/* -------------------------------------------------------------- Answer box --- */
/* The 40-60 word answer, stated first. The thing a reader (and an answer engine) came for. */
.answer-box {
  max-width: var(--measure);
  margin: 0 0 28px; padding: 20px 22px;
  background: var(--spark-tint); border-radius: var(--r-card);
  border-left: 4px solid var(--spark);
}
.answer-box__label { font-size: 14px; font-weight: 800; color: var(--spark); margin: 0 0 6px; }
.answer-box__text { font-size: 19px; line-height: 1.6; color: var(--bone-bright); margin: 0 0 12px; max-width: none; }
.answer-box .verified-stamp { font-size: 13.5px; }

/* --------------------------------------------------------------- Stat bar --- */
/* A page's short figures at a glance, each still one click from its source. */
.stat-bar {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  margin: 0 0 32px; max-width: var(--measure);
  background: var(--border); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden;
}
.stat { background: var(--card); padding: 16px 18px; }
.stat__value { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; color: var(--bone-bright); font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.stat__source { font-size: 13px; color: var(--muted-2); text-decoration: underline; text-underline-offset: 2px; }
.stat__source:hover { color: var(--spark); }

/* ----------------------------------------------------------- On this page --- */
/* On a wide screen the contents sit in a sticky rail beside the article. Every other child stays in
   the first column; the toc spans the rows so it can stick while the reader scrolls. */
@media (min-width: 1100px) {
  .guide-layout--rail { display: grid; grid-template-columns: minmax(0, 1fr) 260px; column-gap: 56px; }
  .guide-layout--rail > * { grid-column: 1; min-width: 0; }
  .guide-layout--rail > .toc {
    grid-column: 2; grid-row: 1 / span 40; align-self: start;
    position: sticky; top: calc(var(--header-h) + 24px); margin-top: 36px;
  }
  .guide-layout--rail > .toc ol { columns: auto; }
}
.toc {
  max-width: var(--measure); margin: 0 0 32px; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: var(--r-card);
}
.toc__title { font-size: 14px; font-weight: 800; color: var(--bone-bright); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 1.3em; columns: 2 220px; column-gap: 28px; font-size: 15px; }
.toc li { margin-bottom: 4px; break-inside: avoid; }
.toc li::marker { color: var(--muted-2); }

/* ---------------------------------------------------------- Section heads --- */
/* "01 Start with the reason you came". The number is a reading aid, not decoration: it lets a
   long page be scanned, which is the whole of what a visitor does with a homepage. */
.section-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 20px; }
.section-head h2 { margin: 0; }
.section-num { font-size: 15px; font-weight: 800; color: var(--spark); font-variant-numeric: tabular-nums; }
.section-head__link { margin-left: auto; font-size: 15px; font-weight: 700; }
.section-head__note { flex-basis: 100%; margin: 2px 0 0; color: var(--muted); }

/* ------------------------------------------------------------- Card grids --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.card-grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }

/* A guide page, as a card: its lead photo when it has one, its title, the first sentence of its
   answer. The whole card is the link, so the photo credit inside it is TEXT: an anchor inside an
   anchor is invalid, and the browser would split the card. The linked credit is on the page. */
.topic-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  color: inherit; transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.topic-card:hover { color: inherit; border-color: var(--spark-border); box-shadow: var(--shadow-card); transform: translateY(-2px); }
.topic-card__media { position: relative; aspect-ratio: 3 / 2; background: var(--well); overflow: hidden; }
/* object-fit crops for DISPLAY only: presentation, not a derivative work, so share-alike is untouched. */
.topic-card__media img { width: 100%; height: 100%; object-fit: cover; }
.topic-card__credit {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px;
  background: linear-gradient(to top, oklch(0 0 0 / 0.6), transparent);
  font-size: 11.5px; color: oklch(1 0 0 / 0.92);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topic-card__body { padding: 16px 18px 18px; }
.topic-card__title { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.015em; line-height: 1.25; color: var(--bone-bright); }
.topic-card__summary { display: block; margin-top: 6px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.topic-card__more { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--spark); }

/* A text-only entry: the way a place, a sibling page or a search result is listed. Name, what kind
   of thing and where, one line on who it suits. No photo by design: place pages carry none. */
.entry {
  display: block; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card);
  color: inherit; transition: border-color 120ms ease, box-shadow 120ms ease;
}
a.entry:hover { color: inherit; border-color: var(--spark-border); box-shadow: var(--shadow-card); }
.entry__kind { display: block; font-size: 13.5px; font-weight: 700; color: var(--spark); text-transform: capitalize; margin-bottom: 3px; }
.entry__title { display: block; font-size: 17px; font-weight: 800; line-height: 1.3; color: var(--bone-bright); }
.entry__text { display: block; margin-top: 5px; font-size: 15px; line-height: 1.55; color: var(--muted); }
.entry__trail { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted-2); }

/* ------------------------------------------------------------------- Bands --- */
/* A hub's children, under the labels its file declares. Each label is an h2 with an id, so
   /wine#adegas-you-can-visit is a link to that list. */
.band { margin-top: 36px; }
.band:first-child { margin-top: 0; }
.band-head { font-size: clamp(21px, 2.4vw, 26px); margin: 0 0 6px; }
.band-note { color: var(--muted); margin: 0 0 16px; }
.band .card-grid { margin-top: 14px; }

/* -------------------------------------------------------------------- FAQ --- */
.faq-list { max-width: var(--measure); margin: 0; }
.faq { border-bottom: 1px solid var(--border); }
.faq:first-of-type { border-top: 1px solid var(--border); }
.faq > summary {
  display: flex; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none;
  padding: 16px 0; font-size: 17px; font-weight: 700; color: var(--bone-bright);
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::after { content: "+"; flex: none; font-size: 22px; line-height: 1; color: var(--spark); }
.faq[open] > summary::after { content: "\2212"; }
.faq > p { margin: 0 0 18px; color: var(--bone); }

/* ------------------------------------------------------- Place: at a glance --- */
.glance { max-width: var(--measure); margin: 0 0 28px; padding: 6px 20px 8px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); }
.best-for {
  max-width: var(--measure); margin: 0 0 28px; padding: 14px 18px;
  background: var(--surface); border-radius: var(--r-card); font-size: 16px; color: var(--bone);
}
.best-for__label { font-weight: 800; color: var(--bone-bright); margin-right: 6px; }

/* ------------------------------------------------------------ Block heads --- */
/* The smaller headings that close a page: facts and sources, questions, more in this section. */
.block { margin-top: 48px; }
.block > h2 { font-size: clamp(21px, 2.4vw, 26px); margin-bottom: 16px; }

/* ------------------------------------------------------------------- Hero --- */
/* The homepage's photograph, full bleed, with the headline over it. The credit stays on the photo:
   most Commons files require attribution wherever they are shown. */
.hero { position: relative; isolation: isolate; color: var(--deep-text); background: var(--deep); }
.hero__media { position: absolute; inset: 0; z-index: -2; margin: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, oklch(0.15 0.03 245 / 0.86) 0%, oklch(0.15 0.03 245 / 0.35) 55%, oklch(0.15 0.03 245 / 0.15) 100%);
}
.hero__inner { display: flex; flex-direction: column; justify-content: flex-end; min-height: min(78vh, 640px); padding-block: 96px 40px; }
.hero__coords { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; color: var(--deep-muted); margin: 0 0 12px; }
.hero__coords a { color: inherit; text-decoration: underline; text-decoration-color: oklch(1 0 0 / 0.3); text-underline-offset: 3px; }
.hero h1 { color: var(--deep-text); font-size: clamp(40px, 7vw, 76px); max-width: 14ch; margin: 0 0 14px; }
.hero__tagline { font-size: clamp(18px, 2.2vw, 22px); line-height: 1.5; color: var(--deep-text); opacity: 0.92; max-width: 40ch; margin: 0 0 24px; }
.hero__search { position: relative; max-width: 520px; }
.hero__search input[type="search"] { padding: 16px 130px 16px 46px; font-size: 17px; border-radius: var(--r-pill); border: 0; background: var(--card); box-shadow: var(--shadow-pop); }
.hero__search .site-search__icon { left: 18px; width: 18px; height: 18px; }
.hero__search .btn { position: absolute; right: 6px; top: 6px; bottom: 6px; padding-block: 0; }
.hero__links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: 15px; font-weight: 600; }
.hero__links a { color: var(--deep-text); text-decoration: underline; text-decoration-color: oklch(1 0 0 / 0.35); text-underline-offset: 3px; }
.hero__credit { position: absolute; right: var(--gutter); bottom: 10px; max-width: 60%; text-align: right; font-size: 12px; color: oklch(1 0 0 / 0.75); }
.hero__credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.hero--plain .hero__inner { min-height: 0; padding-block: 64px 48px; }

/* ------------------------------------------------------------- Right now --- */
/* Live tiles that render only when they hold data. An empty tile is never shown as a dash. */
.now-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.now-strip__tile { padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); }
.now-strip__label { display: flex; align-items: center; font-size: 14px; font-weight: 700; color: var(--muted); }
.now-strip__value { display: block; margin-top: 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; color: var(--bone-bright); font-variant-numeric: tabular-nums; }
.now-strip__note { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.now-strip__note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------ Tips list --- */
.tips { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.tips li { padding: 14px 18px; background: var(--surface); border-radius: var(--r-card); font-size: 16px; }
.tips strong { color: var(--bone-bright); }

/* ---------------------------------------------------------------- Events --- */
.event-list { display: grid; gap: 12px; }
.event-row { display: flex; gap: 16px; padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); }
.event-row__date { flex: none; width: 52px; text-align: center; padding-top: 2px; }
.event-row__day { display: block; font-size: 13px; font-weight: 700; color: var(--spark); text-transform: uppercase; }
.event-row__num { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--bone-bright); font-variant-numeric: tabular-nums; }
.event-row__month { display: block; font-size: 13px; color: var(--muted); }
.event-row__title { display: block; font-size: 17px; font-weight: 800; line-height: 1.3; color: var(--bone-bright); }
.event-row__title:hover { color: var(--spark); }
.event-row__meta { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.event-row__meta a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.event-row__text { margin: 6px 0 0; font-size: 15px; color: var(--bone); }

/* ---------------------------------------------------------------- Search --- */
.search-big { position: relative; max-width: var(--measure); margin: 0 0 24px; }
.search-big input[type="search"] { padding: 15px 120px 15px 46px; font-size: 17px; border-radius: var(--r-pill); }
.search-big .site-search__icon { left: 18px; width: 18px; height: 18px; }
.search-big .btn { position: absolute; right: 6px; top: 6px; bottom: 6px; padding-block: 0; }
.search-results { display: grid; gap: 12px; max-width: var(--measure); }
.search-hubs { margin-top: 16px; }

@media (max-width: 640px) {
  .answer-box { padding: 16px 18px; }
  .answer-box__text { font-size: 17px; }
  .hero__inner { padding-block: 72px 76px; }
  .hero__credit { left: var(--gutter); max-width: none; text-align: left; }
  .event-row { gap: 12px; padding: 14px; }
}

/* -------------------------------------------------------------- Homepage --- */
.home-stats { margin-top: 24px; }
.stat-bar--wide { max-width: none; margin: 0; box-shadow: var(--shadow-card); }
.home-band { padding-block: clamp(40px, 6vw, 72px) 0; }
.home-band--surface { margin-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); background: var(--surface); }
.home-band--surface + .home-band { padding-top: clamp(40px, 6vw, 72px); }

/* ---------------------------------------------------------------- Events --- */
.events-filter { margin-bottom: 14px; }
.events-list { margin-top: 20px; max-width: var(--measure); }
.event-source { margin: 8px 0 20px; }
