/* ==========================================================================
   Dağ Yəhudiləri — Apple-inspired minimal design system
   ========================================================================== */

:root {
  --bg: #fbfbfd;
  --bg-2: #f2f2f5;
  --surface: #ffffff;
  --surface-2: #f6f6f8;
  --text: #16181d;
  --text-2: #6b6f76;
  --text-3: #93979e;
  --line: rgba(0, 0, 0, 0.09);
  --line-strong: rgba(0, 0, 0, 0.16);

  --navy: #14264e;
  --navy-2: #1f3a6e;
  --gold: #b08528;
  --gold-2: #d9b451;

  --accent: var(--navy);
  --accent-soft: rgba(20, 38, 78, 0.08);

  --header-bg: rgba(251, 251, 253, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05), 0 18px 40px rgba(0, 0, 0, 0.08);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-xl: 34px;

  --container: 1120px;
  --header-h: 54px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0a0b0f;
  --bg-2: #101218;
  --surface: #14161d;
  --surface-2: #1a1d25;
  --text: #f3f4f7;
  --text-2: #9aa0ab;
  --text-3: #71767f;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);

  --accent: #e0c073;
  --accent-soft: rgba(224, 192, 115, 0.12);
  --gold: #e0c073;

  --header-bg: rgba(10, 11, 15, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5), 0 22px 48px rgba(0, 0, 0, 0.5);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.028em; line-height: 1.08; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent-soft); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}
.container--narrow { max-width: 760px; }

.section { padding-block: clamp(64px, 9vw, 120px); }
.section--tight { padding-block: clamp(48px, 6vw, 80px); }
.section--alt { background: var(--bg-2); }

.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}

.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.brand__mark {
  width: auto;
  height: 28px;
  object-fit: contain;
}
.brand__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline: auto;
}
.nav__link {
  position: relative;
  font-size: 14px;
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: 999px;
  transition: color 0.25s var(--ease), background-color 0.25s var(--ease);
  white-space: nowrap;
}
.nav__link:hover { color: var(--text); background: var(--accent-soft); }
.nav__link.is-active { color: var(--text); font-weight: 500; background: var(--accent-soft); }

.header__tools { display: flex; align-items: center; gap: 8px; flex: none; }

.lang {
  display: flex;
  align-items: center;
  padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.lang__btn {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--text-2);
  transition: all 0.25s var(--ease);
}
.lang__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 999px;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }

.burger { display: none; }

/* mobile menu */
.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 99;
  background: var(--bg);
  padding: 20px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  overflow-y: auto;
}
.mobile-menu.is-open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-menu a {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.mobile-menu a.is-active { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 999px;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--bg); }
[data-theme="dark"] .btn--primary { color: #16181d; }
.btn--primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--text { padding: 0; color: var(--accent); font-weight: 500; }
.btn--text:hover { opacity: 0.7; }

.btn .chev { transition: transform 0.25s var(--ease); }
.btn:hover .chev { transform: translateX(3px); }

/* ---------- typography blocks ---------- */
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.display {
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
}
.h1 { font-size: clamp(32px, 5vw, 52px); }
.h2 { font-size: clamp(26px, 3.4vw, 40px); }
.h3 { font-size: clamp(19px, 2vw, 23px); }

.lead {
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.55;
  color: var(--text-2);
  letter-spacing: -0.015em;
}

.prose p { margin-bottom: 18px; color: var(--text-2); line-height: 1.68; }
.prose p:last-child { margin-bottom: 0; }

.intro-media {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}
.intro-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head .lead { margin-top: 18px; }
.center { text-align: center; margin-inline: auto; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 8vw, 104px) clamp(56px, 8vw, 96px);
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto;
  height: 620px;
  background: radial-gradient(60% 60% at 50% 40%, var(--accent-soft), transparent 70%);
  pointer-events: none;
  z-index: 1;
}
.hero__inner { position: relative; z-index: 2; }

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(251, 251, 253, 0.86) 22%, rgba(251, 251, 253, 0.93) 60%, var(--bg) 100%);
}
[data-theme="dark"] .hero__media::after {
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(10, 11, 15, 0.86) 22%, rgba(10, 11, 15, 0.93) 60%, var(--bg) 100%);
}
.hero__credit {
  position: relative;
  z-index: 2;
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-3);
}

.emblem {
  width: clamp(220px, 30vw, 340px);
  margin: 0 auto 30px;
}
.emblem img { width: 100%; height: auto; }

.hero__hebrew {
  font-size: 15px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  margin-top: 6px;
}

