:root {
  --surface: #FFFFFF;
  --soft: #F6F4EE;
  --ink: #1D1D1D;
  --muted: #55524A;
  --line: #E4DFD2;
  --accent: #BEB08C;
  --accent-ink: #6B5E36;
  --action: #050D30;
  --radius: 14px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-size: 17px; line-height: 1.6; background: var(--surface); padding-bottom: 76px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--action); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s3); }
h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 23px; font-weight: 600; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0 0 var(--s3); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--s4); }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--action); color: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; }

/* Header */
.top { background: var(--action); color: #fff; position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: var(--s4); }
.brand { display: flex; align-items: center; gap: var(--s3); color: #fff; text-decoration: none; }
.brand strong { display: block; font-size: 18px; line-height: 1.1; }
.brand small { display: block; font-size: 12px; color: #D9D2BC; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--action); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.nav-desk { display: none; gap: var(--s1); }
.nav-desk a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.nav-desk a svg { width: 18px; height: 18px; }
.nav-desk a:hover { background: rgba(255,255,255,.1); }
.nav-desk a[aria-current] { background: var(--accent); color: var(--action); font-weight: 600; }

/* Bottom tab bar (phone) */
.nav-tab { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav-tab a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: 11px; color: var(--muted); text-decoration: none; min-height: 56px; }
.nav-tab svg { width: 24px; height: 24px; }
.nav-tab a[aria-current] { color: var(--action); font-weight: 600; }
.nav-tab a[aria-current] svg { stroke: var(--action); stroke-width: 2.2; }
@media (min-width: 860px) {
  .nav-desk { display: flex; }
  .nav-tab { display: none; }
  body { padding-bottom: 0; }
}

main { padding-top: var(--s6); padding-bottom: var(--s7); min-height: 60vh; }
.hero { padding: var(--s4) 0 var(--s5); max-width: 40rem; }
.hero p:last-child, .page-head p { color: var(--muted); font-size: 18px; max-width: 65ch; }
.page-head { margin-bottom: var(--s5); }
.kicker { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: var(--s1); }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s7); }
.tile { display: flex; flex-direction: column; gap: 2px; padding: var(--s4); border-radius: var(--radius); background: var(--soft); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 132px; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(5,13,48,.08); }
.tile svg { width: 30px; height: 30px; stroke: var(--action); margin-bottom: var(--s2); }
.tile strong { font-size: 19px; }
.tile span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.tile em { font-style: normal; font-size: 13px; color: var(--accent-ink); font-weight: 600; margin-top: auto; padding-top: var(--s2); }
.tile:last-child { grid-column: 1 / -1; background: var(--action); color: #fff; border-color: var(--action); }
.tile:last-child svg { stroke: var(--accent); }
.tile:last-child span { color: #D9D2BC; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(5, 1fr); } .tile:last-child { grid-column: auto; } }

/* Groups and lists */
.group { margin-bottom: var(--s7); }
.group-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.group-head a { font-weight: 600; font-size: 15px; }
.list { display: grid; gap: var(--s3); }
.grid { grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { display: flex; gap: var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.card.home { flex-direction: column; padding: 0; overflow: hidden; }
.card.home .card-body { padding: var(--s4); }
.card-body { min-width: 0; flex: 1; }
.card-body > p:not(.kicker):not(.meta):not(.links) { font-size: 16px; }
.meta { color: var(--muted); font-size: 15px; margin-bottom: var(--s1); }
.price { font-size: 22px; font-weight: 700; color: var(--action); margin-bottom: var(--s1); }
.links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s3) 0 0; font-size: 15px; font-weight: 600; }
.links a { text-decoration: none; padding: 4px 0; }
.links a:hover { text-decoration: underline; }
.date-badge { flex: 0 0 58px; height: 64px; border-radius: 12px; background: var(--action); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.date-badge span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #D9D2BC; }
.date-badge strong { font-size: 24px; }
.date-badge[data-tba] { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.date-badge[data-tba] span { color: var(--muted); font-weight: 600; }

/* Schools */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: var(--s3) 0 var(--s2); }
.stats div { background: var(--soft); border-radius: 10px; padding: var(--s2) var(--s3); }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-weight: 600; font-size: 15px; }
.mini-events { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s3); }
.mini-events ul, .date-list { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.mini-events li { margin-bottom: var(--s1); }
.date-list li { display: flex; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.date-list strong { flex: 0 0 110px; }
.note { background: var(--soft); border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; padding: var(--s4); margin-bottom: var(--s6); max-width: 65ch; }

/* Filters */
.filters { position: sticky; top: 60px; z-index: 10; background: var(--surface); padding: var(--s3) 0; margin-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.search input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid #8F8770; border-radius: 12px; background: #fff; color: var(--ink); }
.chips { display: flex; gap: var(--s2); overflow-x: auto; padding: var(--s3) 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; font: inherit; font-size: 14px; padding: 8px 14px; min-height: 40px; border-radius: 999px; border: 1px solid #8F8770; background: #fff; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--action); font-weight: 600; }
.empty { padding: var(--s5); background: var(--soft); border-radius: var(--radius); color: var(--muted); text-align: center; }
[hidden] { display: none !important; }

/* CTA + buttons */
.btn { display: inline-block; font: inherit; font-weight: 600; font-size: 17px; background: var(--action); color: #fff; border: 0; border-radius: 12px; padding: 14px 22px; min-height: 50px; text-decoration: none; cursor: pointer; }
.btn:hover { background: #0B1A55; }
.btn-light { background: var(--accent); color: var(--action); }
.btn-light:hover { background: #CFC3A2; }
.cta { background: var(--action); color: #fff; border-radius: var(--radius); padding: var(--s6) var(--s5); margin: var(--s6) 0; }
.cta p { color: #D9D2BC; max-width: 55ch; }

/* Form */
.form-card { background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); max-width: 640px; scroll-margin-top: 80px; }
.form-card > p { color: var(--muted); }
form label { display: block; font-weight: 500; font-size: 15px; margin-bottom: var(--s4); }
form input:not([type=checkbox]), form select, form textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid #8F8770; border-radius: 10px; background: #fff; color: var(--ink); }
form .check { display: flex; gap: var(--s2); align-items: flex-start; font-weight: 400; color: var(--muted); }
form .check input { width: 20px; height: 20px; margin-top: 3px; flex: 0 0 auto; }
.opt { font-weight: 400; color: var(--muted); }
.hp { position: absolute; left: -9999px; }
.form-msg { font-weight: 600; margin-top: var(--s3); }
.form-msg[data-ok] { color: #1E6B3A; }
.form-msg[data-err] { color: #A12A1E; }
.fine { font-size: 13px; color: var(--muted); }
.prose { max-width: 65ch; }
.prose h2 { font-size: 20px; margin-top: var(--s5); }

/* Footer */
.foot { background: var(--soft); border-top: 1px solid var(--line); padding: var(--s6) 0; font-size: 15px; color: var(--muted); }
.foot img { margin-bottom: var(--s4); }
.foot p { max-width: 70ch; }
.foot .fine { font-size: 13px; }

.top :focus-visible, .cta :focus-visible, .nav-desk :focus-visible { outline-color: var(--accent); }

/* ---------- Photo layouts (v2) ---------- */
.photo { position: relative; aspect-ratio: 3 / 2; background: linear-gradient(135deg, var(--soft), #E9E3D3); overflow: hidden; }
.photo.short { aspect-ratio: 16 / 7; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; left: 10px; background: rgba(5,13,48,.88); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .03em; padding: 5px 10px; border-radius: 999px; }
.date-chip { position: absolute; top: 10px; left: 10px; background: #fff; color: var(--action); border-radius: 12px; min-width: 52px; padding: 6px 8px; text-align: center; line-height: 1.05; box-shadow: 0 2px 10px rgba(5,13,48,.18); }
.date-chip small { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
.date-chip strong { display: block; font-size: 22px; }
.date-chip[data-tba] strong { font-size: 15px; }

/* Tappable photo cards */
.tile-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.tile-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(5,13,48,.12); }
.tile-body { padding: var(--s3) var(--s4) var(--s4); }
.tile-body h3 { font-size: 18px; margin-bottom: var(--s1); }
.tile-body .meta { font-size: 14px; margin: 0; }
.excerpt { font-size: 15px; color: var(--muted); margin: var(--s2) 0 0; }
.why { color: var(--accent-ink); font-weight: 500; font-size: 15px; margin: 0; }
.why.big { font-size: 18px; margin-bottom: var(--s4); }

/* Horizontal swipe rows on the home page */
.week { margin-bottom: var(--s6); }
.week h1 { font-size: clamp(28px, 6vw, 40px); margin-bottom: var(--s1); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding: var(--s2) var(--s4) var(--s3); margin: 0 calc(var(--s4) * -1); scrollbar-width: thin; }
.rail > * { scroll-snap-align: start; }
.rail-trend { grid-auto-columns: 66%; }
@media (min-width: 680px) { .rail { grid-auto-columns: 40%; } .rail-trend { grid-auto-columns: 30%; } }
@media (min-width: 980px) { .rail { grid-auto-columns: calc(25% - 9px); margin: 0; padding: var(--s2) 0 var(--s3); } .rail-trend { grid-auto-columns: calc(25% - 9px); } }

/* Explore tiles */
.photo-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.photo-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; background: var(--action); color: #fff; text-decoration: none; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.photo-tile:hover img { transform: scale(1.04); }
.photo-tile span { position: absolute; inset: auto 0 0 0; padding: var(--s5) var(--s3) var(--s3); background: linear-gradient(transparent, rgba(5,13,48,.92)); }
.photo-tile strong { display: block; font-size: 19px; }
.photo-tile small { display: block; font-size: 13px; color: #E6E0CC; line-height: 1.35; }
.photo-tile:last-child { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
@media (min-width: 720px) { .photo-tiles { grid-template-columns: repeat(5, 1fr); } .photo-tile, .photo-tile:last-child { grid-column: auto; aspect-ratio: 3 / 4; } }

/* Page banners */
.banner { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: var(--s5); min-height: 220px; background: var(--action); display: flex; align-items: flex-end; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-text { position: relative; padding: var(--s6) var(--s4) var(--s4); width: 100%; background: linear-gradient(transparent, rgba(5,13,48,.55) 25%, rgba(5,13,48,.92)); color: #fff; }
.banner-text h1 { color: #fff; margin-bottom: var(--s2); }
.banner-text p { color: #F1ECDD; max-width: 60ch; margin: 0; font-size: 16px; }
@media (min-width: 720px) { .banner { min-height: 300px; } .banner-text { padding: var(--s7) var(--s6) var(--s5); } }
main:has(> .banner:first-child), main:has(> .week:first-child) { padding-top: var(--s4); }

/* Photo on place, school and home cards */
.card.has-photo { flex-direction: column; padding: 0; overflow: hidden; gap: 0; }
.card.has-photo .card-body { padding: var(--s4); }
.card.has-photo .photo:empty { display: none; }

/* School score colors (the state Dashboard's own scale) */
.lvl { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; border: 1px solid rgba(0,0,0,.25); }
.lvl-blue { background: #1F5FAD; } .lvl-green { background: #2E8B57; } .lvl-yellow { background: #E7C547; } .lvl-orange { background: #E8892B; } .lvl-red { background: #C0392B; }

/* Detail pages */
.back { margin-bottom: var(--s3); font-weight: 600; font-size: 15px; }
.back a { text-decoration: none; }
.detail { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--s7); background: #fff; }
.detail-photo { position: relative; aspect-ratio: 16 / 9; background: var(--soft); }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.detail-photo .date-chip { top: 14px; left: 14px; transform: scale(1.15); transform-origin: top left; }
.detail-body { padding: var(--s5) var(--s4); max-width: 720px; }
@media (min-width: 720px) { .detail-photo { aspect-ratio: 21 / 9; } .detail-body { padding: var(--s6); } }
.detail h1 { font-size: clamp(26px, 5vw, 38px); }
.lead { font-size: 18px; max-width: 62ch; }
.facts { list-style: none; padding: 0; margin: 0 0 var(--s4); border-top: 1px solid var(--line); }
.facts li { display: grid; grid-template-columns: 90px 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.facts strong { color: var(--accent-ink); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s5) 0 var(--s4); }
.btn-ghost { background: #fff; color: var(--action); border: 1.5px solid var(--action); }
.btn-ghost:hover { background: var(--soft); }
@media (max-width: 520px) { .actions .btn { flex: 1 1 100%; text-align: center; } }

/* CTA with photo */
.cta-photo { position: relative; overflow: hidden; padding: 0; }
.cta-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cta-photo .cta-text { position: relative; padding: var(--s6) var(--s5); background: linear-gradient(90deg, rgba(5,13,48,.95), rgba(5,13,48,.75) 60%, rgba(5,13,48,.4)); }
.credits { font-size: 15px; color: var(--muted); padding-left: var(--s5); }
.card.has-photo .photo { aspect-ratio: 16 / 9; }
.card.has-photo .photo.short { aspect-ratio: 16 / 7; }
.group-head { align-items: flex-start; }
.group-head > a { white-space: nowrap; padding-top: 6px; }
.week .group-head > a { padding-top: 26px; }

.photo-tile span { background: linear-gradient(transparent, rgba(5,13,48,.75) 35%, rgba(5,13,48,.95)); }
.photo-tile strong, .photo-tile small, .banner-text h1 { text-shadow: 0 1px 3px rgba(0,0,0,.45); }
@media (max-width: 719px) { .cta-photo .cta-text { background: rgba(5,13,48,.88); } }
.date-chip strong { white-space: nowrap; }

/* Weekly email signup */
.signup { display: grid; gap: var(--s4); background: var(--action); color: #fff; border-radius: var(--radius); padding: var(--s5) var(--s4); margin: var(--s6) 0; }
.signup h2 { color: #fff; font-size: 24px; }
.signup .kicker { color: var(--accent); }
.signup-text p:last-child { color: #E6E0CC; margin: 0; max-width: 52ch; }
.signup-form { display: grid; gap: var(--s2); align-content: start; }
.signup-form label { margin: 0; }
.signup-form input:not([type=checkbox]) { margin-top: 0; border-color: transparent; }
.signup-form .btn { width: 100%; }
.signup-form .fine { color: #CFC8B2; margin: var(--s1) 0 0; }
.signup-form .fine a { color: #fff; }
.signup .form-msg[data-ok] { color: #B8F0C8; }
.signup .form-msg[data-err] { color: #FFD2C8; }
.signup .form-msg:empty { display: none; }
@media (min-width: 820px) { .signup { grid-template-columns: 1.1fr 1fr; padding: var(--s6); align-items: center; } }

/* Community hub */
.hub { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin-bottom: var(--s6); }
.hub .hub-tile, .hub .hub-tile:last-child { aspect-ratio: 16 / 8; grid-column: auto; }
.hub-tile strong { font-size: 22px; }
@media (min-width: 720px) { .hub { grid-template-columns: 1fr 1fr; } .hub .hub-tile, .hub .hub-tile:last-child { aspect-ratio: 16 / 9; } }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s2) 0; }
.pill { font-size: 13px; background: var(--soft); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 3px 10px; }
.when { font-weight: 600; color: var(--action); font-size: 15px; }
.chips + .chips { padding-top: var(--s2); }

.chip-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: var(--s3) 0 0; }
.chip-label + .chips { padding-top: var(--s1); }
.linkish { font: inherit; font-weight: 600; color: var(--action); background: none; border: 0; text-decoration: underline; cursor: pointer; padding: 4px; }
@media (max-width: 360px) { .nav-tab a { font-size: 10px; } }
