/* ==========================================================================
   Public site styles.

   Every colour resolves through the custom properties written into the page
   by the layout, which come from the banner row. Nothing here names a brand,
   so a new banner needs no CSS.
   ========================================================================== */

:root {
  /* Fallbacks only. The layout overrides these per banner. */
  --brand: #1f7a3f;
  --brand-dark: #155c2e;
  --accent: #d4761a;
  --ink: #1a1a1a;
  --paper: #ffffff;

  --muted: #5f6b66;
  --line: #e2e6e4;
  --surface: #f6f8f7;

  --wrap: 1180px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: 10px;
  --shadow: 0 1px 3px rgb(0 0 0 / 8%), 0 8px 24px rgb(0 0 0 / 6%);

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-dark); }
a:hover { color: var(--brand); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 200;
}
.skip-link:focus { left: 0; }

.preview-bar {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* --------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { max-height: 52px; width: auto; }
.brand-text {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.nav-toggle {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.site-nav { display: none; }
.site-nav.is-open { display: block; }

.nav-list { list-style: none; margin: 0; padding: 0; }

.nav-item > a {
  display: block;
  padding: 0.85rem 0;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.nav-item > a:hover,
.nav-item > a[aria-current="page"] { color: var(--brand); }

.nav-sub { list-style: none; margin: 0; padding: 0 0 .5rem 1rem; }
.nav-sub a {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav-sub a:hover { color: var(--brand); }

/* Mobile: the nav drops below the header as a full-width panel. */
@media (max-width: 899px) {
  .site-nav.is-open {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 0 var(--gutter) 1rem;
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
  }
  .header-inner { position: relative; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; }

  .nav-list { display: flex; align-items: center; gap: 0.35rem; }

  .nav-item { position: relative; }
  .nav-item > a {
    padding: 0.6rem 0.9rem;
    border-bottom: 0;
    border-radius: 6px;
    font-size: 0.98rem;
  }
  .nav-item > a:hover { background: var(--surface); }
  .nav-item > a[aria-current="page"] {
    color: var(--brand);
    background: var(--surface);
  }

  /* Dropdown. Kept on hover *and* focus-within so it is keyboard reachable. */
  .nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.4rem;
  }
  .has-children:hover > .nav-sub,
  .has-children:focus-within > .nav-sub { display: block; }

  .nav-sub a { padding: 0.55rem 0.75rem; border-radius: 6px; }
  .nav-sub a:hover { background: var(--surface); }
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(280px, 42vw, 460px);
  background-color: var(--brand-dark);
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  color: #fff;
  isolation: isolate;
}
.hero-tall { min-height: clamp(360px, 58vw, 640px); }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgb(0 0 0 / 62%) 0%,
    rgb(0 0 0 / 38%) 55%,
    rgb(0 0 0 / 18%) 100%
  );
  z-index: -1;
}

.hero-content { padding-block: clamp(2.5rem, 7vw, 5rem); max-width: 46rem; }

.hero-heading {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 0.6rem;
  text-shadow: 0 2px 12px rgb(0 0 0 / 35%);
}

.hero-sub {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  margin: 0 0 1.6rem;
  max-width: 38rem;
  text-shadow: 0 1px 8px rgb(0 0 0 / 35%);
}

/* ---------------------------------------------------------------- pages -- */

.page-head { padding-block: clamp(2rem, 5vw, 3.5rem) 0; }
.page-head h1 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  line-height: 1.15;
  margin: 0;
  color: var(--brand-dark);
}

.page-body {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

@media (min-width: 900px) {
  .page-body:has(.contact-card) {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
  .page-body.is-full { max-width: none; }
}

/* Typography for editor-produced content. */
.prose { max-width: 72ch; }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  margin: 2.2rem 0 0.8rem;
  color: var(--brand-dark);
}
.prose h3 {
  font-size: clamp(1.2rem, 2.4vw, 1.4rem);
  margin: 1.8rem 0 0.6rem;
}
.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: 0.4rem; }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; }
.prose blockquote {
  margin: 1.75rem 0;
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-left: 4px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.prose th, .prose td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
}
.prose th { background: var(--surface); font-weight: 600; }

