/* ============================================================
   Nourkids base.css
   Design tokens, reset, typography, buttons, forms, utilities.
   Uses CSS logical properties so Arabic (RTL) flips cleanly.
   ============================================================ */

:root {
  /* Palette, sampled pixel-exact from the Nourkids logo.
     Navy is the text colour; sky and amber are decoration only (see note below). */
  --bg: #F4FBFF;
  --surface: #FFFFFF;
  --surface-warm: #E9F7FF;
  --ink: #353F70;            /* logo navy: wordmark outline, shorts, skirt */
  --ink-soft: #4E5789;
  --muted: #5A638C;          /* same navy hue, darkened from #7E86AC to clear AA (5.8:1) */
  --line: #DCEBF6;
  --line-strong: #B9D7EA;

  --accent: #008EF4;         /* logo blue: puzzle heart, top left quadrant */
  --accent-strong: #0072C6;  /* white text on this clears AA (4.97:1) */
  --accent-ink: #0B5C97;     /* same blue hue, dark enough to BE text (6:1) */
  --accent-soft: #DCF1FF;

  /* Logo accents. --sky and --amber are bright enough to fail contrast as text,
     so they are only ever used as backgrounds, SVG fills or borders. */
  --sky: #33CEFE;
  --sky-soft: #E4F8FF;
  --grape: #B74AFF;
  --grape-soft: #F4E9FF;
  --amber: #FEBF00;
  --amber-soft: #FFF4D1;
  --magenta: #FC2371;
  --magenta-soft: #FFE6EE;
  --pink: #FE5A97;

  --danger: #E01E5A;
  --danger-soft: #FFE6EE;
  --success: #12A57C;        /* backgrounds only */
  --success-ink: #0B6E54;    /* the readable version, for text on success-soft */
  --success-soft: #DFF6EE;
  --magenta-ink: #B8164A;    /* readable magenta, for white-on-magenta swaps */
  --mint-soft: #DFF6EE;
  --info-soft: #EFE7FF;

  /* Text on the navy footer / admin sidebar */
  --on-ink: #C6D3EC;
  --on-ink-dim: #B6C1DE;
  /* Form placeholders */
  --placeholder: #68719C;

  /* How deeply each colour band curves over the one above it */
  --band-curve: 48px;

  /* Type: Baloo Bhaijaan 2 is the one Baloo cut that covers Arabic and Latin,
     so the same rounded display face works in both languages. Falls back to a
     rounded system face if the font request is blocked or the user is offline. */
  --font-display: "Baloo Bhaijaan 2", ui-rounded, "Avenir Next Rounded", "Trebuchet MS", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Shape: rounder than the other sites, because it's a kids brand */
  --r-s: 12px;
  --r-m: 20px;
  --r-l: 28px;
  --r-pill: 999px;

  --shadow-s: 0 2px 10px rgba(53, 63, 112, 0.07);
  --shadow-m: 0 10px 30px rgba(53, 63, 112, 0.12);
  --shadow-l: 0 24px 60px rgba(53, 63, 112, 0.18);

  /* White cards need more lift now that they sit on tinted bands, not on white */
  --shadow-card: 0 2px 4px rgba(53, 63, 112, 0.05), 0 10px 26px rgba(53, 63, 112, 0.10);
  --shadow-card-hover: 0 6px 12px rgba(53, 63, 112, 0.08), 0 20px 44px rgba(53, 63, 112, 0.16);

  --container: 1160px;
}

@media (max-width: 720px) {
  :root { --band-curve: 32px; }
}

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

html {
  scroll-behavior: smooth;
  /* Bands overlap by --band-curve and the header is sticky, so anchor links need
     clearance or the section heading lands underneath the header. */
  scroll-padding-block-start: 96px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

/* Weight 800 is loaded for Baloo. The few headings that fall back to --font-body
   are short uppercase labels, where a 700/800 snap is invisible. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.14;
  margin: 0 0 0.5em;
  color: var(--ink);
  letter-spacing: 0;
}

p { margin: 0 0 1em; }

/* --accent on white is only 3.4:1, so links use the darker ink variant and
   underline on hover rather than relying on a colour shift alone. */
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

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

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

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

/* Padding is a variable so the band system can add curve clearance on top of it */
.section { --section-pad: 64px; padding-block: var(--section-pad); }
.section--tight { --section-pad: 44px; }

.section-head { max-width: 620px; margin-block-end: 36px; }
.section-head h2 { font-size: clamp(32px, 5.2vw, 44px); }
.section-head h2::after {
  content: '';
  display: block;
  width: 84px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sky), var(--grape) 45%, var(--magenta));
  margin-block-start: 12px;
}
.section-head p { color: var(--muted); margin: 0; font-size: 19px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--accent-strong);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
/* shine sweep on hover */
.btn::after {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: -80%;
  width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: inset-inline-start 0.55s ease;
  pointer-events: none;
}
.btn:hover::after { inset-inline-start: 135%; }
.btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-m);
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  background: var(--line-strong);
  color: #fff;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn:disabled::after { display: none; }

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }

.btn--light {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-s);
}
.btn--light:hover { background: var(--surface); color: var(--accent-strong); }

.btn--small { padding: 10px 20px; font-size: 15px; }
.btn--big { padding: 17px 36px; font-size: 19px; }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #B8164A; }
.btn--full { width: 100%; }

.lang-toggle {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: var(--r-pill);
  padding: 9px 17px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Forms ---------- */
.field { margin-block-end: 18px; }
.field label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-block-end: 7px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 88px; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }

.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Grouped form sections and checkbox rows. Shared by the admin item modal and the
   public registration form, so they belong here rather than in admin.css. */
.fs {
  border: 0;
  margin: 0 0 4px;
  padding: 0;
  min-width: 0; /* stops a fieldset from refusing to shrink inside a grid */
}
.fs__legend {
  padding: 0;
  margin-block-end: 10px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.fs__hint { font-size: 14.5px; color: var(--muted); margin: 0 0 14px; }

.check-field {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-block-end: 18px;
}
.check-field input { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
/* Without min-width:0 the sentence's intrinsic width inflates the flex row and
   pushes the whole page sideways at 320px, the same failure the workshop row had. */
.check-field > span { min-width: 0; overflow-wrap: anywhere; }

.form-error {
  display: none;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--r-s);
  padding: 11px 15px;
  font-size: 15px;
  margin-block-end: 16px;
}
.form-error.is-visible { display: block; }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--shadow-s);
}
.badge--best { background: var(--amber-soft); color: #8A5E00; }
.badge--new { background: var(--mint-soft); color: #0B6E54; }
.badge--low { background: var(--danger-soft); color: var(--danger); }
.badge--out { background: #E7EEF5; color: var(--muted); }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 19px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  font-size: 15.5px;
  font-weight: 700;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip.is-active {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

/* ---------- Status pills (bookings) ---------- */
.status {
  display: inline-block;
  padding: 5px 13px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 800;
}
.status--new { background: var(--info-soft); color: #6B2FB0; }
.status--confirmed { background: var(--amber-soft); color: #8A5E00; }
.status--attended { background: var(--success-soft); color: var(--success-ink); }
.status--cancelled { background: #E7EEF5; color: var(--muted); }
/* Registration statuses. Without these the pill renders with no background. */
.status--contacted { background: var(--amber-soft); color: #8A5E00; }
.status--enrolled { background: var(--success-soft); color: var(--success-ink); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  inset-block-end: 28px;
  inset-inline-start: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: #EAF6FF;
  border: 1px solid rgba(51, 206, 254, 0.45);
  padding: 13px 26px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--shadow-l);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}
[dir="rtl"] .toast { transform: translateX(50%) translateY(16px); }
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
[dir="rtl"] .toast.is-visible { transform: translateX(50%) translateY(0); }

/* Arabic wordmark: no letter-spacing (breaks cursive script), no uppercase */
[dir="rtl"] .brand__name {
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Media ---------- */
/* Real photos: fill their container, cropped nicely. SVG art does the same via viewBox. */
.media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Generated-art animations ----------
   Applied to individual SVG elements inside art.js output. transform-box:fill-box
   makes percentage transform-origins resolve against the element, not the viewBox. */
.art-pop {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: popBounce 2.4s ease-in-out infinite;
}
.art-float {
  transform-box: fill-box;
  animation: floatUp 4s ease-in-out infinite;
}
.art-drip {
  transform-box: fill-box;
  animation: dripDown 2.8s ease-in infinite;
}
.art-spin {
  transform-box: fill-box;
  animation: spinSlow 22s linear infinite;
}
@keyframes popBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  45%      { transform: translateY(-10px) scale(1.06); }
}
@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes dripDown {
  0%   { transform: translateY(0); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(26px); opacity: 0; }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 0.84, 0.44, 1);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-revealed { opacity: 1; transform: none; }

/* ---------- Utilities ---------- */
/* The hidden attribute is only display:none in the browser's own stylesheet, so ANY
   explicit display in our CSS silently beats it. That bit us twice: once on the admin
   modal's fieldsets, and again on a flex notice and an inline-flex button that both
   stayed visible when hidden. This site toggles `hidden` all over the place, so make
   it mean what everyone assumes it means, once, here. */
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.price { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .art-pop, .art-float, .art-drip, .art-spin { animation: none; transform: none; }
  .art-drip { opacity: 1; }
  /* The blanket 0.01ms rule above would leave this infinite loop running at speed.
     !important is needed because store.css defines the animation and loads later. */
  .hero__art .art-tile { animation: none !important; transform: none !important; }
  /* The blanket 0.01ms rule above would leave these infinite loops running at
     full speed, so they have to be stopped by name too. */
  .usps::before, .usps::after, #plans::before, #plans::after,
  #offers::before, #offers::after, #workshops::before, #workshops::after,
  #facilities::before, #facilities::after, #ages::before, #ages::after,
  #visit::before, #visit::after, #rules::before, #rules::after,
  #parties::before, #parties::after, #gallery::before, #gallery::after,
  #about::before, #about::after, #contact::before, #contact::after {
    animation: none !important;
    transform: none !important;
  }
}
