/* Zineddine Benidir — website visual system (Phase 1).
   Self-hosted fonts, palette, two themes (Night default, Bone light), base styles, theme toggle and logo swap.
   Theme roles are --zb-* variables. Elementor's themed global colours point at them (see zb-brand-system.php). */

/* ---------- Fonts (all self-hosted, SIL Open Font License) ---------- */
@font-face { font-family: "Archivo Expanded"; src: url("../fonts/archivo-expanded-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo Expanded"; src: url("../fonts/archivo-expanded-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin.woff2") format("woff2"); font-weight: 400 500; 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; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-ext.woff2") format("woff2"); font-weight: 400 500; 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-italic-latin.woff2") format("woff2"); font-weight: 400; font-style: italic; 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; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-italic-latin-ext.woff2") format("woff2"); font-weight: 400; font-style: italic; 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-400-latin.woff2") format("woff2"); font-weight: 400; 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; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2"); font-weight: 400; 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-500-latin.woff2") format("woff2"); font-weight: 500; 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; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2"); font-weight: 500; 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Palette (fixed) and theme roles ---------- */
:root {
  --zb-sand: #F6D59A;
  --zb-light-ochre: #E7A659;
  --zb-ochre: #C9702F;
  --zb-red-ochre: #93421B;
  --zb-deep-umber: #55230E;
  --zb-ink: #1B1815;
  --zb-bone: #F2ECE2;
  --zb-night: #15161A;
  --zb-dune-50: #FAF7F1;
  --zb-dune-200: #E6DDCE;
  --zb-dune-300: #CFC3AF;
  --zb-dune-400: #A89B86;
  --zb-dune-500: #7E7261;
  --zb-dune-600: #5B5144;
  --zb-dune-700: #3B342C;
  --zb-dune-800: #26221D;
  --zb-night-600: #353943;
  --zb-night-700: #272A31;
  --zb-night-800: #1D1F25;

  --zb-font-display: "Archivo Expanded", "Archivo", system-ui, sans-serif;
  --zb-font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --zb-font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* Night theme: the default, and the fallback when the device states no preference. */
  --zb-surface: var(--zb-night);
  --zb-surface-raised: var(--zb-night-800);
  --zb-hover-raised: var(--zb-night-700);
  --zb-text: var(--zb-bone);
  --zb-text-muted: var(--zb-dune-300);
  --zb-accent-text: var(--zb-light-ochre);
  --zb-action: var(--zb-light-ochre);
  --zb-on-action: var(--zb-night);
  --zb-action-hover: var(--zb-sand);
  --zb-border: var(--zb-night-600);
  --zb-border-strong: var(--zb-dune-400);
  --zb-focus-ring: var(--zb-light-ochre);
  --zb-placeholder: var(--zb-dune-400);
  --zb-photo-surround: var(--zb-night);
  --zb-on-photo: var(--zb-bone);
  color-scheme: dark;
}

