/* =============================================================
   MSHP Ultimate Sacrifice Memorial Pages — Accessible Styles
   WCAG 2.1 Level AA compliant
   Reverent palette: Deep memorial black + MSHP Navy + Gold accent
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: "Georgia", "Cambria", "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #1a1a1a;
  background: #fafaf7;            /* warm off-white for memorial feel */
}

/* ===== REDUCED MOTION (WCAG 2.3.3) ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== SKIP LINK (WCAG 2.4.1) ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  background: #1a1a1a;
  color: #fff;
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 600;
  z-index: 100;
  border-radius: 0 0 4px 4px;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid #ffc408;
  outline-offset: 2px;
}

/* ===== FOCUS INDICATORS ===== */
:focus-visible {
  outline: 3px solid #1e3a5f;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ===== MEMORIAL HEADER ===== */
.memorial-header {
  background: #1a1a1a;            /* Deep memorial black */
  color: #fff;                    /* 18.5:1 contrast — AAA+ */
  padding: 1rem 1.5rem;
  border-bottom: 4px solid #ffc408;
}
.memorial-header .brand {
  font-family: "Segoe UI", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffc408;                 /* 13.8:1 on black */
  font-weight: 600;
  margin: 0;
}
.memorial-header .title-block {
  font-family: "Segoe UI", sans-serif;
  margin-top: 0.5rem;
}
.memorial-header .title-block p {
  margin: 0;
  font-size: 0.875rem;
  color: #e0e0e0;                 /* 12.2:1 on black */
}
.memorial-header nav {
  margin-top: 0.75rem;
}
.memorial-header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.memorial-header nav a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
  font-family: "Segoe UI", sans-serif;
  font-size: 0.875rem;
}
.memorial-header nav a:hover,
.memorial-header nav a:focus-visible {
  color: #ffc408;
}

/* ===== MAIN / MEMORIAL CONTENT ===== */
main {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}
main:focus { outline: none; }

