/* ==========================================================================
   JoyZone brand layer — joyzone.com.sa
   --------------------------------------------------------------------------
   The portable build from the brand kit, with the font paths pointed at this
   theme's own /fonts/ directory. Everything from "2. Tokens" down is the kit
   file unchanged; only the @font-face block differs, and every difference is
   noted where it happens.

   Put `jz-brand` on a wrapper and the vocabulary below works.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Faces — all self-hosted, none from Google's CDN.

   Komika Axis and FF Hekaya were already on this site as TTF (uploaded in
   2022) and are converted to WOFF2 here: 53KB -> 19KB and 63KB -> 21KB. The
   TTFs are left where they were; nothing points at them any more.

   Baloo, Cairo and Geist are SIL OFL and are pulled from Google Fonts once,
   at build time, and served from this theme. Loading them from Google at
   runtime would add a DNS lookup, a TLS handshake and a PDPL exposure for no
   benefit.

   JZ Special is NOT declared. Its file was not delivered with the kit, and a
   @font-face pointing at a missing file fires a 404 on every page request -
   the exact fault this theme already had to clear once, with Kharabeesh. It
   is artwork-only and never carries live text, so nothing is lost. Add the
   block back when jz-special.woff2 arrives.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Komika Axis";
  src: url("../fonts/komika-axis.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* size-adjust is not optional. Hekaya's glyphs are drawn small; at 100% an
   Arabic heading reads visibly smaller than the English one beside it at the
   same font-size. 146% was measured against Komika, not guessed. */
