/* ==========================================================
   Village of Birchbay — CanadaWebs municipal demo platform
   WCAG 2.1 AA: contrast-checked palette, visible focus,
   reduced-motion support, 44px touch targets.
   ========================================================== */

:root {
  --lake: #0E3D5C;        /* primary — 10.4:1 on white */
  --lake-deep: #0A2C43;
  --lake-mid: #155A87;    /* 6.1:1 on white */
  --sky: #CFE3EE;
  --amber: #B65C0A;       /* 4.7:1 with white text */
  --amber-soft: #FBEEDD;
  --pine: #3C6248;
  --sand: #F6F3EC;
  --ink: #1C2733;         /* body text — 14.5:1 */
  --muted: #4E5E6C;       /* 7.1:1 */
  --line: #D8DEE4;
  --white: #fff;
  --focus: #B65C0A;
  --max: 72rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--lake-mid); text-underline-offset: 2px; }
a:hover { color: var(--lake); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3 { color: var(--lake); line-height: 1.25; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 0.2em 0; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin-top: 1.6em; }
h3 { font-size: 1.15rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--lake); color: #fff; padding: 0.75rem 1.25rem;
  z-index: 100; border-radius: 0 0 6px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Alert banner ---------- */
.alert-banner { padding: 0.65rem 0; font-size: 0.97rem; }
.alert-banner p { margin: 0; }
.alert-warning { background: #FCF3E3; border-bottom: 3px solid var(--amber); color: #5C3305; }
.alert-warning a { color: #7A4406; font-weight: 600; }
.alert-info { background: var(--sky); border-bottom: 3px solid var(--lake-mid); color: var(--lake-deep); }
.alert-inner { display: flex; gap: 0.6rem; align-items: flex-start; }
.alert-icon { width: 1.3rem; height: 1.3rem; flex: none; margin-top: 0.2rem; color: var(--amber); }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 4px solid var(--lake);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem; padding-top: 0.9rem; padding-bottom: 0.9rem;
}
.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.crest { width: 54px; height: 54px; }
.brand-name {
  display: block; font-size: 1.35rem; font-weight: 700; color: var(--lake);
  letter-spacing: -0.01em;
}
.brand-tag { display: block; font-size: 0.85rem; color: var(--muted); font-style: italic; }

.nav-toggle {
  display: none; align-items: center; gap: 0.5rem;
  background: var(--lake); color: #fff; border: none;
  padding: 0.6rem 1rem; font-size: 1rem; font-weight: 600;
  border-radius: 6px; cursor: pointer; min-height: 44px;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; display: block; width: 20px; height: 2.5px; background: #fff; position: relative;
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem; }
.site-nav a {
  display: block; padding: 0.55rem 0.8rem; text-decoration: none;
  color: var(--lake); font-weight: 600; font-size: 0.98rem; border-radius: 6px;
}
.site-nav a:hover { background: var(--sky); }
.site-nav a[aria-current="page"] { background: var(--lake); color: #fff; }

@media (max-width: 62rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
}

/* ---------- Hero (homepage) ---------- */
.hero { position: relative; color: #fff; background: var(--lake-deep); overflow: hidden; }
.hero-art { display: block; width: 100%; height: auto; min-height: 260px; object-fit: cover; }
.hero-content {
  position: absolute; inset: 0; display: flex; align-items: center;
}
.hero-content .wrap { width: 100%; }
.hero h1 {
  color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 0.3em;
  text-shadow: 0 2px 14px rgba(10, 44, 67, 0.55);
  max-width: 22ch;
}
.hero p {
  font-size: clamp(1.05rem, 2vw, 1.3rem); margin: 0 0 1.2em; max-width: 44ch;
  text-shadow: 0 1px 10px rgba(10, 44, 67, 0.6);
}
.btn {
  display: inline-block; background: var(--amber); color: #fff !important;
  font-weight: 700; text-decoration: none; padding: 0.8rem 1.4rem;
  border-radius: 8px; min-height: 44px; border: 2px solid transparent;
}
.btn:hover { background: #9C4E08; }
.btn.ghost { background: rgba(255,255,255,0.12); border-color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,0.24); }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
@media (max-width: 48rem) {
  .hero-art { position: absolute; inset: 0; height: 100%; }
  .hero-content { position: relative; z-index: 1; inset: auto; padding: 2.4rem 0 2.6rem; display: block; }
}

/* ---------- Quick links ---------- */
.quick { background: var(--sand); padding: 2.5rem 0 2.8rem; }
.quick h2 { margin-top: 0; }
.quick-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem; margin-top: 1.2rem;
}
.quick-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  background: var(--white); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 1.3rem 0.8rem; text-decoration: none; text-align: center;
  color: var(--lake); font-weight: 700; font-size: 0.97rem;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.quick-card:hover { transform: translateY(-2px); border-color: var(--lake-mid); }
.quick-card svg { width: 2.1rem; height: 2.1rem; color: var(--lake-mid); }

/* ---------- Home news/events ---------- */
.home-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 2.5rem; padding: 2.8rem 0; }
@media (max-width: 52rem) { .home-cols { grid-template-columns: 1fr; } }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-head h2 { margin: 0; }
.all-link { font-weight: 700; white-space: nowrap; }

.news-card {
  border-bottom: 1px solid var(--line); padding: 1rem 0;
}
.news-card:first-of-type { border-top: 1px solid var(--line); margin-top: 1rem; }
.news-date {
  color: var(--muted); font-size: 0.88rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.news-card h3 { margin: 0.15rem 0 0.3rem; }
.news-card h3 a { text-decoration: none; color: var(--lake); }
.news-card h3 a:hover { text-decoration: underline; }
.news-card p { margin: 0; color: var(--muted); font-size: 0.97rem; }

.event-row {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.event-row:first-of-type { border-top: 1px solid var(--line); margin-top: 1rem; }
.event-date-badge {
  flex: none; width: 3.4rem; text-align: center; background: var(--sky);
  border-radius: 8px; padding: 0.35rem 0.2rem; color: var(--lake-deep);
  font-weight: 800; line-height: 1.15; font-size: 0.85rem; text-transform: uppercase;
}
.event-row h3 { margin: 0 0 0.15rem; font-size: 1.02rem; }
.event-row p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* ---------- Visit band ---------- */
.visit-band { background: var(--lake); color: #fff; padding: 3rem 0; }
.visit-band h2 { color: #fff; margin: 0 0 0.4em; }
.visit-band p { max-width: 60ch; }
.visit-band .btn { margin-top: 0.6rem; }

/* ---------- Page hero / breadcrumbs ---------- */
.page-hero {
  background: linear-gradient(180deg, var(--sky) 0%, var(--sand) 100%);
  border-bottom: 1px solid var(--line);
  padding: 1.6rem 0 1.8rem;
}
.page-hero h1 { margin: 0.2rem 0 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0.5rem 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; font-size: 0.9rem; }
.crumbs li + li::before { content: "›"; margin-right: 0.35rem; color: var(--muted); }
.crumbs [aria-current="page"] { color: var(--muted); }

.page-body { padding: 2rem 1.25rem 3rem; }
.prose { max-width: 46rem; }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.97rem; }
.prose th { background: var(--lake); color: #fff; text-align: left; padding: 0.55rem 0.7rem; }
.prose td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; vertical-align: top; }
.prose tr:nth-child(even) td { background: var(--sand); }
.prose blockquote {
  margin: 1rem 0; padding: 0.8rem 1.1rem; background: var(--amber-soft);
  border-left: 4px solid var(--amber); font-size: 0.98rem;
}
.prose blockquote p { margin: 0; }

/* ---------- Cards & grids (council, services) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.1rem; margin: 1.4rem 0; }
.card {
  background: var(--white); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 1.2rem 1.2rem 1.1rem;
}
.card h3 { margin: 0 0 0.25rem; }
.card .role { color: var(--amber); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.card p { font-size: 0.94rem; color: var(--muted); margin: 0.4rem 0 0; }
.card a { word-break: break-all; }
.svc-card { text-decoration: none; display: block; transition: border-color 0.12s ease, transform 0.12s ease; }
.svc-card:hover { border-color: var(--lake-mid); transform: translateY(-2px); }
.svc-card h3 { color: var(--lake); }

/* ---------- News listing ---------- */
.news-list { max-width: 46rem; }
article.news-full { max-width: 46rem; }
.meta-line { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.4rem; }

/* ---------- Contact / info boxes ---------- */
.info-box {
  background: var(--sand); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 1.2rem 1.4rem; margin: 1rem 0;
}
.info-box h3 { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--lake-deep); color: #E7EEF3; margin-top: 3rem; }
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2rem; padding: 2.6rem 1.25rem 2rem;
}
.footer-h { color: #fff; font-size: 1.05rem; margin: 0 0 0.6rem; }
.site-footer a { color: #BFD9E8; }
.site-footer a:hover { color: #fff; }
.site-footer p { margin: 0 0 0.5rem; font-size: 0.95rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.45rem; font-size: 0.95rem; }
.footer-emerg { font-weight: 600; color: #F3C98B; }
.footer-legal { border-top: 1px solid rgba(255,255,255,0.15); padding: 1.1rem 0 1.3rem; }
.footer-legal p { margin: 0.15rem 0; font-size: 0.85rem; color: #9FB8C7; }
.demo-note a { color: #F3C98B; font-weight: 600; }

/* ---------- Utilities ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }
