/* ==========================================================================
   USS Leyte (CV-32) Association — site stylesheet
   One stylesheet for every page. Colors and sizes are set once in :root,
   so changing a value there changes it everywhere.
   ========================================================================== */

:root {
  --navy:        #14284b;   /* header, headings */
  --navy-deep:   #0c1a33;   /* footer */
  --gold:        #c8a24a;   /* accents, rules */
  --gold-light:  #e9d7a6;
  --paper:       #faf8f3;   /* page background */
  --card:        #ffffff;
  --ink:         #1f2328;   /* body text */
  --muted:       #5b6270;   /* captions, notes */
  --line:        #ddd6c6;   /* borders */
  --link:        #1d4e89;
  --link-hover:  #0f2f57;

  --serif: Georgia, "Times New Roman", Times, serif;
  --sans:  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --page-width: 62rem;
  --text-width: 42rem;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; }          /* 18px base: easier reading */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover, a:focus { color: var(--link-hover); }

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p, ul, ol { margin: 0 0 1em; }

/* ---------- Skip link (keyboard users) ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: var(--navy-deep);
  padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- Header and navigation ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 4px solid var(--gold);
}
.site-header .inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.1rem 1rem 0;
}
.site-title {
  display: block;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  line-height: 1.2;
}
.site-title:hover, .site-title:focus { color: var(--gold-light); }
.site-tagline {
  margin: 0.2rem 0 0.9rem;
  color: var(--gold-light);
  font-size: 0.95rem;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
}
.site-nav a {
  display: block;
  padding: 0.55rem 0.8rem;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 4px 4px 0 0;
}
.site-nav a:hover, .site-nav a:focus { background: rgba(255,255,255,0.12); color: #fff; }
.site-nav a[aria-current="page"] { background: var(--gold); color: var(--navy-deep); }

/* ---------- Main content ---------- */
main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0.5rem 1rem 3rem;
  overflow-wrap: break-word;   /* long web addresses wrap instead of widening the page */
}
.prose { max-width: var(--text-width); }

.breadcrumb { font-size: 0.9rem; color: var(--muted); margin: 1.2rem 0 0; }
.breadcrumb a { color: var(--muted); }

.lead { font-size: 1.15rem; }

.note {
  background: var(--card);
  border-left: 4px solid var(--gold);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0;
  color: var(--muted);
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 4px solid var(--gold);
  font-family: var(--serif);
  font-style: italic;
  color: #3a3f47;
}
blockquote cite { display: block; margin-top: 0.4rem; font-style: normal; font-size: 0.9rem; color: var(--muted); }

/* ---------- Hero photo (Home page) ---------- */
.hero { margin: 1.5rem 0 0; }
.hero img {
  display: block;
  width: 100%;
  max-width: 780px;          /* the source photo is 780px wide; don't stretch it */
  margin: 0 auto;
  border: 1px solid var(--line);
}
figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.4rem;
}

/* ---------- Key dates strip ---------- */
.facts {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}
.facts li {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  padding: 0.7rem 0.9rem;
}
.facts .date { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--navy); font-weight: bold; }
.facts .what { font-size: 0.9rem; color: var(--muted); }

/* ---------- Section cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.1rem 1.2rem;
  text-decoration: none;
  color: var(--ink);
}
.card:hover, .card:focus { border-color: var(--gold); box-shadow: 0 2px 8px rgba(20,40,75,0.12); color: var(--ink); }
.card h3 { margin: 0 0 0.35rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Photos and figures inside pages ---------- */
.figure { margin: 1.5rem 0; }
.figure img {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--card);
}
.figure-small img { max-width: 260px; }

/* Picture beside text on wide screens, stacked on phones */
.split { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 48rem) {
  .split { grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); }
  .split .figure { margin-top: 0; }
}

/* Long lists of names in columns */
.names { columns: 2 16rem; column-gap: 2rem; padding-left: 1.1rem; font-size: 0.95rem; }
.names li { break-inside: avoid; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; background: var(--card); min-width: 100%; }
th, td { text-align: left; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--navy); color: #fff; font-weight: 600; }
tbody tr:nth-child(even) { background: #f4f1ea; }
td:nth-child(n+2) { white-space: nowrap; }

/* Tables marked class="stack" become one card per row on phones */
@media (max-width: 40rem) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); }
  table.stack td { border: 0; padding: 0.1rem 0; white-space: normal; }
  table.stack td:first-child { font-family: var(--serif); font-weight: bold; color: var(--navy); }
  table.stack td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}

/* ---------- Lists of documents (newsletters, reunion flyers) ---------- */
.doc-list { list-style: none; padding: 0; }
.doc-list li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.doc-list .meta { color: var(--muted); font-size: 0.9rem; }

small { font-size: 0.88rem; color: var(--muted); }

/* Newsletter pages: section headings a little smaller, bylines under them */
.newsletter h2 { font-size: 1.3rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.byline { font-style: italic; color: var(--muted); margin-top: -0.3em; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #cfd6e2;
  font-size: 0.9rem;
  border-top: 4px solid var(--gold);
}
.site-footer .inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
.site-footer a { color: var(--gold-light); }
.site-footer p { margin: 0 0 0.4rem; }

/* ---------- Small screens ---------- */
@media (max-width: 40rem) {
  html { font-size: 106.25%; }       /* 17px */
  h1 { font-size: 1.75rem; }
  .site-title { font-size: 1.4rem; }
  .site-nav a { padding: 0.45rem 0.6rem; }
}

/* ---------- Printing ---------- */
@media print {
  .site-nav, .skip-link { display: none; }
  .site-header, .site-footer { background: none; color: #000; border: 0; }
  .site-title, .site-tagline { color: #000; }
  a { color: #000; }
}

/* In Memoriam: A-Z jump links */
.jump { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.jump a { display: inline-block; min-width: 2rem; text-align: center; padding: 0.2rem 0.4rem; border: 1px solid var(--line); background: var(--card); text-decoration: none; }

/* Photos page: grid of featured photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.photo-grid figure { margin: 0; background: var(--card); border: 1px solid var(--line); }
.photo-grid img { display: block; width: 100%; height: 13rem; object-fit: cover; }
.photo-grid figcaption { text-align: left; padding: 0.5rem 0.7rem 0.7rem; color: var(--ink); }
.photo-grid figcaption span { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
