/* ==========================================================================
   Putnam County Rescue Squad — shared stylesheet
   Recreated as an editable starting point.
   --------------------------------------------------------------------------
   Design notes for whoever edits this next:
   - All colors are CSS variables in :root below. Change them in one place.
   - Layout is plain CSS grid/flex, no framework, no build step.
   - Each page links this one file. Add page-specific rules at the bottom
     under the matching comment, or in a new file if it grows large.
   ========================================================================== */

:root {
  /* Palette — department blue primary, red accent (from the squad logo) */
  --blue:       #1d4ea3;   /* primary brand blue  */
  --blue-dark:  #163d80;   /* hover / pressed     */
  --red:        #b1232b;   /* accent red (logo)   */
  --red-dark:   #8a1a20;   /* accent red, darker  */
  --charcoal:   #1d2127;   /* headers, footer     */
  --slate:      #3a4049;   /* body text on light  */
  --ash:        #6b7280;   /* muted / captions    */
  --line:       #e2e4e8;   /* hairline borders    */
  --paper:      #ffffff;   /* card / page surface */
  --bg:         #f5f6f8;   /* page background     */
  --safety:     #f2b705;   /* hi-vis accent (sparingly) */

  /* Back-compat: older rules referencing --red as the primary now resolve to blue.
     Primary actions use --blue; --red is reserved for small accents. */

  /* Type */
  --font-display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body:    "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Rhythm */
  --maxw: 1100px;
  --gap:  1.5rem;
  --radius: 4px;
}

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--slate);
  background: var(--bg);
  line-height: 1.6;
  font-size: 1.05rem;
}
img { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--charcoal);
  line-height: 1.15;
  letter-spacing: 0.01em;
  font-weight: 600;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); text-transform: uppercase; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); text-transform: uppercase; }
