/* =====================================================================
   First Coast Model Railroad Society — site styles
   Accessibility goals (WCAG 2.1 AA):
   - All sizes in rem/em, so browser text-size settings and zoom work.
   - No fixed/sticky header when the screen is small OR zoomed in
     (zooming shrinks the CSS viewport, so the media query handles it).
   - High-contrast colors (4.5:1+ for text), large touch targets (48px).
   - Strong visible focus ring for keyboard users.
   - Respects "reduce motion" and Windows High Contrast settings.
   ===================================================================== */

:root {
  --navy:        #1c3050;
  --navy-dark:   #111f35;
  --navy-soft:   #2a4470;
  --red:         #a8262a;
  --red-dark:    #861d20;
  --brass:       #e0b84f;
  --cream:       #f7f3ea;
  --paper:       #ffffff;
  --sky:         #eaf0f7;
  --ink:         #1b2430;
  --ink-soft:    #3f4a58;
  --line:        #c9d2de;
  --focus:       #ffbf00;
  --radius:      14px;
  --shadow:      0 2px 6px rgba(17, 31, 53, .08), 0 10px 30px rgba(17, 31, 53, .10);
  --font:        "Atkinson Hyperlegible", "Segoe UI", Verdana, Arial, sans-serif;
  --font-head:   "Lato", "Segoe UI", Verdana, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.text-lg  { font-size: 112.5%; }
html.text-xl  { font-size: 125%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  font-family: var(--font);
  font-size: 1.1875rem;          /* ~19px at default browser size */
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  overflow-wrap: break-word;
}

a { color: var(--red); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--red-dark); text-decoration-thickness: .14em; }

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 7px #111;
  border-radius: 6px;
}

[tabindex="-1"]:focus { outline: none; box-shadow: none; }

