﻿:root {
  --bg: #f3ead8;
  --surface: rgba(255, 248, 235, 0.86);
  --surface-deep: rgba(232, 220, 195, 0.88);
  --text: #241c16;
  --muted: #6a5645;
  --gold: #b08a45;
  --gold-light: #d0b77b;
  --burgundy: #6f1d1b;
  --burgundy-mid: #8b2a24;
  --stone: #695b4c;
  --border: rgba(176, 138, 69, 0.34);
  --shadow-sm: 0 8px 24px rgba(47, 36, 26, 0.09);
  --shadow: 0 18px 48px rgba(47, 36, 26, 0.14);
  --shadow-lg: 0 30px 80px rgba(47, 36, 26, 0.22);
  --radius: 20px;
  --radius-lg: 30px;
  --paper: #e8dcc3;
  --sepia: #7b5c3b;
  --dark-brown: #2f241a;
  --soft-stone: #c8bda7;
  --heritage-old-image: url("/public/images/backgrounds/old-lubavitch-buildings.jpg");
  --heritage-new-image: url("/public/images/backgrounds/modern-restoration-ohel.jpg");
  --heritage-panorama: url("/public/images/backgrounds/old-to-new-lubavitch-panorama.jpg");
  --heritage-paper: url("/public/images/textures/parchment-texture.jpg");
  --heritage-grain: url("/public/images/textures/subtle-grain.png");
  --heritage-map-lines: url("/public/images/textures/archive-map-lines.svg");
  --heritage-old-opacity: 0.23;
  --heritage-new-opacity: 0.20;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-family: "Source Sans Pro", Inter, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 48% 7%, rgba(255, 249, 230, 0.74) 0 15rem, transparent 35rem),
    linear-gradient(105deg, rgba(123, 92, 59, 0.16), transparent 35%, rgba(176, 138, 69, 0.14) 70%, rgba(111, 29, 27, 0.10)),
    var(--heritage-paper),
    linear-gradient(180deg, #f3ead8 0%, #e8dcc3 100%);
  background-size: auto, auto, 320px 320px, auto;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(90deg, rgba(243, 234, 216, 0.02), rgba(243, 234, 216, 0.52) 43%, rgba(243, 234, 216, 0.08) 100%),
    var(--heritage-map-lines) center/cover no-repeat,
    var(--heritage-old-image) left center/64vw auto no-repeat,
    var(--heritage-grain) repeat;
  filter: sepia(0.58) saturate(0.86) contrast(1.03);
  mix-blend-mode: multiply;
  opacity: calc(var(--heritage-old-opacity) + 0.16);
}

body::after {
  z-index: 0;
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 250, 237, 0.46), transparent 24rem),
    linear-gradient(90deg, rgba(243, 234, 216, 0.70) 0 44%, rgba(243, 234, 216, 0.03) 76%),
    var(--heritage-new-image) right 13vh/58vw auto no-repeat,
    radial-gradient(ellipse at center, transparent 0 52%, rgba(47, 36, 26, 0.26) 100%);
  filter: sepia(0.18) saturate(0.96) contrast(1.03);
  mix-blend-mode: multiply;
  opacity: calc(var(--heritage-new-opacity) + 0.12);
}

body > * {
  position: relative;
  z-index: 1;
}

body[data-page="history"] {
  --heritage-old-image: url("/public/images/backgrounds/old-lubavitch-street.jpg");
  --heritage-new-image: url("/public/images/backgrounds/cemetery-restoration.jpg");
  --heritage-old-opacity: 0.30;
  --heritage-new-opacity: 0.12;
}

body[data-page="restoration"] {
  --heritage-old-image: url("/public/images/backgrounds/old-lubavitch-buildings.jpg");
  --heritage-new-image: url("/public/images/backgrounds/modern-restoration-ohel.jpg");
  --heritage-old-opacity: 0.17;
  --heritage-new-opacity: 0.28;
}

body[data-page="gallery"] {
  --heritage-old-image: url("/public/images/backgrounds/old-lubavitch-street.jpg");
  --heritage-new-image: url("/public/images/backgrounds/cemetery-restoration.jpg");
  --heritage-old-opacity: 0.21;
  --heritage-new-opacity: 0.18;
}

body[data-page="news"],
body[data-page="news-detail"] {
  --heritage-old-image: url("/public/images/backgrounds/old-lubavitch-buildings.jpg");
  --heritage-new-image: url("/public/images/backgrounds/modern-restoration-ohel.jpg");
  --heritage-old-opacity: 0.19;
  --heritage-new-opacity: 0.16;
}

body[data-page="the-rebbe"] {
  --heritage-old-image: url("/public/images/backgrounds/old-lubavitch-street.jpg");
  --heritage-new-image: url("/public/images/backgrounds/modern-restoration-ohel.jpg");
  --heritage-old-opacity: 0.24;
  --heritage-new-opacity: 0.18;
}

body[data-page="archive"] {
  --heritage-old-image: url("/public/images/backgrounds/old-lubavitch-street.jpg");
  --heritage-new-image: url("/public/images/backgrounds/cemetery-restoration.jpg");
  --heritage-old-opacity: 0.33;
  --heritage-new-opacity: 0.10;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.85; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; cursor: pointer; }

.sr-only {
  border: 0; clip: rect(0 0 0 0); height: 1px;
  margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px;
}

