/* ============================================================
   CVMRR.CSS — Connecticut Valley Model Railroad Club
   Green Mountain Railroad color scheme
   Last updated: May 2026
   ============================================================ */

/* ── 1. CSS Custom Properties (Color Tokens) ─────────────── */
:root {
  /* Green Mountain Railroad greens */
  --green-dark:    #1e4d0f;   /* Header bg, h2/h3, text links        */
  --green-mid:     #2d6e18;   /* Nav bar bg, sub-headers             */
  --green-light:   #c8dfc0;   /* Borders, dividers — use sparingly   */
  --green-footer:  #142e08;   /* Footer background                   */

  /* Green Mountain Railroad yellow */
  --yellow:        #e8b800;   /* Accents, hover, rule lines, borders */
  --yellow-pale:   #fdf5d0;   /* Callout/news box backgrounds        */

  /* Typography */
  --text-primary:  #1a1a1a;
  --text-secondary:#4a4a4a;
  --text-muted:    #666666;
  --text-footer:   #c8dfc0;

  /* Links */
  --link-color:    #1e4d0f;
  --link-hover:    #c07800;   /* Darker gold — readable on white     */
  --link-visited:  #5a7a52;

  /* Page */
  --page-bg:       #ffffff;
  --content-max:   960px;

  /* Spacing */
  --gap:           1.4rem;
}

/* ── 2. Reset & Base ─────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--page-bg);
}

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

/* ── 3. Page Shell ───────────────────────────────────────── */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-area {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--gap) 1.25rem;
}

/* ── 4. Site Header ──────────────────────────────────────── */
.site-header {
  background: var(--green-dark);
  border-bottom: 4px solid var(--yellow);
}

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

.site-logo {
  flex-shrink: 0;
}

.site-logo img {
  display: block;
  /* Image is 398x160 — scale down gracefully on smaller screens */
  max-height: 90px;
  width: auto;
}

.site-title {
  color: #ffffff;
}

.site-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.site-title p {
  font-size: 0.8rem;
  color: var(--yellow);
  margin-top: 0.25rem;
  letter-spacing: 0.03em;
}

/* ── 5. Navigation Bar ───────────────────────────────────── */
.site-nav {
  background: var(--green-mid);
  border-bottom: 3px solid var(--yellow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

.site-nav a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.65rem 1.1rem;
  letter-spacing: 0.02em;
  transition: background 0.15s, color 0.15s;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;   /* overlaps the nav border-bottom */
}

/* Nav visited: always white — visited distinction belongs in content, not nav */
.site-nav a:visited {
  color: #ffffff;
}

.site-nav a:hover,
.site-nav a:visited:hover {
  background: var(--green-dark);
  color: var(--yellow);
}

.site-nav a.active {
  background: var(--green-dark);
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  margin-left: auto;
  /* iOS Safari: remove tap delay and highlight flash */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── 6. News / Announcement Banner ──────────────────────── */
.news-banner {
  background: var(--yellow-pale);
  border-bottom: 2px solid var(--yellow);
  padding: 0.6rem 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dark);
}

.news-banner a {
  color: var(--green-dark);
  text-decoration: underline;
}

.news-banner a:hover {
  color: var(--link-hover);
}

/* ── 7. Headings ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  color: var(--green-dark);
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; border-left: 4px solid var(--yellow); padding-left: 0.6rem; margin-top: 1.5rem; }
h3 { font-size: 1.05rem; margin-top: 1.2rem; }
h4 { font-size: 0.95rem; margin-top: 1rem; }

/* Section heading with rule — use class="section-heading" */
.section-heading {
  margin: 1.5rem 0 0.75rem;
}

/* ── 8. Body Text & Paragraphs ───────────────────────────── */
p {
  margin-bottom: 0.9rem;
  color: var(--text-primary);
}

/* ── 9. Links ────────────────────────────────────────────── */
a {
  color: var(--link-color);
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited);
}

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

/* ── 10. Horizontal Rules & Dividers ─────────────────────── */
hr {
  border: none;
  height: 2px;
  background: linear-gradient(to right, var(--green-dark), var(--yellow), var(--green-dark));
  border-radius: 2px;
  margin: 1.5rem 0;
}

/* Thin rule — use <hr class="rule-thin"> */
hr.rule-thin {
  height: 1px;
  background: var(--green-light);
  margin: 1rem 0;
}

