/* The live Square: small additions on top of the tour's styles (preview.css). */
.tabs-in--3 { grid-template-columns: repeat(3, 1fr); }
.wx-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.wx-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; }
.wx-chip b { font-family: var(--display); font-weight: 900; font-size: 18px; }
.source-link { color: var(--river); font-weight: 700; }
.empty-card { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.empty-card p { color: var(--muted); }
.form-note { font-size: 14px; color: var(--muted); }
.form-error { color: var(--brick); font-weight: 700; font-size: 15px; }
.field .err { color: var(--brick); font-weight: 700; font-size: 14px; margin-top: 4px; }
.field[data-invalid] input, .field[data-invalid] textarea { border-color: var(--brick); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.founding-mark { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--gold); border-radius: 999px; padding: 4px 10px; font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.welcome-number { font-family: var(--display); font-weight: 900; font-size: 54px; line-height: .9; color: var(--gold-deep); }
.contact-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; }
.contact-line a { color: var(--river); font-weight: 700; }

/* Seasonal lists (Halloween in October): a warm card on the week. */
:root { --season: #A9480C; --season-soft: #FDF1E6; --season-line: #F0D3B8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --season: #F2A766; --season-soft: #2A1D13; --season-line: #4A3322; } }
:root[data-theme="dark"] { --season: #F2A766; --season-soft: #2A1D13; --season-line: #4A3322; }
.blk-season { background: var(--season-soft); border: 1px solid var(--season-line); border-radius: 14px; padding: 16px 14px; scroll-margin-top: 88px; }
.blk-season .blk-head { flex-wrap: wrap; }
.blk-season .eyebrow, .blk-season .more { color: var(--season); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--river); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Runs (festivals, drives, light shows): a plain list of rows, no day column. */
.runs > .ev:first-child { border-top: 0; }
.runs .ev-time { color: var(--gold-deep); }
.blk > .sub-h, .view > .sub-h { margin-top: 4px; }

/* Phones: the time sits above the title so a title gets the full width (no more four-line titles). */
@media (max-width: 560px) {
  .dayblock { grid-template-columns: 52px 1fr; }
  .ev { grid-template-columns: 1fr; gap: 3px; padding: 13px 14px 14px; }
  .ev-time { font-size: 13.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--gold-deep); }
  .ev-title { font-size: 16.5px; }
  .blk-season { padding: 16px 10px 14px; }
  .blk-season > .blk-head, .blk-season > .sub-h, .blk-season > .fine { padding-inline: 4px; }
}
.blk-season .days { border-color: var(--season-line); }

/* Home layout. Phones: one column in reading order (official alerts first when there are any).
   Desktops: the week in a wide main column; notices, house rules and the email in a sidebar. */
.home-main, .home-side { display: contents; }
#view-home > .home-main > .keeper { order: 0; }
#view-home .blk-notices.alerting { order: 1; }
#view-home .blk-spotlight { order: 2; }
#view-home .blk-season { order: 3; }
#view-home .blk-notices { order: 4; }
#view-home .blk-garage { order: 5; }
#view-home .blk-weekend { order: 5; }
#view-home .blk-shops { order: 6; }
#view-home .house { order: 7; }
#view-home .signup { order: 8; }
#view-home .foot { order: 9; }
@media (min-width: 1100px) {
  .wrap { max-width: 1180px; }
  #view-home { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px 48px; align-items: start; }
  .home-main, .home-side { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
  /* not sticky: a pinned sidebar slid over the full-width rows at the foot of the week */
  #view-home .foot { grid-column: 1 / -1; }
  #view-home .home-side .signup { order: 5; }
  #view-calendar, #view-shops { max-width: 860px; width: 100%; margin-inline: auto; }
}

/* While the week loads: the page's outline, gently breathing, instead of a "Loading…" line. */
.skeleton { display: flex; flex-direction: column; gap: 12px; }
.sk-line, .sk-card { display: block; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.sk-line { height: 14px; }
.sk-short { width: 38%; height: 12px; margin-top: 10px; }
.sk-title { width: 62%; height: 28px; }
.sk-card { height: 148px; border-radius: 12px; }
.sk-tall { height: 260px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton > * { animation: sk-breathe 1.6s ease-in-out infinite; }
  @keyframes sk-breathe { 50% { opacity: .55; } }
}

/* Today and right now. */
.dayblock.is-today .day-side { background: var(--gold-soft); }
.dayblock.is-today .day-dow { color: var(--gold-deep); }
.now-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--label); font-weight: 800; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.now-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 50%, transparent); }
@media (prefers-reduced-motion: no-preference) { .now-pill::before { animation: now-pulse 1.8s ease-out infinite; } @keyframes now-pulse { 70% { box-shadow: 0 0 0 7px transparent; } } }
.btnrow .btn .ic { width: 18px; height: 18px; }

/* Don't miss: the keeper's picks. */
.blk-spotlight { gap: 10px; }
.blk-spotlight .eyebrow { color: var(--gold-deep); }
.spots { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.spot { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 18px 18px 16px; border-radius: 14px; background: var(--inverse-bg); color: var(--inverse-fg); border: 1px solid transparent; box-shadow: var(--shadow); width: 100%; }
.spot:hover { border-color: var(--gold); }
.spot-when { font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--inverse-accent); }
.spot-title { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 28px; line-height: .95; text-wrap: balance; }
.spot-where { font-size: 14.5px; opacity: .8; }
.spot-go { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--inverse-accent); }

