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

:root {
  --blue:    #2563eb;
  --blue-dk: #1d4ed8;
  --gray-50: #f9fafb;
  --gray-100:#f3f4f6;
  --gray-300:#d1d5db;
  --gray-500:#6b7280;
  --gray-700:#374151;
  --gray-900:#111827;
  --radius:  10px;
  --shadow:  0 2px 12px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--gray-900);
  background: #fff;
  line-height: 1.6;
}

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

a { color: var(--blue); }

/* ── Layout helpers ───────────────────────────────────────────────────────── */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: bold;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.section-sub {
  font-size: 17px;
  color: var(--gray-500);
  margin-bottom: 28px;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 56px 24px 48px;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 36px;
}

.hero-photo-wrap {
  flex-shrink: 0;
}

.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.15);
}

.hero-photo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}

.hero-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .1em;
  opacity: .75;
  font-family: system-ui, sans-serif;
  margin-bottom: 6px;
}

.hero-name {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 6px;
}

.hero-mission {
  font-size: 17px;
  opacity: .85;
  font-family: system-ui, sans-serif;
  margin-bottom: 12px;
}

.hero-bio {
  font-size: 15px;
  opacity: .75;
  font-style: italic;
  max-width: 440px;
}

/* ── Subscribe ────────────────────────────────────────────────────────────── */
.subscribe-section {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--gray-100);
}

.subscribe-form {
  margin-top: 4px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-input {
  flex: 1 1 200px;
  padding: 14px 16px;
  font-size: 17px;
  font-family: Georgia, serif;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s;
  color: var(--gray-900);
  background: #fff;
}

.form-input:focus {
  border-color: var(--blue);
}

.btn-primary {
  padding: 14px 28px;
  font-size: 17px;
  font-weight: bold;
  font-family: system-ui, sans-serif;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}

.btn-primary:hover  { background: var(--blue-dk); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.form-message {
  margin-top: 12px;
  font-size: 16px;
  font-family: system-ui, sans-serif;
  min-height: 24px;
}

.form-message.success { color: #15803d; }
.form-message.error   { color: #dc2626; }

/* ── Map ──────────────────────────────────────────────────────────────────── */
.map-section {
  padding: 56px 0 48px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
}

.map-container {
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-300);
}

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  font-family: Georgia, serif;
}

.map-popup-city   { font-size: 16px; font-weight: bold; color: var(--gray-900); }
.map-popup-date   { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.map-popup-note   { font-size: 14px; color: var(--gray-700); margin-top: 6px; font-style: italic; }

/* ── Archive CTA ──────────────────────────────────────────────────────────── */
.archive-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--gray-100);
}

.archive-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.btn-secondary {
  padding: 13px 26px;
  font-size: 16px;
  font-family: system-ui, sans-serif;
  font-weight: bold;
  background: var(--gray-900);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}

.btn-secondary:hover { background: var(--gray-700); color: #fff; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  padding: 32px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--gray-500);
  font-family: system-ui, sans-serif;
}

/* ── Archive page ─────────────────────────────────────────────────────────── */
.archive-header {
  background: linear-gradient(160deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 40px 24px;
}

.archive-header h1 { font-size: 28px; }
.archive-header p  { opacity: .8; margin-top: 4px; font-family: system-ui, sans-serif; }

.archive-login-box {
  max-width: 480px;
  margin: 64px auto;
  padding: 0 24px;
  text-align: center;
}

.archive-login-box h2 { font-size: 24px; margin-bottom: 12px; }
.archive-login-box p  { color: var(--gray-500); margin-bottom: 28px; font-family: system-ui, sans-serif; }

.archive-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px;
}

.letter-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 16px;
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}

.letter-card:hover .letter-subject { color: var(--blue); }

.letter-date    { font-size: 13px; color: var(--gray-500); font-family: system-ui, sans-serif; white-space: nowrap; }
.letter-subject { font-size: 18px; font-weight: bold; margin: 2px 0 4px; }
.letter-location{ font-size: 13px; color: var(--gray-500); font-family: system-ui, sans-serif; }
.letter-arrow   { font-size: 20px; color: var(--gray-300); flex-shrink: 0; }

/* ── Letter detail ────────────────────────────────────────────────────────── */
.letter-detail {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.letter-detail-meta {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--gray-100);
}

.letter-detail-meta h1 { font-size: 28px; line-height: 1.3; }
.letter-detail-date    { font-size: 14px; color: var(--gray-500); font-family: system-ui, sans-serif; margin-top: 8px; }
.letter-detail-body    { font-size: 17px; line-height: 1.85; }
.letter-detail-body p  { margin-bottom: 16px; }
.letter-detail-body img{ max-width: 100%; border-radius: 8px; margin: 16px 0; }

.attachments-box {
  margin-top: 40px;
  padding: 20px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-100);
}

.attachments-box h3    { font-size: 15px; color: var(--gray-700); margin-bottom: 12px; font-family: system-ui, sans-serif; }
.attachment-link       { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 15px; color: var(--blue); text-decoration: none; font-family: system-ui, sans-serif; }
.attachment-link:hover { text-decoration: underline; }

/* ── Loading / empty states ───────────────────────────────────────────────── */
.loading {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-500);
  font-family: system-ui, sans-serif;
  font-size: 16px;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--gray-500);
  font-family: system-ui, sans-serif;
}

.empty-state p { font-size: 17px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-inner   { flex-direction: column; text-align: center; gap: 20px; }
  .hero-bio     { margin: 0 auto; }
  .form-row     { flex-direction: column; }
  .btn-primary  { width: 100%; text-align: center; }
  .archive-cta  { flex-direction: column; align-items: flex-start; }
  .map-container{ height: 300px; }
  .letter-arrow { display: none; }
}
