/* ==========================================================================
   THEATRUM ANIMI — fonts, reset, base typography, focus
   Ported verbatim from mockup/assets/css/base.css. Inter and Noto Serif are
   declared in theme.json (fontFace), so WordPress prints their @font-face
   rules and the editor offers them; Caveat stays here so it can never be
   chosen for a heading in the editor (docs/wp-contract.md, section 10).
   The motion section moved to its owners: the hero settle to the ta/hero
   block, the card hover to blocks/core-post-template.css.
   ========================================================================== */

/* Subset to Latin + Latin Extended-A: the site is English only, and the partner
   names (Pozorište, Nedomyšleno, Dejvická, Ó Ruairc, Branà) all live in that range.
   5.7MB of variable TTF became 288KB of subset WOFF2. */
@font-face {
  font-family: "Caveat";
  src: url("../fonts/Caveat-Variable.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* --- reset ---------------------------------------------------------------- */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol { margin: 0; }

ul[class], ol[class] { list-style: none; padding: 0; }

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

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; padding: 0; cursor: pointer; }

table { border-collapse: collapse; width: 100%; }

/* --- document ------------------------------------------------------------- */

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1rem); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

body {
  margin: 0;
  background: var(--color-surface-page);
  color: var(--color-ink-primary);
  font-family: var(--font-body);
  font-size: var(--type-body);
  line-height: var(--lh-prose);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--color-rasa); color: var(--color-crepito); }

/* --- headings ------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--lh-heading);
}

h1 { font-size: var(--type-h1); font-weight: 900; letter-spacing: var(--ls-h1); text-transform: uppercase; }
h2 { font-size: var(--type-h2); font-weight: 900; letter-spacing: var(--ls-h2); text-transform: uppercase; }
h3 { font-size: var(--type-h3); font-weight: 700; letter-spacing: -0.007em; }
h4 { font-size: var(--type-h4); font-weight: 700; }
h5 { font-size: var(--type-h5); font-weight: 600; line-height: var(--lh-tight); }

.display-xl {
  font-family: var(--font-display);
  font-size: var(--type-display-xl);
  font-weight: 900;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
}

.display-lg {
  font-family: var(--font-display);
  font-size: var(--type-display-lg);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.022em;
  text-transform: uppercase;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--type-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-ink-secondary);
  margin-bottom: var(--space-2xs);
}

.lead {
  font-size: var(--type-lead);
  line-height: 1.55;
  color: var(--color-ink-secondary);
  max-width: var(--measure);
}

.body-lg { font-size: var(--type-body-lg); }
.body-sm { font-size: var(--type-body-sm); }

.meta {
  font-family: var(--font-display);
  font-size: var(--type-meta);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--color-ink-secondary);
}

.caption {
  font-family: var(--font-display);
  font-size: var(--type-caption);
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-ink-secondary);
}

/* --- prose ---------------------------------------------------------------- */

.prose { max-width: none; }
.prose > * + * { margin-top: var(--space-md); }
.prose h2 { margin-top: var(--space-2xl); }
.prose h3 { margin-top: var(--space-xl); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: var(--space-2xs); }

/* --- links ---------------------------------------------------------------- */

a { color: inherit; }

.prose a,
a.link {
  color: var(--color-ink-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  transition: text-decoration-thickness var(--motion-fast) var(--ease);
}
.prose a:hover,
a.link:hover { text-decoration-thickness: 3px; }

.is-inverse .prose a,
.is-inverse a.link { color: var(--color-crepito); }

/* --- the marginalia device ------------------------------------------------ */

.marginalia {
  font-family: var(--font-hand);
  font-size: var(--type-marginalia);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-ink-primary);
  max-width: 16rem;
  overflow-wrap: break-word;
}
.marginalia--underline::after {
  content: "";
  display: block;
  width: 78%;
  height: 2px;
  margin-top: var(--space-2xs);
  background: currentcolor;
  transform: rotate(-1.2deg);
  transform-origin: left center;
}
.marginalia--ellipse {
  display: inline-block;
  padding: 0.6em 1.2em;
  border: 2px solid currentcolor;
  border-radius: 50%;
  transform: rotate(-3deg);
}
.is-inverse .marginalia { color: var(--color-crepito); }

/* --- focus system (WCAG 2.4.11 / 2.4.13) ---------------------------------- */

:focus { outline: none; }

:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
  box-shadow: 0 0 0 calc(var(--focus-offset) + 1px) var(--focus-separator);
  border-radius: var(--radius-xs);
}

/* --- skip links ----------------------------------------------------------- */

.skip-link {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: var(--z-skip-link);
  padding: var(--space-2xs) var(--space-md);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--color-rasa);
  color: var(--color-crepito);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - var(--space-lg)));
  transition: transform var(--motion-fast) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* A second skip link sits beside the first on wide screens. Below that it takes
   the same position: only one can hold focus at a time, so they never collide,
   and neither is offset far enough down to peek past its hidden transform. */
.skip-link--second { left: 14rem; }
@media (max-width: 34rem) {
  .skip-link--second { left: var(--space-sm); }
}

/* --- utility -------------------------------------------------------------- */

.visually-hidden:not(:focus):not(:active) {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[hidden] { display: none !important; }

.is-inverse { color: var(--color-ink-inverse); }
.is-inverse .eyebrow,
.is-inverse .meta,
.is-inverse .caption,
.is-inverse .lead { color: var(--color-ink-inverse-secondary); }

/* --- WordPress: skip links --------------------------------------------------
   Core prints its skip link as a.skip-link.screen-reader-text; the core
   screen-reader-text rules clip it, so they are undone here and the mockup
   .skip-link rules above take over. The article template's second link is a
   paragraph (class skip-link-second) holding the link, because core cannot
   put a class on a link inside paragraph text. */
.skip-link.screen-reader-text,
.skip-link.screen-reader-text:focus {
  clip-path: none;
  display: inline-flex;
  z-index: var(--z-skip-link);
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  word-wrap: normal;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-2xs) var(--space-md);
  font-size: 0.9375rem;
  line-height: inherit;
  background: var(--color-rasa);
  color: var(--color-crepito);
  box-shadow: none;
  border-radius: 0;
}
.skip-link.screen-reader-text:focus-visible {
  box-shadow: 0 0 0 calc(var(--focus-offset) + 1px) var(--focus-separator);
  border-radius: var(--radius-xs);
}
.skip-link-second { margin: 0; }
.skip-link-second > a {
  position: absolute;
  top: var(--space-sm);
  left: 14rem;
  z-index: var(--z-skip-link);
  padding: var(--space-2xs) var(--space-md);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--color-rasa);
  color: var(--color-crepito);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - var(--space-lg)));
  transition: transform var(--motion-fast) var(--ease);
}
.skip-link-second > a:focus-visible { transform: translateY(0); }
@media (max-width: 34rem) {
  .skip-link-second > a { left: var(--space-sm); }
}

/* --- WordPress: core block defaults the mockup does not have -------------- */

/* Paragraphs, list items and captions carry no margins of their own in the
   mockup; core's figure and caption defaults would add them back. */
.wp-element-caption { margin: 0; }
/* Image captions are core's figcaption.wp-element-caption, which theme.json
   colours ink-secondary for light surfaces; on an inverse band they take the
   light caption colour of the mockup's .is-inverse .caption. */
.is-inverse .wp-element-caption { color: var(--color-ink-inverse-secondary); }
