/* ═══════════════════════════════════════════════════════
   Letters from Dick — Archive Design System
   Warm, archival, 1968 Americana / military correspondence
═══════════════════════════════════════════════════════ */

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

/* ─── Design Tokens ─────────────────────────────────── */
:root {
  --bg:            #ede6d0;
  --bg-dark:       #e3d9bf;
  --surface:       #faf5e8;
  --surface-2:     #f2ebd4;
  --nav-bg:        #1c1508;
  --nav-text:      #c8b888;
  --nav-hover:     #e8d89a;
  --text:          #231c0e;
  --text-muted:    #6b5a3c;
  --text-faint:    #9a8060;
  --accent:        #5c4829;
  --accent-hover:  #7a6040;
  --border:        #c0a878;
  --border-light:  #ddd0b0;
  --gold:          #9e7c2e;
  --red-seal:      #8b2020;
  --shadow:        rgba(28, 20, 8, 0.12);
  --shadow-lg:     rgba(28, 20, 8, 0.22);

  --font-display:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:     'Lora', Georgia, 'Times New Roman', serif;
  --font-mono:     'Special Elite', 'Courier New', Courier, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(140, 100, 40, 0.07) 1px, transparent 0),
    linear-gradient(180deg, var(--bg-dark) 0%, var(--bg) 120px);
  background-size: 18px 18px, 100% 100%;
  min-height: 100vh;
}

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

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

/* ─── Navigation ────────────────────────────────────── */
.site-nav {
  background: var(--nav-bg);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--nav-hover);
  letter-spacing: 0.03em;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:hover { color: #fff; text-decoration: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nav-text);
  padding: 0.4rem 0.85rem;
  border-radius: 2px;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--nav-bg);
  background: var(--nav-hover);
  text-decoration: none;
}

.nav-links .nav-admin {
  border: 1px solid rgba(200, 184, 136, 0.3);
  margin-left: 0.5rem;
}
.nav-links .nav-logout {
  color: #c47a7a;
  border: 1px solid rgba(196, 122, 122, 0.3);
  margin-left: 0.25rem;
}
.nav-links .nav-logout:hover { background: #8b2020; color: #fff; }

/* ─── Page Layout ───────────────────────────────────── */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.page-header {
  text-align: center;
  margin-bottom: 3.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.page-header .subtitle {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ─── Hero (Homepage) ───────────────────────────────── */
.hero {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,245,210,0.4) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { max-width: 680px; position: relative; }

.hero-seal {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--border);
  padding: 0.35rem 1rem;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 600;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2rem;
}

.hero-divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 auto 2rem;
}

.hero-desc {
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 3.5rem;
  font-style: italic;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem 1.5rem;
  border-radius: 2px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--border);
  transition: background 0.2s;
}
.hero-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--shadow);
  border-color: var(--gold);
  text-decoration: none;
}
.hero-card:hover::before { background: var(--gold); }

.hero-card-num {
  font-family: var(--font-mono);
  font-size: 2rem;
  color: var(--border);
  display: block;
  margin-bottom: 0.75rem;
  line-height: 1;
}
.hero-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.hero-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ─── Letters Section ───────────────────────────────── */
.month-list { display: flex; flex-direction: column; gap: 1rem; }

.month-group {
  border: 1px solid var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  background: var(--surface);
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  cursor: pointer;
  background: var(--surface-2);
  border-bottom: 1px solid transparent;
  user-select: none;
  transition: background 0.15s;
}
.month-header:hover { background: var(--bg-dark); }
.month-group.open .month-header {
  border-bottom-color: var(--border-light);
}

.month-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
}
.month-header .month-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.month-toggle {
  width: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-faint);
  transition: transform 0.2s;
}
.month-group.open .month-toggle { transform: rotate(90deg); }

.month-body {
  display: none;
  padding: 1.5rem;
}
.month-group.open .month-body { display: block; }

.letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.letter-thumb {
  cursor: pointer;
  border: 2px solid var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.letter-thumb:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 12px var(--shadow);
  transform: translateY(-2px);
}
.letter-thumb img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}
.letter-thumb-meta {
  padding: 0.5rem 0.6rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border-light);
}
.letter-thumb-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Admin controls on thumbs */
.letter-thumb .admin-thumb-controls {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  gap: 4px;
}
.letter-thumb:hover .admin-thumb-controls { display: flex; }

/* ─── Photos Section ────────────────────────────────── */
.photo-grid {
  columns: 3;
  column-gap: 1.25rem;
}
@media (max-width: 900px) { .photo-grid { columns: 2; } }
@media (max-width: 540px) { .photo-grid { columns: 1; } }

.photo-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  border: 2px solid var(--border-light);
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.photo-item:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px var(--shadow);
}
.photo-item img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.photo-item-meta {
  padding: 0.75rem 0.85rem;
  background: var(--surface-2);
  border-top: 1px solid var(--border-light);
}
.photo-item-caption {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.photo-item-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

/* Drag-and-drop state */
.photo-item.drag-over { border-color: var(--accent); border-style: dashed; opacity: 0.7; }
.photo-item.dragging { opacity: 0.4; }
.photo-item .drag-handle {
  position: absolute;
  top: 6px;
  left: 6px;
  cursor: grab;
  width: 24px; height: 24px;
  background: rgba(28,20,8,0.6);
  border-radius: 2px;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
}
body.admin-mode .photo-item .drag-handle { display: flex; }

/* ─── Book Section ──────────────────────────────────── */
.book-layout {
  max-width: 900px;
  margin: 0 auto;
}
.book-info {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: 2px;
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}
.book-icon {
  font-size: 3.5rem;
  line-height: 1;
  flex-shrink: 0;
  filter: sepia(60%);
}
.book-info h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.book-info p {
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
}
.book-download-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.book-viewer {
  width: 100%;
  height: 75vh;
  min-height: 500px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #fff;
}

/* ─── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--accent);
  color: #f5edd3;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #f5edd3; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
}

.btn-danger {
  background: transparent;
  color: var(--red-seal);
  border: 1px solid rgba(139,32,32,0.3);
}
.btn-danger:hover { background: var(--red-seal); color: #fff; }

/* Icon buttons */
.icon-btn {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s, color 0.15s;
}
.icon-btn-edit {
  background: rgba(92,72,41,0.12);
  color: var(--accent);
}
.icon-btn-edit:hover { background: var(--accent); color: #fff; }
.icon-btn-del {
  background: rgba(139,32,32,0.1);
  color: var(--red-seal);
}
.icon-btn-del:hover { background: var(--red-seal); color: #fff; }

/* ─── Admin Panel ───────────────────────────────────── */
.admin-bar {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}
.admin-bar-label { color: #c47a7a; text-transform: uppercase; }

.admin-panel {
  background: #fdf6e8;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
}
.admin-panel-header h3 {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.admin-panel-body {
  display: none;
  padding: 1.5rem;
}
.admin-panel.open .admin-panel-body { display: block; }

/* Upload drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.drop-zone:hover,
.drop-zone.drag-active {
  border-color: var(--accent);
  background: rgba(92,72,41,0.04);
}
.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.drop-zone-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.drop-zone-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* Upload file list */
.upload-file-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.upload-file-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  font-size: 0.85rem;
}
.upload-file-status { font-size: 0.75rem; }
.upload-file-name { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.upload-file-parsed { font-size: 0.75rem; color: var(--text-faint); }

/* Form elements */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}
select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* People tags */
.people-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.people-tag {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.people-tag.selected {
  background: var(--accent);
  color: #f5edd3;
  border-color: var(--accent);
}

/* ─── Admin Edit Modal ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,20,8,0.7);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px var(--shadow-lg);
}
.modal h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* ─── Lightbox ──────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 7, 2, 0.93);
  z-index: 1000;
  display: none;
  flex-direction: column;
}
.lightbox.open { display: flex; }

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  flex-shrink: 0;
}
.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
}
.lightbox-close {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0 4rem;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  transition: opacity 0.15s;
}
.lightbox-img.loading { opacity: 0; }

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 64px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  color: rgba(255,255,255,0.7);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.lightbox-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.lightbox-btn:disabled { opacity: 0.2; cursor: default; }
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

.lightbox-caption {
  flex-shrink: 0;
  padding: 1rem 4rem 1.5rem;
  text-align: center;
}
.lightbox-caption-text {
  font-style: italic;
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
.lightbox-caption-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
}

/* ─── Photo Resize Handle ───────────────────────────── */
.photo-item .resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
  display: none;
  z-index: 10;
}
.photo-item .resize-handle::before {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 24px 24px;
  border-color: transparent transparent rgba(28,20,8,0.65) transparent;
}
.photo-item .resize-handle::after {
  content: '';
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255,255,255,0.85);
  border-bottom: 2px solid rgba(255,255,255,0.85);
}
body.admin-mode .photo-item .resize-handle { display: block; }

/* ─── Admin Thumb Controls ──────────────────────────── */
.admin-thumb-controls {
  display: flex;
  gap: 3px;
}
.photo-item .admin-thumb-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
}
body.admin-mode .photo-item .admin-thumb-controls { display: flex; }
body.admin-mode .letter-thumb .admin-thumb-controls { display: flex; }

/* ─── Empty States ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-faint);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  filter: grayscale(40%) opacity(0.6);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}
.empty-state p {
  font-size: 0.9rem;
  color: var(--text-faint);
}

/* ─── Login Page ────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 380px;
  border-radius: 2px;
  box-shadow: 0 8px 32px var(--shadow);
}
.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  text-align: center;
  margin-bottom: 0.25rem;
}
.login-card .login-subtitle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
  margin-bottom: 2rem;
}
.login-error {
  background: rgba(139,32,32,0.08);
  border: 1px solid rgba(139,32,32,0.2);
  color: var(--red-seal);
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 2px;
  margin-bottom: 1rem;
  display: none;
}
.login-error.visible { display: block; }

/* ─── Footer ────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 2rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  background: var(--bg-dark);
}
.site-footer em { font-style: italic; }

/* ─── Utility ───────────────────────────────────────── */
.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }

/* ─── Hamburger Menu ────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-inner { padding: 0 1rem; }
  .nav-brand { font-size: 1rem; }

  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-bottom: 2px solid var(--gold);
    flex-direction: column;
    padding: 0.75rem 0;
    gap: 0;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.75rem 1.5rem;
    font-size: 0.8rem;
    border-radius: 0;
  }
  .nav-links .nav-admin { border: none; margin-left: 0; }
  .nav-links .nav-logout { border: none; margin-left: 0; border-radius: 0; }

  .page-content { padding: 2rem 1rem 4rem; }
  .page-header h1 { font-size: 2rem; }

  .hero-cards { grid-template-columns: 1fr; gap: 1rem; }
  .hero h1 { font-size: 2.8rem; }

  .letter-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

  .form-row { grid-template-columns: 1fr; }

  .book-info { flex-direction: column; gap: 1rem; }
  .book-download-bar { flex-wrap: wrap; }
  .book-viewer { height: 60vh; }

  .admin-bar { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding: 0.75rem 1rem; }

  .lightbox-stage { padding: 0 3rem; }
  .lightbox-caption { padding: 0.75rem 3rem 1rem; }
  .lightbox-btn { width: 36px; height: 52px; }

  .modal { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 1rem; }
  .letter-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .lightbox-stage { padding: 0 2.5rem; }
  .lightbox-btn { width: 30px; }
  .month-header h2 { font-size: 1.1rem; }
  .month-header .month-meta { font-size: 0.68rem; gap: 0.5rem; }
}
