/* ==========================================================
   Japan Society of Fairfield County — reorganized site
   Theme tokens: light by default, dark via [data-theme="dark"]
   ========================================================== */
:root {
  --bg: #f7f3ec;          /* washi paper */
  --bg-alt: #efe8dc;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --ink: #1f1b18;         /* sumi ink */
  --ink-soft: #5a524b;
  --line: #e2d9cb;
  --accent: #b7282e;      /* shu / vermilion */
  --accent-ink: #ffffff;
  --accent-soft: #f6e3e1;
  --sakura: #e9a3b4;
  --gold: #b08a3e;
  --link: #a1252b;
  --shadow: 0 1px 2px rgba(40,25,10,.06), 0 8px 24px rgba(40,25,10,.07);
  --sidebar-w: 260px;
  --topnav-h: 64px;
  --radius: 14px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15130f;
  --bg-alt: #1b1814;
  --surface: #221e19;
  --surface-2: #29241e;
  --ink: #f1ebe2;
  --ink-soft: #b9afa3;
  --line: #3a332b;
  --accent: #e0545a;
  --accent-ink: #1a0c0c;
  --accent-soft: #3a1f1f;
  --sakura: #e9a3b4;
  --gold: #d4ae62;
  --link: #f08a8f;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Snapping is done gently in app.js (soft snap), not with CSS scroll-snap,
   so the motion can be slow and eased instead of the browser's instant snap. */
html { scroll-padding-top: var(--topnav-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  transition: background .25s, color .25s;
}
h1, h2, h3, h4 { font-family: "Shippori Mincho", "Noto Serif JP", Georgia, serif; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
strong { font-weight: 700; }

/* ---------- Top navigation bar ----------
   3-column grid: equal-width side columns guarantee the tabs sit at the true center
   of the page, regardless of how wide the logo or the Donate button are. */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topnav-h); z-index: 60;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  column-gap: 16px; padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { justify-self: start; display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; }
.brand-logo { width: 40px; height: 40px; flex: none; }
.brand-text { font-family: "Shippori Mincho", serif; font-weight: 700; line-height: 1.15; font-size: 1.02rem; white-space: nowrap; }
.brand-text small { display: block; font-family: "Noto Sans", sans-serif; font-weight: 400; font-size: .74rem; color: var(--ink-soft); letter-spacing: .04em; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; padding: 8px 14px; border-radius: 8px; white-space: nowrap;
  color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .93rem;
}
.tabs a:hover { color: var(--ink); background: var(--surface-2); }
.tabs a.active { color: var(--accent); }
.tabs a.active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.tab-cta { padding: 8px 18px; flex: none; }
.icon-btn { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); }

/* ---------- Collapsed section nav: floating dot rail ---------- */
.rail {
  position: fixed; right: 20px; top: calc(50% + var(--topnav-h) / 2); transform: translateY(-50%); z-index: 55;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; width: 44px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 999px; box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: opacity .25s, transform .25s;
}
body.nav-open .rail { opacity: 0; pointer-events: none; transform: translateY(-50%) translateX(12px); }
.rail hr { width: 18px; border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.dots { display: flex; flex-direction: column; align-items: center; }
.dots a, .rail-btn {
  position: relative; display: grid; place-items: center; width: 36px; height: 19px;
  color: var(--ink-soft); text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer;
}
.rail-btn { height: 32px; border-radius: 999px; }
.rail-btn:hover { color: var(--ink); background: var(--surface-2); }
.rail-btn svg { width: 17px; height: 17px; }
.dots a.grp { margin-top: 7px; }               /* small gap between top-level groups */
.dots a::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid currentColor; box-sizing: border-box; transition: transform .2s, background .2s;
}
.dots a:hover::before { transform: scale(1.3); color: var(--ink); }
.dots a.active { color: var(--accent); }
.dots a.active::before { background: currentColor; transform: scale(1.35); }
/* hover/focus label, like a tooltip to the left of the rail */
.dots a span, .rail-btn span {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translate(6px, -50%);
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s, transform .15s;
  background: var(--ink); color: var(--bg); font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 6px;
}
.dots a:hover span, .dots a:focus-visible span, .rail-btn:hover span, .rail-btn:focus-visible span { opacity: 1; transform: translate(0, -50%); }
/* rail theme button: moon in light mode (switch to dark), sun in dark mode */
.rail .icon-sun { display: none; }
.rail .icon-moon { display: inline; }
:root[data-theme="dark"] .rail .icon-sun { display: inline; }
:root[data-theme="dark"] .rail .icon-moon { display: none; }

/* ---------- Expanded section nav: floating card ---------- */
.sidebar {
  position: fixed; top: calc(var(--topnav-h) + 14px); right: 16px; bottom: 16px; width: var(--sidebar-w);
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; z-index: 70; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateX(16px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
body.nav-open .sidebar { opacity: 1; visibility: visible; transform: none; transition: opacity .25s ease, transform .25s ease; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 4px 24px; }
.sidebar-title { font-family: "Shippori Mincho", serif; font-weight: 700; font-size: 1.05rem; }
.collapse-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.collapse-btn:hover { border-color: var(--accent); }
.collapse-btn svg { width: 16px; height: 16px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.nav-group { margin: 10px 0 4px; }
.nav-group > span { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); padding: 6px 12px; font-weight: 600; }
.nav a {
  display: block; padding: 7px 12px; border-radius: 8px; color: var(--ink);
  text-decoration: none; font-size: .93rem; border-right: 3px solid transparent;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); border-right-color: var(--accent); font-weight: 600; }

.sidebar-tools { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.tool-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer;
}
.tool-btn:hover { border-color: var(--accent); }
.tool-btn svg { width: 18px; height: 18px; flex: none; }
.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.sidebar .icon-moon { display: none; }
:root[data-theme="dark"] .sidebar .icon-sun { display: none; }
:root[data-theme="dark"] .sidebar .icon-moon { display: inline; }

/* click-outside layer while the card is open (transparent on desktop, dimmed on phones) */
.scrim { display: none; }
body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: transparent; }

/* ---------- Main + panels ---------- */
main { padding-top: var(--topnav-h); }
.panel {
  min-height: calc(100vh - var(--topnav-h)); min-height: calc(100dvh - var(--topnav-h));
  padding: clamp(48px, 7vh, 88px) clamp(20px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: center;
  border-bottom: 1px solid var(--line);
}
.panel:nth-of-type(even) { background: var(--bg-alt); }
.panel > .inner { width: 100%; max-width: 1080px; margin: 0 auto; }
.eyebrow { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 10px; display: block; }
.lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 68ch; }
.section-head { margin-bottom: 28px; }

/* ---------- Hero ---------- */
.hero { padding: 0; position: relative; justify-content: flex-end; color: #fff; background: #111 !important; overflow: hidden; }
/* Full-strength photo + a gradient only behind the text keeps the image crisp instead of dimming all of it */
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,8,6,.92) 0%, rgba(10,8,6,.7) 38%, rgba(10,8,6,.15) 72%, rgba(10,8,6,0) 100%);
}
.hero .inner { position: relative; z-index: 1; padding: clamp(40px, 8vh, 96px) clamp(20px, 5vw, 72px); max-width: none; }
.hero h1, .hero .lede { text-shadow: 0 1px 12px rgba(0,0,0,.45); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lede { color: #f2ece4; }
.hero .eyebrow { color: #ffb8bf; }
.hero .caption { font-size: .8rem; color: #ddd; margin-top: 18px; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--accent); cursor: pointer; font-family: inherit;
}
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.hero .btn.ghost { color: #fff; }
.btn:hover { filter: brightness(1.08); }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card.media { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card.media .body { padding: 20px 22px 22px; }
.card.media > img { width: 100%; aspect-ratio: 3/2; object-fit: cover; background: var(--surface-2); }
.card.media > img.top { object-position: 50% 18%; }
/* Small originals (e.g. book covers) are shown at their real size instead of being stretched */
.card.media > img.contain { object-fit: scale-down; padding: 14px; }
.tag + h3 { margin-top: 10px; }
.card.media .body { display: flex; flex-direction: column; flex: 1; }
.card.media .body > .note:last-child { margin-top: auto; margin-bottom: 0; padding-top: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--ink-soft); margin-bottom: 10px; }
.meta b { color: var(--ink); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag.gold { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.tag.silver { background: color-mix(in srgb, #8a8f98 22%, transparent); color: var(--ink-soft); }
.note { font-size: .9rem; color: var(--ink-soft); }
.callout { border-left: 4px solid var(--sakura); background: var(--surface); padding: 14px 18px; border-radius: 0 10px 10px 0; }

.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 32px; align-items: center; }
.feature img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }

/* ---------- PayPal forms (original buttons preserved) ---------- */
.paypal {
  margin-top: 14px; padding: 16px; border-radius: 12px; background: var(--surface-2);
  border: 1px dashed var(--line);
}
.paypal label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.paypal select, .paypal input[type=text] {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .92rem; margin-bottom: 10px;
}
.pp-yellow {
  background: #FFD140; color: #000; border: 0; border-radius: 6px; padding: 10px 24px;
  font: 700 .9rem "Helvetica Neue", Arial, sans-serif; cursor: pointer; min-width: 186px;
}
.pp-yellow:hover { filter: brightness(.96); }
.pp-small { font-size: .74rem; color: var(--ink-soft); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.pp-small img { height: 14px; display: inline; }
.pp-cards { height: 22px; margin-top: 8px; }
:root[data-theme="dark"] .pp-small img, :root[data-theme="dark"] .pp-cards { background: #fff; border-radius: 3px; padding: 1px 3px; }

/* ---------- Segmented tabs ---------- */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.seg [role="tab"] {
  padding: 9px 18px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-soft);
  font: inherit; font-weight: 600; font-size: .93rem; cursor: pointer;
}
.seg [role="tab"]:hover { color: var(--ink); }
.seg [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.tabpanel { animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tabpanel { animation: none; } }

/* ---------- Tiers ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.tier { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.tier .price { font-family: "Shippori Mincho", serif; font-size: 1.8rem; font-weight: 700; }
.tier .price small { font-size: .9rem; color: var(--ink-soft); font-weight: 400; }
.tier ul { padding-left: 18px; margin: 10px 0 0; font-size: .93rem; }
.tier.platinum { border-top: 4px solid #8d96a5; }
.tier.gold { border-top: 4px solid var(--gold); }
.tier.silver { border-top: 4px solid #b9bec6; }
.member-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.member-tiers div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.member-tiers b { display: block; font-family: "Shippori Mincho", serif; font-size: 1.35rem; }
.member-tiers span { font-size: .85rem; color: var(--ink-soft); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem;
}
.taxnote { font-size: .85rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 22px; }

/* ---------- Timeline (Sakura) ---------- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--sakura); display: grid; gap: 18px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--sakura); border: 3px solid var(--bg); }
.timeline .when { font-weight: 700; color: var(--accent); font-size: .9rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.gallery figcaption { font-size: .8rem; color: var(--ink-soft); margin-top: 6px; }

/* ---------- Archive ---------- */
.year-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.year-tabs button {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer;
}
.year-tabs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.archive-search { width: 100%; max-width: 360px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; margin-bottom: 14px; }
.archive { columns: 2 320px; column-gap: 28px; }
.archive section { break-inside: avoid; margin-bottom: 18px; }
.archive h3 { font-size: 1.1rem; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 2px; margin-bottom: 8px; }
.archive ul { list-style: none; padding: 0; margin: 0; }
.archive li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.archive li a { text-decoration: none; font-weight: 600; }
.archive li a:hover { text-decoration: underline; }
.archive li .d { color: var(--ink-soft); font-size: .83rem; margin-left: 4px; }
.archive li[hidden], .archive section[hidden] { display: none; }

/* ---------- People ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.person b { display: block; }
.person span { font-size: .88rem; color: var(--ink-soft); }

/* ---------- Supporters ---------- */
.logo-card { display: flex; gap: 14px; align-items: center; }
.logo-card img { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: #fff; padding: 4px; flex: none; border: 1px solid var(--line); }
.logo-card .links { font-size: .86rem; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sponsor-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.sponsor-row img { height: 110px; width: auto; background: #fff; border-radius: 12px; padding: 8px; border: 1px solid var(--line); }

.linklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.linklist li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.linklist li b { display: block; }
.linklist li p { margin: 2px 0 4px; font-size: .9rem; color: var(--ink-soft); }
.linklist a { font-size: .9rem; word-break: break-word; }

/* ---------- Memoriam ---------- */
.memorial { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.memorial .photos { display: grid; gap: 10px; }
.memorial .photos img { border-radius: 10px; }
.memorial .photos figcaption { font-size: .78rem; color: var(--ink-soft); }
.memorial .photos figure { margin: 0; }
.memorial .sig { font-style: italic; color: var(--ink-soft); }
details.more summary { cursor: pointer; color: var(--link); font-weight: 600; margin: 4px 0 10px; }
@media (max-width: 700px) { .memorial { grid-template-columns: 1fr; } .memorial .photos { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Embeds ---------- */
.embed { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ---------- Footer ---------- */
.footer { padding: 36px clamp(20px, 5vw, 72px); background: var(--surface); }
.social { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.social a img { width: 36px; height: 36px; border-radius: 8px; }
.footer small { color: var(--ink-soft); display: block; margin-top: 12px; }

/* ---------- Responsive ---------- */
/* keep content clear of the floating dot rail */
@media (min-width: 761px) {
  .panel:not(.hero) { padding-right: max(clamp(20px, 5vw, 72px), 84px); padding-left: max(clamp(20px, 5vw, 72px), 84px); }
}
/* Medium screens: tighten the top bar, hide the brand subtitle */
@media (max-width: 1280px) {
  .brand-text small { display: none; }
  .tabs a { padding: 8px 10px; }
  .tabs a.active::after { left: 10px; right: 10px; }
}
/* Tablets: logo + actions on the first row, tabs centered on a second row */
@media (max-width: 1080px) {
  :root { --topnav-h: 108px; }
  .topnav { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 56px auto; padding: 0 16px; row-gap: 0; }
  .tabs { grid-column: 1 / -1; grid-row: 2; justify-content: safe center; margin: 0 -16px; padding: 0 10px 8px; }
}
/* Phones: dot rail hides; the menu button opens the full section list as a drawer */
@media (max-width: 760px) {
  .rail { display: none; }
  .icon-btn { display: grid; }
  .sidebar { top: 0; right: 0; bottom: 0; border-radius: 0; border-width: 0 0 0 1px; width: min(300px, 86vw); }
  body.nav-open .scrim { background: rgba(0,0,0,.4); }
  .panel { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .tab-cta { display: none; }
}

/* Recent Highlights: always a balanced 3 × 2 grid (2 × 3 / 1 × 6 on smaller screens) */
.grid.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1180px) { .grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.six { grid-template-columns: 1fr; } }

/* Short windows: not enough height for the dot rail — use the menu button instead */
@media (max-height: 600px) and (min-width: 761px) {
  .rail { display: none; }
  .icon-btn { display: grid; }
}
