/* ═══════════════════════════════════════════════════════════════════════════
   Soroki Magazine — Editorial Design System
   Inspired by classic broadsheet newspapers with modern digital refinement
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── Palette: Ink & Ivory ────────────────────────────────────────────── */
  --ink:          #1A1A1E;
  --ink-soft:     #2A2A30;
  --ink-muted:    #5A5A64;
  --ink-faint:    #8A8A94;
  --ivory:        #FAF9F6;
  --ivory-warm:   #F3F1EC;
  --ivory-deep:   #E8E5DD;
  --parchment:    #FFFFFF;
  --crimson:      #B8282E;
  --crimson-dark: #8E1E23;
  --crimson-glow: #D4454A;
  --gold:         #C9A84C;
  --gold-muted:   #B89840;

  /* ── Typography ──────────────────────────────────────────────────────── */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-ui:      'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* ── Layout ──────────────────────────────────────────────────────────── */
  --max-width:    1180px;
  --col-gap:      28px;
  --section-gap:  56px;

  /* ── Effects ─────────────────────────────────────────────────────────── */
  --radius:       4px;
  --shadow-card:  0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-lift:  0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition:   0.3s var(--ease);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Global mobile overflow prevention — every block-level element
   is constrained to viewport width. This single rule prevents
   any child from pushing the page wider than the screen. */
section, div, nav, main, article, aside, table, form, ul, ol,
img, video, canvas, iframe, pre {
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--ivory);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1;
  overflow-x: hidden;
}

a { color: var(--crimson); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--crimson-dark); }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; overflow-x: hidden; }

/* ═══════════════════════════════════════════════════════════════════════════
   HEADER — Single compact bar with auto-hide on scroll
   ═══════════════════════════════════════════════════════════════════════════ */

.site-header {
  background: var(--parchment);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--ink);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  will-change: transform;
}

.site-header.header-hidden {
  transform: translateY(-100%);
  box-shadow: none;
}

.header-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ── Logo ──────────────────────────────────────────────────────────────── */
.logo-link {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.8px;
  line-height: 1;
}

.logo-sub {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  color: var(--crimson);
  text-transform: uppercase;
  letter-spacing: 2.5px;
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-link {
  font-family: var(--font-ui);
  padding: 14px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.nav-link:hover { color: var(--ink); }

.nav-link.active {
  color: var(--crimson);
  border-bottom-color: var(--crimson);
}

.nav-categories { display: contents; }

/* ── Right: Lang toggle + Hamburger ────────────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 1px;
}

.lang-sep {
  font-size: 10px;
  color: var(--ivory-deep);
  margin: 0 1px;
  user-select: none;
}

.lang-btn {
  padding: 2px 6px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-faint);
  border-radius: 2px;
  transition: all var(--transition);
}

.lang-btn.active {
  color: var(--parchment);
  background: var(--ink);
}

.lang-btn:hover:not(.active) {
  color: var(--ink);
}

/* ── Header Search Icon ────────────────────────────────────────────────── */
.header-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  padding: 4px;
  transition: color var(--transition);
}

.header-search-btn:hover { color: var(--crimson); }

/* ── Search Page ──────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  max-width: 600px;
}

.search-bar input {
  flex: 1;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 15px;
  border: 2px solid var(--ivory-deep);
  outline: none;
  transition: border-color var(--transition);
}

.search-bar input:focus { border-color: var(--crimson); }

.search-btn {
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--parchment);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.search-btn:hover { background: var(--crimson); }

.search-stats {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 20px;
}

/* ── Mobile Menu Button ───────────────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transition: all var(--transition);
}

.mobile-menu-btn.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.mobile-menu-btn.is-open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ── Mobile Dropdown ──────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 16px 24px 24px;
  background: var(--parchment);
  border-top: 1px solid var(--ivory-deep);
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.mobile-nav.open { display: flex; }

.mobile-nav .nav-link {
  padding: 9px 0;
  font-size: 12px;
  border-bottom: none;
  margin-bottom: 0;
}

.nav-categories-mobile { display: contents; }

/* ═══════════════════════════════════════════════════════════════════════════
   HERO — Dramatic full-width featured article
   ═══════════════════════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  margin-bottom: var(--section-gap);
  min-height: 480px;
  display: flex;
  align-items: flex-end;
}

.hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  transition: opacity 0.6s var(--ease);
}

.hero:hover .hero-img { opacity: 0.45; }

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(26,26,30,0.85) 0%, rgba(26,26,30,0.3) 50%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 48px;
  color: #fff;
  max-width: 720px;
}

.hero-badge {
  display: inline-block;
  background: var(--crimson);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 5px 14px;
  margin-bottom: 16px;
}

.hero-cat {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  margin-left: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
}

.hero-content h1 a {
  color: #fff;
  text-decoration: none;
  transition: color var(--transition);
}

.hero-content h1 a:hover { color: var(--gold); }

.hero-excerpt {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  opacity: 0.85;
  margin-bottom: 18px;
  font-weight: 300;
}

.hero-meta {
  display: flex;
  gap: 18px;
  font-family: var(--font-ui);
  font-size: 12px;
  opacity: 0.6;
  letter-spacing: 0.03em;
}

.empty-hero {
  text-align: center;
  padding: 100px 24px;
}

.empty-hero h1 {
  font-family: var(--font-display);
  font-size: 56px;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.empty-hero p {
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink-faint);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTIONS — Editorial section breaks
   ═══════════════════════════════════════════════════════════════════════════ */

.section { margin-bottom: var(--section-gap); }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 3px double var(--ink);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.section-link {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--crimson);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.section-link:hover { color: var(--crimson-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   ARTICLE GRID — Newspaper-inspired card layout
   ═══════════════════════════════════════════════════════════════════════════ */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--col-gap);
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--parchment);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ivory-deep);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}