@media (max-width: 900px) {
  body::before {
    opacity: 0.30;
    background:
      linear-gradient(180deg, rgba(243, 234, 216, 0.28), rgba(243, 234, 216, 0.76)),
      var(--heritage-map-lines) center top/cover no-repeat,
      var(--heritage-old-image) top left/100vw auto no-repeat,
      var(--heritage-grain) repeat;
  }

  body::after {
    opacity: 0.24;
    background:
      linear-gradient(180deg, rgba(243, 234, 216, 0.58), rgba(243, 234, 216, 0.24)),
      var(--heritage-new-image) right bottom/100vw auto no-repeat;
  }

  body[data-page="home"] .hero {
    min-height: 620px;
  }

  body[data-page="home"] .hero::before {
    background:
      linear-gradient(180deg, rgba(243, 234, 216, 0.22), rgba(243, 234, 216, 0.70) 46%, rgba(47, 36, 26, 0.18)),
      var(--heritage-old-image) top left/86vw auto no-repeat,
      var(--heritage-new-image) bottom right/92vw auto no-repeat;
    opacity: 0.86;
  }

  body[data-page="home"] .stats-row {
    margin-top: -2.5rem;
  }
}

/* Session reset: restore the original visual baseline. */
:root {
  --bg: #f3ead8;
  --surface: #fdf8ee;
  --surface-deep: #e6dbc8;
  --text: #181410;
  --muted: #5a5048;
  --gold: #a67c42;
  --gold-light: #c9a96e;
  --burgundy: #561f1b;
  --burgundy-mid: #7a3630;
  --stone: #736b62;
  --border: rgba(110, 85, 55, 0.16);
  --shadow-sm: 0 2px 10px rgba(20, 14, 8, 0.07);
  --shadow: 0 8px 36px rgba(20, 14, 8, 0.11);
  --shadow-lg: 0 24px 64px rgba(20, 14, 8, 0.16);
  --radius: 20px;
  --radius-lg: 30px;
}

body {
  min-height: 100vh;
  position: static;
  isolation: auto;
  background: linear-gradient(180deg, #f5edd8 0%, #eee3cc 100%);
}

body::before,
body::after,
.hero::before,
body[data-page="home"] .hero::after,
body[data-page="home"] .hero h1::after {
  content: none;
  display: none;
}

body > * {
  position: static;
  z-index: auto;
}

.header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(243, 234, 216, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(110, 85, 55, 0.13);
  box-shadow: none;
}

.header-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 1rem; padding: 1rem 0;
}

.brand strong {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--burgundy);
  text-shadow: none;
  text-transform: none;
}

.brand small {
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.nav-list a {
  color: var(--stone);
  font-family: inherit;
  font-weight: 400;
  text-transform: none;
  font-size: 0.9rem;
  letter-spacing: 0;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}

.nav-list a.active-link,
.nav-list a:hover {
  color: var(--burgundy);
  background: rgba(86, 31, 27, 0.07);
  box-shadow: none;
}

main.page,
.page {
  width: min(1200px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

body[data-page="home"] main.page {
  padding-bottom: 4rem;
}

.hero,
body[data-page="home"] .hero {
  position: relative;
  overflow: hidden;
  width: auto;
  margin: 2rem 0 3.5rem;
  margin-left: 0;
  margin-right: 0;
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  min-height: 560px;
  display: grid;
  align-items: end;
  justify-items: stretch;
  background: linear-gradient(160deg, #2a1a10, #3d2518) center/cover no-repeat;
  border: 0;
  box-shadow: none;
}

.hero-bg,
body[data-page="home"] .hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-repeat: no-repeat;
  filter: none;
  mix-blend-mode: normal;
  opacity: 1;
}

.hero-bg::after {
  content: "";
  display: block;
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(12, 8, 4, 0.12) 0%,
    rgba(12, 8, 4, 0.30) 45%,
    rgba(12, 8, 4, 0.78) 100%
  );
}

.hero-content,
body[data-page="home"] .hero-content {
  position: relative; z-index: 2;
  max-width: 780px;
  padding: 0 2.5rem 3rem;
  text-align: left;
  color: inherit;
  text-shadow: none;
}

.hero-tags,
body[data-page="home"] .hero-tags {
  justify-content: flex-start;
}

.hero-tag,
body[data-page="home"] .hero-tag {
  background: rgba(169, 130, 79, 0.35);
  border: 1px solid rgba(169, 130, 79, 0.55);
  color: #f0e4cc;
}

.hero h1,
body[data-page="home"] .hero h1 {
  color: #f7ede0;
  font-size: clamp(2.6rem, 4.5vw, 4.5rem);
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}

.hero p,
body[data-page="home"] .hero p {
  color: #ecdfd0;
  margin-left: 0;
  margin-right: 0;
  max-width: 46rem;
}

.hero-buttons,
body[data-page="home"] .hero-buttons {
  justify-content: flex-start;
}

.btn-secondary,
body[data-page="home"] .btn-secondary {
  background: rgba(255,255,255,0.14);
  color: #f2e6d8;
  border: 1px solid rgba(255,255,255,0.35);
}

.section-title {
  margin-bottom: 1.75rem;
  padding: 0 0 1rem;
  border: 0;
  border-bottom: 2px solid rgba(166, 124, 66, 0.22);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.card,
.news-card,
.archive-card,
.site-card,
.stat-card,
.timeline-card,
.image-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

.news-card,
.archive-card,
.site-card,
.image-card {
  border-radius: var(--radius-lg);
}

.cta-panel {
  background: linear-gradient(135deg, rgba(86,31,27,0.1), rgba(166,124,66,0.08));
  border: 1px solid rgba(110, 85, 55, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: none;
  backdrop-filter: none;
}

.pullquote {
  background: rgba(166, 124, 66, 0.07);
  box-shadow: none;
  backdrop-filter: none;
}

.figure {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: none;
}

.news-card img,
.archive-card img,
.site-card img,
.gallery-item img,
.figure img {
  filter: none;
}

body[data-page="home"] .stats-row {
  margin-top: 2rem;
  z-index: auto;
}
