@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Inter:wght@400;500;600;700&display=swap");
@import url("colors_and_type.css");

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

:root {
  /* Legacy surface-local aliases. The canonical brand tokens (--mb-*,
     --mb-font-*, etc.) come from colors_and_type.css imported above —
     don't redeclare them here. The aliases below let older selectors
     keep their semantic names without drifting from the brand. */
  --blue:    var(--mb-blue);
  --blue-dk: var(--mb-blue-deep);
  --gray-50: #f9fafb;
  --gray-100:#f3f4f6;
  --gray-300:#d1d5db;
  --gray-500:#6b7280;
  --gray-700:#374151;
  --gray-900:#111827;
  --radius:  var(--mb-radius);
  --shadow:  0 2px 12px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--mb-font-sans);
  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;
}

/* Utility-page H1 — used on forget-me/, account/close-confirm/, etc. where
   the visual hierarchy is established at the smaller card-title size and a
   default browser H1 would over-dominate the narrow page layout. */
.h1-compact {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 16px;
}

/* ── Utility-flow pages (forget-me/, account/close-confirm/) ─────────────
   Centered narrow card with a wordmark header. Page bg is light gray;
   header and card are white. */
.utility-page             { background: #f9fafb; }

.utility-header {
  background: #fff;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  text-align: center;
}
.utility-header__link     { display: inline-block; }
.utility-header__logo     { height: 60px; width: auto; display: block; }

.utility-card {
  max-width: 560px;
  margin: 64px auto;
  padding: 32px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-family: system-ui, sans-serif;
  color: #111;
}
.utility-card__body       { font-size: 15px; line-height: 1.6; color: #374151; }
.utility-card__note       { font-size: 14px; line-height: 1.6; color: #6b7280; }
.utility-card__error      { font-size: 15px; line-height: 1.6; color: #991b1b; }
.utility-card__heading    { margin: 0 0 16px; font-size: 22px; }
.utility-card__form       { margin-top: 24px; }
.utility-card__input      { width: 100%; margin-bottom: 12px; }
.utility-card__btn-block {
  background: #991b1b;
  width: 100%;
  padding: 12px;
}
.utility-card__btn-large {
  background: #991b1b;
  padding: 14px 28px;
  font-size: 16px;
}
.utility-card__btn-row    { text-align: center; margin: 32px 0 0; }
.utility-card__hint       { text-align: center; margin: 16px 0 0; font-size: 14px; color: #9ca3af; }
.utility-card__working    { text-align: center; padding: 32px 0; }
.utility-card__working-text { font-size: 16px; }
.utility-card__back-link  { display: inline-block; padding: 10px 20px; }

/* ── Archive page — wordmark + back link in the dark header ───────── */
.archive-header__link     { display: inline-block; margin-bottom: 16px; }
.archive-header__logo     { height: 40px; width: auto; display: block; }
.archive-header__back {
  color: rgba(255,255,255,.7);
  font-family: system-ui, sans-serif;
  font-size: 14px;
  text-decoration: none;
  display: block;
}
.archive-header__title    { margin-top: 8px; }

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

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  background: var(--mb-blue);
  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-family: var(--mb-font-serif);
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.01em;
  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: var(--mb-font-sans);
  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: "Inter", system-ui, -apple-system, sans-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: var(--mb-blue);
  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; }

/* "— or, if you already have a code —" separator between the two forms. */
.archive-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 20px;
  color: var(--gray-400, #9ca3af);
  font-family: system-ui, sans-serif;
  font-size: 13px;
}
.archive-divider::before,
.archive-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200, #e5e7eb);
}

.archive-code-label {
  display: block;
  text-align: left;
  font-size: 13px;
  color: var(--gray-500);
  font-family: system-ui, sans-serif;
  margin-bottom: 6px;
}

.archive-code-input {
  width: 100%;
  margin-bottom: 12px;
  /* Big, friendly, monospaced — the code in the email is in a similar
     mono face, so the user can pattern-match without thinking. */
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 22px;
  letter-spacing: 3px;
  text-align: center;
}

.archive-code-hint {
  color: var(--gray-400, #9ca3af) !important;  /* override the .archive-login-box p rule */
  margin-bottom: 0 !important;
  font-size: 13px !important;
  font-family: system-ui, sans-serif;
  text-align: center;
}

.archive-session-note {
  color: rgba(255,255,255,.55);
  font-size: 12px;
  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; }
}
