/* Millis Historic Trail — shared stylesheet
   Aged parchment / colonial New England aesthetic */

:root {
  --bg: #faf6ed;
  --bg-panel: #f3ecdc;
  --text: #1a1209;
  --accent: #c49a2a;
  --rust: #8b3a1a;
  --line: #d8cdb3;
  --shadow: rgba(26, 18, 9, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: #faf6ed;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(196, 154, 42, 0.05), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(139, 58, 26, 0.04), transparent 55%);
  color: var(--text);
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

a { color: var(--rust); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.narrow { max-width: 760px; }

/* ---- Site header / nav ---- */
.site-header {
  border-bottom: 3px double var(--accent);
  background: rgba(250, 246, 237, 0.95);
  position: sticky;
  top: 0;
  z-index: 1100;
  backdrop-filter: blur(4px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  max-width: 1080px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.brand {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: 0.5px;
}
.brand:hover { text-decoration: none; color: var(--rust); }
.brand small {
  display: block;
  font-family: "Libre Baskerville", serif;
  font-weight: 400;
  font-size: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.nav-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.nav-links a {
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.nav-links a:hover { color: var(--rust); text-decoration: none; }

.nav-toggle { display: none; }
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  padding: 8px;
}
.nav-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle:checked + .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle:checked + .nav-burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked + .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero {
  text-align: center;
  padding: 70px 20px 56px;
  border-bottom: 1px solid var(--line);
}
.hero .eyebrow {
  font-size: 0.8rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem);
  margin: 0 0 16px;
}
.hero p.lede {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.05rem;
  font-style: italic;
  color: #4a3c28;
}
.hero .meta {
  margin-top: 18px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--rust);
}
.rule {
  width: 90px;
  height: 2px;
  background: var(--accent);
  border: none;
  margin: 22px auto;
}

.btn {
  display: inline-block;
  padding: 11px 26px;
  background: var(--rust);
  color: #faf6ed;
  font-family: "Playfair Display", serif;
  font-size: 0.95rem;
  letter-spacing: 1px;
  border-radius: 2px;
  transition: background 0.2s;
}
.btn:hover { background: #6f2d12; text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--rust);
  border: 1.5px solid var(--rust);
}
.btn-outline:hover { background: var(--rust); color: #faf6ed; }

.map-section { padding: 50px 0; }
#map {
  width: 100%;
  height: 480px;
  border: 4px solid #fff;
  outline: 1px solid var(--line);
  box-shadow: 0 6px 24px var(--shadow);
  border-radius: 3px;
}
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 8px; }
.section-head p { color: #5a4a32; margin: 0; font-style: italic; }

.stops-section { padding: 30px 0 60px; }
.stops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.stop-card {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 3px 10px var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s;
  display: flex;
  flex-direction: column;
}
.stop-card:hover { transform: translateY(-4px); box-shadow: 0 10px 22px var(--shadow); }
.card-cover {
  position: relative;
  height: 170px;
  background:
    repeating-linear-gradient(45deg, #ece3cd, #ece3cd 12px, #e4d9bd 12px, #e4d9bd 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}
.card-cover .cover-ph {
  color: #8a7a58;
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 1px;
}
.card-cover .cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.stop-card .num {
  font-family: "Playfair Display", serif;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 2px;
}
.stop-card h3 { margin: 4px 0 8px; font-size: 1.3rem; }
.stop-card .addr { font-size: 0.85rem; color: #5a4a32; margin: 0 0 16px; flex: 1; }
.stop-card a.card-link {
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rust);
  font-family: "Playfair Display", serif;
}

.about-section {
  padding: 60px 0;
  background: #f5efe1;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about-section p { margin: 0 0 18px; }

.page-body { padding: 50px 0 60px; }
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 44px;
  align-items: start;
}
.article h2 { font-size: 1.7rem; margin: 36px 0 12px; }
.article p { margin: 0 0 18px; }
.article .byline {
  font-style: italic;
  color: #5a4a32;
  margin-bottom: 24px;
  font-size: 0.92rem;
}

.figure {
  margin: 28px 0;
  background: #fffdf7;
  border: 1px solid var(--line);
  padding: 12px;
  box-shadow: 0 3px 10px var(--shadow);
}
.figure .placeholder-img {
  background:
    repeating-linear-gradient(45deg, #ece3cd, #ece3cd 12px, #e4d9bd 12px, #e4d9bd 24px);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a7a58;
  font-style: italic;
  letter-spacing: 1px;
  border: 1px dashed #c3b489;
}
.figure figcaption {
  font-size: 0.82rem;
  color: #5a4a32;
  padding: 10px 4px 2px;
}
.figure .credit { display: block; color: var(--accent); font-style: italic; }

.photo-gallery {
  margin: 38px 0 8px;
  padding-top: 26px;
  border-top: 2px solid var(--accent);
}
.photo-gallery h2 { margin: 0 0 6px; font-size: 1.5rem; }
.photo-gallery .gallery-note {
  font-style: italic;
  color: #5a4a32;
  font-size: 0.9rem;
  margin: 0 0 22px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.gallery-item {
  margin: 0;
  background: #fffdf7;
  border: 1px solid var(--line);
  padding: 10px;
  box-shadow: 0 3px 10px var(--shadow);
}
.gallery-item .placeholder-img { height: 180px; position: relative; overflow: hidden; }
.placeholder-img .cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.placeholder-img .ph-label { font-style: italic; }
.gallery-item figcaption {
  font-size: 0.78rem;
  color: #5a4a32;
  padding: 8px 2px 2px;
}
.gallery-item .credit { color: var(--accent); font-style: italic; }

.coming-soon {
  background: #f5efe1;
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  font-style: italic;
  color: #5a4a32;
  margin: 24px 0;
}

.sidebar { position: sticky; top: 90px; }
.fact-box, .qr-box {
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 22px;
  box-shadow: 0 3px 10px var(--shadow);
  margin-bottom: 24px;
}
.fact-box h3, .qr-box h3 {
  font-size: 1.1rem;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}
.fact-box dl { margin: 0; }
.fact-box dt {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 12px;
}
.fact-box dt:first-child { margin-top: 0; }
.fact-box dd { margin: 2px 0 0; font-size: 0.95rem; }
.qr-placeholder {
  width: 150px;
  height: 150px;
  margin: 0 auto 12px;
  border: 2px dashed #c3b489;
  background:
    repeating-linear-gradient(45deg, #ece3cd, #ece3cd 8px, #e4d9bd 8px, #e4d9bd 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  color: #8a7a58;
  font-style: italic;
  padding: 10px;
}
.qr-img {
  width: 170px;
  height: 170px;
  margin: 0 auto 12px;
  display: block;
  border: 1px solid var(--line);
  background: #fffdf7;
  padding: 6px;
}
.qr-box p { font-size: 0.78rem; color: #5a4a32; text-align: center; margin: 0; }

.stop-nav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f5efe1;
}
.stop-nav .container {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.stop-nav a {
  font-family: "Playfair Display", serif;
  font-size: 0.92rem;
  color: var(--rust);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stop-nav a span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.stop-nav .sn-prev { text-align: left; flex: 1; }
.stop-nav .sn-next { text-align: right; flex: 1; }
.stop-nav .sn-map {
  align-self: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.72rem;
  padding: 0 6px;
}

.history-article {
  margin: 0 auto 56px;
  padding-bottom: 40px;
  border-bottom: 3px double var(--line);
}
.history-article:last-child { border-bottom: none; }
.history-article h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 0 0 6px; }

.site-footer {
  background: #2a1d0e;
  color: #e8dcc2;
  padding: 44px 20px;
  text-align: center;
  border-top: 4px solid var(--accent);
}
.site-footer .ft-name {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 8px;
}
.site-footer p { margin: 6px 0; font-size: 0.85rem; }
.site-footer .accent { color: var(--accent); }
.site-footer a { color: #e8dcc2; text-decoration: underline; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  #map { height: 380px; }
}

@media (max-width: 720px) {
  .nav-burger { display: flex; }
  .nav-links {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    border-top: 1px solid var(--line);
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
  }
  .nav-links a:last-child { border-bottom: none; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .hero { padding: 48px 16px 40px; }
  .hero .meta .btn { display: block; margin: 10px auto 0 !important; max-width: 240px; }
  #map { height: 320px; }
  .stops-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .figure .placeholder-img { height: 220px; }
  .container { padding: 0 16px; }
}

@media (max-width: 360px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stop-nav .container { flex-wrap: wrap; }
  .stop-nav .sn-map { order: 3; flex-basis: 100%; text-align: center; margin-top: 6px; }
}