/* =========================================================================
   site.css - copied VERBATIM from the public site's styles.css
   (C:\dev\BrooklineFireWebsite\styles.css, the Brookline Fire Protection
   District website). Do not edit here; change the source and re-copy.

   Sections copied, in order, each complete and unchanged:
     1.  DESIGN TOKENS
     2.  RESET AND BASE
     3.  TYPOGRAPHY
     4.  LAYOUT PRIMITIVES
     5.  ACCESSIBILITY HELPERS  (skip-link, sr-only, focus-visible)
         BUTTONS                (.btn and variants)
     9.  PAGE HEADER            (.page-head)
     14. TABLES, FAQ, NOTICES   (tables, .notice)

   App-only styles live in app.css and use these tokens.
   ========================================================================= */


/* =========================================================================
   1. DESIGN TOKENS
   ========================================================================= */

:root {
  /* Brand red, extended into a usable scale. --red is the original #c00. */
  --red-900: #4a0000;
  --red-800: #6e0000;
  --red-700: #8a0000;
  --red-600: #a80000;
  --red: #c00000;
  --red-400: #d92626;

  /* Brand cream. --cream is the original #ffeeba. */
  --cream: #ffeeba;
  --cream-600: #f2d98a;

  /* A "yes" answer. Used sparingly - the brand has no green of its own. */
  --green-700: #1e6b37;
  --green-50: #eaf5ee;


  /* Neutrals */
  --ink: #14141a;
  --ink-2: #1e1e26;
  --ink-3: #2c2c37;
  --slate: #5a5a66;
  --line: #e3e3ea;
  --paper: #ffffff;
  --paper-2: #f7f7fa;
  --paper-3: #eeeef4;

  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  --wrap: 1180px;
  --measure: 68ch;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;

  /* Layered shadows read as depth; a single flat shadow reads as a border. */
  --shadow-1: 0 1px 2px rgba(20, 20, 26, 0.06), 0 2px 8px rgba(20, 20, 26, 0.06);
  --shadow-2: 0 2px 4px rgba(20, 20, 26, 0.06), 0 8px 24px rgba(20, 20, 26, 0.10);
  --shadow-3: 0 8px 16px rgba(20, 20, 26, 0.10), 0 24px 56px rgba(20, 20, 26, 0.16);
  --shadow-red: 0 10px 30px rgba(192, 0, 0, 0.28);

  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}


/* =========================================================================
   2. RESET AND BASE
   ========================================================================= */

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

html {
  scroll-behavior: smooth;
  /* Anchor targets clear the fixed header. */
  scroll-padding-top: calc(var(--nav-h) + var(--s-4));
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper-2);
  /* Belt and braces against horizontal scroll on small screens. */
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--red);
  color: #fff;
}


/* =========================================================================
   3. TYPOGRAPHY
   ========================================================================= */

h1, h2, h3, h4 {
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem); font-weight: 900; }
h2 { font-size: clamp(1.75rem, 1.2rem + 2.1vw, 2.6rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); }
h4 { font-size: 1.05rem; }

p { margin-bottom: var(--s-4); }

strong { font-weight: 700; }

/* Small uppercase label that sits above a heading. */
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red-700);
  margin-bottom: var(--s-3);
}

.eyebrow--light { color: var(--cream); }

/* Red rule under a section heading. */
.rule::after {
  content: "";
  display: block;
  width: 64px;
  height: 5px;
  margin-top: var(--s-4);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--red-400));
}

.rule--center::after { margin-left: auto; margin-right: auto; }

.lead {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--slate);
}


/* =========================================================================
   4. LAYOUT PRIMITIVES
   ========================================================================= */

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

.band {
  padding-block: clamp(var(--s-7), 6vw, var(--s-9));
}

.band--tight { padding-block: var(--s-7); }
.band--paper { background: var(--paper); }
.band--alt { background: var(--paper-3); }

.band--dark {
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(192, 0, 0, 0.35), transparent 60%),
    linear-gradient(160deg, var(--ink) 0%, #241014 55%, var(--red-900) 100%);
  color: #fff;
}

.band--dark h1,
.band--dark h2,
.band--dark h3 { color: #fff; }

.band--dark p { color: rgba(255, 255, 255, 0.86); }

/* Content pages keep .container as their main wrapper. */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin: var(--s-7) auto var(--s-8);
  padding: clamp(var(--s-5), 4vw, var(--s-7));
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}

.grid { display: grid; gap: var(--s-5); }

.section {
  margin-bottom: var(--s-7);
  scroll-margin-top: calc(var(--nav-h) + var(--s-4));
}

.section:last-child { margin-bottom: 0; }


/* =========================================================================
   5. ACCESSIBILITY HELPERS
   ========================================================================= */

.skip-link {
  position: absolute;
  top: -60px;
  left: var(--s-4);
  z-index: 300;
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: top 0.15s var(--ease);
}

.skip-link:focus { top: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 3px;
  border-radius: 2px;
}

body > header nav a:focus-visible,
body > header nav button:focus-visible {
  outline-color: var(--cream);
}




/* =========================================================================
   BUTTONS
   ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
              background 0.2s var(--ease), color 0.2s var(--ease);
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn--primary {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow-red);
}

.btn--primary:hover {
  background: var(--red-600);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(192, 0, 0, 0.42);
}

.btn--cream {
  background: var(--cream);
  color: var(--red-800);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}

.btn--cream:hover {
  background: #fff;
  transform: translateY(-3px);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.btn--ghost:hover {
  background: #fff;
  color: var(--red-800);
  border-color: #fff;
  transform: translateY(-3px);
}

.btn--outline {
  background: transparent;
  color: var(--red-700);
  border-color: currentColor;
}

.btn--outline:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transform: translateY(-3px);
}




/* =========================================================================
   9. PAGE HEADER
   ========================================================================= */

