/* ==========================================================================
   base.css — page defaults, layout container widths, scroll-reveal motion
   ========================================================================== */

:root {
  /* One size for every title type, on every page */
  --fs-page-title: 52px;     /* h1 of the inner pages (head of the page) */
  --fs-section-title: 44px;  /* h2 of every page section */
  --fs-media-title: 34px;    /* player title inside the audio / video details card */

  /* Inner pages: space above (under the header) and below the page head —
     breadcrumb, title, tabs — kept equal */
  --page-head-space: 64px;

  /* Hover language of the site — one rule per button family:
     - icon / light buttons  → filled with the brand blue, icon turns white
     - filled blue buttons   → cream fill, navy ink, soft blue edge          */
  --hover-fill: var(--color-blue-500);
  --hover-cream: var(--color-cream-300);
  --hover-cream-ink: var(--color-navy-700);
  --hover-cream-border: var(--color-blue-300);

  --cw: 1180px;   /* content width */
  --cww: 1320px;  /* wide content width */
  --accent: var(--color-blue-500);
}

@media (max-width: 900px) {
  :root {
    --page-head-space: 48px;
  }
}

@media (max-width: 640px) {
  :root {
    --fs-page-title: 36px;
    --page-head-space: 36px;
  }
}

@media (max-width: 560px) {
  :root {
    --fs-section-title: 32px;
    --fs-media-title: 26px;  /* stays below the section titles on phones */
  }
}

@media (min-width: 1700px) {
  :root {
    --cw: clamp(1180px, calc(1180px + (100vw - 1700px) * 0.75), 1640px);
    --cww: clamp(1320px, calc(1320px + (100vw - 1700px) * 0.8), 1800px);
  }
}

/* The page reads RTL, but the root box runs LTR so the window scrollbar stays
   on the right (the viewport scrollbar follows the root element's direction).
   <html dir="rtl"> is kept for language/accessibility semantics. */
html {
  /*rtl:ignore*/
  direction: ltr; /* LTR pages too: the scrollbar is on the right either way */
}

body {
  direction: rtl;
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
  /* The page heroes slide up under the header by a fixed 88px, but the header is
     a few px taller on wide screens. Start the page background with the heroes'
     top colour so no white seam shows above them. */
  background: var(--color-white) linear-gradient(var(--color-cream-200), var(--color-cream-200)) top / 100% 160px no-repeat;
  color: var(--color-navy-700);
  font-family: 'Cairo', sans-serif;
  text-align: right;
}

a {
  color: var(--color-gold-700);
  text-decoration: none;
}

a:hover {
  color: var(--color-navy-700);
}

[hidden] {
  display: none !important;
}

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* "Skip to content" (first link of every page, added by src/build.js):
   off-screen until the keyboard reaches it, then it drops in at the top
   start corner; it moves the focus to <main id="main">. */
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  right: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--color-navy-700);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s ease;
}

.skip-link:focus {
  transform: none;
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 117, 150, .45);
}

/* <main> is focused by the skip link, so the keyboard carries on from there */
main:focus {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}

/* Scroll box with its scrollbar on the right: the box runs LTR, its content
   flips back to RTL. Use on scroll containers whose children are blocks. */
.scroll-right {
  /*rtl:ignore*/
  direction: ltr;
}

.scroll-right > * {
  direction: rtl;
}

/* Tabs (every [role=tab] on the site): soft ring in the tab's colour for
   keyboard focus instead of the browser's black outline; none for mouse clicks */
[role="tab"]:focus {
  outline: none;
}

[role="tab"]:focus-visible {
  box-shadow: 0 0 0 4px var(--acc-ring, rgba(59, 117, 150, .25));
}

/* --------------------------------------------------------------------------
   Popup motion — played automatically when a window / dropdown is shown
   (its [hidden] attribute is removed). Components attach these keyframes:
     pop-fade  backdrops            pop-in    dialog windows
     pop-drop  dropdowns / panels opening under their button
   -------------------------------------------------------------------------- */
@keyframes pop-fade {
  from {
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.96);
  }
}

@keyframes pop-drop {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* Closing (GP.hide / GP.animateOut add .is-closing, then hide after these):
     pop-fade-out  backdrops      pop-out  dialog windows      pop-lift  dropdowns */
@keyframes pop-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes pop-out {
  to {
    opacity: 0;
    transform: translateY(12px) scale(.97);
  }
}

@keyframes pop-lift {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* a closing popup no longer catches clicks */
.is-closing {
  pointer-events: none;
}

/* Body scroll lock while a modal dialog is open */
body.is-locked {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Entrance motion — js/core/reveal.js marks blocks with data-rv
   ("" = waiting, hidden; "in" = play) and staggers them with --rv-delay.
   An animation (not a transition) so components keep their own transitions;
   it animates from the hidden pose to the element's normal styles.
   -------------------------------------------------------------------------- */
[data-rv=""] {
  opacity: 0;
}

[data-rv="in"] {
  animation: rv-in .75s cubic-bezier(.22, .61, .36, 1) var(--rv-delay, 0s) backwards;
}

@keyframes rv-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-rv] {
    opacity: 1 !important;
    animation: none !important;
  }
}