/* Bone theme: when the device asks for light and the visitor has not chosen Night, or when the visitor chose Bone. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --zb-surface: var(--zb-bone);
    --zb-surface-raised: var(--zb-dune-50);
    --zb-hover-raised: var(--zb-dune-200);
    --zb-text: var(--zb-ink);
    --zb-text-muted: var(--zb-dune-600);
    --zb-accent-text: var(--zb-red-ochre);
    --zb-action: var(--zb-red-ochre);
    --zb-on-action: var(--zb-bone);
    --zb-action-hover: var(--zb-deep-umber);
    --zb-border: var(--zb-dune-300);
    --zb-border-strong: var(--zb-dune-500);
    --zb-focus-ring: var(--zb-red-ochre);
    --zb-placeholder: var(--zb-dune-600);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --zb-surface: var(--zb-bone);
  --zb-surface-raised: var(--zb-dune-50);
  --zb-hover-raised: var(--zb-dune-200);
  --zb-text: var(--zb-ink);
  --zb-text-muted: var(--zb-dune-600);
  --zb-accent-text: var(--zb-red-ochre);
  --zb-action: var(--zb-red-ochre);
  --zb-on-action: var(--zb-bone);
  --zb-action-hover: var(--zb-deep-umber);
  --zb-border: var(--zb-dune-300);
  --zb-border-strong: var(--zb-dune-500);
  --zb-focus-ring: var(--zb-red-ochre);
  --zb-placeholder: var(--zb-dune-600);
  color-scheme: light;
}

/* ---------- Base ---------- */
/* Beats Hello Elementor's reset (white page, #333 text, pink links) without !important. */
:root body {
  background-color: var(--zb-surface);
  color: var(--zb-text);
  font-family: var(--zb-font-serif);
  font-size: 18px;
  line-height: 28px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:root { background-color: var(--zb-surface); }
body a { color: var(--zb-accent-text); }
body a:hover, body a:active { color: var(--zb-text); }
:root body :focus-visible { outline: 2px solid var(--zb-focus-ring); outline-offset: 2px; }
::selection { background: var(--zb-action); color: var(--zb-on-action); }
:root body img { border-radius: 0; }

/* Links inside running text are underlined, so they never rely on colour alone. */
.elementor-widget-text-editor a:not(.elementor-button),
.zb-prose a,
a.zb-link {
  color: var(--zb-accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.elementor-widget-text-editor a:not(.elementor-button):hover,
.zb-prose a:hover,
a.zb-link:hover { text-decoration-thickness: 2px; }

/* ---------- Type styles (CSS classes for any Elementor widget: Advanced → CSS Classes) ---------- */
.zb-display, .zb-h1, .zb-h2, .zb-h3, .zb-eyebrow, .zb-descriptor, .zb-button { font-family: var(--zb-font-display); }
.zb-display { font-size: 56px; line-height: 60px; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; }
.zb-h1 { font-size: 40px; line-height: 48px; font-weight: 500; letter-spacing: -0.005em; text-wrap: balance; }
.zb-h2 { font-size: 28px; line-height: 36px; font-weight: 500; text-wrap: balance; }
.zb-h3 { font-size: 20px; line-height: 28px; font-weight: 500; }
.zb-eyebrow { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--zb-accent-text); }
.zb-descriptor { font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: 0.24em; text-transform: uppercase; color: var(--zb-text-muted); }
.zb-button { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.04em; }
.zb-lead { font-family: var(--zb-font-serif); font-size: 22px; line-height: 32px; font-weight: 400; max-width: 38em; }
.zb-body { font-family: var(--zb-font-serif); font-size: 18px; line-height: 28px; font-weight: 400; max-width: 40em; }
.zb-body-small { font-family: var(--zb-font-serif); font-size: 16px; line-height: 24px; font-weight: 400; }
.zb-caption { font-family: var(--zb-font-serif); font-size: 15px; line-height: 24px; font-weight: 400; font-style: italic; color: var(--zb-text-muted); }
.zb-exif { font-family: var(--zb-font-mono); font-size: 12px; line-height: 16px; font-weight: 400; letter-spacing: 0.04em; color: var(--zb-text-muted); }
.zb-data { font-family: var(--zb-font-mono); font-size: 13px; line-height: 20px; font-weight: 400; }
.zb-muted { color: var(--zb-text-muted); }
@media (max-width: 600px) {
  .zb-display { font-size: 40px; line-height: 44px; }
  .zb-h1 { font-size: 32px; line-height: 40px; }
  .zb-h2 { font-size: 24px; line-height: 32px; }
  .zb-lead { font-size: 20px; line-height: 30px; }
}

/* ---------- Buttons ---------- */
/* ":root body" outranks Hello Elementor's reset and Elementor's site-wide button style (.elementor-kit-N button). */
:root body .zb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 14px 26px;
  border: 1px solid var(--zb-border-strong); border-radius: 2px;
  background: transparent; color: var(--zb-text);
  font-family: var(--zb-font-display); font-weight: 500; font-size: 14px; line-height: 20px; letter-spacing: 0.04em;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
:root body .zb-btn:hover { background: transparent; border-color: var(--zb-text); color: var(--zb-text); }
:root body .zb-btn.zb-btn--primary { background: var(--zb-action); border-color: var(--zb-action); color: var(--zb-on-action); }
:root body .zb-btn.zb-btn--primary:hover { background: var(--zb-action-hover); border-color: var(--zb-action-hover); color: var(--zb-on-action); }
/* Hover: Sand with Night text in the dark theme (brand book), Deep umber with Bone text in the light theme. */

:root body ::placeholder { color: var(--zb-placeholder); opacity: 1; }

/* ---------- Surfaces ---------- */
.zb-raised { background: var(--zb-surface-raised); border: 1px solid var(--zb-border); border-radius: 4px; }
.zb-photo-surround { background: var(--zb-photo-surround); color: var(--zb-on-photo); }

/* ---------- Theme toggle ---------- */
:root body button.zb-theme-toggle {
  display: none; /* shown once the script is running, so it never appears as a dead button */
  align-items: center; justify-content: center;
  width: 44px; height: 44px; min-height: 0; padding: 0; margin: 0;
  background: transparent; color: var(--zb-text);
  border: 1px solid var(--zb-border-strong); border-radius: 2px; box-shadow: none;
  cursor: pointer; line-height: 0;
  transition: border-color .2s ease, color .2s ease;
}
:root.zb-js body button.zb-theme-toggle { display: inline-flex; }
:root body button.zb-theme-toggle:hover,
:root body button.zb-theme-toggle:focus { background: transparent; border-color: var(--zb-text); color: var(--zb-text); }
.zb-theme-toggle svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.zb-theme-toggle .zb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Show per theme: logo swap, toggle icons, and two utility classes for Elementor widgets ---------- */
/* Only hides, never sets a display value, so Elementor containers keep their own layout. */
:root[data-theme="dark"] .zb-only-light,
:root[data-theme="dark"] .zb-theme-toggle .zb-icon-moon,
:root[data-theme="dark"] .zb-logo .zb-logo__light,
:root[data-theme="light"] .zb-only-dark,
:root[data-theme="light"] .zb-theme-toggle .zb-icon-sun,
:root[data-theme="light"] .zb-logo .zb-logo__dark { display: none !important; }
/* Before the script runs (or without it): follow the device, Night when it states nothing. */
@media not (prefers-color-scheme: light) {
  :root:not([data-theme]) .zb-only-light,
  :root:not([data-theme]) .zb-theme-toggle .zb-icon-moon,
  :root:not([data-theme]) .zb-logo .zb-logo__light { display: none !important; }
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .zb-only-dark,
  :root:not([data-theme]) .zb-theme-toggle .zb-icon-sun,
  :root:not([data-theme]) .zb-logo .zb-logo__dark { display: none !important; }
}

.zb-logo { display: inline-block; line-height: 0; text-decoration: none; }
.zb-logo img { display: block; width: auto; height: var(--zb-logo-h, 46px); max-width: none; }
@media (max-width: 767px) { .zb-logo img { height: var(--zb-logo-h-mobile, 40px); } }

@media (prefers-reduced-motion: reduce) {
  :root body .zb-btn, :root body button.zb-theme-toggle { transition: none; }
}

/* Text inside a photo-surround block stays Bone in both themes, over Elementor's heading colours. */
:root body .zb-photo-surround :is(h1, h2, h3, h4, h5, h6, p, li, span) { color: var(--zb-on-photo); }