.card-img {
  width: 100%;
  height: 210px;
  background-size: cover;
  background-position: center;
  background-color: var(--ivory-warm);
  position: relative;
}

.card-img::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(0,0,0,0.06));
  pointer-events: none;
}

.card-img-placeholder {
  background: var(--ivory-warm);
  position: relative;
}

.card-img-placeholder::before {
  content: 'S';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--ivory-deep);
  opacity: 0.6;
}

.card-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-cat {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--crimson);
  margin-bottom: 8px;
}

.card-body h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.card-body p {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ivory-deep);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE ARTICLE — Long-form reading experience
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Article Breadcrumb ────────────────────────────────────────────────── */
.article-breadcrumb {
  max-width: 740px;
  margin: 0 auto 20px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.article-breadcrumb a {
  color: var(--ink-faint);
  transition: color var(--transition);
}

.article-breadcrumb a:hover {
  color: var(--crimson);
}

.article-full {
  max-width: 740px;
  margin: 0 auto var(--section-gap);
}

.article-hero {
  width: calc(100% + 120px);
  margin-left: -60px;
  height: 440px;
  background-size: cover;
  background-position: center;
  margin-bottom: 36px;
}

.article-header { margin-bottom: 36px; }

.article-cat {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--crimson);
  margin-bottom: 14px;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.article-meta {
  display: flex;
  gap: 18px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
}

.article-body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink-soft);
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin: 40px 0 18px;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  margin: 32px 0 14px;
  color: var(--ink);
}

.article-body p { margin-bottom: 18px; }

.article-body img {
  margin: 24px 0;
  border-radius: 0;
}

.article-body blockquote {
  border-left: 3px solid var(--crimson);
  padding: 16px 24px;
  margin: 28px 0;
  font-style: italic;
  color: var(--ink-muted);
  background: var(--ivory-warm);
  font-size: 19px;
}

.article-body ul, .article-body ol { margin: 18px 0; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }

/* ── Article Page Breaks ───────────────────────────────────────────────── */
.article-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0;
  padding: 14px 0;
  border-top: 1px solid var(--ivory-deep);
  border-bottom: 1px solid var(--ivory-deep);
  flex-wrap: wrap;
}

.article-pages-info {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.article-pages-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.article-pages-btns .pg-btn {
  min-width: 32px;
  text-align: center;
  padding: 6px 10px;
  font-size: 12px;
}

.article-pages-btns .pg-btn-active {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}

.article-photos { margin-top: 48px; }
.article-photos h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 20px;
  color: var(--ink);
}