/* Calendar search. */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; color: var(--muted); }
.search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); padding: 12px 0; outline: none; }
#calList { display: flex; flex-direction: column; gap: 12px; }

/* Shops before the first storefront. */
.shops-welcome { display: grid; gap: 20px; }
.sample { position: relative; display: grid; gap: 8px; background: var(--surface); border: 1px dashed var(--line); border-radius: 14px; padding: 18px; max-width: 420px; }
.sample-tag { position: absolute; top: 12px; right: 12px; font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 11.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.sample-head { display: flex; gap: 12px; align-items: center; }
.sample-head .mono { width: 52px; }
.sample-special { font-size: 14.5px; background: var(--gold-soft); border-radius: 8px; padding: 8px 10px; }
.sample .founding-mark { justify-self: start; }
@media (min-width: 820px) { .shops-welcome { grid-template-columns: 420px 1fr; align-items: start; } .shops-welcome > .btn { grid-column: 1 / -1; justify-self: start; } }

/* Weather on the calendar's days and in the strip. */
.wx-ic { width: 18px; height: 18px; flex: none; }
.wx-chip { align-items: center; }
.wx-chip .wx-ic { color: var(--gold-deep); }
.day-wx { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 8px; font-family: var(--label); font-weight: 800; font-size: 13px; letter-spacing: .02em; color: var(--muted); text-transform: none; }
.day-wx .wx-ic { color: var(--gold-deep); }

/* The home-screen card, and room for the iPhone status bar when opened as an app. */
.install { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.install-icon img { border-radius: 11px; display: block; }
.install-title { font-weight: 700; }
.install .fine .ic { vertical-align: -3px; }
.install-actions { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
#view-home .install { order: 8; }
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top, 0px); } }

