/* =========================
   Modern Responsive Reset
   ========================= */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
  color: #0f172a;            /* slate-900 */
  background: #f1f5f9;       /* slate-100 */
}

/* Make media responsive */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* Links */
a {
  color: #0b5fff;
  text-decoration: none;
  text-underline-offset: 2px;
}
a:hover, a:focus-visible { text-decoration: underline; }

/* =========================
   Page Layout
   ========================= */
/* If the page has no wrappers, style the body content as a centered sheet */
body {
  padding: clamp(12px, 2.5vw, 24px);
}

/* Create a "card" feel for all content */
body > *:first-child {
  /* often the first element is the top nav; we don't want it jammed to the top */
  margin-top: 0;
}

/* Constrain overall readable width
   Works even when markup is flat (no container div) by styling common blocks */
body {
  max-width: 1100px;
  margin-inline: auto;
}

/* A soft surface behind content if the page uses tables/images heavily */
body {
  background-image:
    radial-gradient(900px 400px at 20% -10%, rgba(11,95,255,0.10), transparent 60%),
    radial-gradient(700px 350px at 90% 10%, rgba(239,68,68,0.10), transparent 60%);
  background-color: #f1f5f9;
}

/* Give the main content a clean panel effect:
   If markup is simple, we apply this to the body via a pseudo wrapper vibe */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(241,245,249,0.70);
  pointer-events: none;
  z-index: -2;
}
body::after {
  content: "";
  position: fixed;
  inset: 12px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 16px;
  box-shadow:
    0 10px 30px rgba(15,23,42,0.08),
    0 2px 8px rgba(15,23,42,0.06);
  pointer-events: none;
  z-index: -1;
}
@media (max-width: 640px) {
  body::after { inset: 8px; border-radius: 14px; }
}

/* Since body::after is fixed, we need inner padding so content doesn't sit on edges */
body {
  padding: clamp(18px, 3vw, 34px);
}

/* =========================
   Typography
   ========================= */
p { margin: 0 0 1rem; }
b, strong { font-weight: 700; }

em { color: #334155; } /* slate-700 */

hr {
  border: 0;
  border-top: 1px solid rgba(15,23,42,0.10);
  margin: 1.25rem 0;
}

/* Make headings feel consistent even if page uses bold text instead of h1/h2 */
h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 1.25rem 0 0.5rem;
}
h1 { font-size: clamp(1.4rem, 2vw, 2rem); }
h2 { font-size: clamp(1.2rem, 1.6vw, 1.5rem); }
h3 { font-size: 1.15rem; }

/* If the page uses <center> or big bold lines, keep them readable */
center { display: block; margin: 0.75rem 0; }

/* =========================
   Navigation Link Bars (top & bottom)
   ========================= */
/* Many old pages do: | link | link | link |
   This makes them wrap nicely and look like pills */
body > a,
body a {
  /* leave default behavior; specific bar styling below uses heuristics */
}

/* Style sequences that look like nav bars:
   if links are separated by pipes, they are often in a single paragraph/line.
   We can’t reliably select that without classes, so we improve all "pipe" areas:
   Make pipes lighter and spacing nicer. */
body {
  /* reduce the harshness of text pipes */
}
body :where(p, div, td, center) {
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Make standalone nav-ish links look like chips on small screens
   (won't break regular inline links too much because it's limited to short anchors) */
@media (max-width: 720px) {
  a {
    /* keep general links normal */
  }

  /* But images-as-links (buttons) should not shrink weirdly */
  a > img { vertical-align: middle; }
}

/* =========================
   Tables (Contact section)
   ========================= */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
}

/* Add a clean card style to the contact info table */
table tr td {
  padding: 10px 12px;
  border-top: 1px solid rgba(15,23,42,0.08);
  vertical-align: top;
}

/* First row no top border */
table tr:first-child td { border-top: 0; }

table {
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(248,250,252,0.75);
}

/* Icons in the contact table */
table img {
  max-width: 32px;
  height: auto;
}

/* Responsive table: stack cells on mobile */
@media (max-width: 640px) {
  table, tbody, tr, td { display: block; width: 100%; }
  table { border-radius: 14px; }
  table tr td { border-top: 1px solid rgba(15,23,42,0.10); }
  table tr td:first-child { border-top: 0; }
}

/* =========================
   Content spacing improvements
   ========================= */
img {
  border-radius: 10px;
}

/* But keep tiny UI gifs (arrows/new/pdf) from becoming rounded blobs */
img[src$=".gif"] { border-radius: 0; }

/* Give major banner images breathing room */
img[src*="firerescue"],
img[src*="Photo_banner"],
img[src*="smoke20push"] {
  display: block;
  margin: 14px auto;
  border-radius: 14px;
}

/* Make long “Latest News” lines more readable */
a + img, img + a { margin-left: 6px; }

/* Improve readability of dense sections */
:where(p, td, div) {
  font-size: 1rem;
}

/* =========================
   Accessibility polish
   ========================= */
:focus-visible {
  outline: 3px solid rgba(11,95,255,0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
