/* ============================================================
   Chidonim — warm editorial design system
   Audience: Israeli parents & kids. Warm paper, terracotta ink,
   playful-but-credible. RTL-first. No webfonts (system stack).
   ============================================================ */
:root {
  /* surfaces */
  --paper: #faf5ec;
  --card: #fffdf8;
  --ink: #2b2119;
  --muted: #6f6051;
  --faint: #9a8874;
  --line: #e9dcc6;
  --line-soft: #f1e7d3;

  /* accents — one family, varied hue (terracotta / amber / teal) */
  --terra: #ce5a2e;
  --terra-deep: #a8431f;
  --terra-tint: #fae7d7;
  --amber: #d9941a;
  --amber-deep: #a86e0c;
  --amber-tint: #faeed2;
  --teal: #1e7a68;
  --teal-deep: #145c4f;
  --teal-tint: #ddefe8;

  /* shape + depth */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-card:
    inset 0 1px 0 rgb(255 255 255 / .75),
    0 1px 2px rgb(74 52 28 / .07),
    0 10px 28px -14px rgb(74 52 28 / .22);
  --shadow-lift:
    inset 0 1px 0 rgb(255 255 255 / .8),
    0 2px 4px rgb(74 52 28 / .08),
    0 18px 38px -14px rgb(74 52 28 / .30);

  --font: "Segoe UI", "Noto Sans Hebrew", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--terra-tint); color: var(--terra-deep); }

/* faint paper grain — kills flatness on cheap screens */
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 780px; }
a { color: var(--terra-deep); }
:focus-visible { outline: 3px solid var(--terra-tint); outline-offset: 2px; border-radius: 6px; }

/* ---------- header ---------- */
.site-header {
  background: rgb(255 253 248 / .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem 1.25rem; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink);
  font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em;
}
.brand-logo { width: 38px; height: 38px; flex: none; }
.main-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.main-nav a {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: .95rem;
  padding: .45rem .9rem; border-radius: 999px;
  transition: background .15s, color .15s;
}
.main-nav a:hover { color: var(--terra-deep); background: var(--terra-tint); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4.2rem 0 3rem;
  text-align: center;
  background:
    radial-gradient(52rem 30rem at 50% -12rem, #fbeed9 0%, rgb(251 238 217 / 0) 62%),
    radial-gradient(30rem 22rem at 88% 110%, var(--teal-tint) 0%, rgb(221 239 232 / 0) 60%),
    radial-gradient(26rem 20rem at 8% 115%, var(--amber-tint) 0%, rgb(250 238 210 / 0) 60%),
    var(--paper);
}
.hero-doodles { position: absolute; inset: 0; pointer-events: none; }
.hero-doodles svg { position: absolute; opacity: .5; }
.eyebrow {
  display: inline-block;
  font-size: .82rem; font-weight: 800; letter-spacing: .04em;
  color: var(--terra-deep);
  background: var(--terra-tint);
  border: 1px solid rgb(206 90 46 / .25);
  padding: .32rem 1rem; border-radius: 999px;
  margin: 0 0 1.1rem;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.3;
  margin: 0 0 .8rem; color: var(--ink);
  text-wrap: balance;
}
.lead { color: var(--muted); font-size: 1.12rem; margin: 0 auto; max-width: 640px; }
.hero-stats { display: flex; gap: .8rem; justify-content: center; margin-top: 1.8rem; flex-wrap: wrap; }
.stat-chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem 1.2rem;
  box-shadow: var(--shadow-card);
  display: flex; align-items: baseline; gap: .5rem;
}
.stat-chip b { font-size: 1.25rem; font-weight: 800; color: var(--terra-deep); font-variant-numeric: tabular-nums; }
.stat-chip span { color: var(--muted); font-size: .88rem; font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  .hero .eyebrow, .hero h1, .hero .lead, .hero-stats {
    animation: rise .7s cubic-bezier(.2,.7,.2,1) both;
  }
  .hero .eyebrow { animation-delay: .05s; }
  .hero h1 { animation-delay: .12s; }
  .hero .lead { animation-delay: .2s; }
  .hero-stats { animation-delay: .28s; }
  .hero-doodles svg { animation: drift 9s ease-in-out infinite alternate; }
  .hero-doodles svg:nth-child(2) { animation-delay: -3s; }
  .hero-doodles svg:nth-child(3) { animation-delay: -6s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: translateY(-6px) rotate(-2deg); } to { transform: translateY(8px) rotate(3deg); } }