/* ── Article Prev/Next Navigation ──────────────────────────────────────── */
.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--ivory-deep);
}

.article-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--ivory-deep);
  text-decoration: none;
  color: var(--ink);
  transition: all var(--transition);
  max-width: 48%;
}

.article-nav-btn:hover {
  border-color: var(--crimson);
  color: var(--crimson);
}

.article-nav-next {
  margin-left: auto;
  text-align: right;
}

.article-nav-arrow {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.5;
}

.article-nav-btn:hover .article-nav-arrow { opacity: 1; }

.article-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-nav-label {
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.article-nav-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .article-nav { flex-direction: column; gap: 10px; }
  .article-nav-btn { max-width: 100%; }
  .article-breadcrumb { margin-bottom: 12px; padding: 0 12px; }
}

/* ── Article Index (all articles in category) ─────────────────────────── */
.article-index {
  margin-top: 36px;
  border: 1px solid var(--ivory-deep);
  background: var(--ivory-warm);
}

.article-index-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.03em;
  user-select: none;
  transition: color var(--transition);
}

.article-index-header:hover { color: var(--ink); }

.article-index-icon { font-size: 14px; opacity: 0.5; }

.article-index-toggle {
  margin-left: auto;
  font-size: 12px;
  transition: transform var(--transition);
}

.article-index.open .article-index-toggle {
  transform: rotate(180deg);
}

.article-index-list {
  display: none;
  margin: 0;
  padding: 0 18px 14px 40px;
  list-style: decimal;
}

.article-index.open .article-index-list { display: block; }

.article-index-list li {
  padding: 5px 0;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-muted);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.article-index-list li:last-child { border-bottom: none; }

.article-index-list li a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.article-index-list li a:hover { color: var(--crimson); }

.article-index-list li.current {
  color: var(--crimson);
}

.article-index-list li.current strong {
  color: var(--crimson);
  font-weight: 700;
}

.related-section {
  margin-top: var(--section-gap);
  padding-top: 40px;
  border-top: 3px double var(--ink);
}

.related-section h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHOTO GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.gallery-full-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.photo-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  background: var(--ivory-warm);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.5s var(--ease);
}

.photo-item:hover img {
  transform: scale(1.06);
  filter: brightness(1.05);
}

/* Photo with caption wrapper */
.photo-item-wrap {
  display: flex;
  flex-direction: column;
}

/* Caption above photo: name/title */
.photo-caption-title {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  padding: 0 2px 5px;
  margin: 0;
}

/* Caption below photo: description */
.photo-caption-desc {
  font-family: var(--font-ui);
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.45;
  padding: 5px 2px 0;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GALLERY GRID
   ═══════════════════════════════════════════════════════════════════════════ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--col-gap);
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  background: var(--parchment);
  overflow: hidden;
  border: 1px solid var(--ivory-deep);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--ink);
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: transparent;
}

.gallery-card .card-img { height: 200px; }

.gallery-count {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.gallery-desc {
  font-size: 15px;
  color: var(--ink-muted);
  margin-bottom: 28px;
  max-width: 600px;
  line-height: 1.6;
}

/* ── Breadcrumb ───────────────────────────────────────────────────────── */
.gallery-breadcrumb {
  font-family: var(--font-ui);
  font-size: 12px;
  margin-bottom: 24px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.gallery-breadcrumb a { color: var(--crimson); }
.gallery-breadcrumb a:hover { text-decoration: underline; }

.bc-sep { margin: 0 6px; color: var(--ivory-deep); }
.bc-current { color: var(--ink); font-weight: 600; }

/* ── Gallery Prev/Next Navigation ──────────────────────────────────────── */
.gallery-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--ivory-deep);
}

.gallery-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid var(--ivory-deep);
  text-decoration: none;
  color: var(--ink);
  transition: all var(--transition);
  max-width: 48%;
}

.gallery-nav-btn:hover {
  border-color: var(--crimson);
  color: var(--crimson);
}

.gallery-nav-next { margin-left: auto; text-align: right; }

