/* ============================================================
   WW2 Letters — Shared Stylesheet
   Fonts: Playfair Display (headings) + EB Garamond (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=EB+Garamond:ital,wght@0,400;0,500;1,400&display=swap');

/* ---- Reset & base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --parchment:      #f5edd6;
  --parchment-dark: #e8d9b8;
  --parchment-mid:  #efe1c0;
  --ink:            #2c1a0e;
  --sepia:          #7a5c3a;
  --sepia-light:    #a88050;
  --accent:         #8b3a1a;
  --accent-hover:   #6d2c12;
  --highlight:      rgba(255, 200, 60, 0.40);
  --dark-bg:        #1a1208;
  --dark-mid:       #2a1f14;
  --border:         #c9b089;
  --border-light:   #ddc99a;
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.18);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.22);
  --shadow-lg:      0 8px 40px rgba(0,0,0,0.28);
  --radius:         4px;
  --nav-h:          64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--dark-mid);
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.25;
}

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

/* ---- Scroll-reveal ---------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   SITE NAV (shared across all pages)
   ============================================================ */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  background: var(--dark-bg);
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
}

.nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #e8d9b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
.nav-brand:hover { color: #fff; text-decoration: none; }

.nav-center {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

.nav-letter-links {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.nav-prev, .nav-next {
  background: transparent;
  border: 1px solid #7a6040;
  color: #c9b089;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: 'EB Garamond', serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-prev:hover, .nav-next:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
}
.nav-divider { color: #5a4a30; font-size: 0.85rem; }

/* Language toggle */
.lang-toggle { display: flex; gap: 0.3rem; flex-shrink: 0; }
.lang-btn {
  background: transparent;
  border: 1px solid #7a6040;
  color: #c9b089;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: sans-serif;
  letter-spacing: 0.05em;
  transition: all 0.2s;
}
.lang-btn:hover, .lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   INDEX PAGE — Hero
   ============================================================ */
.hero {
  background: linear-gradient(160deg, #1a1208 0%, #2d1f10 60%, #3a2412 100%);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  color: #f0dfc0;
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}
.hero .subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #c9a87a;
  margin-bottom: 2rem;
}
.hero .hook {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: 1.05rem;
  color: #c9b089;
  line-height: 1.8;
}

/* ============================================================
   INDEX PAGE — Timeline
   ============================================================ */
.timeline-section {
  background: var(--dark-mid);
  padding: 3rem 1.5rem 4rem;
}
.timeline-section h2 {
  text-align: center;
  color: #e8d9b8;
  font-size: 1.6rem;
  margin-bottom: 2.5rem;
}

.timeline {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  position: relative;
}
.timeline-item:nth-child(odd) { flex-direction: row-reverse; }

.timeline-dot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--dark-mid);
  top: 1.1rem;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-card {
  width: calc(50% - 2rem);
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.2s, transform 0.2s;
  display: block;
}
.timeline-item:nth-child(odd) .timeline-card { margin-right: 2rem; }
.timeline-item:nth-child(even) .timeline-card { margin-left: 2rem; }

.timeline-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--ink);
}
.timeline-card .tl-type {
  font-family: sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--accent);
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  margin-bottom: 0.4rem;
}
.timeline-card .tl-date {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.timeline-card .tl-from {
  font-size: 0.88rem;
  color: var(--sepia);
  font-style: italic;
}
.timeline-card .tl-thumb {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 2px;
  margin-top: 0.7rem;
  border: 1px solid var(--border);
}
.timeline-card .tl-thumb-placeholder {
  width: 100%;
  height: 90px;
  background: var(--parchment-dark);
  border-radius: 2px;
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sepia-light);
  font-size: 1.5rem;
  border: 1px dashed var(--border);
}

/* ============================================================
   INDEX PAGE — Introduction
   ============================================================ */
.intro-section {
  background: var(--parchment);
  padding: 3.5rem 1.5rem;
}
.intro-section .inner {
  max-width: 720px;
  margin: 0 auto;
}
.intro-section h2 {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.intro-section p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

/* ============================================================
   LETTER PAGE
   ============================================================ */
.letter-page { background: var(--dark-mid); min-height: 100vh; }

.letter-hero {
  background: var(--dark-bg);
  border-bottom: 1px solid #3a2a18;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.letter-hero .type-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.18rem 0.65rem;
  border-radius: 2px;
  margin-bottom: 0.5rem;
  font-family: sans-serif;
}
.letter-hero h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: #f0dfc0;
  margin-bottom: 0.25rem;
}
.letter-hero .origin {
  color: #c9a87a;
  font-style: italic;
  font-size: 1rem;
}

/* Image viewer */
.letter-image-panel {
  background: #0f0a04;
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: flex-start;
}
.letter-img {
  max-height: 70vh;
  max-width: 100%;
  object-fit: contain;
  cursor: zoom-in;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: 2px;
}