/* Garage sales. */
.sale-map { height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
.sale-map .leaflet-popup-content { font-family: var(--body); font-size: 14px; line-height: 1.4; }
@media (min-width: 1100px) { .sale-map { height: 380px; } }

/* Photos of Elkhorn. */
.photo { margin: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); position: relative; }
.photo img { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 696; object-fit: cover; }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; padding: 28px 14px 10px; background: linear-gradient(transparent, rgba(8, 17, 26, .72)); color: #fff; font-size: 13px; }
.photo figcaption span { font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 14px; }
.photo figcaption a { color: rgba(255, 255, 255, .8); font-size: 11.5px; white-space: nowrap; }
#view-home > .photo { order: 9; }
#view-home .foot { order: 10; }
@media (min-width: 1100px) { #view-home > .photo { display: none; } .photo img { aspect-ratio: 1600 / 520; } } /* desktops show it in the masthead */

/* The holidays: evergreen instead of pumpkin. */
.blk-season--holidays { --season: #1D6A44; --season-soft: #EBF5EF; --season-line: #C5E1D1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .blk-season--holidays { --season: #7FCDA3; --season-soft: #11261A; --season-line: #284A36; } }
:root[data-theme="dark"] .blk-season--holidays { --season: #7FCDA3; --season-soft: #11261A; --season-line: #284A36; }

/* Desktops: Main Street fills the masthead's right side (the same CC0 photo credited at the foot of the week). */
@media (min-width: 1100px) {
  .town-elkhorn .masthead .wrap { position: relative; }
  .town-elkhorn .masthead .wrap::after { content: ""; position: absolute; top: 46px; right: 16px; width: min(560px, 46%); aspect-ratio: 16 / 9; border-radius: 18px; background: url("/assets/photos/main-street-1-1600.jpg") center 60% / cover no-repeat; box-shadow: var(--shadow); }
}

/* The Thursday email, offered mid-week on phones (desktops have it in the sidebar). */
.inline-signup { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 16px; border-radius: 14px; background: var(--inverse-bg); color: var(--inverse-fg); order: 4; }
.inline-signup p { font-size: 14.5px; }
.inline-signup-k { font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: 13px; color: var(--inverse-accent); margin-bottom: 2px; }
@media (min-width: 1100px) { #view-home .inline-signup { display: none; } }

/* Home order on phones, after the mid-week sign-up card joined. */
#view-home .blk-garage { order: 5; }
#view-home .inline-signup { order: 6; }
#view-home .blk-weekend { order: 7; }
#view-home .blk-shops { order: 8; }
#view-home .house { order: 9; }
#view-home .install { order: 10; }
#view-home .signup { order: 11; }
#view-home > .photo { order: 12; }
#view-home .foot { order: 13; }

/* Event sheet: a band in the section's color with a date tile. */
.ev-hero { --cat: var(--c-community); display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--cat) 14%, var(--surface)); border-left: 5px solid var(--cat); margin-bottom: 4px; }
.cat-family { --cat: var(--c-family); } .cat-school { --cat: var(--c-school); } .cat-faith { --cat: var(--c-faith); } .cat-classes { --cat: var(--c-classes); } .cat-shops { --cat: var(--c-shops); } .cat-garage { --cat: var(--c-garage); } .cat-community { --cat: var(--c-community); }
.ev-tile { display: flex; flex-direction: column; align-items: center; min-width: 56px; padding: 6px 8px; border-radius: 10px; background: var(--surface); font-family: var(--display); text-transform: uppercase; line-height: 1; box-shadow: 0 1px 0 var(--line); }
.ev-tile span { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.ev-tile b { font-size: 30px; font-weight: 900; margin: 2px 0; }
.ev-cat { font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 13.5px; }
.ev-cat .dot { margin-right: 6px; }

/* Calendar quick jumps. */
.jumps { display: flex; gap: 8px; flex-wrap: wrap; }
.jump { font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.jump:hover { border-color: var(--gold); }

/* A soft fade when switching tabs. */
@media (prefers-reduced-motion: no-preference) {
  .view.fade-in { animation: view-in .28s ease-out; }
  @keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
}
.btnrow a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* Since 1867: the town's first photograph, near the foot of the week. */
.heritage { margin: 0; display: grid; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.heritage img { width: 100%; height: auto; border-radius: 10px; filter: sepia(.25) contrast(1.05); }
.heritage-k { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: 26px; line-height: 1; margin-bottom: 6px; }
.heritage figcaption p:not(.heritage-k) { font-size: 15px; color: var(--muted); }
.heritage figcaption a { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); }
#view-home > .heritage { order: 13; }
#view-home .foot { order: 14; }
@media (min-width: 760px) { .heritage { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
@media (min-width: 1100px) { #view-home > .heritage { grid-column: 1 / -1; } }

/* Keyboard: links get the same clear focus ring as buttons, and a skip link appears on Tab. */
a:focus-visible { outline: 3px solid var(--river); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: var(--ground); padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
#main:focus { outline: none; }

/* Subscribe to the calendar. */
.subscribe { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.subscribe:hover { border-color: var(--gold); }
.subscribe .ic { color: var(--gold-deep); margin-top: 2px; }
.subscribe b { display: block; }
.subscribe span span { font-size: 14px; color: var(--muted); }

/* Know <town>: the town's own facts, places and traditions, edged in its school colors (lib/character.js). */
.know { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 18px 18px; display: grid; gap: 12px; }
.know::before { content: ''; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--town, var(--gold)) 0 60%, var(--town-2, var(--gold-deep)) 60%); }
.know-mascot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 800; }
.know-swatch { width: 22px; height: 22px; border-radius: 50%; flex: none; background: conic-gradient(var(--town, var(--gold)) 0 50%, var(--town-2, var(--gold-deep)) 50%); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.know-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 0; }
.know-facts div { background: var(--paper); border-radius: 10px; padding: 10px 12px; }
.know-facts dt { font-family: var(--label); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.know-facts dd { margin: 2px 0 0; font-weight: 700; }
.know-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.know-list b { display: block; }
.know .sub-h { margin: 4px 0 0; }
.heritage--text { grid-template-columns: 1fr !important; }
#view-home .know { order: 10; }

/* Around <town>: OpenStreetMap places near the Square. */
.around-map { height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); z-index: 0; }
.map-credit { font-size: 12px; color: var(--muted); margin-top: 6px; }
.around-groups { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.around-group p { font-size: 15px; color: var(--ink-2, var(--muted)); line-height: 1.5; }
.around-group .sub-h { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.around-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--surface); }
#view-home .blk-around { order: 8; }
@media (min-width: 1100px) { #view-home .blk-around { grid-column: 1; } }

/* <Town> through the years: a few dated moments under the old photo. */
.timeline-blk { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 18px; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0 0 0 4px; display: grid; gap: 14px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding-left: 22px; align-items: baseline; }
.timeline li::before { content: ''; position: absolute; left: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--surface); }
.tl-y { font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1; }
.tl-t { font-size: 15px; color: var(--ink-2, var(--muted)); }
#view-home > .timeline-blk { order: 13; }
@media (min-width: 1100px) { #view-home > .timeline-blk { grid-column: 1 / -1; } .timeline { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } .timeline::before { display: none; } }
.know-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.know-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