.gallery-nav-arrow {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.gallery-nav-label {
  font-family: var(--font-ui);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  display: block;
}

.gallery-nav-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  display: block;
  line-height: 1.3;
}

@media (max-width: 480px) {
  .gallery-nav { flex-direction: column; gap: 10px; }
  .gallery-nav-btn { max-width: 100%; }
}

.sub-galleries { margin-bottom: 36px; }

.sub-galleries-title, .photos-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ivory-deep);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 40px;
  padding-top: 28px;
}

.pg-btn {
  font-family: var(--font-ui);
  padding: 9px 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  transition: all var(--transition);
}

.pg-btn:hover {
  background: var(--ink);
  color: var(--parchment);
}

.pg-info {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATES — Loading, Empty, 404
   ═══════════════════════════════════════════════════════════════════════════ */

.loading {
  text-align: center;
  padding: 100px 24px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty-msg {
  text-align: center;
  padding: 60px 24px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-faint);
}

.not-found {
  text-align: center;
  padding: 100px 24px;
}

.not-found h1 {
  font-family: var(--font-display);
  font-size: 96px;
  color: var(--ivory-deep);
  margin-bottom: 8px;
  letter-spacing: -3px;
  line-height: 1;
}

.not-found p {
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--ink-faint);
  margin-bottom: 28px;
}

.not-found a {
  display: inline-block;
  font-family: var(--font-ui);
  padding: 12px 28px;
  background: var(--ink);
  color: var(--parchment);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background var(--transition);
}

.not-found a:hover { background: var(--crimson); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════════════════════════ */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,12,0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: zoom-out;
}

#lightbox img {
  position: relative;
  z-index: 1;
  max-width: 85vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-drag: none;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 36px;
  line-height: 1;
  width: 48px;
  height: 64px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.lb-arrow:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--font-ui);
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  background: rgba(0,0,0,0.4);
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 2;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

@media (max-width: 768px) {
  .lb-arrow { width: 44px; height: 56px; font-size: 28px; }
  .lb-prev { left: 4px; }
  .lb-next { right: 4px; }
  #lightbox img { max-width: 94vw; max-height: 85vh; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FOOTER — Refined editorial footer
   ═══════════════════════════════════════════════════════════════════════════ */

.site-main {
  min-height: calc(100vh - 280px);
  padding: 36px 0;
}

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 40px 0 32px;
  margin-top: var(--section-gap);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.footer-brand .logo-text {
  color: #fff;
  font-size: 24px;
}

.footer-tagline {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-family: var(--font-ui);
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.footer-links a:hover { color: #fff; }

.footer-rule {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 24px 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.03em;
}

.footer-locale {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CEMETERY PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Cemetery Sidebar + Layout ─────────────────────────────────────────── */
.cem-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

.cem-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--ivory-warm);
  border-right: 1px solid var(--ivory-deep);
  border-radius: 6px 0 0 6px;
  position: sticky;
  top: 56px;
  align-self: flex-start;
  overflow-y: auto;
  padding: 16px 0;
  font-family: var(--font-ui);
}

.cem-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 0 16px 8px;
}

.cem-sidebar-nav {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.cem-sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.cem-sidebar-nav li a:hover {
  background: var(--ivory-warm);
  color: var(--ink);
}

.cem-sidebar-nav li a.cem-sb-active {
  background: var(--ivory-warm);
  color: var(--crimson);
  border-left-color: var(--crimson);
  font-weight: 600;
}

.cem-sidebar-nav li a .cem-sb-icon {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.cem-sidebar-nav li a .cem-sb-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.cem-sidebar-divider {
  height: 1px;
  background: var(--ivory-deep);
  margin: 8px 16px;
}

.cem-sidebar-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.78rem;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.15s;
}
.cem-sidebar-back:hover { color: var(--crimson); }

.cem-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

/* Mobile: sidebar becomes horizontal tab bar */
@media (max-width: 768px) {
  .cem-layout {
    flex-direction: column;
    overflow: hidden;
  }

  .cem-sidebar {
    width: 100% !important;
    min-width: 0 !important;
    position: sticky;
    top: 44px;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--ivory-deep);
    border-radius: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 5;
  }

  .cem-sidebar-title { display: none; }
  .cem-sidebar-divider { display: none; }
  .cem-sidebar-back { display: none; }

  .cem-sidebar-nav {
    display: flex;
    gap: 0;
    margin: 0;
    white-space: nowrap;
  }

  .cem-sidebar-nav li a {
    padding: 10px 14px;
    border-left: none;
    border-bottom: 2px solid transparent;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .cem-main {
    width: 100%;
    overflow-x: hidden;
  }

  .cem-sidebar-nav li a.cem-sb-active {
    border-left-color: transparent;
    border-bottom-color: var(--crimson);
  }

  .cem-sidebar-nav li a .cem-sb-icon { display: none; }
  .cem-sidebar-nav li a .cem-sb-dot { width: 8px; height: 8px; }
}

/* ── Cemetery Map ──────────────────────────────────────────────────────── */
.cem-map-container {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--ivory-warm);
  border: 1px solid var(--ivory-deep);
  max-width: 100%;
  overflow: hidden;
}

.cem-map {
  overflow-x: auto;
}

/* ── Cemetery Grid Map ────────────────────────────────────────────────── */
.cmap-container { min-height: 100px; max-width: 100%; overflow: hidden; }

.cmap-info {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
  min-height: 24px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--ivory-warm);
  border-radius: 4px;
}
.cmap-info:empty { display: none; }