/* Wide content must scroll inside itself, never widen the page. */
.prose table, .prose pre { display: block; max-width: 100%; overflow-x: auto; }

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.contact-card h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.contact-card address { font-style: normal; color: var(--muted); }

.child-pages { border-top: 1px solid var(--line); padding-top: 1.75rem; }
.child-pages h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
.child-pages ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.child-pages a {
  display: block;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}
.child-pages a:hover { border-color: var(--brand); }

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.07); color: #fff; }

/* --------------------------------------------------------------- footer -- */

.site-footer {
  margin-top: clamp(3rem, 8vw, 6rem);
  background: var(--brand-dark);
  color: #fff;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }

.footer-grid {
  display: grid;
  gap: 2rem;
  padding-block: clamp(2.5rem, 6vw, 4rem);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
}

.footer-logo { max-height: 56px; width: auto; }
.footer-name { font-family: var(--font-head); font-size: 1.4rem; font-weight: 700; }
.footer-tagline { margin: 0.75rem 0 0; opacity: 0.85; max-width: 32ch; }

.footer-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.75;
  margin: 0 0 0.75rem;
}
.site-footer address { font-style: normal; line-height: 1.8; }

.social-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.1rem 0 0;
  padding: 0;
}

.footer-bottom {
  border-top: 1px solid rgb(255 255 255 / 18%);
  padding-block: 1.25rem 2rem;
  font-size: 0.88rem;
  opacity: 0.8;
}
.footer-bottom p { margin: 0 0 0.35rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================= weekly ad */

.ad-dates { color: var(--muted); margin: .35rem 0 1rem; font-size: 1.05rem; }

.ad-wrap { padding-block: clamp(1.5rem, 4vw, 3rem); display: grid; gap: 2.5rem; }

.ad-page { margin: 0; }

.ad-stage {
  position: relative; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface);
}
.ad-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain; display: block;
}

/* One hotspot per mapped block. Transparent until pointed at, so the
   artwork reads normally and the targets only announce themselves on
   interaction. */
.ad-hot {
  position: absolute;
  padding: 0; border: 2px solid transparent; border-radius: 4px;
  background: transparent; cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.ad-hot:hover, .ad-hot:focus-visible, .ad-hot.is-open {
  border-color: var(--accent);
  background: rgb(255 255 255 / 12%);
}
.ad-hot:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.ad-card {
  position: absolute; left: 50%; top: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20; min-width: 210px; max-width: min(320px, 88vw);
  padding: .8rem .9rem;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 28px rgb(0 0 0 / 22%);
  text-align: left; font-size: .92rem; line-height: 1.45;
  opacity: 0; visibility: hidden;
  transition: opacity .12s ease;
  pointer-events: none;
}
.ad-card.is-above { top: auto; bottom: calc(100% + 8px); }

.ad-hot:hover .ad-card,
.ad-hot:focus-visible .ad-card,
.ad-hot.is-open .ad-card { opacity: 1; visibility: visible; }

.ad-item { display: block; }
.ad-item + .ad-item {
  margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line);
}
.ad-item-name { display: block; font-weight: 700; }
.ad-item-price {
  display: block; font-size: 1.25rem; font-weight: 700; color: var(--brand-dark);
}
.ad-item-price small { font-size: .7em; font-weight: 600; }
.ad-item-was {
  display: block; font-size: .82rem; color: var(--muted); text-decoration: line-through;
}
.ad-item-desc { display: block; font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.ad-item-limit {
  display: inline-block; margin-top: .3rem; padding: .05rem .45rem;
  font-size: .75rem; font-weight: 700; border-radius: 999px;
  background: var(--accent); color: #fff;
}

.ad-page-caption {
  margin-top: .6rem; font-size: .9rem; color: var(--muted); text-align: center;
}

/* Touch: no hover, so the card is opened by tap and centred rather than
   anchored to a block that may sit at the screen edge. */
@media (hover: none) {
  .ad-card {
    position: fixed; left: 50%; right: auto; top: auto; bottom: 1rem;
    transform: translateX(-50%); max-width: 92vw; width: 22rem;
  }
  .ad-card.is-above { top: auto; bottom: 1rem; }
}