.hero .lead { max-width: 660px; margin: 22px auto 0; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

/* ---------- stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.stat { background: var(--bg); padding: 30px 24px; }
.stat__value {
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.stat__label { font-size: 15px; font-weight: 500; margin-top: 6px; }
.stat__note { font-size: 13.5px; color: var(--text-3); margin-top: 8px; line-height: 1.45; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 28px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.card__media {
  margin: -28px -28px 4px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
a.card:hover .card__media img { transform: scale(1.05); }

.card__icon {
  width: 42px; height: 42px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 6px;
}
.card__title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.card__text { font-size: 15px; color: var(--text-2); line-height: 1.55; }
.card__meta { font-size: 13px; color: var(--text-3); display: flex; gap: 10px; align-items: center; }
.card__foot { margin-top: auto; padding-top: 14px; font-size: 14px; color: var(--accent); display: flex; align-items: center; gap: 6px; }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }

/* ---------- quote ---------- */
.quote {
  text-align: center;
  max-width: 820px;
  margin-inline: auto;
}
.quote__mark { font-size: 54px; line-height: 1; color: var(--accent); opacity: 0.35; }
.quote__text {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.32;
  margin-top: 10px;
}
.quote__author { margin-top: 18px; font-size: 14px; color: var(--text-3); }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-strong) 8%, var(--line-strong) 92%, transparent);
}
.tl-item { position: relative; padding-bottom: 42px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -34px; top: 7px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: transform 0.4s var(--ease);
}
.tl-item:hover::before { transform: scale(1.25); }
.tl-item__period {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.tl-item__title { font-size: 21px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; }
.tl-item__text { margin-top: 8px; color: var(--text-2); line-height: 1.62; max-width: 640px; }

/* ---------- topic sections ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 44px; }
.chip {
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  transition: all 0.25s var(--ease);
}
.chip:hover, .chip.is-active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
[data-theme="dark"] .chip:hover, [data-theme="dark"] .chip.is-active { color: #16181d; }

.topic {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 48px;
  padding-block: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.topic:first-of-type { border-top: 0; }
.topic__aside { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; }
.topic__lead { font-size: 15px; color: var(--text-2); margin-top: 12px; line-height: 1.55; }

.topic__media {
  margin-top: 22px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
}
.topic__media img { width: 100%; height: auto; display: block; }

.deflist { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 26px; }
.deflist__row { background: var(--surface); padding: 16px 20px; display: grid; grid-template-columns: 200px 1fr; gap: 16px; }
.deflist__name { font-weight: 500; font-size: 15px; }
.deflist__text { font-size: 15px; color: var(--text-2); line-height: 1.5; }

/* ---------- article ---------- */
.article { max-width: 720px; margin-inline: auto; }
.article__meta { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: var(--text-3); margin-bottom: 20px; flex-wrap: wrap; }
.article__title { font-size: clamp(30px, 4.6vw, 48px); letter-spacing: -0.035em; }
.article__lead { margin-top: 20px; }
.article__cover {
  margin-top: 28px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 9;
}
.article__cover img { width: 100%; height: 100%; object-fit: cover; }
.article__body { margin-top: 42px; }
.article__body h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  margin-top: 44px;
  margin-bottom: 14px;
  letter-spacing: -0.025em;
}
.article__body p { font-size: 17.5px; line-height: 1.72; color: var(--text-2); margin-bottom: 20px; }
.article__body blockquote {
  margin: 34px 0;
  padding: 24px 28px;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.article__body blockquote p { font-size: 19px; color: var(--text); margin-bottom: 8px; letter-spacing: -0.02em; }
.article__body blockquote cite { font-size: 13.5px; color: var(--text-3); font-style: normal; }
.article__list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 24px 28px; margin: 30px 0; }
.article__list h4 { font-size: 15px; margin-bottom: 14px; }
.article__list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--text-2);
  line-height: 1.55;
}
.article__list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.article__list li:last-child { margin-bottom: 0; }

/* ---------- detail page ---------- */
.detail-hero {
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 15% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
  padding: clamp(28px, 4vw, 52px);
  overflow: hidden;
}
.detail-hero__media {
  margin: calc(-1 * clamp(28px, 4vw, 52px)) calc(-1 * clamp(28px, 4vw, 52px)) clamp(24px, 3vw, 36px);
  aspect-ratio: 16 / 8;
  background: var(--surface-2);
}
.detail-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.media-credit {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
}
.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 28px; }
.fact { background: var(--surface); padding: 16px 20px; display: flex; justify-content: space-between; gap: 18px; font-size: 15px; flex-wrap: wrap; }
.fact__label { color: var(--text-3); }
.fact__value { font-weight: 500; text-align: right; }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--text-2); margin-bottom: 26px; transition: color 0.25s var(--ease); }
.back-link:hover { color: var(--accent); }

/* ---------- footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: 56px 36px; font-size: 14px; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 44px; }
.footer__about { color: var(--text-2); line-height: 1.6; max-width: 360px; margin-top: 14px; }
.footer__title { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.footer__links li { margin-bottom: 10px; }
.footer__links a { color: var(--text-2); transition: color 0.25s var(--ease); }
.footer__links a:hover { color: var(--accent); }
.footer__emblem { width: 76px; height: auto; }
.footer__bottom {
  margin-top: 44px; padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px;
}

/* ---------- misc ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].in { opacity: 1; transform: none; }

.empty { text-align: center; padding-block: 120px; }
.empty .h2 { margin-bottom: 14px; }

.skeleton {
  display: grid; place-items: center;
  min-height: 60vh;
  color: var(--text-3);
  font-size: 15px;
}

.hebrew { font-size: 13px; color: var(--text-3); letter-spacing: 0.1em; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topic { grid-template-columns: 1fr; gap: 20px; }
  .topic__aside { position: static; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .burger { display: grid; }
  .brand__name { font-size: 14px; }
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  .deflist__row { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .container { padding-inline: 20px; }
  .grid--4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  .footer__grid { grid-template-columns: 1fr; gap: 30px; }
  .article__body p { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