@font-face {
  font-family: "FF Hekaya";
  src: url("../fonts/ff-hekaya.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 146%;
}

/* Komika's digits, sliced out by unicode-range. The Arabic display faces are
   drawn for Arabic script and their numerals are the weakest part of them, so
   in RTL the digits come from here and an Arabic price shows the same numerals
   an English one does. No Arabic letterform is touched. */
@font-face {
  font-family: "JZ Numerals";
  src: url("../fonts/komika-axis.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039, U+002B, U+002C, U+002D, U+002E, U+0025, U+00D7;
}

/* Baloo Bhaijaan 2 — arabic + latin-ext + latin, self-hosted.
   Split by unicode-range so an English page never downloads the Arabic
   subset and an Arabic one never downloads the Latin extras. */
@font-face {
  font-family: "Baloo Bhaijaan 2";
  src: url("../fonts/baloo-bhaijaan-arabic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: "Baloo Bhaijaan 2";
  src: url("../fonts/baloo-bhaijaan-latin-ext.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Baloo Bhaijaan 2";
  src: url("../fonts/baloo-bhaijaan-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cairo — arabic + latin-ext + latin, self-hosted.
   Split by unicode-range so an English page never downloads the Arabic
   subset and an Arabic one never downloads the Latin extras. */
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo-arabic.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC4, U+10EFC-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cairo";
  src: url("../fonts/cairo-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Geist — latin-ext + latin, self-hosted.
   Split by unicode-range so an English page never downloads the Arabic
   subset and an Arabic one never downloads the Latin extras. */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

.jz-brand {
  --jz-ground: #d2f4f6;
  --jz-panel: #ffffff;
  --jz-line: #231f20;
  --jz-ink: #231f20;
  --jz-muted: #4a4344;
  --jz-yellow: #ffdd00;
  --jz-yellow-ink: #231f20;
  --jz-red: #e1251b;
  --jz-red-ink: #ffffff;
  --jz-red-deep: #bb1f1d;
  --jz-cyan: #1dcad4;
  --jz-tint: #e4f8fa;
  --jz-hairline: rgba(35, 31, 32, 0.2);

  --jz-ease: cubic-bezier(0.2, 1, 0.35, 1);

  color: var(--jz-ink);
}

/* --------------------------------------------------------------------------
   3. Type
   -------------------------------------------------------------------------- */

.jz-display,
.jz-title {
  font-family: "Komika Axis", system-ui, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.jz-display { line-height: 1.06; }
.jz-title   { line-height: 1.28; }

/* Arabic never takes letter-spacing: it defeats contextual shaping and the
   letters stop joining. It never takes uppercase either -- the script has no
   case, so the declaration is dead weight that confuses the next reader. */
[dir="rtl"] .jz-display,
[dir="rtl"] .jz-title {
  font-family: "FF Hekaya", system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}
[dir="rtl"] .jz-display { line-height: 1.26; }
[dir="rtl"] .jz-title   { line-height: 1.32; }

/* The display face without the uppercase/tracking. Use on anything that mixes
   words and numbers -- buttons, prices, badges -- so the digits come from
   JZ Numerals rather than the Arabic face. */
.jz-face {
  font-family: "JZ Numerals", "Komika Axis", system-ui, sans-serif;
  font-weight: 400;
}
[dir="rtl"] .jz-face {
  font-family: "JZ Numerals", "FF Hekaya", system-ui, sans-serif;
}

/* Descriptions and subtitles. Baloo is the only brand face covering BOTH
   Latin and Arabic, so a description looks like itself in either locale. */
.jz-lede {
  font-family: "Baloo Bhaijaan 2", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.55;
  color: var(--jz-muted);
}
[dir="rtl"] .jz-lede { line-height: 1.8; }

/* Poster title: yellow fill, black stroke, hard cast. paint-order draws the
   stroke BEHIND the fill, which keeps the counters open. Four stacked
   text-shadows fake this badly -- they thicken glyphs until they close up. */
.jz-title-plain {
  color: var(--jz-yellow);
  -webkit-text-stroke: 3px var(--jz-line);
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--jz-line);
}
@supports not (paint-order: stroke) {
  .jz-title-plain { -webkit-text-stroke: 0; }
}

/* --------------------------------------------------------------------------
   4. Depth - the detail that carries the whole look
   An even black keyline plus a HARD offset cast in the keyline colour. It is a
   printed sticker, not a floating card. Never substitute a blurred drop shadow
   for the cast; blur is only ever the faint ambient layer beneath it.
   -------------------------------------------------------------------------- */

.jz-edge-sm { border: 2.5px solid var(--jz-line); box-shadow: 0 3.5px 0 var(--jz-line); }
.jz-edge    { border: 3px   solid var(--jz-line); box-shadow: 0 6px 0 var(--jz-line), 0 18px 34px rgba(16,42,47,.22); }
.jz-edge-lg { border: 4px   solid var(--jz-line); box-shadow: 0 10px 0 var(--jz-line), 0 34px 60px rgba(16,42,47,.28); }

.jz-ground { background-color: var(--jz-ground); }

.jz-panel {
  background: var(--jz-panel);
  border: 3px solid var(--jz-line);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--jz-line), 0 18px 34px rgba(16,42,47,.22);
}
.jz-panel-sm {
  background: var(--jz-panel);
  border: 2.5px solid var(--jz-line);
  border-radius: 14px;
  box-shadow: 0 3.5px 0 var(--jz-line);
}

/* Cast and lift must always move together. A lift without the cast growing
   reads as sliding sideways, not rising. */
.jz-lift {
  transition: transform .18s var(--jz-ease), box-shadow .18s var(--jz-ease);
}
@media (hover: hover) {
  .jz-lift:hover { transform: translateY(-6px); box-shadow: 0 12px 0 var(--jz-line); }
}
.jz-lift:active { transform: translateY(2px); box-shadow: 0 4px 0 var(--jz-line); }

/* --------------------------------------------------------------------------
   5. Controls
   -------------------------------------------------------------------------- */

.jz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.4rem;
  border: 2.5px solid var(--jz-line);
  border-radius: 9999px;
  background: var(--jz-cyan);
  color: var(--jz-ink);            /* ink, never white -- see the colour rules */
  box-shadow: 0 3.5px 0 var(--jz-line);
  font-family: "JZ Numerals", "Komika Axis", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .4px;
  cursor: pointer;
  transition: transform .18s var(--jz-ease), box-shadow .18s var(--jz-ease);
}
[dir="rtl"] .jz-btn {
  font-family: "JZ Numerals", "FF Hekaya", system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}
@media (hover: hover) {
  .jz-btn:hover { transform: translateY(-3px); box-shadow: 0 6.5px 0 var(--jz-line); }
}
.jz-btn:active { transform: translateY(2px); box-shadow: 0 1.5px 0 var(--jz-line); }

.jz-btn-accent { background: var(--jz-yellow); color: var(--jz-yellow-ink); }
.jz-btn-quiet  { background: var(--jz-panel);  color: var(--jz-ink); }
.jz-btn-danger { background: var(--jz-red);    color: var(--jz-red-ink); }

.jz-input {
  background: var(--jz-panel);
  border: 2.5px solid var(--jz-line);
  border-radius: 12px;
  padding: .65rem .9rem;
  color: var(--jz-ink);
  box-shadow: 0 3.5px 0 var(--jz-hairline);
}
.jz-input:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2.5px var(--jz-cyan), 0 3.5px 0 var(--jz-line);
}

/* Section label. Sits on the open GROUND, never inside a bordered panel --
   a bordered tab inside a bordered panel is a box in a box, and the tilt has
   no air to sit in. */
.jz-tab {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .44rem 1.06rem;
  border: 2.5px solid var(--jz-line);
  border-radius: 9999px;
  background: var(--jz-red);
  color: var(--jz-red-ink);
  box-shadow: 0 3.5px 0 var(--jz-line);
  font-family: "Komika Axis", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .4px;
  line-height: 1.15;
  rotate: -1deg;
}
[dir="rtl"] .jz-tab {
  font-family: "FF Hekaya", system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
  rotate: 1deg;                    /* the tilt mirrors, it does not stay put */
}

/* --------------------------------------------------------------------------
   6. Motion
   -------------------------------------------------------------------------- */

@keyframes jz-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.jz-bob {
  filter: drop-shadow(0 8px 14px rgba(16,42,47,.28));
  animation: jz-bob 4s ease-in-out infinite;
}

.jz-tilt-start { rotate: -1deg; transition: rotate .18s var(--jz-ease); }
.jz-tilt-end   { rotate:  1deg; transition: rotate .18s var(--jz-ease); }
@media (hover: hover) {
  .jz-tilt-start:hover, .jz-tilt-end:hover { rotate: 0deg; }
}

@media (prefers-reduced-motion: reduce) {
  .jz-bob { animation: none; }
  .jz-tilt-start, .jz-tilt-end { rotate: 0deg; transition: none; }
  .jz-lift, .jz-lift:hover, .jz-lift:active { transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   7. Body faces

   TYPOGRAPHY.md names Geist and Cairo as the body faces, but the kit's CSS
   declares neither: on the platforms the body face comes from a runtime
   setting. WordPress has no such setting, and TYPOGRAPHY.md says to name the
   faces directly here instead. That is what this does.
   -------------------------------------------------------------------------- */

.jz-brand {
  font-family: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[dir="rtl"] .jz-brand,
.jz-brand[dir="rtl"] {
  font-family: "Cairo", system-ui, sans-serif;
}