/* ---------- section titles ---------- */
.section-head { display: flex; align-items: center; gap: .8rem; margin: 3rem 0 1.2rem; }
.section-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.section-title .kicker {
  display: block; font-size: .8rem; font-weight: 800; letter-spacing: .05em;
  margin-bottom: .15rem;
}
.section-head .rule { flex: 1; height: 2px; border-radius: 2px; background: var(--line-soft); min-width: 2rem; }
.kicker-trivia { color: var(--terra); }
.kicker-riddle { color: var(--amber-deep); }
.kicker-fact { color: var(--teal); }

/* ---------- cards ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.card {
  --ac: var(--terra); --ac-deep: var(--terra-deep); --ac-tint: var(--terra-tint);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem 1.15rem;
  text-decoration: none; color: inherit; display: block;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--ac) 45%, var(--line));
  box-shadow: var(--shadow-lift);
}
.card-trivia { --ac: var(--terra); --ac-deep: var(--terra-deep); --ac-tint: var(--terra-tint); }
.card-riddle { --ac: var(--amber); --ac-deep: var(--amber-deep); --ac-tint: var(--amber-tint); }
.card-fact   { --ac: var(--teal);  --ac-deep: var(--teal-deep);  --ac-tint: var(--teal-tint); }
.card h3 { margin: 0 0 .3rem; font-size: 1.06rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.card .icon {
  display: inline-flex; width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--ac-tint); color: var(--ac-deep);
  align-items: center; justify-content: center; margin-bottom: .7rem;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .6);
}
.card .icon svg { width: 24px; height: 24px; }
.card::after {
  content: "‹";
  position: absolute; top: 1.15rem; left: 1.2rem;
  color: var(--faint); font-size: 1.3rem; font-weight: 700; line-height: 1;
  transition: transform .18s ease, color .18s ease;
}
[dir="rtl"] .card::after { content: "‹"; }
.card:hover::after { transform: translateX(-4px); color: var(--ac-deep); }

/* ---------- Q&A ---------- */
.qa-list { display: grid; gap: .65rem; margin: 1.5rem 0; }
.qa {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(74 52 28 / .05);
  transition: border-color .15s ease;
}
.qa:hover { border-color: color-mix(in srgb, var(--terra) 35%, var(--line)); }
.qa summary {
  cursor: pointer; padding: .9rem 1.15rem;
  font-weight: 800; font-size: 1rem; letter-spacing: -0.01em;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: .8rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+";
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--terra-tint); color: var(--terra-deep);
  font-size: 1.25rem; font-weight: 400; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.qa[open] summary::after { content: "–"; background: var(--terra); color: #fff; transform: rotate(180deg); }
.qa .answer {
  margin: 0 1.15rem .95rem; padding: .75rem 1rem 0;
  border-top: 2px dashed var(--line-soft);
  color: var(--muted); line-height: 1.7;
}
.qa .answer strong { color: var(--ink); }
.qa[open] { border-color: color-mix(in srgb, var(--terra) 40%, var(--line)); }

.qa-controls { display: flex; gap: .6rem; margin: 1.2rem 0; flex-wrap: wrap; }
.btn {
  border: 1.5px solid var(--line); background: var(--card); border-radius: 999px;
  padding: .55rem 1.25rem; font: inherit; font-size: .92rem; font-weight: 700;
  cursor: pointer; color: var(--terra-deep);
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { border-color: var(--terra); background: var(--terra-tint); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* ---------- facts ---------- */
.fact-list { display: grid; gap: .65rem; margin: 1.5rem 0; }
.fact {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .95rem 1.15rem; display: flex; gap: .85rem; align-items: flex-start;
  box-shadow: 0 1px 2px rgb(74 52 28 / .05);
}
.fact .fact-num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal-tint); color: var(--teal-deep);
  font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .6);
}
.fact p { margin: 0; color: var(--ink); line-height: 1.7; }
.fact:nth-child(odd) .fact-num { background: var(--amber-tint); color: var(--amber-deep); }