/* ===== IN MEMORIAM BLOCK ===== */
.in-memoriam {
  background: linear-gradient(to bottom, #fafaf7 0%, #fff 100%);
  border-top: 1px solid #d9d9d9;
  border-bottom: 3px solid #1e3a5f;
  padding: 2.5rem 2rem 2rem;
  margin: 0 -1.25rem;
  text-align: center;
  position: relative;
}
.in-memoriam::before {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #1a1a1a;
  margin: 0 auto 1.5rem;
}
.in-memoriam .label {
  font-family: "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #4a4a4a;                 /* 9.74:1 */
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.in-memoriam .rank {
  font-family: "Segoe UI", sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  color: #1e3a5f;
  margin: 0.5rem 0 0;
  letter-spacing: 1px;
}
.in-memoriam h1 {
  font-size: 2.5rem;
  line-height: 1.15;
  color: #1a1a1a;
  margin: 0.25rem 0 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.portrait-frame {
  display: inline-block;
  padding: 8px;
  background: #fff;
  border: 1px solid #c5cad1;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  margin: 1rem 0 1.5rem;
}
.portrait-frame img {
  display: block;
  max-width: 280px;
  width: 100%;
  height: auto;
  filter: grayscale(0%);          /* preserve original tonality */
}
.badge-eow {
  font-family: "Segoe UI", sans-serif;
  font-size: 0.9375rem;
  color: #1a1a1a;
  margin-top: 1rem;
  line-height: 1.8;
}
.badge-eow strong {
  font-weight: 600;
  color: #1e3a5f;
}
.badge-eow .divider {
  display: inline-block;
  width: 40px;
  height: 1px;
  background: #c5cad1;
  vertical-align: middle;
  margin: 0 1rem;
}
.final-tribute {
  margin: 1.25rem auto 0;
  max-width: 520px;
  font-style: italic;
  color: #4a4a4a;
  font-size: 0.9375rem;
}

/* ===== BIOGRAPHICAL NARRATIVE ===== */
.biography {
  padding-top: 2.5rem;
}
.biography h2 {
  font-family: "Segoe UI", sans-serif;
  font-size: 1.375rem;
  color: #1e3a5f;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ffc408;
  font-weight: 600;
}
.biography p {
  margin: 0 0 1.1rem;
  font-size: 1.0625rem;
}
.biography p:first-of-type::first-letter {
  font-size: 2.8rem;
  font-weight: 700;
  color: #1e3a5f;
  float: left;
  line-height: 1;
  padding: 6px 10px 0 0;
  font-family: "Georgia", serif;
}
.attribution {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d9d9d9;
  font-style: italic;
  color: #4a4a4a;
  font-size: 0.9375rem;
}

/* ===== LINKS ===== */
a { color: #0542a0; }             /* 7.43:1 — AAA */
a:hover, a:focus-visible { text-decoration-thickness: 2px; }
.external-link::after {
  content: " (opens in new window)";
  font-size: 0.875rem;
  color: #4a4a4a;
}
.pdf-link::after {
  content: " (PDF)";
  font-size: 0.875rem;
  color: #4a4a4a;
}

/* ===== INDEX PAGE ===== */
.index-intro {
  background: #f0ead2;            /* warm memorial cream */
  border-left: 4px solid #1a1a1a;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  border-radius: 0 4px 4px 0;
}
.index-intro p:last-child { margin-bottom: 0; }
.officers-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.officers-grid li {
  margin: 0;
}
.officer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem 1.5rem;
  background: #fff;
  border: 1px solid #c5cad1;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  min-height: 300px;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}
.officer-card:hover,
.officer-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border-color: #1e3a5f;
  text-decoration: none;
}
.officer-card img {
  max-width: 140px;
  width: 100%;
  height: auto;
  border: 1px solid #d9d9d9;
  padding: 4px;
  background: #fff;
  margin-bottom: 1rem;
}
.officer-card .card-rank {
  font-family: "Segoe UI", sans-serif;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #4a4a4a;
  margin: 0 0 0.25rem;
}
.officer-card .card-name {
  font-family: "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}
.officer-card .card-eow {
  font-size: 0.8125rem;
  color: #4a4a4a;                 /* 9.74:1 */
  font-family: "Segoe UI", sans-serif;
}

/* ===== FOOTER ===== */
footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  background: #1a1a1a;
  color: #fff;
  text-align: center;
  font-size: 0.875rem;
  font-family: "Segoe UI", sans-serif;
  border-top: 3px solid #ffc408;
}
footer a { color: #ffc408; }
footer p { margin: 0.4rem 0; }
footer .memorial-quote {
  font-style: italic;
  max-width: 560px;
  margin: 0 auto 1rem;
  color: #e0e0e0;
  line-height: 1.7;
}

/* ===== UTILITY ===== */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .in-memoriam { padding: 2rem 1.25rem 1.5rem; }
  .in-memoriam h1 { font-size: 1.875rem; }
  .portrait-frame img { max-width: 220px; }
  .biography { padding-top: 1.5rem; }
  .biography h2 { font-size: 1.25rem; }
  .biography p { font-size: 1rem; }
  .biography p:first-of-type::first-letter { font-size: 2.25rem; }
  .officers-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ===== PRINT ===== */
@media print {
  .memorial-header, .skip-link, footer nav { display: none; }
  body { color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
  .in-memoriam h1 { color: #000; }
  .biography h2 { color: #000; border-bottom-color: #000; }
  main { max-width: none; }
}

/* ===== PHOTO GALLERY (secondary photos from memorial) ===== */
.memorial-gallery {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #d9d9d9;
}
.memorial-gallery h2 {
  font-family: "Segoe UI", sans-serif;
  font-size: 1.375rem;
  color: #1e3a5f;
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ffc408;
  font-weight: 600;
}
.memorial-gallery .gallery-note {
  color: #4a4a4a;
  font-style: italic;
  font-size: 0.9375rem;
  margin: 0 0 1.5rem;
}
.memorial-gallery .gallery-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.memorial-gallery .gallery-grid li { margin: 0; }
.memorial-gallery .gallery-grid figure {
  margin: 0;
  background: #fff;
  padding: 8px;
  border: 1px solid #c5cad1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.memorial-gallery .gallery-grid img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 600px) {
  .memorial-gallery .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}
