@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Libre+Franklin:wght@400;500;600&display=swap');

:root {
  --paper: #F1EAD9;
  --paper-deep: #E6D9BC;
  --ink: #2B2320;
  --ink-soft: #5B4E44;
  --walnut: #4A2F22;
  --oxblood: #7C3B32;
  --brass: #9C7A3C;
  --brass-faint: rgba(156, 122, 60, 0.35);
  --max-width: 920px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Libre Franklin', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--oxblood); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--walnut); }

h1, h2, h3, .display {
  font-family: 'Fraunces', serif;
  color: var(--walnut);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}

/* ---------- Header / nav ---------- */

.site-header {
  background: var(--walnut);
  color: var(--paper);
  padding: 2.5rem 1.5rem 0;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.header-photos {
  display: none;
}

@media (min-width: 900px) {
  .header-photos {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 130px;
    overflow: hidden;
    border: 1px solid var(--brass-faint);
  }

  .header-photos img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    filter: sepia(0.5) saturate(0.65) brightness(0.85);
    animation: header-photo-fade 30s infinite;
  }

  .header-photos img:nth-child(1) { animation-delay: 0s; }
  .header-photos img:nth-child(2) { animation-delay: 5s; }
  .header-photos img:nth-child(3) { animation-delay: 10s; }
  .header-photos img:nth-child(4) { animation-delay: 15s; }
  .header-photos img:nth-child(5) { animation-delay: 20s; }
  .header-photos img:nth-child(6) { animation-delay: 25s; }
}

@keyframes header-photo-fade {
  0%, 100% { opacity: 0; }
  3% { opacity: 1; }
  14% { opacity: 1; }
  20% { opacity: 0; }
}

.site-title-link {
  text-decoration: none;
}

.site-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  color: var(--paper);
  margin: 0;
}

.site-tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--brass);
  font-size: 1.05rem;
  margin-top: 0.35rem;
}

nav.site-nav {
  margin-top: 2rem;
  border-top: 1px solid rgba(241, 234, 217, 0.25);
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

nav.site-nav a {
  color: var(--paper);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.9rem 1.1rem;
  border-right: 1px solid rgba(241, 234, 217, 0.15);
}

nav.site-nav a:first-child { padding-left: 0; }

nav.site-nav a:hover,
nav.site-nav a.current {
  color: var(--brass);
}

nav.site-nav a.current {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: var(--brass);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--brass-faint);
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span:not(.sr-only) {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--paper);
}

/* ---------- Page body ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.page-eyebrow {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
}

.page-intro {
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  white-space: pre-line;
}

.rule {
  border: none;
  border-top: 1px solid var(--brass-faint);
  margin: 2.5rem 0;
}

/* ---------- About page prose ---------- */

.prose {
  max-width: 62ch;
  font-size: 1.05rem;
}

.prose p { margin: 0 0 1.2rem; }

.prose ul {
  margin: 0 0 1.2rem;
  padding-left: 1.3rem;
}

.signoff {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--walnut);
  margin-top: 2rem;
}

/* ---------- Plate gallery ---------- */

.plates {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 2rem;
}

.plate:nth-child(3n+1) { grid-column: span 2; }

.plates.plates-full {
  grid-template-columns: 1fr;
}

.plates.plates-full .plate:nth-child(3n+1) {
  grid-column: span 1;
}

.plate figure {
  margin: 0;
}

.plate img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--paper-deep);
  border: 1px solid var(--brass-faint);
}

.plate figcaption {
  margin-top: 0.7rem;
}

.plate-number {
  display: block;
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--brass);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.plate-caption {
  font-family: 'Fraunces', serif;
  font-style: italic;
  color: var(--ink);
  font-size: 1rem;
  white-space: pre-line;
  line-height: 1.45;
}

.unconfirmed {
  border-bottom: 1px dashed var(--brass);
  cursor: help;
}

/* ---------- Lightbox ---------- */

main img {
  cursor: zoom-in;
}

.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(43, 35, 32, 0.92);
  cursor: zoom-out;
  z-index: 1000;
}

.lightbox-overlay.is-open {
  display: flex;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid var(--brass-faint);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.lightbox-lock {
  overflow: hidden;
}

/* ---------- Reunion year picker ---------- */

.reunion-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem 2rem;
}

.reunion-choice {
  display: block;
  text-decoration: none;
  color: inherit;
}

.reunion-choice img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  background: var(--paper-deep);
  border: 1px solid var(--brass-faint);
}

.reunion-choice:hover img {
  border-color: var(--brass);
}

.reunion-year {
  display: block;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--walnut);
  font-size: 1.4rem;
  margin-top: 0.75rem;
}

.reunion-choice:hover .reunion-year {
  color: var(--oxblood);
}

/* ---------- Empty page ---------- */

.empty-note {
  color: var(--ink-soft);
  font-style: italic;
  border-left: 2px solid var(--brass-faint);
  padding-left: 1rem;
}

/* ---------- Contact form ---------- */

.contact-section {
  max-width: 62ch;
}

.contact-intro {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.contact-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-field label {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.contact-field input,
.contact-field textarea {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper-deep);
  border: 1px solid var(--brass-faint);
  padding: 0.65rem 0.75rem;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: 2px solid var(--oxblood);
  outline-offset: 1px;
}

.contact-field textarea {
  resize: vertical;
  min-height: 8rem;
}

.contact-hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.contact-submit {
  align-self: flex-start;
  font-family: 'Libre Franklin', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--paper);
  background: var(--walnut);
  border: none;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
}

.contact-submit:hover {
  background: var(--oxblood);
}

/* ---------- Footer ---------- */

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-top: 1px solid var(--brass-faint);
  padding-top: 1.5rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .plates { grid-template-columns: 1fr; }
  .plate:nth-child(3n+1) { grid-column: span 1; }
  .reunion-choices { grid-template-columns: 1fr; }
  nav.site-nav a { padding: 0.7rem 0.8rem; font-size: 0.88rem; }

  .nav-toggle {
    display: flex;
  }

  nav.site-nav {
    display: none;
    flex-direction: column;
    margin-top: 3.5rem;
    border-top: none;
  }

  nav.site-nav.is-open {
    display: flex;
  }

  nav.site-nav a {
    border-right: none;
    border-bottom: 1px solid rgba(241, 234, 217, 0.15);
  }

  nav.site-nav a:first-child {
    padding-left: 1.1rem;
  }
}

/* ---------- Reduced motion / focus ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .header-photos img {
    animation: none;
    opacity: 0;
  }

  .header-photos img:first-child {
    opacity: 1;
  }
}

a:focus-visible, nav.site-nav a:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 2px;
}
