/* ═════════════════════════════════════
   BASE — site-wide chrome: fonts, colors, reset, nav, footer.
   Shared by every page. Page-specific section styles live in components.css.
═════════════════════════════════════ */

@font-face {
  font-family: 'NextExitRound';
  src: url('../media/fonts/NextExitRound-Light.otf') format('opentype');
  font-weight: 300;
}
@font-face {
  font-family: 'NextExitRound';
  src: url('../media/fonts/NextExitRound-Regular.otf') format('opentype');
  font-weight: 400;
}
@font-face {
  font-family: 'NextExitRound';
  src: url('../media/fonts/NextExitRound-Bold.otf') format('opentype');
  font-weight: 700;
}

:root {
  --blue:       #00529C;
  --blue-light: #EEF4FA;
  --blue-mid:   #C8DCF0;
  --text-dark:  #0D1E3A;
  --text-body:  #3A4A6A;
  --gray:       #939598;
  --border:     #E2ECF7;
  /* mustard — the one confirmed interaction accent color */
  --gold:       #EDC11C;
  --green:      #9CB734;
  --green-light: #F3F6E7;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'NextExitRound', 'Heebo', Arial, sans-serif;
  background: #fff;
  color: var(--text-dark);
  overflow-x: hidden;
}

/* ─────────────────────────────────────
   SCROLL ANIMATIONS — driven by main.js toggling .visible
───────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }


/* ─────────────────────────────────────
   NAV
───────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 72px;
  height: 80px;
}

.nav-logo img {
  height: 54px;
}

.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
}

.nav-links li { position: relative; }

/* Donate list item: only meant for the mobile dropdown menu (see the
   900px breakpoint below) — desktop already has the persistent
   .btn-donate-nav pill button, so this stays hidden there. */
.nav-donate-mobile { display: none; }

.nav-links a {
  position: relative;
  text-decoration: none;
  color: var(--text-body);
  font-size: 16px;
  font-weight: 400;
  padding-bottom: 6px;
  transition: color 0.15s;
}