/* Layout */
.cmap-layout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  overflow: hidden;
}
.cmap-middle {
  display: flex;
  gap: 2px;
  align-items: flex-start;
  max-width: 100%;
  min-width: 0;
}
.cmap-slot-a,
.cmap-slot-b,
.cmap-slot-v { min-width: 0; max-width: 100%; }
.cmap-slot-b { flex: 1; }
.cmap-slot-v { flex-shrink: 0; }
.cmap-slot-gd { display: flex; gap: 2px; max-width: 100%; }

/* Section cards */
.cmap-card {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--ivory-deep);
  min-width: 0;
  max-width: 100%;
}
.cmap-card-header {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmap-letter {
  font-size: 1.4rem;
  font-weight: 700;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(0,0,0,0.06);
}
.cmap-card-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
}
.cmap-card-stats {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  opacity: 0.65;
}
.cmap-card-hint {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  opacity: 0.5;
  font-style: italic;
  margin-top: 2px;
}

/* Section color themes */
.cmap-sec-a { background: #f0f7f0; border-color: #c8e6c9; }
.cmap-sec-a .cmap-card-header { background: #e8f5e9; color: #2E7D32; }
.cmap-sec-a .cmap-grave { background: #4CAF50; }
.cmap-sec-a .cmap-grave:hover { background: #2E7D32; }

.cmap-sec-b { background: #eef4fb; border-color: #bbdefb; }
.cmap-sec-b .cmap-card-header { background: #e3f2fd; color: #1565C0; }
.cmap-sec-b .cmap-grave { background: #42A5F5; }
.cmap-sec-b .cmap-grave:hover { background: #1565C0; }

.cmap-sec-v { background: #fdf3ed; border-color: #ffccbc; }
.cmap-sec-v .cmap-card-header { background: #fbe9e7; color: #BF360C; }
.cmap-sec-v .cmap-grave { background: #FF7043; }
.cmap-sec-v .cmap-grave:hover { background: #BF360C; }

.cmap-sec-g { background: #f6eef9; border-color: #e1bee7; }
.cmap-sec-g .cmap-card-header { background: #f3e5f5; color: #6A1B9A; }
.cmap-sec-g .cmap-grave { background: #AB47BC; }
.cmap-sec-g .cmap-grave:hover { background: #6A1B9A; }

.cmap-sec-d { background: #fbeeee; border-color: #ffcdd2; }
.cmap-sec-d .cmap-card-header { background: #fce4ec; color: #B71C1C; }
.cmap-sec-d .cmap-grave { background: #EF5350; }
.cmap-sec-d .cmap-grave:hover { background: #B71C1C; }

/* Row strips */
.cmap-card-body {
  padding: 8px 10px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}
.cmap-row-strip {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
  min-width: 0;
  max-width: 100%;
}
.cmap-rlabel {
  width: 36px;
  min-width: 36px;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  color: var(--ink-faint);
  text-align: right;
  padding-right: 6px;
  user-select: none;
}
.cmap-graves {
  display: flex;
  gap: 1px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Individual grave box */
.cmap-grave {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.1s, box-shadow 0.1s;
  opacity: 0.8;
}
.cmap-grave:hover {
  transform: scale(1.7);
  z-index: 5;
  opacity: 1;
  box-shadow: 0 0 6px rgba(0,0,0,0.25);
}
.cmap-grave-sel {
  opacity: 1;
  outline: 2px solid var(--crimson);
  outline-offset: 1px;
  transform: scale(1.5);
  z-index: 4;
  box-shadow: 0 0 0 3px rgba(184,40,46,0.2);
}

/* Tooltip */
.cmap-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(26,26,30,0.95);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  padding: 7px 11px;
  border-radius: 5px;
  border: 1px solid #555;
  display: none;
  z-index: 100;
  max-width: 280px;
  line-height: 1.45;
  backdrop-filter: blur(6px);
}
.cmap-tt-name { color: #90caf9; font-weight: 500; }
.cmap-tt-xn { color: #ce93d8; }
.cmap-tt-meta { color: #999; font-size: 0.7rem; }

@media (max-width: 768px) {
  .cmap-middle { flex-direction: column; }
  .cmap-slot-gd { flex-direction: column; }
  .cmap-grave { width: 8px; height: 8px; }
  .cmap-rlabel { width: 24px; min-width: 24px; font-size: 0.5rem; }
  .cmap-tooltip { max-width: 85vw; }
  .cmap-card-header { padding: 6px 10px; }
  .cmap-letter { font-size: 1.1rem; width: 28px; height: 28px; }
  .cmap-card-title { font-size: 0.8rem; }
}

@media (max-width: 480px) {
  .cmap-grave { width: 6px; height: 6px; }
  .cmap-graves { gap: 0; }
  .cmap-row-strip { margin-bottom: 1px; }
  .cmap-rlabel { width: 20px; min-width: 20px; font-size: 0.45rem; padding-right: 3px; }
  .cmap-card-body { padding: 6px 6px 8px; }
}

/* Detail card shown on grave click */
.cmap-detail {
  font-family: var(--font-ui);
}
.cmap-detail-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.cmap-detail-dates {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.cmap-detail-loc {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 6px;
}
.cmap-detail-notes {
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-style: italic;
  border-top: 1px solid var(--ivory-deep);
  padding-top: 6px;
  margin-top: 4px;
}

.cem-intro {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-muted);
  margin-bottom: 28px;
  max-width: 700px;
  line-height: 1.6;
}

/* Auth form */
.cem-auth {
  max-width: 400px;
  margin: 0 auto;
  border: 1px solid var(--ivory-deep);
  background: var(--parchment);
  padding: 28px;
}

.cem-auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--ivory-deep);
}

.cem-tab {
  flex: 1;
  padding: 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.cem-tab.active {
  color: var(--crimson);
  border-bottom-color: var(--crimson);
}

.cem-field {
  margin-bottom: 14px;
}

.cem-field label {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cem-field input {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  border: 1px solid var(--ivory-deep);
  outline: none;
  transition: border-color var(--transition);
}

.cem-field input:focus {
  border-color: var(--crimson);
}

.cem-btn {
  display: inline-block;
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--parchment);
  border: none;
  cursor: pointer;
  transition: background var(--transition);
  width: 100%;
  margin-top: 6px;
}

.cem-btn:hover { background: var(--crimson); }

.cem-error {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--crimson);
  margin-bottom: 12px;
  display: none;
}

.cem-link {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* Search */
.cem-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ivory-deep);
}

.cem-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cem-search-bar input {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  border: 1px solid var(--ivory-deep);
  outline: none;
}

.cem-search-bar input:focus { border-color: var(--crimson); }

.cem-search-bar select {
  padding: 9px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  border: 1px solid var(--ivory-deep);
  background: var(--parchment);
}

.cem-search-bar .cem-btn {
  width: auto;
  margin-top: 0;
  padding: 9px 20px;
}

.cem-stats {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 12px;
}

/* Results table */
#cem-results {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cem-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 13px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.cem-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}

.cem-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--ivory-deep);
  color: var(--ink-soft);
}

.cem-table tbody tr:hover {
  background: var(--ivory-warm);
}

.cem-photo-link {
  text-decoration: none;
  font-size: 16px;
  margin-right: 2px;
  transition: transform 0.15s;
  display: inline-block;
}

.cem-photo-link:hover {
  transform: scale(1.3);
}

.cem-has-notes {
  cursor: help;
}

.cem-notes-row td {
  padding: 4px 10px 10px 10px;
  font-size: 11px;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--ivory-deep);
  background: var(--ivory-warm);
}

.cem-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.cem-empty {
  text-align: center;
  padding: 40px 20px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-faint);
}

@media (max-width: 768px) {
  .cem-table { font-size: 11px; }
  .cem-table th, .cem-table td { padding: 5px 6px; }
  .cem-auth { padding: 20px; }
  /* Hide middle name on tablets */
  .cem-table th:nth-child(3), .cem-table td:nth-child(3) { display: none; }
  .cem-search-bar input { min-width: 0; }
}

@media (max-width: 480px) {
  .cem-search-bar { flex-direction: column; }
  .cem-search-bar input { min-width: auto; }
  .cem-table { font-size: 10px; }
  .cem-table th, .cem-table td { padding: 4px 4px; }
  /* Hide middle name + birth on small phones */
  .cem-table th:nth-child(3), .cem-table td:nth-child(3),
  .cem-table th:nth-child(4), .cem-table td:nth-child(4) { display: none; }
  .cem-welcome { flex-direction: column; gap: 8px; align-items: flex-start; }
}

@media (max-width: 375px) {
  .cem-table { font-size: 9px; }
  /* Also hide row column on very small screens */
  .cem-table th:nth-child(7), .cem-table td:nth-child(7) { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-content { animation: fadeUp 0.7s var(--ease) both; }
.hero-badge   { animation: fadeUp 0.5s var(--ease) 0.1s both; }

.article-card,
.gallery-card {
  animation: fadeUp 0.45s var(--ease) both;
}

.article-card:nth-child(2),
.gallery-card:nth-child(2) { animation-delay: 0.06s; }
.article-card:nth-child(3),
.gallery-card:nth-child(3) { animation-delay: 0.12s; }
.article-card:nth-child(4),
.gallery-card:nth-child(4) { animation-delay: 0.18s; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-strip { grid-template-columns: repeat(2, 1fr); }

  .article-hero {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --section-gap: 40px;
    --col-gap: 20px;
  }

  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  .header-bar { height: 44px; padding: 0 16px; }
  .logo-text { font-size: 22px; }
  .logo-sub { font-size: 8px; letter-spacing: 2px; }

  .hero { min-height: 360px; }
  .hero-content { padding: 28px; }
  .hero-content h1 { font-size: 28px; }
  .hero-excerpt { font-size: 15px; }

  .article-grid { grid-template-columns: 1fr; gap: 18px; }
  .gallery-strip { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-full-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .article-header h1 { font-size: 30px; }
  .article-body { font-size: 17px; }
  .article-hero { height: 280px; width: 100%; margin-left: 0; }

  .footer-top { flex-direction: column; text-align: center; }
  .footer-links { flex-wrap: wrap; justify-content: center; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
  .footer-brand { justify-content: center; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 480px) {
  .header-bar { height: 40px; padding: 0 12px; }
  .logo-text { font-size: 20px; }
  .logo-sub { display: none; }
  .lang-btn { font-size: 9px; padding: 2px 5px; }
  .lang-sep { font-size: 9px; }

  .hero { min-height: 260px; }
  .hero-content { padding: 18px; }
  .hero-content h1 { font-size: 22px; }
  .hero-excerpt { font-size: 14px; }
  .hero-badge { font-size: 9px; padding: 4px 10px; }

  .container { padding: 0 16px; }

  .card-img { height: 170px; }
  .card-body { padding: 14px 16px 18px; }
  .card-body h3 { font-size: 16px; }

  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }

  .article-header h1 { font-size: 24px; }
  .article-hero { height: 200px; }
  .article-body { font-size: 16px; }

  .mobile-nav { padding: 12px 16px 16px; }

  .footer-inner { padding: 0 16px; }

  .section-header h2 { font-size: 22px; }
}

@media (max-width: 375px) {
  .container { padding: 0 12px; }
  .header-bar { padding: 0 10px; }
  .hero-content { padding: 14px; }
  .hero-content h1 { font-size: 20px; }
  .card-body { padding: 12px 14px 16px; }
  .card-body h3 { font-size: 15px; }
  .lang-btn { font-size: 10px; padding: 3px 6px; }
  .lang-sep { font-size: 10px; }
  .footer-inner { padding: 0 12px; }
  .cem-map-container { padding: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   Cemetery Photo Lightbox
   ═══════════════════════════════════════════════════════════════════════════ */

#cem-lightbox {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  align-items: center; justify-content: center;
}
.cem-lb-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
}
.cem-lb-content {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  max-width: 90vw; max-height: 90vh;
}
.cem-lb-img {
  max-width: 85vw; max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  user-select: none;
  -webkit-user-drag: none;
}
.cem-lb-close {
  position: fixed; top: 16px; right: 20px;
  background: none; border: none; color: #fff;
  font-size: 36px; cursor: pointer; z-index: 10001;
  line-height: 1; opacity: 0.8;
}
.cem-lb-close:hover { opacity: 1; }
.cem-lb-prev, .cem-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.5); border: none; color: #fff;
  font-size: 40px; padding: 8px 14px; cursor: pointer;
  border-radius: 4px; z-index: 10001; opacity: 0.7;
}
.cem-lb-prev:hover, .cem-lb-next:hover { opacity: 1; background: rgba(0,0,0,0.7); }
.cem-lb-prev { left: 10px; }
.cem-lb-next { right: 10px; }
.cem-lb-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #ccc; font-size: 14px; z-index: 10001;
}

@media (max-width: 600px) {
  .cem-lb-img { max-width: 95vw; max-height: 80vh; }
  .cem-lb-prev, .cem-lb-next { font-size: 28px; padding: 6px 10px; }
  .cem-lb-prev { left: 4px; }
  .cem-lb-next { right: 4px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Cemetery Photo Upload Modal
   ═══════════════════════════════════════════════════════════════════════════ */

#cem-upload-modal {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  align-items: center; justify-content: center;
}
.cem-upload-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
}
.cem-upload-dialog {
  position: relative;
  background: #fff; border-radius: 12px;
  padding: 24px; max-width: 480px; width: 90vw;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.cem-upload-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; font-size: 24px;
  cursor: pointer; color: #999; line-height: 1;
}
.cem-upload-close:hover { color: #333; }
.cem-upload-drop {
  border: 2px dashed #ccc; border-radius: 8px;
  padding: 32px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: #666; line-height: 1.6;
}
.cem-upload-drop:hover { border-color: #4a7c59; background: #f8faf8; }
.cem-upload-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px;
}
.cem-btn-primary {
  background: #4a7c59 !important; color: #fff !important; border-color: #4a7c59 !important;
}
.cem-btn-primary:hover { background: #3d6a4c !important; }
.cem-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.cem-upload-link {
  font-size: 12px; text-decoration: none; color: #999; cursor: pointer;
}
.cem-upload-link:hover { color: #4a7c59; }

.cem-sortable {
  cursor: pointer; user-select: none; white-space: nowrap;
}
.cem-sortable:hover { background: rgba(0,0,0,0.05); }

/* ═══════════════════════════════════════════════════════════════════════════
   Print
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .site-header, .site-footer, #lightbox, .mobile-nav, #cem-lightbox { display: none !important; }
  .site-main { padding: 0; }
  .article-full { max-width: 100%; }
  .article-body { font-size: 12pt; }
  a { color: inherit; text-decoration: underline; }
}