h3 { font-size: 1.25rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--charcoal);
  color: #cdd2da;
  font-size: 0.85rem;
}
.topbar .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}
.topbar a { color: #cdd2da; }
.topbar strong { color: #fff; }

/* ---------- header / nav ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 4px solid var(--blue);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.85rem; }
.brand .logo {
  width: 56px; height: 56px; flex: 0 0 56px;
  background: var(--blue);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.7rem; text-align: center;
  line-height: 1.05;
  border-radius: var(--radius);
}
.brand .name { font-family: var(--font-display); text-transform: uppercase; }
.brand .name b { display: block; color: var(--charcoal); font-size: 1.15rem; letter-spacing: 0.02em; }
.brand .name span { display: block; color: var(--ash); font-size: 0.78rem; letter-spacing: 0.08em; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.4rem 0.6rem;
  font-size: 1.2rem; cursor: pointer; color: var(--charcoal);
}
.main-nav ul {
  display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0;
}
.main-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.95rem;
  color: var(--charcoal);
  border-radius: var(--radius);
}
.main-nav a:hover { background: var(--bg); text-decoration: none; }
.main-nav a.active { color: var(--blue); border-bottom: 2px solid var(--blue); border-radius: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  background: var(--charcoal);
  color: #fff;
  text-align: center;
  padding: 4.5rem 1.25rem;
  overflow: hidden;
}
.hero::after { /* blue & yellow chevron stripe (pointing up), matching apparatus markings */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background:
    repeating-linear-gradient(-45deg, var(--safety) 0 10px, var(--blue) 10px 20px) 0 0 / 50% 100% no-repeat,
    repeating-linear-gradient(45deg,  var(--safety) 0 10px, var(--blue) 10px 20px) 100% 0 / 50% 100% no-repeat;
}
.hero h1 { color: #fff; margin-bottom: 0.4rem; }
.hero p { color: #d7dbe2; font-size: 1.2rem; max-width: 640px; margin: 0 auto 1.5rem; }
.hero .est { color: var(--safety); font-family: var(--font-display); letter-spacing: 0.15em; text-transform: uppercase; font-size: 0.85rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  background: var(--blue); color: #fff;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.7rem 1.4rem; border-radius: var(--radius);
  border: 2px solid var(--blue);
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.btn.ghost { background: transparent; color: #fff; }
.btn.ghost:hover { background: rgba(255,255,255,0.12); }

/* ---------- sections ---------- */
section { padding: 3rem 0; }
.section-head { max-width: 720px; margin-bottom: 2rem; }
.section-head .eyebrow {
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: 0.15em; font-size: 0.8rem; color: var(--red); margin-bottom: 0.3rem;
}
.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { color: var(--red-dark); }
.card .tag {
  display: inline-block; font-family: var(--font-display); text-transform: uppercase;
  font-size: 0.7rem; letter-spacing: 0.08em; color: #fff; background: var(--charcoal);
  padding: 0.15rem 0.5rem; border-radius: 2px; margin-bottom: 0.6rem;
}

/* ---------- image placeholder ----------
   Replace any element with this class with a real <img>. */
.img-ph {
  background: repeating-linear-gradient(135deg, #e9ebef 0 12px, #eef0f3 12px 24px);
  border: 1px dashed #c4c8cf;
  border-radius: var(--radius);
  color: var(--ash);
  display: grid; place-items: center;
  text-align: center;
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 0.85rem;
  min-height: 200px;
  padding: 1rem;
}
.img-ph small { display: block; font-family: var(--font-body); text-transform: none; letter-spacing: 0; color: #9aa0a8; margin-top: 0.3rem; }

/* ---------- news ---------- */
.news-item { border-bottom: 1px solid var(--line); padding: 1.5rem 0; }
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: 0; }
.news-item .meta { color: var(--ash); font-size: 0.85rem; margin-bottom: 0.4rem; }

/* ---------- stations / contact info rows ---------- */
.info-row { display: flex; gap: 0.6rem; align-items: baseline; }
.info-row .label { font-family: var(--font-display); text-transform: uppercase; font-size: 0.8rem; color: var(--ash); min-width: 90px; }

/* ---------- callout ---------- */
.callout {
  background: var(--blue); color: #fff; text-align: center; padding: 2.5rem 1.25rem;
}
.callout h2 { color: #fff; }
.callout p { max-width: 600px; margin: 0 auto 1.25rem; color: #dbe6f7; }

/* ---------- footer ---------- */
.site-footer { background: var(--charcoal); color: #aab0ba; font-size: 0.9rem; }
.site-footer .container { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.site-footer .grid { gap: 2rem; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 0.75rem; }
.site-footer a { color: #aab0ba; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.35rem; }
.site-footer .copyright {
  border-top: 1px solid #2c313a; margin-top: 2rem; padding-top: 1.25rem;
  color: #7a8290; font-size: 0.8rem;
}

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 4px solid var(--blue);
    padding: 0.5rem 1.25rem 1rem;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { padding: 0.75rem 0.5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .site-header { position: static; }
}

/* ---------- accessibility ---------- */
:focus-visible { outline: 3px solid var(--safety); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ==========================================================================
   PAGE-SPECIFIC RULES — add below
   ========================================================================== */

/* Hero with background photo (used on the homepage) */
.hero.has-photo {
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
}
.hero.has-photo::before { /* dark scrim so white text stays legible */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,30,55,0.78), rgba(20,30,55,0.62));
}
.hero.has-photo .container { position: relative; z-index: 1; }

/* Brand logo as a real image */
.brand img.logo { object-fit: contain; background: #fff; padding: 2px; }

/* Photo at the top of a card */
.card .card-photo {
  margin: -1.5rem -1.5rem 1.25rem;
  height: 200px;
  object-fit: cover;
  width: calc(100% + 3rem);
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
}

/* Framed standalone photo with optional caption */
figure.photo { margin: 0; }
figure.photo img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  object-fit: cover;
}
figure.photo figcaption {
  font-size: 0.85rem; color: var(--ash); margin-top: 0.5rem;
}

/* Gallery grid */
.gallery img { aspect-ratio: 4 / 3; object-fit: cover; }

/* Personnel member grid */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.25rem;
}
.member { margin: 0; text-align: center; }
.member-photo {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--blue-dark);
  margin-bottom: 0.6rem;
}
.member figcaption {
  font-weight: 600;
  color: var(--charcoal);
  font-size: 0.95rem;
  line-height: 1.25;
}
.member .m-name { display: block; }
.member .m-rank {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--red);
  font-weight: 500;
  margin-top: 0.1rem;
}
.member .m-unit {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--ash);
  margin-top: 0.1rem;
}
/* Officer cards get a red top accent to set leadership apart */
.member.officer .member-photo {
  background: var(--charcoal);
  border-top: 3px solid var(--red);
}
/* Special Ops cards use a distinct slate tone with a gold accent */
.member.specops .member-photo {
  background: var(--slate);
  border-top: 3px solid var(--safety);
}
/* Team Leader cards use the brand blue with a red accent */
.member.leader .member-photo {
  background: var(--blue-dark);
  border-top: 3px solid var(--red);
}
@media (max-width: 480px) {
  .member-grid { grid-template-columns: repeat(2, 1fr); }
}
