/* Half Moon Bay Volunteer Fire Department — site styles */

/* Poppins (SIL Open Font License), self-hosted */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/poppins-700.woff2") format("woff2"); }

:root {
  /* Coastal palette */
  --ink: #0b2e40;          /* deep ocean */
  --ink-2: #134257;        /* open water */
  --ink-3: #08202d;        /* night sea (footer) */
  --accent: #5fd0c3;       /* seafoam: highlights on dark backgrounds */
  --accent-hover: #86ddd3;
  --teal: #0f6f7a;         /* deep teal: links and labels on light backgrounds */
  --teal-dark: #0a535b;
  --coral: #c64d33;        /* sunset coral: urgent actions, 911 */
  --coral-dark: #a83f28;
  --paper: #ffffff;
  --paper-2: #f6f1e7;      /* sand */
  --text: #1d2f3a;
  --muted: #56677a;
  --line: #e6dccb;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / .06), 0 8px 24px rgb(0 0 0 / .08);
  --wrap: 72rem;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

a { color: var(--teal); text-underline-offset: .18em; }
a:hover { color: var(--teal-dark); }

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 46rem; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--ink); padding: .6rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---------- Header ---------- */

.site-header {
  background: var(--ink);
  color: #fff;
  border-bottom: 4px solid var(--accent);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4.75rem;
}