/* ── 11. Callout / Info Boxes ────────────────────────────── */
.callout {
  background: var(--yellow-pale);
  border: 1px solid var(--yellow);
  border-left: 5px solid var(--yellow);
  border-radius: 0 5px 5px 0;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  color: var(--green-dark);
  display: block;
  margin-bottom: 0.35rem;
}

/* ── 12. Lists ───────────────────────────────────────────── */
ul, ol {
  margin: 0.5rem 0 0.9rem 1.5rem;
}

li {
  margin-bottom: 0.3rem;
}

/* ── 13. Photo Gallery Grid ──────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.gallery a {
  display: block;
  border: 2px solid var(--green-light);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gallery a:hover {
  border-color: var(--yellow);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.gallery img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.gallery figcaption {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.5rem;
  background: #f8f8f8;
  text-align: center;
}

/* ── 14. Show Flyer Layout ───────────────────────────────── */
.show-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1rem;
}

.show-flyer img {
  max-width: 280px;
  border: 2px solid var(--green-light);
  border-radius: 4px;
}

.show-details h3 {
  color: var(--green-dark);
  margin-top: 0;
}

.show-details .show-date {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.25rem;
}

.show-details .show-location {
  font-size: 1rem;
  color: #cc0000;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.show-details .show-hours {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

/* Ticket price list */
.ticket-list {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
}

.ticket-list li {
  padding: 0.2rem 0;
  font-size: 0.9rem;
}

.ticket-list li::before {
  content: "✦ ";
  color: var(--yellow);
  font-size: 0.75rem;
}

/* ── 15. Shows Archive List ──────────────────────────────── */
.shows-archive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}

.shows-archive a {
  display: block;
  background: var(--yellow-pale);
  border: 1px solid var(--yellow);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}

.shows-archive a:hover {
  background: var(--yellow);
  color: var(--green-dark);
}

.shows-archive a.current-year {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--yellow);
}

/* ── 16. Maps Embed ──────────────────────────────────────── */
.map-embed {
  margin: 1rem 0;
  border: 2px solid var(--green-light);
  border-radius: 4px;
  overflow: hidden;
  max-width: 500px;
}

.map-embed iframe {
  display: block;
  width: 100%;
  border: none;
}

/* ── 17. Facebook Link Block ─────────────────────────────── */
.facebook-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--yellow-pale);
  border: 1px solid var(--yellow);
  border-radius: 5px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  color: var(--green-dark);
  text-decoration: none;
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.facebook-link:hover {
  background: var(--yellow);
  color: var(--green-dark);
}

/* ── 18. "Back to" Navigation Link ──────────────────────── */
.back-link {
  display: inline-block;
  color: var(--green-mid);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 1rem;
}

.back-link::before {
  content: "← ";
}

.back-link:hover {
  color: var(--link-hover);
}

/* ── 19. Site Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--green-footer);
  border-top: 3px solid var(--yellow);
  margin-top: auto;
}

.site-footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-footer img {
  /* cvmrrc.jpg club logo 124x74 */
  height: 52px;
  width: auto;
  flex-shrink: 0;
}

.site-footer-text {
  font-size: 0.78rem;
  color: var(--text-footer);
  line-height: 1.6;
}

.site-footer-text a {
  color: var(--yellow);
}

.site-footer-text a:hover {
  color: #ffffff;
}

/* ── 20. Tables (show dealer lists, etc.) ────────────────── */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.9rem;
}

th {
  background: var(--green-dark);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--green-light);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) td {
  background: #f7faf5;
}