/* Mustard underline sweep on hover, instead of a plain color change */
.nav-links a::after {
  content: '';
  position: absolute;
  right: 0; left: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.nav-links a:hover { color: var(--text-dark); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-donate-nav {
  background: var(--blue);
  color: white;
  padding: 12px 32px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.btn-donate-nav:hover { background: var(--gold); color: var(--text-dark); }

/* Language switch — plain text link naming the other language in its own
   language. Same mustard underline sweep as the nav links on hover. */
.lang-switch {
  position: relative;
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 2px;
}
.lang-switch::after {
  content: '';
  position: absolute;
  right: 0; left: 0; bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.22s ease;
}
.lang-switch:hover::after,
.lang-switch:focus-visible::after { transform: scaleX(1); }
.lang-switch-short { display: none; }

/* ── Sub-menus ──
   Each top item is a page; its sub-menu links to sections of that page.
   Desktop: opens on hover/keyboard focus (and on click of the small
   chevron, for touch tablets). Phones: closed by default, opened by the
   chevron button only — tapping the item name goes to the page. */
.nav-item-row { display: flex; align-items: center; gap: 2px; }
.sub-toggle {
  background: none; border: none; padding: 4px; margin: 0; cursor: pointer;
  color: var(--text-body); display: inline-flex; align-items: center;
  border-radius: 6px;
}
.sub-toggle svg { width: 12px; height: 12px; transition: transform 0.2s ease; }
.has-sub.open > .nav-item-row .sub-toggle svg { transform: rotate(180deg); }

@media (min-width: 901px) {
  .has-sub { padding: 28px 0; margin: -28px 0; } /* keeps hover alive between item and panel */
  .sub-menu {
    position: absolute; top: 100%; inset-inline-start: -16px;
    min-width: 210px; list-style: none;
    background: #fff; border: 1px solid var(--border); border-radius: 14px;
    box-shadow: 0 14px 32px rgba(0, 82, 156, 0.12);
    padding: 8px;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 120;
  }
  .has-sub:hover > .sub-menu,
  .has-sub:focus-within > .sub-menu,
  .has-sub.open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
  .nav-links .sub-menu a {
    display: block; padding: 9px 14px; border-radius: 9px;
    font-size: 15px; white-space: nowrap; color: var(--text-body);
  }
  .nav-links .sub-menu a::after { display: none; }
  .nav-links .sub-menu a:hover, .nav-links .sub-menu a:focus-visible {
    background: var(--blue-light); color: var(--blue);
  }
}

/* Six items on mid-size screens: tighten spacing so everything fits */
@media (min-width: 901px) and (max-width: 1240px) {
  nav { padding: 0 32px; }
  .nav-links { gap: 22px; }
  .nav-links > li > .nav-item-row > a { font-size: 15px; }
  .nav-actions { gap: 14px; }
  .btn-donate-nav { padding: 11px 22px; font-size: 15px; }
}
@media (min-width: 901px) and (max-width: 1080px) {
  nav { padding: 0 18px; }
  .nav-links { gap: 12px; }
  .nav-links > li > .nav-item-row > a { font-size: 14.5px; }
  .sub-toggle { padding: 4px 2px; }
  .nav-actions { gap: 10px; }
  .btn-donate-nav { padding: 10px 16px; font-size: 14px; }
  .lang-switch { font-size: 14.5px; }
  .nav-logo img { height: 46px; }
  [dir="ltr"] .nav-logo img { height: 54px; }
}

/* Hamburger toggle — hidden on desktop, shown at nav breakpoint */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Nav responsive breakpoint ── */
@media (max-width: 900px) {
  nav { padding: 0 20px; height: 64px; }
  .nav-logo img { height: 40px; }
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: 64px;
    right: 0;
    left: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0,82,156,0.08);
    padding: 4px 20px 12px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links { max-height: calc(100vh - 64px); overflow-y: auto; }
  .nav-links li { width: 100%; }

  .nav-links a {
    display: block;
    padding: 15px 2px;
    font-size: 17px;
  }
  .nav-links > li { border-bottom: 1px solid var(--border); }
  .nav-links > li:last-child { border-bottom: none; }
  .nav-item-row { justify-content: space-between; }
  .nav-item-row > a { flex: 1; }
  .sub-toggle { padding: 12px 10px; }
  .sub-toggle svg { width: 14px; height: 14px; }

  .sub-menu { display: none; list-style: none; padding: 0 14px 10px; }
  .has-sub.open > .sub-menu { display: block; }
  .nav-links .sub-menu a { padding: 9px 2px; font-size: 15.5px; color: var(--text-body); }
  .nav-links a::after { display: none; }

  .nav-donate-mobile { display: block; }
  .nav-donate-mobile a { color: var(--blue); font-weight: 700; }

  .btn-donate-nav { padding: 10px 22px; font-size: 15px; }
  .nav-actions { gap: 14px; }

  /* Phones: short code ("EN" / "עב") in the header. The full name is kept
     for screen readers, visually hidden. */
  .lang-switch { font-size: 15px; padding: 8px 4px; }
  .lang-switch-short { display: inline; }
  .lang-switch-full {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
}

@media (max-width: 400px) {
  .btn-donate-nav { padding: 9px 16px; font-size: 14px; }
  .nav-actions { gap: 10px; }
}


/* ─────────────────────────────────────
   FOOTER
───────────────────────────────────── */
footer {
  background: #0C1C38;
  color: var(--gray);
  padding: 48px 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  font-size: 16px;
  font-weight: 300;
}

.footer-logo img {
  height: 46px;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 36px;
}

.footer-links a {
  white-space: nowrap;
  color: var(--gray);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: white; }

.footer-legal { font-size: 14px; white-space: nowrap; }
@media (max-width: 1400px) { .footer-links { gap: 24px; } }
.footer-a11y { display: block; margin-top: 6px; }
.footer-a11y a { color: var(--gray); text-decoration: underline; text-underline-offset: 3px; }
.footer-a11y a:hover { color: white; }

/* Footer stacks (logo / links / social / legal) below 1100px — with six
   menu items plus the social icons, one row no longer fits. */
@media (max-width: 1240px) {
  footer {
    flex-direction: column;
    text-align: center;
    padding: 40px 24px;
    gap: 24px;
  }
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px 24px;
    font-size: 15px;
  }
  .footer-legal { font-size: 13px; line-height: 1.6; white-space: normal; }
}

/* Current page in the menu */
.nav-links > li > .nav-item-row > a[aria-current="page"] { color: var(--text-dark); font-weight: 700; }
