/* ============================================================
   BURLINGTON, RIGHT NOW — the BTown Brief front door (v2, Aug 2026)

   One page, three layers:
     1. the bento — photographs carrying one live number each
     2. the questions — twelve first-person pills, one open panel
     3. everything, A–Z — the guarantee that every page is reachable

   Photographs are Stephen's own (assets/img/ig, sources in sources.json).
   Type is one family, Archivo: wide + black for display, normal for text.
   Color is the lake, the maple, the sap, the ink — used as blocks, not tints.
============================================================ */

:root {
  --paper: #F6F4EF;
  --card:  #FFFFFF;
  --ink:   #0E1A33;
  --ink2:  #46526B;
  --mute:  #8A93A6;
  --line:  #E6E2D8;
  --lake:  #1748D1;
  --lake-soft: #E8EDFA;
  --maple: #F25A1E;
  --sap:   #FFC53D;
  --mint:  #BFE8D2;
  --f: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 26px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B0E14; --card: #151A24; --ink: #F3F1EA; --ink2: #B9BFCD; --mute: #7C8598;
    --line: #232A38; --lake: #7FA0F0; --lake-soft: #162138; --mint: #2A4A3A;
  }
}
:root[data-theme="dark"] {
  --paper: #0B0E14; --card: #151A24; --ink: #F3F1EA; --ink2: #B9BFCD; --mute: #7C8598;
  --line: #232A38; --lake: #7FA0F0; --lake-soft: #162138; --mint: #2A4A3A;
}

/* The theme toggle shows the mode you'd switch TO: moon in light, sun in dark. */
#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) #theme-toggle .icon-moon { display: none; }
}
:root[data-theme="dark"] #theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] #theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] #theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] #theme-toggle .icon-moon { display: block; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--sap); outline-offset: 2px; }
img { display: block; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(.8rem, 2.5vw, 1.6rem); }

/* Display face: wide, black, upper — the poster voice, used for titles only. */
.D {
  font-variation-settings: "wdth" 110, "wght" 900;
  text-transform: uppercase;
  letter-spacing: -.025em;
  line-height: .9;
}

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 1rem; height: 60px; }
.mark { font-variation-settings: "wdth" 112, "wght" 900; text-transform: uppercase; letter-spacing: .01em; font-size: 1.05rem; white-space: nowrap; }
.mark i { font-style: normal; color: var(--maple); }
/* The verbs stretch across the open middle instead of huddling by the
   wordmark; the Read/Subscribe pills carry the right edge. */
.verbs { display: flex; flex: 1; justify-content: space-evenly; gap: 1rem; margin-left: .5rem; font-weight: 700; font-size: 1rem; color: var(--ink2); }
.verbs a:hover { color: var(--ink); }
.read-cta { background: var(--maple); color: #fff; border-radius: 999px; padding: .55rem 1.15rem; font-weight: 800; font-size: .95rem; white-space: nowrap; }
.read-cta:hover { filter: brightness(1.08); }
.subs { background: var(--sap); color: #1B1500; border-radius: 999px; padding: .55rem 1.15rem; font-weight: 800; font-size: .95rem; white-space: nowrap; }
.subs:hover { filter: brightness(1.04); }
.sbtn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); color: var(--ink2); display: grid; place-items: center; cursor: pointer; }
.sbtn:hover { color: var(--ink); border-color: var(--ink); }

/* ------------------------------------------- the opening frame (the cover) */
.cover { position: relative; min-height: clamp(360px, 54vh, 580px); display: grid; place-items: center; overflow: hidden; background: var(--paper); }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Two layers: a dark tint up top so the headline stays readable, and a pure
   fade to the page color below it — the photo dissolves into the bento with
   no gray band and no hard edge. Cover background is paper too, so there's
   never a black sliver under the image. */
.cover::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(8,12,20,0) 50%, var(--paper) 97%),
  linear-gradient(180deg, rgba(8,12,20,.42), rgba(8,12,20,.16) 42%, rgba(8,12,20,0) 72%); }
.cover-date { position: absolute; top: 10px; left: 0; right: 0; z-index: 1; margin: 0; text-align: center;
  color: rgba(246,244,239,.88); font-size: .82rem; font-weight: 700; letter-spacing: .05em;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 8px rgba(8,12,20,.5); }
