/* The Marblehead Independent — Festival Companion
   Georgia ALWAYS. Independent Red #C2261D · Harbor Black #1E1F21 ·
   Shell White #FDF9F4 · Slate Blue #375E97 */

:root {
  --red: #C2261D;
  --black: #1E1F21;
  --shell: #FDF9F4;
  --blue: #375E97;
  --green: #2f6b3a;
  --line: #e4ddd2;
  --muted: #6b6258;
  --font: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--shell);
  color: var(--black);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  /* reserve space for the sticky support banner so it never covers content */
  padding-bottom: var(--sticky-h, 0px);
}
button, input, select { font-family: var(--font); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header / nameplate ---- */
.site {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 18px 10px;
  text-align: center;
}
.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.masthead-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.masthead-link:hover { text-decoration: none; }
.nameplate {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
  white-space: nowrap;
  font-weight: 700;
  font-size: clamp(1.05rem, 5.5vw, 1.7rem);
}
.np-the { color: var(--black); letter-spacing: .1px; }
.np-ind { color: var(--red); text-transform: uppercase; letter-spacing: .02em; }
.np-logo {
  height: clamp(150px, 34vw, 230px);
  width: auto;
  display: block;
}
h1 {
  font-size: clamp(26px, 6vw, 40px);
  margin: 4px 0 8px;
  color: var(--black);
}
.lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

/* ---- Now & Next ---- */
.nowbox {
  max-width: 920px;
  margin: 18px auto;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 4px;
}
.nowbox strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  color: var(--red);
  margin: 8px 0 4px;
}
.nowbox strong:first-child { margin-top: 0; }
.nowbox em { color: var(--muted); }
.nowbox .mini {
  display: block;
  padding: 4px 0;
  color: var(--black);
  border-bottom: 1px dotted var(--line);
}
.nowbox .mini span { color: var(--muted); font-style: italic; }

/* ---- About / orientation panel ---- */
.about {
  max-width: 920px;
  margin: 0 auto 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.about > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 18px;
  font-weight: bold;
  color: var(--blue);
  font-size: 15px;
  text-align: center;
}
.about > summary::-webkit-details-marker { display: none; }
.about > summary::after { content: " ▾"; color: var(--muted); }
.about[open] > summary::after { content: " ▴"; }
.about > summary:hover { color: var(--red); }
.about-body { padding: 0 18px 16px; }
.about-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; }
.about-body p:last-child { margin-bottom: 0; }
.about-list {
  margin: 4px 0 0;
  padding-left: 22px;
}
.about-list li { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.about-list li:last-child { margin-bottom: 0; }

/* ---- "What changed" banner (editorial trust layer) ---- */
.changed {
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 4px;
}
.changed strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  color: var(--blue);
  margin-bottom: 6px;
}
.changed .chg { margin: 4px 0; font-size: 14px; }
.changed .chg-date {
  display: inline-block;
  min-width: 96px;
  color: var(--muted);
  font-style: italic;
}

/* ---- Countdown clock ---- */
.countdown {
  display: flex;
  gap: 10px;
  margin: 8px 0 6px;
}
.cd-unit {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--shell);
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 5px;
  padding: 10px 4px 7px;
}
.cd-num {
  font-size: clamp(28px, 9vw, 44px);
  font-weight: bold;
  color: var(--blue);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cd-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-top: 6px;
}
.nowbox .cd-head { text-align: center; }

/* ---- Controls ---- */
.controls {
  max-width: 920px;
  margin: 0 auto;
  padding: 4px 18px 0;
  text-align: center;
}

/* Primary view switch — a centered segmented control */
.viewbar {
  display: inline-flex;
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(30, 31, 33, .05);
}
.viewbtn {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--blue);
  padding: 11px 18px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .6px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.viewbtn:last-child { border-right: 0; }
.viewbtn:hover { background: var(--shell); color: var(--blue); }
.viewbtn.on { background: var(--blue); color: #fff; }

/* Search — a centered, comfortably sized box */
#search {
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  font-size: 16px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
}
#search::placeholder { color: var(--muted); font-style: italic; }

/* Build-your-festival helper line */
.filter-help {
  max-width: 560px;
  margin: 0 auto 16px;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.45;
}
.filter-help strong { color: var(--black); font-style: normal; }

/* Filter rows — a step label above a centered row of chips */
.filter-group { margin-bottom: 16px; }
.filter-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: bold;
  color: var(--blue);
  margin-bottom: 9px;
}
.filter-label .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0;
  vertical-align: middle;
}
.bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--black);
  padding: 8px 15px;
  font-size: 13px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.chip:hover { border-color: var(--red); color: var(--red); }
.chip.on {
  background: var(--black);
  color: var(--shell);
  border-color: var(--black);
}
/* Comfortable touch targets (≥44px tall) for mobile + accessibility */
.chip { min-height: 44px; }
.viewbtn { min-height: 44px; }

/* Visible focus for keyboard users */
#search:focus-visible,
.chip:focus-visible,
.viewbtn:focus-visible,
.star:focus-visible,
.about > summary:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---- Count ---- */
.count {
  max-width: 920px;
  margin: 10px auto 0;
  padding: 0 18px;
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
  text-align: center;
}

/* ---- Official-info disclaimer (understated, not alarmist) ---- */
.disclaimer {
  max-width: 720px;
  margin: 4px auto 0;
  padding: 8px 18px 0;
  color: var(--muted);
  font-size: 12.5px;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}