/* ── 21. Responsive — Mobile (≤768px) ───────────────────── */
@media (max-width: 768px) {

  /* Header: stack logo above title on very small screens */
  .site-header-inner {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .site-logo img {
    max-height: 70px;
  }

  .site-title h1 {
    font-size: 1.1rem;
  }

  /* Nav: show toggle button, collapse links */
  .nav-toggle {
    display: block;
  }

  .site-nav-inner {
    flex-direction: column;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav-inner.open {
    max-height: 400px;
  }

  .site-nav a {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--green-dark);
    border-left: none;
    margin-bottom: 0;
  }

  .site-nav a.active {
    border-bottom: 1px solid var(--green-dark);
    border-left: 4px solid var(--yellow);
    border-bottom-color: var(--green-dark);
  }

  /* Show layout: stack on mobile */
  .show-layout {
    grid-template-columns: 1fr;
  }

  .show-flyer img {
    max-width: 100%;
  }

  /* Gallery: 2 columns on mobile */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Shows archive: 2 columns on mobile */
  .shows-archive {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Activity cards: single column on mobile */
  .activity-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .site-title h1 {
    font-size: 1rem;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── 22. Shows Archive — Item Internals ─────────────────── */

/* Each archive item (link or gap) is a flex column */
.shows-archive a,
.shows-archive .show-gap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  padding: 0.4rem 0.5rem;
  text-align: center;
}

.show-year {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.show-loc {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 0.15rem;
}

/* COVID gap — greyed-out non-link entry */
.shows-archive .show-gap {
  background: #eeeeee;
  border: 1px solid #cccccc;
  border-radius: 4px;
  color: #888888;
  font-style: italic;
  cursor: default;
}

.shows-archive .show-gap .show-year {
  font-size: 1.15rem;
  font-weight: 700;
}

/* ── 23. Page Subtitle ───────────────────────────────────── */
.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: -0.3rem;
  margin-bottom: 0.5rem;
}

/* ── 24. Activity Cards Grid ─────────────────────────────── */
.activity-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.activity-card {
  border: 1px solid var(--green-light);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}

.activity-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.14);
}

.activity-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

/* Text-only card variant — emoji icon replaces photo */
.activity-card-icon {
  width: 100%;
  height: 160px;
  background: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  flex-shrink: 0;
}

.activity-card-body {
  padding: 0.85rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.activity-card-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  color: var(--green-dark);
}

.activity-card-body p {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  flex: 1;
}

.activity-card-body a {
  display: inline-block;
  background: var(--green-mid);
  color: #ffffff;
  padding: 0.3rem 0.85rem;
  border-radius: 3px;
  font-size: 0.825rem;
  font-weight: 700;
  text-decoration: none;
  align-self: flex-start;
  transition: background 0.15s, color 0.15s;
}

.activity-card-body a:visited {
  color: #ffffff;
}

.activity-card-body a:hover {
  background: var(--green-dark);
  color: var(--yellow);
}

/* ── Side-by-side layout halves (PowerHouse Mall page) ──── */
.layout-halves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.layout-half {
  margin: 0;
}

.layout-half img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid var(--green-light);
  border-radius: 4px;
  transition: border-color 0.15s;
}

.layout-half a:hover img {
  border-color: var(--yellow);
}

.layout-half figcaption {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.3rem 0 0;
}

@media (max-width: 480px) {
  .layout-halves {
    grid-template-columns: 1fr;
  }
}

/* "Photos coming soon" note on placeholder cards */
.card-note {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: auto;
}

/* ── 25. Show Flyer Gallery ──────────────────────────────── */
.flyer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.flyer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.flyer-card img {
  width: 100%;
  height: auto;
  border: 2px solid var(--green-mid);
  border-radius: 4px;
  transition: border-color 0.15s;
}

.flyer-card a:hover img {
  border-color: var(--yellow);
}

.flyer-card .flyer-year {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
  margin-top: 0.5rem;
  display: block;
}

.flyer-card .flyer-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.15rem 0;
  display: block;
}

.flyer-card a.flyer-pdf {
  font-size: 0.78rem;
  color: var(--green-mid);
  text-decoration: none;
  margin-top: 0.3rem;
  display: inline-block;
}

.flyer-card a.flyer-pdf:hover { text-decoration: underline; }

.flyer-card .flyer-missing {
  width: 100%;
  min-height: 120px;
  background: var(--yellow-pale);
  border: 2px dashed var(--green-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
}

/* ── 26. Captioned Gallery ───────────────────────────────── */
.gallery-captioned {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.gallery-captioned figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.gallery-captioned figure img {
  width: 100%;
  height: auto;
  border: 2px solid var(--green-mid);
  border-radius: 4px;
  display: block;
}

.gallery-captioned figure a:hover img {
  border-color: var(--yellow);
}

.gallery-captioned figcaption {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* ── 27. Buttons ─────────────────────────────────────────── */
.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--green-dark);
  color: var(--yellow);
  border: 2px solid var(--green-dark);
}

.btn-primary:hover {
  background: var(--green-mid);
  color: #fff;
  border-color: var(--green-mid);
}

.btn-secondary {
  background: transparent;
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
}

.btn-secondary:hover {
  background: var(--green-dark);
  color: var(--yellow);
}

/* ── 27. Print ───────────────────────────────────────────── */
@media print {
  .site-nav,
  .nav-toggle,
  .news-banner,
  .back-link { display: none; }

  .site-header {
    background: #fff;
    border-bottom: 2px solid #000;
  }

  .site-title h1 { color: #000; }

  body { font-size: 11pt; }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.75em;
    color: #555;
  }
}