.container { width: min(100% - 2.5rem, 72rem); margin-inline: auto; }
.narrow    { max-width: 46rem; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 2000;
  background: var(--focus); color: #111; font-weight: 700;
  padding: .75rem 1.25rem; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Site notice (e.g. "website being updated") ---------- */
.site-notice {
  background: var(--brass); color: #1a1406;
  font-weight: 700; text-align: center;
  padding: .7rem 1.25rem; line-height: 1.45;
}
.site-notice[hidden] { display: none; }

/* ---------- Header ---------- */
.site-header { background: var(--navy); color: #fff; z-index: 1000; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
/* Sticky only on roomy screens. Zoomed-in or small screens scroll normally. */
@media (min-width: 62em) and (min-height: 45em) {
  .site-header { position: sticky; top: 0; }
  /* keep jump-link targets from hiding under the pinned header */
  main [id] { scroll-margin-top: 11rem; }
}

.header-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem 1.25rem; padding-block: .75rem;
}
.brand { display: flex; align-items: center; gap: .85rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: #fff; }
.brand-name { font-family: var(--font-head); font-weight: 900; font-size: 1.2rem; line-height: 1.2; }
.brand-name small { display: block; font-family: var(--font); font-weight: 400; font-size: .9rem; color: #cfdcee; }

.header-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.textsize { display: flex; align-items: center; gap: .3rem; }
.textsize-label { font-size: .9rem; color: #cfdcee; margin-right: .2rem; }
.textsize button {
  min-width: 2.9rem; min-height: 2.9rem; border-radius: 8px; cursor: pointer;
  background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.5); font-weight: 700; line-height: 1;
}
.textsize button:nth-of-type(1) { font-size: .95rem; }
.textsize button:nth-of-type(2) { font-size: 1.15rem; }
.textsize button:nth-of-type(3) { font-size: 1.35rem; }
.textsize button[aria-pressed="true"] { background: #fff; color: var(--navy); border-color: #fff; }

.menu-toggle {
  display: none; align-items: center; gap: .5rem; min-height: 3rem; padding: .5rem 1.1rem;
  background: var(--red); color: #fff; border: 2px solid rgba(255,255,255,.4); border-radius: 8px;
  font-weight: 700; font-size: 1.05rem; cursor: pointer;
}
.menu-toggle .bars { display: inline-block; width: 1.3rem; height: .15rem; background: currentColor; position: relative; }
.menu-toggle .bars::before, .menu-toggle .bars::after {
  content: ""; position: absolute; left: 0; width: 100%; height: 100%; background: currentColor;
}
.menu-toggle .bars::before { top: -.4rem; } .menu-toggle .bars::after { top: .4rem; }

.site-nav { background: var(--navy-dark); border-top: 3px solid var(--red); }
.site-nav ul { list-style: none; padding: .4rem 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; }
.site-nav a {
  display: flex; align-items: center; min-height: 3rem; padding: .35rem 1.1rem;
  color: #e6eef8; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; border-radius: 8px;
}
.site-nav a:hover { background: var(--navy-soft); color: #fff; }
.site-nav a[aria-current="true"] { background: var(--red); color: #fff; }

/* Small screens (and zoomed-in desktops): big labelled Menu button */
@media (max-width: 52em) {
  .menu-toggle { display: inline-flex; }
  .js .site-nav[data-open="false"] { display: none; }
  .site-nav ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); padding: .6rem 1.25rem .9rem; }
  .site-nav a { justify-content: center; background: var(--navy-soft); }
  .textsize-label { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3.2rem; padding: .7rem 1.6rem; border-radius: 10px;
  font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; line-height: 1.2;
  text-decoration: none; border: 2px solid transparent; cursor: pointer; text-align: center;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #dfe8f4; color: var(--navy); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.75); }
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--sky); color: var(--navy); }
.btn-fb { background: #1466d6; color: #fff; }
.btn-fb:hover { background: #0f4fa8; color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; isolation: isolate;
  background: var(--navy) url("../img/banner-bridge-enhanced.jpg") center / cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(12,24,44,.92) 0%, rgba(12,24,44,.78) 45%, rgba(12,24,44,.40) 100%);
}
.hero-inner { padding-block: clamp(3rem, 8vh, 6.5rem); max-width: 44rem; }
.hero-logo { width: 7rem; height: 7rem; border-radius: 50%; border: 4px solid rgba(255,255,255,.35); margin-bottom: 1.25rem; background: #fff; }
.eyebrow { font-weight: 700; color: var(--brass); letter-spacing: .04em; font-size: 1.05rem; margin-bottom: .5rem; }
.hero h1 {
  font-family: var(--font-head); font-weight: 900; line-height: 1.1;
  font-size: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); margin-bottom: 1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.hero-lead { font-size: 1.3rem; color: #e8eff9; margin-bottom: 1.8rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- Visit strip ---------- */
.visit { margin-top: -2.5rem; position: relative; z-index: 2; }
.visit-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.visit-card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem; border-top: 5px solid var(--red); display: flex; gap: 1rem; align-items: flex-start;
}
.visit-card .ico {
  flex: none; width: 3rem; height: 3rem; border-radius: 50%; background: var(--sky); color: var(--navy);
  display: grid; place-items: center; font-size: 1.5rem;
}
.visit-card h2 { font-family: var(--font-head); font-size: 1.2rem; color: var(--navy); margin-bottom: .25rem; }
.visit-card p { font-size: 1.05rem; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-alt { background: var(--paper); }
.section-sky { background: var(--sky); }
.section-head { text-align: center; max-width: 46rem; margin: 0 auto 2.5rem; }
.section-head h2 {
  font-family: var(--font-head); font-weight: 900; color: var(--navy);
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); line-height: 1.15;
}
.section-head h2::after {
  content: ""; display: block; width: 4rem; height: .3rem; border-radius: 3px;
  background: var(--red); margin: .8rem auto 0;
}
.section-head p { margin-top: .9rem; color: var(--ink-soft); font-size: 1.15rem; }
.prose p + p { margin-top: 1rem; }
.prose { max-width: 40rem; }

/* ---------- Two-column layout ---------- */
.split { display: grid; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 54em) { .split { grid-template-columns: 1fr 1fr; } }
.photo-frame { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--line); }
.photo-frame img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.split h3 { font-family: var(--font-head); font-size: 1.6rem; color: var(--navy); line-height: 1.25; margin-bottom: 1rem; }

.callout {
  margin-top: 1.4rem; padding: 1rem 1.2rem; border-radius: 10px;
  background: var(--sky); border-left: 5px solid var(--navy); font-size: 1.05rem;
}

/* ---------- Upcoming shows ---------- */
.shows-list { list-style: none; padding: 0; display: grid; gap: 1.25rem; }
.show-card {
  display: grid; grid-template-columns: auto 1fr; gap: 1.25rem 1.5rem;
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem;
}
.show-date {
  width: 6.2rem; text-align: center; border-radius: 12px; overflow: hidden; align-self: start;
  border: 2px solid var(--navy); background: #fff; line-height: 1.1;
}
.show-date .m { display: block; background: var(--navy); color: #fff; font-weight: 700; padding: .35rem 0; font-size: 1rem; letter-spacing: .06em; }
.show-date .d { display: block; font-family: var(--font-head); font-weight: 900; font-size: 2.3rem; color: var(--navy); padding: .3rem 0 .1rem; }
.show-date .y { display: block; font-size: .9rem; color: var(--ink-soft); padding-bottom: .4rem; }
.show-card h3 { font-family: var(--font-head); font-size: 1.45rem; color: var(--navy); line-height: 1.25; margin-bottom: .5rem; }
.show-meta { list-style: none; padding: 0; display: grid; gap: .35rem; margin-bottom: .75rem; }
.show-meta li { display: flex; gap: .6rem; align-items: baseline; }
.show-meta i { color: var(--red); flex: none; width: 1.2rem; text-align: center; }
.show-desc { color: var(--ink-soft); margin-bottom: .9rem; white-space: pre-line; }
.show-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.show-links .btn { min-height: 2.9rem; padding: .5rem 1.1rem; font-size: 1rem; }
.cal-choices {
  margin-top: .9rem; padding: 1rem 1.1rem; border: 2px solid var(--line); border-radius: 12px; background: var(--sky);
}
.cal-title { font-weight: 700; color: var(--navy); margin-bottom: .6rem; }
.cal-buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.cal-buttons .btn { min-height: 2.9rem; padding: .5rem 1.1rem; font-size: 1rem; }
.cal-note { margin-top: .6rem; color: #14532d; font-weight: 700; }
.cal-note:empty { display: none; }
.shows-empty {
  background: var(--paper); border-radius: var(--radius); padding: 2rem; text-align: center;
  border: 2px dashed var(--line); color: var(--ink-soft); max-width: 46rem; margin: 0 auto;
}
@media (max-width: 34em) {
  .show-card { grid-template-columns: 1fr; }
  .show-date { width: auto; display: flex; align-items: baseline; gap: .5rem; border: 0; background: transparent; }
  .show-date .m, .show-date .d, .show-date .y { display: inline; background: none; color: var(--navy); padding: 0; font-size: 1.15rem; }
}

/* ---------- Feature cards ---------- */
.features { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); margin-bottom: 2.5rem; }
.feature {
  background: var(--paper); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow);
}
.feature .ico { font-size: 2rem; color: var(--red); margin-bottom: .6rem; display: block; }
.feature h3 { font-family: var(--font-head); color: var(--navy); font-size: 1.3rem; margin-bottom: .4rem; }
.feature p { color: var(--ink-soft); }

.info-panel {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.6rem 1.8rem; border-left: 6px solid var(--red); margin-bottom: 3rem;
}
.info-panel h3 { font-family: var(--font-head); color: var(--navy); font-size: 1.35rem; margin-bottom: .6rem; }
.info-panel p + p { margin-top: .7rem; }

/* ---------- Gallery ---------- */
.gallery-title { font-family: var(--font-head); color: var(--navy); font-size: 1.6rem; text-align: center; margin-bottom: 1.2rem; }
.gallery { list-style: none; padding: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.gallery button {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in; background: var(--line);
  border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s ease; }
.gallery button:hover img { transform: scale(1.04); }
.gallery-more { text-align: center; margin-top: 1.5rem; }
.gallery-status { text-align: center; color: var(--ink-soft); }

/* ---------- Venue list ---------- */
.venues { padding-left: 1.4rem; margin: 1rem 0; }
.venues li { padding: .2rem 0; }

/* ---------- Membership ---------- */
.benefits { list-style: none; padding: 0; }
.benefits li { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.benefits li:last-child { border-bottom: 0; }
.benefits i { color: var(--red); font-size: 1.4rem; flex: none; margin-top: .1rem; }

.cta {
  margin-top: 3rem; background: var(--navy); color: #fff; border-radius: 18px;
  padding: clamp(1.8rem, 4vw, 3rem); text-align: center;
  background-image: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}
.cta:focus { outline: none; box-shadow: none; }
.cta h3 { font-family: var(--font-head); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); margin-bottom: .6rem; }
.cta p { color: #dbe6f3; max-width: 38rem; margin: 0 auto 1.5rem; }
.cta .small { font-size: .98rem; margin: 1.3rem auto 0; }
.cta a:not(.btn) { color: #fff; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

/* ---------- Contact ---------- */
.section-navy { background: var(--navy); color: #fff; }
.section-navy .section-head h2 { color: #fff; }
.section-navy .section-head h2::after { background: var(--brass); }
.section-navy .section-head p { color: #dbe6f3; }
.contact-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.contact-card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.22);
  border-radius: var(--radius); padding: 1.5rem;
}
.contact-card .ico { font-size: 1.9rem; color: var(--brass); display: block; margin-bottom: .5rem; }
.contact-card h3 { font-family: var(--font-head); font-size: 1.25rem; margin-bottom: .4rem; }
.contact-card p, .contact-card address { color: #e3ebf5; font-style: normal; }
.contact-card a:not(.btn) { color: #fff; }
.contact-card a, .visit-card a, .info-panel a, .site-footer a { overflow-wrap: anywhere; }
.contact-card .btn { margin-top: .8rem; }

.map { background: var(--line); }
.map iframe { display: block; width: 100%; height: clamp(18rem, 45vh, 28rem); border: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: #d5e0ee; padding-block: 2.5rem 1.5rem; font-size: 1.02rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); padding-bottom: 1.8rem; border-bottom: 1px solid rgba(255,255,255,.15); }
.footer-brand { display: flex; gap: 1rem; align-items: flex-start; }
.footer-brand img { width: 4rem; height: 4rem; border-radius: 50%; flex: none; background: #fff; }
.footer-brand strong { display: block; color: #fff; font-family: var(--font-head); font-size: 1.1rem; }
.site-footer h2 { font-family: var(--font-head); color: #fff; font-size: 1.1rem; margin-bottom: .4rem; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; justify-content: space-between; align-items: center; padding-top: 1.2rem; font-size: .95rem; color: #b9c8db; }
.admin-link {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .3rem 1rem;
  color: #b9c8db !important; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; text-decoration: none; font-size: .9rem;
}
.admin-link:hover { color: #fff !important; border-color: #fff; }

/* ---------- Back to top ---------- */
.back-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 900;
  display: inline-flex; align-items: center; gap: .4rem; min-height: 3rem; padding: .5rem 1rem;
  background: var(--red); color: #fff; border-radius: 10px; text-decoration: none; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.back-top:hover { background: var(--red-dark); color: #fff; }
.back-top[hidden] { display: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0;
}
.lightbox::backdrop { background: rgba(5, 10, 20, .92); }
.lightbox-inner { height: 100%; display: flex; flex-direction: column; color: #fff; padding: .75rem; gap: .6rem; }
.lightbox-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.lightbox-count { font-size: 1.05rem; }
.lightbox figure { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; }
.lightbox figure img { max-width: 100%; max-height: calc(100vh - 12rem); object-fit: contain; border-radius: 6px; }
.lightbox figcaption { text-align: center; font-size: 1.1rem; max-width: 50rem; }
.lightbox-nav { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; }
.lightbox .btn { min-width: 9rem; }

/* ---------- Motion & high contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .textsize button, .menu-toggle, .site-nav a, .visit-card, .show-card, .feature, .contact-card { border: 2px solid CanvasText; }
  .hero::before { background: Canvas; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .site-nav, .back-top, .map, .gallery, .gallery-more, .site-notice { display: none !important; }
  body { background: #fff; font-size: 12pt; }
}
