/* ==========================================================================
   base.css – design tokens, fonts and element defaults

   Everything that defines the look in one place: change a color or a font
   here and the whole site follows. Also loaded inside the block editor.
   ========================================================================== */

/* ---------- Fonts (self-hosted; licence: assets/fonts/LICENSE.txt) ---------- */

@font-face {
  font-family: "Ribeye";
  src: url("../fonts/ribeye.woff2") format("woff2");
  font-weight: 400; /* Ribeye has one weight only */
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */

:root {
  /*
   * Colors. The values come from theme.json (which also feeds the editor's color picker);
   * the hex codes here are only fallbacks.
   */
  --color-stage: var(--wp--preset--color--stage, #2a1538);    /* dark theatre: header, stage, footer */
  --color-plum: var(--wp--preset--color--plum, #6b004b);      /* brand color: headings, links */
  --color-tomato: var(--wp--preset--color--tomato, #dd3333);  /* brand accent: buttons */
  --color-sun: var(--wp--preset--color--sun, #ffd23f);        /* logo yellow: highlights on dark */
  --color-ink: var(--wp--preset--color--ink, #2a1538);        /* body text */
  --color-paper: var(--wp--preset--color--paper, #fffaf2);    /* page background */
  --color-butter: var(--wp--preset--color--butter, #fff0c2);  /* pastel section backgrounds … */
  --color-peach: var(--wp--preset--color--peach, #ffe0cf);
  --color-sky: var(--wp--preset--color--sky, #d9edf7);

  /* Derived colors, not offered in the editor. */
  --color-ink-soft: #655670;         /* secondary text */
  --color-line: #f0e2d0;             /* borders and the "paper edge" under cards */
  --color-on-stage: #fff6e6;         /* text on the dark stage */
  --color-on-stage-soft: #d9c9e0;
  --color-tomato-dark: #b92323;

  /* Typography */
  --font-display: "Ribeye", Georgia, "Times New Roman", serif;  /* headings: playful fairground lettering */
  --font-display-weight: 400;  /* the weight the heading font is drawn in; a bolder value would be faked by the browser */
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-small: 0.9rem;
  --text-body: 1.0625rem;
  --text-large: clamp(1.15rem, 0.4vw + 1.05rem, 1.3rem);
  --text-h3: clamp(1.3rem, 0.8vw + 1.1rem, 1.6rem);
  --text-h2: clamp(1.7rem, 1.8vw + 1.2rem, 2.5rem);
  --text-h1: clamp(2.1rem, 3.2vw + 1.2rem, 3.6rem);

  /* Layout */
  --width-content: 720px;   /* comfortable reading width */
  --width-wide: 1140px;     /* cards, galleries, header */
  --gutter: clamp(1rem, 4vw, 2rem);
  --space-section: clamp(3rem, 7vw, 5.5rem);

  /* Shapes: everything is round. */
  --radius-small: 12px;
  --radius-card: 28px;
  --radius-pill: 999px;
  --scallop-size: 22px;     /* height of one scallop on the stage edge; its width is twice that */
}

/* ---------- Element defaults ---------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--color-ink);
  background: var(--color-paper);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  line-height: 1.15;
  color: var(--color-plum);
  text-wrap: balance;
  hyphens: auto;                 /* long German words break with a hyphen (uses lang="de" of the page) */
  hyphenate-limit-chars: 11 4 4; /* only words of 11+ letters, at least 4 letters on each side */
  overflow-wrap: break-word;     /* a word that still does not fit wraps instead of overflowing */
}

/* Small headings sit in narrow cards. "balance" would split words there that fit whole,
   just to even out the lines; "pretty" only avoids a lonely last word. */
h3,
h4 {
  text-wrap: pretty;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-large); }

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-plum);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-tomato);
}

img,
video,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--color-tomato);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Accessibility helpers ---------- */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--color-paper);
}

.skip-link:focus {
  left: 0.5rem;
}

/* Visitors who asked their system for less motion get none. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