.brand {
  display: flex; align-items: center; gap: .75rem;
  color: #fff; text-decoration: none; padding: .5rem 0;
}
.brand:hover { color: #fff; }
.brand img { width: 3.6rem; height: auto; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; line-height: 1.1;
  font-size: 1.05rem; text-transform: uppercase; letter-spacing: .04em;
}
.brand-name small {
  display: block; font-family: var(--font); font-weight: 500;
  font-size: .72rem; letter-spacing: .12em; color: var(--accent);
}

.nav-toggle {
  display: none;
  background: transparent; color: #fff; border: 2px solid rgb(255 255 255 / .35);
  border-radius: 8px; padding: .45rem .7rem; font: inherit; font-weight: 600; cursor: pointer;
  align-items: center; gap: .5rem;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 1.2rem; height: 2px; background: currentColor; position: relative;
  transition: transform .2s;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.site-nav a {
  display: block; color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .55rem .8rem; border-radius: 6px;
}
.site-nav a:hover { background: rgb(255 255 255 / .1); color: #fff; }
.site-nav a[aria-current] { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.site-nav .nav-911 a { background: var(--coral); margin-left: .5rem; }
.site-nav .nav-911 a:hover { background: var(--coral-dark); }

@media (max-width: 960px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-header .wrap { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; padding-bottom: 1rem; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a { padding: .75rem .5rem; border-bottom: 1px solid rgb(255 255 255 / .08); }
  .site-nav a[aria-current] { box-shadow: inset 4px 0 0 var(--accent); padding-left: 1rem; }
  .site-nav .nav-911 a { margin: .75rem 0 0; text-align: center; border-radius: 6px; border: 0; }
}

/* ---------- Sections ---------- */

.section { padding: clamp(3rem, 2rem + 4vw, 5.5rem) 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--ink); color: #e3eef2; }
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }

.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .14em; color: var(--teal); margin-bottom: .6rem;
}
.section-dark .eyebrow, .hero .eyebrow, .page-hero .eyebrow { color: var(--accent); }

.lead { font-size: 1.2rem; color: var(--muted); }
.section-dark .lead { color: #b9cdd6; }

/* ---------- Hero ---------- */

.hero {
  position: relative; color: #fff; isolation: isolate;
  background: var(--ink);
  min-height: clamp(24rem, 60vh, 38rem);
  display: grid; align-items: end;
}
.hero picture, .hero > img { position: absolute; inset: 0; z-index: -2; }
.hero picture img, .hero > img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(8 32 45 / .25) 0%, rgb(8 32 45 / .55) 45%, rgb(8 32 45 / .9) 100%);
}
.hero .wrap { padding: 4rem 0 3.5rem; }
.hero h1 { color: #fff; max-width: 18ch; text-shadow: 0 2px 16px rgb(0 0 0 / .4); }
.hero p { font-size: 1.2rem; max-width: 38rem; color: #e6f1f4; }

.page-hero { background: var(--ink); color: #fff; padding: 3.5rem 0 3rem; border-bottom: 1px solid var(--ink-2); }
.page-hero h1 { color: #fff; margin: 0; }
.page-hero p { margin: .75rem 0 0; color: #b9cdd6; font-size: 1.15rem; max-width: 40rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--accent); color: var(--ink); text-decoration: none;
  font-weight: 700; padding: .8rem 1.3rem; border-radius: 8px; border: 2px solid var(--accent);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--ink); }
.btn-outline { background: transparent; color: #fff; border-color: rgb(255 255 255 / .6); }
.btn-outline:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-red { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn-red:hover { background: var(--coral-dark); border-color: var(--coral-dark); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Announcement ---------- */

.announcement {
  background: var(--accent); color: var(--ink);
}
.announcement .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 2rem; padding: 1.25rem 0;
}
.announcement h2 { font-size: 1.5rem; margin: 0; }
.announcement p { margin: 0; font-weight: 600; }

/* ---------- Layout helpers ---------- */

.split { display: grid; gap: clamp(2rem, 1rem + 3vw, 4rem); align-items: center; }
@media (min-width: 820px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split-reverse > :first-child { order: 2; }
}
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .35rem; }
.card p:last-child { margin-bottom: 0; }

a.card { display: block; color: inherit; text-decoration: none; transition: transform .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); border-color: var(--accent); color: inherit; }
a.card .card-link { color: var(--teal); font-weight: 600; font-size: .95rem; }
.card-ext::after { content: " ↗"; }

.card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.card-icon {
  width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--accent); margin-bottom: 1rem;
}
.card-icon svg { width: 1.4rem; height: 1.4rem; }

/* ---------- Conditions bar (rain / wind / air / fire / power) ---------- */

.conditions { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.conditions a {
  display: flex; align-items: flex-start; gap: .75rem;
  background: var(--ink-2); color: #fff; text-decoration: none; border-radius: var(--radius);
  padding: 1rem 1.1rem; border: 1px solid rgb(255 255 255 / .08);
}
.conditions a:hover { border-color: var(--accent); color: #fff; }
.conditions svg { width: 1.6rem; height: 1.6rem; color: var(--accent); flex: none; margin-top: .15rem; }
.conditions strong { display: block; text-transform: capitalize; }
.conditions span { font-size: .85rem; color: #a9c0cb; }

/* ---------- Timeline (About) ---------- */

.timeline { list-style: none; margin: 2rem 0 0; padding: 0; border-left: 3px solid var(--accent); }
.timeline li { position: relative; padding: 0 0 1.75rem 1.75rem; }
.timeline li::before {
  content: ""; position: absolute; left: -.6rem; top: .35rem; width: .95rem; height: .95rem;
  border-radius: 50%; background: var(--coral); border: 3px solid var(--paper-2);
}
.timeline .year {
  display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--ink);
}
.timeline p { margin: .2rem 0 0; }

/* ---------- Events ---------- */

.event {
  display: grid; gap: 1.5rem; grid-template-columns: auto 1fr; align-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.event-date {
  width: 4.5rem; text-align: center; border-radius: 8px; overflow: hidden;
  background: var(--paper); border: 2px solid var(--ink); line-height: 1;
}
.event-date .m { display: block; background: var(--ink); color: var(--accent); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; padding: .35rem 0; }
.event-date .d { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; padding: .4rem 0; color: var(--ink); }
.event-date .y { display: block; font-size: .75rem; color: var(--muted); padding-bottom: .35rem; }
.event h3 { margin: 0 0 .25rem; }
.event h3 a { color: var(--ink); text-decoration: none; }
.event h3 a:hover { color: var(--teal); }
.event-meta { color: var(--muted); font-size: .95rem; margin-bottom: .75rem; }
.event-past { opacity: .85; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; background: var(--paper-2); color: var(--muted); padding: .2rem .5rem; border-radius: 4px; margin-left: .5rem; vertical-align: middle; }

.empty-state {
  text-align: center; padding: 2.5rem 1.5rem; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted);
}
.empty-state h3 { color: var(--ink); }

.banner-img { border-radius: var(--radius); margin-bottom: 2rem; box-shadow: var(--shadow); width: 100%; }

.back-link { display: inline-block; margin-bottom: 1.5rem; font-weight: 600; text-decoration: none; }
.back-link::before { content: "← "; }

/* ---------- Video ---------- */

.video-embed { position: relative; aspect-ratio: 16 / 9; margin: 2rem 0 .75rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Photo gallery ---------- */

.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.gallery-item { position: relative; display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s, opacity .3s; }
.gallery-item:hover img { transform: scale(1.04); opacity: .9; }
.gallery-date {
  position: absolute; left: .6rem; bottom: .6rem; background: rgb(8 32 45 / .75); color: #fff;
  font-size: .78rem; font-weight: 600; padding: .2rem .55rem; border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) { .gallery-item img { transition: none; } .gallery-item:hover img { transform: none; } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(4 22 32 / .92); }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3.5rem 4.5rem 1.5rem; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { color: #dcebf0; margin-top: .9rem; text-align: center; max-width: 50rem; font-size: .95rem; }
.lightbox-btn {
  position: fixed; background: rgb(255 255 255 / .12); color: #fff; border: 0; border-radius: 50%;
  width: 3rem; height: 3rem; font-size: 2rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.lightbox-btn:hover { background: var(--accent); color: var(--ink); }
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .lightbox figure { padding: 3.5rem .75rem 5rem; }
  .lightbox-prev, .lightbox-next { top: auto; bottom: 1rem; transform: none; }
  .lightbox-prev { left: calc(50% - 3.5rem); }
  .lightbox-next { right: calc(50% - 3.5rem); }
}

/* ---------- Store ---------- */

.product-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.product-pair img { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }

/* ---------- Contact ---------- */

.contact-callout {
  display: flex; gap: 1rem; align-items: center;
  background: #fdeee9; border: 1px solid #f4c9bc; border-left: 6px solid var(--coral);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 2rem;
}
.contact-callout strong { font-size: 1.1rem; color: var(--coral-dark); }
.contact-callout svg { width: 2rem; height: 2rem; color: var(--coral); flex: none; }

dl.contact-list { margin: 0; display: grid; gap: 1.25rem; }
dl.contact-list dt { font-weight: 700; color: var(--ink); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
dl.contact-list dd { margin: .2rem 0 0; font-size: 1.15rem; }


/* ---------- Footer ---------- */

.site-footer { background: var(--ink-3); color: #a9bfca; font-size: .95rem; border-top: 4px solid var(--coral); }
.site-footer .wrap { padding: 3rem 0 1.5rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.site-footer h2 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .9rem; font-family: var(--font); }
.site-footer a { color: #dcebf0; text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer address { font-style: normal; }
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-brand img { width: 4.5rem; }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgb(255 255 255 / .08);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; font-size: .85rem; color: #7f97a3;
}

/* ---------- Utilities ---------- */

.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media print {
  .site-header, .site-footer, .nav-toggle { display: none; }
  .hero { min-height: 0; color: #000; }
  .hero::after, .hero picture { display: none; }
  .hero h1, .hero p { color: #000; text-shadow: none; }
}