.cover-copy { position: relative; z-index: 1; text-align: center; color: #F6F4EF; padding: 3.4rem 1rem; max-width: 60rem; }
.cover .eyebrow { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .35em; text-transform: uppercase; opacity: .85; }
.cover h1 { margin: .7rem 0 0; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(2.7rem, 7vw, 5.4rem); line-height: 1.02; letter-spacing: -.01em; }
.cover .lede { margin: 1.1rem auto 0; max-width: 48ch; font-size: clamp(1rem, 1.6vw, 1.15rem); font-weight: 500; opacity: .92; }
.cover-btns { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.pillbtn { border: 1.5px solid rgba(246,244,239,.55); background: rgba(10,14,22,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #F6F4EF; border-radius: 999px; padding: .68rem 1.3rem; font-weight: 700; font-size: .95rem; }
.pillbtn:hover { background: rgba(246,244,239,.16); color: #fff; }
.cover .credit { position: absolute; right: 14px; bottom: 10px; z-index: 1; font-size: .68rem; color: rgba(246,244,239,.6); }

/* ---------------------------------------------------------------- kicker */
.bento { padding-top: clamp(1rem, 2.5vw, 1.5rem); }

/* ---------------------------------------------------------------- bento */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 152px; gap: 12px; margin-top: .6rem; }
.t {
  position: relative; overflow: hidden; border-radius: var(--r);
  background: var(--card); color: var(--ink);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.05rem 1.2rem;
  transition: transform .2s ease;
  grid-column: span 2;
}
.t:hover { transform: translateY(-2px); }
.t > * { position: relative; z-index: 1; }
.t.ph { color: #fff; }
.t.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.t.ph::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(0,0,0,.08) 0%, rgba(0,0,0,0) 38%, rgba(8,12,24,.72) 100%); }
.t .lab { margin: 0; font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .92; }
.t .num { margin: .12rem 0 0; font-variation-settings: "wdth" 108, "wght" 900; font-size: clamp(2.2rem, 4.4vw, 3.6rem); letter-spacing: -.04em; line-height: .95; font-variant-numeric: tabular-nums; }
.t .num small { font-size: .42em; font-weight: 700; letter-spacing: -.01em; opacity: .9; }
.t .num.small { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.02em; line-height: 1; }
.t .sub { margin: .28rem 0 0; font-size: .88rem; font-weight: 500; opacity: .92; }
.t.big { grid-column: span 2; grid-row: span 2; }

/* subscribe — ink, the page's closing band */
.band { margin-top: clamp(2.6rem, 6vw, 4.4rem); }
.band .t.dark { padding: 1.3rem 1.5rem; }
.t.dark { background: var(--ink); color: var(--paper); flex-direction: row; flex-wrap: wrap; align-items: center; gap: .2rem 1.4rem; }
.t.dark .lab { flex: 1 1 100%; }
.t.dark .sub { flex: 1 1 320px; margin: 0; }
.t.dark .sub { opacity: .8; }
.t.dark iframe { flex: 0 1 420px; width: 100%; max-width: 420px; height: 52px; border: 0; border-radius: 12px; margin-top: .2rem; background: transparent; }
:root[data-theme="dark"] .t.dark, :root:not([data-theme="light"]) .t.dark { }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t.dark { background: #1748D1; color: #fff; } }
:root[data-theme="dark"] .t.dark { background: #1748D1; color: #fff; }

/* ---------------------------------------------------------------- questions */
.ask { margin-top: clamp(2.4rem, 6vw, 4rem); }
.ask h2 { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 3.8rem); }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
/* One quiet style for every pill; the chosen one goes maple red. */
.pill {
  border: 0; cursor: pointer; font: inherit; font-weight: 800;
  font-size: clamp(.98rem, 1.5vw, 1.2rem); letter-spacing: -.01em;
  padding: .78rem 1.15rem; border-radius: 999px;
  color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .15s ease;
}
.pill:hover { transform: rotate(-1.1deg) scale(1.02); box-shadow: inset 0 0 0 1.5px var(--ink); }
.pill.on, .pill.on:hover { background: var(--maple); color: #fff; box-shadow: none; transform: none; }
.panels { margin-top: 12px; }
.qp { display: none; position: relative; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 1.25rem 1.3rem 1.15rem; }
.qp.on { display: block; }
.qp > img { position: absolute; right: 16px; top: 16px; width: 64px; height: 64px; border-radius: 18px; object-fit: cover; }
.qp h3 { margin: 0 0 .9rem; padding-right: 84px; font-size: 1.35rem; font-weight: 900; letter-spacing: -.02em; min-height: 40px; display: flex; align-items: center; }
.qp .split { margin: 1rem 0 .5rem; font-size: .72rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--mute); }
.qp h3 + .split { margin-top: 0; }
.rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
/* The daily panel packs a dozen links. Flex rows instead of grid: every line
   stretches to fill its full width, so no orphan cell ever sits empty, and the
   tighter cards keep the tallest panel scroll-light. */
.qp[data-q="daily"] .rows { display: flex; flex-wrap: wrap; gap: 8px; }
.qp[data-q="daily"] .rows a { flex: 1 1 190px; min-height: 0; padding: .55rem .85rem; }
.qp[data-q="daily"] .split { margin: .65rem 0 .4rem; }
.rows a { display: flex; flex-direction: column; gap: .12rem; padding: .9rem 1rem; border-radius: 16px; background: var(--paper); border: 1.5px solid var(--line); min-height: 66px; }
.rows a:hover { border-color: var(--ink); background: var(--sap); color: #1B1500; }
.rows b { font-weight: 800; font-size: 1rem; }
.rows em { font-style: normal; font-weight: 800; font-size: .84rem; color: var(--lake); }
.rows a:hover em { color: #1B1500; }
.rows small { font-size: .82rem; color: var(--ink2); }
.rows a:hover small { color: #3A2E10; }

/* ------------------------------------------------- a few of my favorites */
.favs { margin-top: clamp(2.4rem, 6vw, 4rem); }
.favhead { display: flex; align-items: flex-end; gap: 1.6rem; margin-bottom: 1rem; }
.favhead h2 { margin: 0; font-size: clamp(1.8rem, 4.2vw, 3rem); }
.favhead p { margin: 0 0 .2rem; color: var(--ink2); font-size: .95rem; }
.favshelf {
  /* No scroll-snap: a flick should glide with momentum like an IG carousel,
     not catch on the next card. The dots track position instead. */
  display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 12px;
  scrollbar-width: thin; scrollbar-color: var(--mute) var(--line);
}
/* the scrollbar is the affordance — keep it visible, iPhone-thin */
.favshelf::-webkit-scrollbar { height: 6px; }
.favshelf::-webkit-scrollbar-track { background: var(--line); border-radius: 999px; }
.favshelf::-webkit-scrollbar-thumb { background: var(--mute); border-radius: 999px; }
/* IG-style page dots under the shelf — the swipe-right affordance the
   scrollbar alone wasn't. Built by v2.js from the shelf's real width. */
.favdots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.favdots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
  background: var(--mute); opacity: .45; cursor: pointer; transition: all .2s ease; }
.favdots button.on { background: var(--maple); opacity: 1; transform: scale(1.3); }
.fav {
  flex: 0 0 236px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 20px;
  overflow: hidden; transition: transform .2s ease;
}
.fav:hover { transform: translateY(-2px); border-color: var(--ink); }
.fav > img { width: 100%; height: 128px; object-fit: cover; }
.fav .tx { display: block; padding: .65rem .85rem .8rem; }
.fav .tx b { display: block; font-weight: 800; font-size: .95rem; letter-spacing: -.01em; }
.fav .tx small { display: block; margin-top: .2rem; font-size: .76rem; color: var(--ink2); line-height: 1.4; font-weight: 500; }
.fav .tx i { display: inline-block; margin-top: .5rem; font-style: normal; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #B8860B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fav .tx i { color: var(--sap); } }
:root[data-theme="dark"] .fav .tx i { color: var(--sap); }

/* ---------------------------------------------------------------- A–Z */
.az { margin-top: clamp(2.6rem, 6vw, 4.4rem); border-top: 2px solid var(--ink); padding-top: 1.4rem; scroll-margin-top: 72px; }
#subscribe, #ask { scroll-margin-top: 72px; }
.azhead { display: grid; grid-template-columns: auto 1fr; gap: .6rem 2rem; align-items: end; }
.azhead h2 { margin: 0; font-size: clamp(1.8rem, 4.2vw, 3rem); }
.azhead p { margin: 0; color: var(--ink2); font-size: .95rem; max-width: 48ch; }
.find { grid-column: 1 / -1; display: flex; align-items: center; gap: .6rem; margin-top: .4rem; background: var(--card); border: 1.5px solid var(--line); border-radius: 999px; padding: .55rem 1rem; color: var(--mute); }
.find:focus-within { border-color: var(--ink); }
.find input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1rem; color: var(--ink); min-width: 0; }
/* shelf chips: filter the shelves below */
.azchips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: .9rem; }
.azchip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink2); border-radius: 999px; padding: .4rem .85rem; font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; white-space: nowrap; }
.azchip:hover { border-color: var(--ink); color: var(--ink); }
.azchip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 800; }

/* the shelves: compact photo tiles, four columns of them */
.shelves { columns: 4; column-gap: 16px; margin-top: 1.2rem; }
.grp { break-inside: avoid; margin-bottom: 1.4rem; }
.grp[hidden] { display: none; }
.gh { display: flex; align-items: baseline; gap: 8px; padding-bottom: 5px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.gh i { width: 9px; height: 9px; border-radius: 2.5px; align-self: center; background: var(--lake); }
.gh .c-maple { background: var(--maple); } .gh .c-sap { background: var(--sap); } .gh .c-mint { background: var(--mint); } .gh .c-lake { background: var(--lake); }
.gh h3 { margin: 0; font-size: .8rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.gh small { margin-left: auto; color: var(--mute); font-weight: 700; font-size: .72rem; font-variant-numeric: tabular-nums; }
.tile { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1.5px solid var(--line); border-radius: 13px; overflow: hidden; margin-bottom: 7px; min-height: 54px; }
.tile:hover { border-color: var(--lake); }
.tile > img { width: 72px; height: 54px; object-fit: cover; flex: 0 0 72px; align-self: stretch; }
.tile .mo { flex: 0 0 72px; align-self: stretch; min-height: 54px; display: grid; place-items: center; font-style: normal; font-size: 1.35rem; background: var(--paper); border-right: 1px solid var(--line); }
.tile .tt { padding: .45rem .7rem .45rem 0; min-width: 0; }
.tile .tt b { display: block; font-weight: 800; font-size: .84rem; letter-spacing: -.01em; line-height: 1.2; }
.tile .tt b i { font-style: normal; font-weight: 600; color: var(--mute); }
.tile .tt small { display: block; margin-top: 1px; font-size: .72rem; color: var(--ink2); font-weight: 500; line-height: 1.3; }
.tile.lead { border-color: var(--lake); }
.tile.lead b { color: var(--lake); }
.tile.hide { display: none; }
.azmore { margin: 1.2rem 0 0; font-size: .92rem; }
.azmore a { color: var(--lake); font-weight: 800; }
.azmore.start { margin: clamp(1.6rem, 4vw, 2.6rem) 0 0; font-size: 1rem; }

/* ---------------------------------------------------------------- foot */
.foot { margin: 2.6rem 0 3.2rem; font-size: .82rem; color: var(--mute); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.foot a { color: var(--ink2); font-weight: 600; }
.foot a:hover { color: var(--lake); }

/* ---------------------------------------------------------------- phones & tablets */
@media (max-width: 1100px) { .shelves { columns: 3; } }
@media (max-width: 980px) { .shelves { columns: 2; } }
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 720px) {
  /* Phones: two deliberate header rows, nothing squished.
     Row 1 — wordmark left, Read + Subscribe right.
     Row 2 — Eat Do Play Listen/Watch left, theme + search icons right.
     The ordered ::before is a full-width flex break between the rows. */
  .bar { gap: .5rem .6rem; height: auto; flex-wrap: wrap; padding-top: .55rem; padding-bottom: .55rem; }
  .bar::before { content: ""; flex-basis: 100%; height: 0; order: 3; }
  .mark { order: 1; font-size: 1rem; }
  .read-cta { order: 2; margin-left: auto; padding: .5rem 1rem; font-size: .88rem; }
  .subs { order: 2; padding: .5rem 1rem; font-size: .88rem; }
  .verbs { order: 4; flex: 1; justify-content: space-between; gap: .5rem; margin-left: 0; font-size: .9rem; }
  #theme-toggle { order: 5; margin-left: auto; }
  #search-open { order: 6; }
  .bento { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 142px; }
  .t { grid-column: span 1; padding: .9rem .95rem; }
  .t.big { grid-column: span 2; grid-row: span 2; }
  .sbtn { width: 34px; height: 34px; }
  .t .num { font-size: 2rem; }
  .favhead { flex-direction: column; align-items: flex-start; gap: .3rem; }
  .fav { flex-basis: 200px; }
  .fav > img { height: 108px; }
  .azhead { grid-template-columns: 1fr; }
  .shelves { columns: 1; }
  .tile { min-height: 48px; }
  .tile > img, .tile .mo { flex-basis: 64px; }
  .qp > img { width: 52px; height: 52px; right: 12px; top: 12px; }
  .qp h3 { padding-right: 64px; font-size: 1.2rem; }
  /* Pills two-up on phones — half the vertical run of the question list.
     The daily pill leads at full width; the other twelve pair up evenly. */
  .pills { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pill { font-size: .82rem; padding: .55rem .55rem; text-align: center; letter-spacing: 0; }
  .pill[data-q="daily"] { grid-column: 1 / -1; font-size: .95rem; padding: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .t, .pill, .fav { transition: none; }
}