.site-foot .disclaimer-foot {
  padding: 0;
  margin: 0 auto 14px;
}

/* ---- List ---- */
.list {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 18px 40px;
}
.dayhdr {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--shell);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--red);
  border-bottom: 2px solid var(--black);
  padding: 10px 0 6px;
  margin: 22px 0 12px;
}
.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 18px 52px 18px 16px;
  margin-bottom: 18px;
}
.card .when {
  font-size: 12px;
  color: var(--red);
  font-weight: bold;
  letter-spacing: .3px;
}
.card h3 { margin: 4px 0 8px; font-size: 18px; line-height: 1.25; }
.card h3 a { color: var(--black); }
.card h3 a:hover { color: var(--red); }
.card .desc {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.5;
  color: #3c3a36;
}
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.meta span {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 7px;
  color: var(--muted);
}
.card .when .addr {
  font-weight: normal;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0;
}
.card .when-sep { color: var(--line); margin: 0 4px; font-weight: normal; }
.meta .tag { background: var(--shell); color: var(--black); font-weight: bold; }
.meta .free { color: var(--green); border-color: #cfe3d3; }
.meta .paid { color: var(--red); border-color: #eccac7; }
.meta .kids { color: var(--blue); border-color: #cdd8ea; }

.star {
  position: absolute;
  top: 7px; right: 7px;
  width: 44px; height: 44px;          /* full 44px touch target */
  display: flex; align-items: center; justify-content: center;
  border: none; background: none;
  font-size: 22px; line-height: 1;
  color: var(--red);
  cursor: pointer;
}
.empty { text-align: center; color: var(--muted); font-style: italic; padding: 40px 0; }

/* category accent stripe */
.card.catart { border-left: 4px solid var(--red); }
.card.catliterary { border-left: 4px solid var(--blue); }
.card.catmusic { border-left: 4px solid #8a5a00; }
.card.catfilm { border-left: 4px solid #5a3d8a; }
.card.catkidsfamily { border-left: 4px solid var(--green); }
.card.catactive { border-left: 4px solid var(--black); }
.card.catmarketplaceevents { border-left: 4px solid #b07a00; }
.card.catother { border-left: 4px solid var(--line); }

/* ---- Footer ---- */
.site-foot {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 18px 50px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.site-foot .support { margin-bottom: 20px; }
.support-card {
  max-width: 460px;
  margin: 0 auto;
  padding: 22px 24px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(30, 31, 33, .07);
  text-align: center;
}
.support-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: bold;
  color: var(--red);
}
.support-lead {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--black);
}
.support-meter {
  height: 8px;
  background: var(--line);
  border-radius: 5px;
  overflow: hidden;
  margin: 0 0 7px;
}
.support-meter > span {
  display: block;
  height: 100%;
  background: var(--blue);
  border-radius: 5px;
}
.support-count {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted);
}
.support-count strong { color: var(--blue); }
.support-btn {
  display: inline-block;
  padding: 12px 26px;
  background: var(--red);
  color: #fff;
  border-radius: 24px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: 13px;
}
.support-btn:hover { background: #a81e16; text-decoration: none; }
.support-btn:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.support-news { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.support-news a { color: var(--blue); }

/* ---- Sticky support banner (after first save; dismissible) ---- */
.sticky-support {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 -2px 12px rgba(30, 31, 33, .22);
  transform: translateY(100%);
  transition: transform .22s ease;
}
.sticky-support.in { transform: none; }
.sticky-link {
  flex: 1;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.45;
}
.sticky-link:hover { text-decoration: underline; }
.sticky-link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sticky-arrow { font-weight: bold; white-space: nowrap; }
.sticky-close {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.sticky-close:hover { background: rgba(255, 255, 255, .32); }
.sticky-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.site-foot .copyright {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.site-foot .updated { margin-top: 6px; font-size: 12px; color: var(--muted); }

@media (max-width: 520px) {
  .card h3 { font-size: 16px; }
  .viewbar { display: flex; width: 100%; }
  .viewbtn { flex: 1 1 0; padding: 11px 8px; }
  #search { text-align: left; }
}

/* ---- Back-to-top button ---- */
.to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--sticky-h, 0px));
  z-index: 1000;
  min-width: 44px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--blue);
  border-radius: 24px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 2px 7px rgba(30, 31, 33, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: #2c4d7e; border-color: #2c4d7e; }
.to-top:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

/* ---- Map view ---- */
#mapwrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 18px 40px;
}
#map {
  height: 60vh;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.mapnote {
  margin: 8px 2px 0;
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}
/* Brand the Leaflet popup to match the cards (Georgia, Shell White). */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--shell);
  color: var(--black);
  border: 1px solid var(--line);
  font-family: var(--font);
}
.leaflet-container { font-family: var(--font); }
.pop strong { display: block; color: var(--red); font-size: 15px; }
.pop-count { color: var(--muted); font-size: 12px; font-style: italic; margin-bottom: 6px; }
.pop a {
  display: block;
  color: var(--blue);
  margin-top: 6px;
  border-top: 1px dotted var(--line);
  padding-top: 6px;
}
.pop a:first-of-type { border-top: none; }
.pop-when { display: block; color: var(--muted); font-size: 12px; font-style: italic; }
.mfoa-pin { background: none; border: none; }