/* ---------- prose ---------- */
.prose h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin: 2.2rem 0 .7rem; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-right: 1.2rem; }
.prose a { font-weight: 700; }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: .85rem; color: var(--faint); margin: 1.4rem 0 0; font-weight: 600; }
.crumbs a { color: var(--terra-deep); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- content page head ---------- */
.container.narrow h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.35;
  margin: .6rem 0 .7rem; text-wrap: balance;
}
.page-chip {
  display: inline-block; font-size: .8rem; font-weight: 800; letter-spacing: .04em;
  padding: .28rem .95rem; border-radius: 999px;
  background: var(--terra-tint); color: var(--terra-deep);
  border: 1px solid rgb(206 90 46 / .25);
  margin-top: 1.4rem;
}
.page-chip.chip-riddle { background: var(--amber-tint); color: var(--amber-deep); border-color: rgb(217 148 26 / .3); }
.page-chip.chip-fact { background: var(--teal-tint); color: var(--teal-deep); border-color: rgb(30 122 104 / .3); }

/* ---------- related ---------- */
.related { margin: 3rem 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .65rem; }
.related a {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem 1rem; text-decoration: none; color: var(--ink);
  font-weight: 700; font-size: .93rem;
  transition: border-color .15s, background .15s, transform .15s;
}
.related a:hover { border-color: var(--terra); background: var(--terra-tint); transform: translateY(-1px); }

/* ---------- footer: deep warm close ---------- */
.site-footer {
  background: #241a10; color: #e8dcc4;
  margin-top: 4rem; padding: 2.4rem 0 2rem;
  border-top: 4px solid var(--terra);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1.2rem; flex-wrap: wrap; font-size: .9rem;
}
.footer-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.05rem; color: #fff; }
.footer-brand svg { width: 30px; height: 30px; }
.footer-inner nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-inner a { color: #cbb894; text-decoration: none; font-weight: 600; }
.footer-inner a:hover { color: #fff; }
.footer-note { flex-basis: 100%; color: #a68f6d; font-size: .82rem; margin: 0; }

/* ---------- cookie banner ---------- */
.cookie-banner {
  position: fixed; bottom: 1.2rem; right: 1.2rem; left: 1.2rem; max-width: 540px;
  margin-inline-start: auto;
  background: #2b2119; color: #f3e9d6;
  border-radius: var(--radius); padding: 1.1rem 1.3rem; z-index: 100;
  box-shadow: 0 18px 50px -12px rgb(0 0 0 / .45);
  border: 1px solid rgb(255 255 255 / .08);
}
.cookie-banner p { margin: 0 0 .9rem; font-size: .9rem; line-height: 1.6; }
.cookie-actions { display: flex; gap: .6rem; }
.cookie-actions button {
  border: none; border-radius: 999px; padding: .55rem 1.4rem;
  font: inherit; font-weight: 800; cursor: pointer;
}
#cookie-accept { background: var(--terra); color: #fff; }
#cookie-accept:hover { background: var(--terra-deep); }
#cookie-refuse { background: transparent; color: #cbb894; border: 1.5px solid #5c4c38; }
#cookie-refuse:hover { border-color: #cbb894; }

/* ---------- 404 ---------- */
.error-wrap { text-align: center; padding: 5rem 1rem; max-width: 640px; margin: 0 auto; }
.error-code {
  font-size: 5.5rem; font-weight: 800; letter-spacing: -0.04em;
  color: var(--terra); line-height: 1; margin: 0 0 1rem;
}
.error-links { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: 1.6rem; }
.error-links a {
  display: inline-block; padding: .65rem 1.35rem; border-radius: 999px;
  background: var(--terra-tint); color: var(--terra-deep);
  text-decoration: none; font-weight: 700;
}
.error-links a:hover { background: var(--terra); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .hero { padding: 3rem 0 2.2rem; }
  .header-inner { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .main-nav { gap: 0; }
  .main-nav a { padding: .4rem .7rem; font-size: .88rem; }
  .hero-doodles { display: none; }
  .section-head .rule { display: none; }
}
