/* ══════════════════════════════════════════════════════════════
   Illinois Terminal Division, NMRA — style.css
   One stylesheet for the whole site. Colors are set once below;
   change them here and every page follows.
   ══════════════════════════════════════════════════════════════ */

/* ── Colors and sizes ─────────────────────────────────────────── */
:root {
  --green-light: #84c495;   /* page background (original ITD green)   */
  --green:       #488f3c;   /* band behind the content                */
  --green-dark:  #2c6530;   /* header and footer                      */
  --green-text:  #2d7a41;   /* headings on white                      */
  --gold:        #ffbb00;   /* menu highlight                         */
  --gold-soft:   #fff4d1;   /* notice boxes                           */
  --blue:        #006797;   /* card borders and links                 */
  --ink:         #1d1d1d;
  --muted:       #555;
  --paper:       #ffffff;
  --radius:      6px;
  --content:     1100px;    /* maximum page width                     */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Verdana, sans-serif;
}

/* ── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--green-light);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a { color: var(--blue); }
a:hover { color: #00405e; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  color: var(--green-text);
  line-height: 1.25;
  margin: 1.4em 0 0.5em;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--gold);
  color: #000;
  padding: 0.5em 1em;
  z-index: 200;
}
.skip-link:focus { left: 1em; }

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
  text-decoration: none;
}
.brand:hover { color: #fff; }
.brand img {
  width: 120px;
  background: #fff;
  border-radius: 50%;
  padding: 3px 6px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: clamp(1.2rem, 3.5vw, 1.7rem); font-weight: 700; letter-spacing: 0.02em; }
.brand-sub { font-size: 0.9rem; opacity: 0.9; }

/* ── Menu ─────────────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  font: inherit;
  font-weight: 600;
  background: var(--gold);
  color: #000;
  border: 0;
  border-radius: var(--radius);
  padding: 0.45em 0.9em;
  white-space: nowrap;
  cursor: pointer;
}

.site-nav { background: var(--green); }

.site-nav > ul {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 0.5rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.site-nav li { position: relative; }

.site-nav a {
  display: block;
  padding: 0.7em 1em;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.site-nav > ul > li > a:hover,
.site-nav > ul > li:focus-within > a,
.site-nav a[aria-current="page"],
.site-nav .current-section > a {
  background: var(--gold);
  color: #000;
}

.has-sub > a::after { content: " \25BE"; }

/* Drop-down lists */
.site-nav li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  min-width: 15rem;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid #ccc;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}
.site-nav li:hover > ul,
.site-nav li:focus-within > ul { display: block; }

.site-nav li ul a {
  color: var(--ink);
  font-weight: 500;
  padding: 0.5em 1em;
}
.site-nav li ul a:hover,
.site-nav li ul a[aria-current="page"] {
  background: var(--gold-soft);
  color: #000;
}

/* ── Page body ────────────────────────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: var(--content);
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--paper);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}
.card a[href^="mailto:"] { overflow-wrap: anywhere; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.lead { font-size: 1.15rem; }

.notice {
  background: var(--gold-soft);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.notice > :first-child { margin-top: 0; }
.notice > :last-child { margin-bottom: 0; }

/* Two or three columns of cards on wide screens, one column on phones */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.grid > .card { margin-bottom: 0; }

/* Meeting schedule: date in bold, details underneath */
.schedule { list-style: none; padding: 0; margin: 0; }
.schedule li { padding: 0.6rem 0; border-bottom: 1px solid #e3e3e3; }
.schedule li:last-child { border-bottom: 0; }
.schedule strong { display: block; color: var(--green-text); }

/* Lists of documents */
.doc-list { padding-left: 1.2rem; }
.doc-list li { margin: 0.35rem 0; }
.filetype {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 0 0.3em;
  margin-left: 0.3em;
  white-space: nowrap;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid #e3e3e3; }
thead th { background: var(--green-dark); color: #fff; }
tbody tr:nth-child(even) { background: #f4faf5; }

/* Google Calendar embed */
.calendar-embed {
  position: relative;
  width: 100%;
  height: 650px;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  overflow: hidden;
}
.calendar-embed iframe { width: 100%; height: 100%; border: 0; }
.small { font-size: 0.875rem; color: var(--muted); overflow-wrap: anywhere; }

/* Photo gallery (opens in a lightbox) */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1.25rem;
  margin: 1rem 0;
}
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 6px solid #ddd;
  border-radius: var(--radius);
  transition: border-color 0.15s;
}
.gallery a:hover img, .gallery a:focus-visible img { border-color: var(--gold); }
.gallery figcaption { text-align: center; font-size: 0.95rem; margin-top: 0.4rem; }

/* Train show headline block */
.show-hero {
  text-align: center;
  background: var(--paper);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  margin-bottom: 1.5rem;
}
.show-hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); margin: 0; }
.show-hero .venue { font-size: 1.25rem; font-weight: 600; margin: 0.5rem 0; }
.show-hero .date { font-size: clamp(1.5rem, 5vw, 2.4rem); font-weight: 800; color: #b02a10; margin: 0.5rem 0; }
.show-hero .admission {
  display: inline-block;
  background: var(--gold);
  color: #000;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.3em 1.2em;
}

.button {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.5em 1em;
  margin: 0.25rem 0.25rem 0.25rem 0;
}
.button:hover { background: #00405e; color: #fff; }

.columns-list { columns: 3 12rem; padding-left: 1.2rem; }

.banner { text-align: center; margin-top: 1rem; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  background: var(--green-dark);
  color: #fff;
  font-size: 0.95rem;
}
.footer-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
}
.footer-inner p { margin: 0.25rem 0; }
.footer-logo img {
  display: block;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
}
.site-footer a { color: var(--gold); }
.site-footer a:hover { color: #fff; }
.footer-links a { margin-right: 1.1em; white-space: nowrap; }
.updated { opacity: 0.85; font-size: 0.875rem; }

/* ── Phones and small tablets (≤ 760px) ───────────────────────── */
@media (max-width: 760px) {
  .brand img { width: 84px; }
  .brand-sub { display: none; }

  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; }

  .site-nav > ul { flex-direction: column; padding: 0.25rem 0; }
  .site-nav a { padding: 0.65em 1.25em; }

  /* No hover on touch screens: show sub-pages inline */
  .site-nav li ul {
    display: block;
    position: static;
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0 0 0.25rem 1.25rem;
  }
  .site-nav li ul a { color: #fff; font-weight: 400; padding: 0.4em 1.25em; }
  .site-nav li ul a:hover,
  .site-nav li ul a[aria-current="page"] { background: rgba(255, 255, 255, 0.15); color: #fff; }
  .has-sub > a::after { content: ""; }
  .site-nav .current-section > a { background: transparent; color: #fff; }
  .site-nav .current-section > a[aria-current="page"] { background: var(--gold); color: #000; }

  .calendar-embed { height: 520px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Printing (e.g. the show page or contact list) ────────────── */
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  body { background: #fff; }
  .card, .show-hero { border: 0; padding: 0; }
}