/* Postcard tabs */
.postcard-tabs {}
.tab-buttons {
  display: flex;
  background: #0f0a04;
  border-bottom: 1px solid #3a2a18;
}
.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #c9b089;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}
.tab-btn.active { border-bottom-color: var(--accent); color: #fff; }
.tab-btn:hover:not(.active) { color: #fff; }
.tab-panel { display: flex; justify-content: center; padding: 1.5rem; background: #0f0a04; }

/* Text columns */
.letter-text-panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.text-col-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
  margin-bottom: 0.5rem;
}
.col-label {
  font-family: sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sepia-light);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.text-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
}
.para-row { display: contents; }
.para-de, .para-no {
  background: var(--parchment);
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.6rem;
  border-radius: 3px;
  font-size: 1rem;
  line-height: 1.8;
  cursor: default;
  transition: background 0.15s;
}
.para-de.hovered, .para-no.hovered { background: var(--highlight); }

/* Letter contextual note */
.letter-note {
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
}
.letter-note .note-inner {
  background: var(--parchment-dark);
  border-left: 3px solid var(--accent);
  padding: 0.9rem 1.2rem;
  border-radius: 0 3px 3px 0;
  font-size: 0.95rem;
  color: var(--sepia);
  font-style: italic;
}

/* Letter footer nav */
.letter-footer-nav {
  background: var(--dark-bg);
  border-top: 1px solid #3a2a18;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  gap: 1rem;
}
.footer-nav-link {
  color: #c9b089;
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.footer-nav-link:hover { color: #fff; text-decoration: none; }
.footer-nav-link.center { color: var(--sepia-light); font-size: 0.85rem; font-family: sans-serif; }

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-page { background: var(--parchment); }

.about-hero {
  background: var(--dark-bg);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  border-bottom: 2px solid var(--accent);
}
.about-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: #f0dfc0; margin-bottom: 0.5rem; }
.about-hero p { color: #c9a87a; font-style: italic; }

.about-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.about-section h2 {
  font-size: 1.6rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
}
.about-section p { margin-bottom: 1rem; font-size: 1.05rem; }
.about-section + .about-section { border-top: 1px solid var(--border-light); }

/* Photo gallery */
.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1.5rem;
}
.gallery-item { max-width: 280px; text-align: center; }
.gallery-item img {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 2px;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.gallery-item img:hover { box-shadow: var(--shadow-md); }
.gallery-item figcaption {
  font-size: 0.88rem;
  color: var(--sepia);
  margin-top: 0.5rem;
  font-style: italic;
}
.placeholder-card .placeholder-img {
  width: 100%;
  min-height: 200px;
  background: var(--parchment-dark);
  border: 2px dashed var(--border);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--sepia);
  gap: 0.6rem;
  font-family: sans-serif;
  font-size: 0.88rem;
}
.placeholder-card .placeholder-img span { font-size: 3rem; }

/* Context quotes */
.context-quote {
  border-left: 3px solid var(--accent);
  margin: 1.5rem 0;
  padding: 1rem 1.3rem;
  background: var(--parchment-mid);
  border-radius: 0 3px 3px 0;
}
.context-quote p { font-style: italic; margin-bottom: 0.4rem; }
.context-quote cite {
  font-size: 0.82rem;
  color: var(--sepia);
  font-style: normal;
  font-family: sans-serif;
}

/* Leaflet map */
#letter-map {
  height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

/* ============================================================
   SHARED FOOTER
   ============================================================ */
.site-footer {
  background: var(--dark-bg);
  border-top: 1px solid #3a2a18;
  text-align: center;
  padding: 1.5rem;
  color: #5a4a30;
  font-family: sans-serif;
  font-size: 0.8rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 700px) {
  .timeline::before { left: 1rem; }
  .timeline-item, .timeline-item:nth-child(odd) { flex-direction: column; padding-left: 2.5rem; }
  .timeline-dot { left: 1rem; }
  .timeline-card, .timeline-item:nth-child(odd) .timeline-card,
  .timeline-item:nth-child(even) .timeline-card { width: 100%; margin: 0; }
  .text-col-headers, .text-columns { grid-template-columns: 1fr; }
  .col-label:last-child { margin-top: 1.5rem; }
  .nav-brand { font-size: 0.9rem; }
  .letter-footer-nav { flex-direction: column; text-align: center; gap: 0.6rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  #site-nav, #lightbox, .letter-footer-nav, .tab-buttons { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .para-de, .para-no { background: none; border: 1px solid #ccc; }
  .letter-image-panel { background: none; }
  .letter-img { max-height: 60vh; }
  .text-columns { gap: 1cm; }
  h1, h2 { color: #000; }
  a { color: #000; }
}