.page-head {
  position: relative;
  padding: calc(var(--nav-h) + var(--s-7)) 0 var(--s-7);
  background:
    radial-gradient(900px 340px at 12% 0%, rgba(192, 0, 0, 0.45), transparent 62%),
    linear-gradient(150deg, var(--ink) 0%, #26121a 60%, var(--red-900) 100%);
  color: #fff;
  overflow: hidden;
}

/* Faint chevron texture, low enough not to fight the text. */
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background: repeating-linear-gradient(
    -45deg,
    #fff 0 2px,
    transparent 2px 16px
  );
  pointer-events: none;
}

.page-head .wrap { position: relative; }

.page-head h1 {
  color: #fff;
  margin-bottom: var(--s-4);
}

.page-head-sub {
  max-width: 62ch;
  margin: 0;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  color: rgba(255, 255, 255, 0.88);
}

.page-head + .container {
  margin-top: calc(var(--s-6) * -1);
  position: relative;
  z-index: 2;
}




/* =========================================================================
   14. TABLES, FAQ, NOTICES
   ========================================================================= */

.table-scroll {
  overflow-x: auto;
  margin: var(--s-5) 0;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  background: var(--paper);
}

caption {
  padding: var(--s-4);
  font-weight: 700;
  text-align: left;
  color: var(--slate);
}

th, td {
  padding: var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  background: linear-gradient(180deg, var(--red), var(--red-700));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:nth-child(even) { background: var(--paper-2); }
tbody tr:hover { background: #fdf3f3; }
tbody tr:last-child td { border-bottom: 0; }

/* --- FAQ --- */
.faq-item {
  margin-bottom: var(--s-3);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--red);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  overflow: hidden;
}

.faq-item h3 { margin: 0; font-size: 1.05rem; }

.faq-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: 100%;
  padding: var(--s-4) var(--s-5);
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.faq-toggle:hover { background: var(--paper-2); color: var(--red-700); }

/* Driven by aria-expanded so the icon can never disagree with the state. */
.faq-toggle::after {
  content: "";
  flex-shrink: 0;
  width: 0.55em;
  height: 0.55em;
  border-right: 2.5px solid var(--red);
  border-bottom: 2.5px solid var(--red);
  transform: translateY(-25%) rotate(45deg);
  transition: transform 0.25s var(--ease);
}

.faq-toggle[aria-expanded="true"]::after {
  transform: translateY(25%) rotate(-135deg);
}

/* Collapsed with the `hidden` attribute, which genuinely removes the panel
   from the accessibility tree. The previous max-height approach left the text
   readable by screen readers while aria-expanded claimed it was collapsed. */
.faq-panel {
  margin: 0;
  padding: 0 var(--s-5) var(--s-5);
  max-width: none;
  color: var(--slate);
}

/* --- Notice --- */
.notice {
  padding: var(--s-5);
  margin: var(--s-5) 0;
  background: #fdf4f4;
  border-left: 5px solid var(--red);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.notice p { margin-bottom: var(--s-2); max-width: none; }
.notice p:last-child { margin-bottom: 0; }

/* --- Address check (services.html) --- */
.address-check {
  margin: var(--s-5) 0;
  padding: var(--s-5);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.address-check-fields {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  gap: var(--s-4);
  align-items: end;
}

.address-check-field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.address-check label { font-weight: 700; font-size: 0.92rem; }

/* --slate on white is 6.9:1, comfortably over the 3:1 WCAG 1.4.11 asks of a
   field's outline. */
.address-check input {
  width: 100%;
  min-height: 48px;
  padding: var(--s-3) var(--s-4);
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--slate);
  border-radius: var(--r-sm);
}

.address-check .btn { min-height: 48px; justify-content: center; }

.address-check-hint,
.address-check-note {
  margin: var(--s-3) 0 0;
  font-size: 0.85rem;
  color: var(--slate);
}

.address-check-result { margin: 0; }

.address-check-result:not(:empty) {
  margin-top: var(--s-4);
  padding: var(--s-4);
  background: var(--paper);
  border-left: 5px solid var(--slate);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}

.address-check-result--yes:not(:empty) {
  background: var(--green-50);
  border-left-color: var(--green-700);
}

.address-check-result--no:not(:empty),
.address-check-result--error:not(:empty) { border-left-color: var(--red); }

@media (max-width: 620px) {
  .address-check-fields { grid-template-columns: 1fr; }
}

/* --- Contact form ---
   A Google Form in a frame. The frame cannot size itself to its content -
   it is cross-origin, so this page cannot read how tall the form is - so the
   height is set by hand in contact.html to fit the form as built. Past that
   height the form scrolls inside the frame, which is ugly but still usable.
   Re-check it whenever questions are added to the form. */
.contact-form {
  margin-bottom: var(--s-4);
}

.contact-form iframe {
  display: block;
  width: 100%;
  max-width: 640px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--paper-2);
}

.contact-form-fallback {
  font-size: 0.9rem;
  color: var(--slate);
}

.popular-pages {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin: var(--s-5) 0;
}

.popular-pages li { margin: 0; }

.popular-pages a {
  display: inline-block;
  padding: var(--s-3) var(--s-5);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease);
}

.popular-pages a:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  text-decoration: none;
}


