/* =============================================================================
   EESTI MMA LIIGA UI, eml.css, v1.0, 4 December 2026
   -----------------------------------------------------------------------------
   One stylesheet for the league's web pages, registration and results tools.
   Read top to bottom: each layer only uses the layers above it.

     1. Fonts            licensed webfonts, self-hosted, built from the OTF files
     2. Brand tokens     raw values from the brand guide. Never used by components.
     3. Theme tokens     semantic names components ask for (dark default, light)
     4. Scale tokens     type, space, radius, shadow, motion
     5. Base             reset and element defaults
     6. Type             display, headings, text, data
     7. Layout           wrap, band, stack, cluster, grid
     8. Components       eml-* blocks, one section each, BEM modifiers (--)
     9. Brand device     the 45 degree cut, live dot, round clock
    10. Utilities        small, single-purpose helpers

   Rules
   - Components use theme tokens (var(--surface), var(--danger)), never hex.
   - Switch theme with one attribute: <html data-theme="light"> (dark is default).
   - The accent marks one thing per view: live, the active item, focus.
     Dark: glow amber. Light: garnet. Glow never sits on paper.
   - Square corners everywhere; the one shape is the 45 degree cut.
     Round only for dots, switches and avatars.
   ========================================================================== */


/* 1. FONTS ================================================================= */
/* WOFF2 built from the OTF: Voltera's TTF and shipped WOFF2 lose the S/Z hacek in Chrome. */

@font-face { font-family: "Voltera";  src: url(fonts/voltera-900.woff2)  format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Voltera";  src: url(fonts/voltera-900i.woff2) format("woff2"); font-weight: 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Voltera";  src: url(fonts/voltera-700.woff2)  format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Glavia";   src: url(fonts/glavia-700.woff2)   format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Ironexa";  src: url(fonts/ironexa-400.woff2)  format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Ironexa";  src: url(fonts/ironexa-700.woff2)  format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Ironexa Mono"; src: url(fonts/ironexa-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }


/* 2. BRAND TOKENS ========================================================== */
/* Straight from the brand guide. Components never read these directly. */

:root {
  --eml-garnet:      #4A0E19;  /* the brand ground: hero, top bar, plates      */
  --eml-ink:         #0E0E10;
  --eml-ink-2:       #17171A;
  --eml-ink-3:       #202024;
  --eml-rule:        #2A2A2E;
  --eml-ash:         #A99D97;  /* secondary text on ink and garnet             */
  --eml-stone:       #5D5952;  /* secondary text on paper and white            */
  --eml-paper:       #F2F0EA;
  --eml-white:       #FFFFFF;
  --eml-rule-light:  #DAD6CE;
  --eml-glow:        #FFB547;  /* the signal on ink and garnet. Never on paper. */

  --eml-font-display: "Voltera", "Arial Narrow", sans-serif;
  --eml-font-lead:    "Glavia", system-ui, sans-serif;
  --eml-font-text:    "Ironexa", system-ui, sans-serif;
  --eml-font-mono:    "Ironexa Mono", ui-monospace, monospace;
}


/* 3. THEME TOKENS ========================================================== */
/* Dark is the default: the league lives on ink and garnet. Contrast is measured in the UI guide. */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg:             var(--eml-ink);
  --surface:        var(--eml-ink-2);
  --surface-2:      var(--eml-ink-3);
  --sunken:         #0A0A0B;
  --brand:          var(--eml-garnet);    /* brand ground for bars and heroes  */
  --on-brand:       var(--eml-paper);     /* 13.5:1 */
  --border:         var(--eml-rule);      /* dividers, card edges (decorative) */
  --border-strong:  #57534F;
  --border-control: #75706B;              /* inputs: 4.0:1 on sunken           */
  --text:           var(--eml-paper);     /* 16.9:1 */
  --text-2:         #CDC8C2;              /* 11.6:1 */
  --muted:          var(--eml-ash);       /*  7.3:1 */
  --accent:         var(--eml-glow);      /* 11.0:1 */
  --accent-text:    var(--eml-glow);
  --on-accent:      var(--eml-ink);       /* 11.0:1 */
  --focus:          var(--eml-glow);
  --primary-bg:     var(--eml-paper);     /* one primary button per view */
  --primary-text:   var(--eml-ink);
  --ok:             #4CB782;
  --warn:           #E0B341;
  --danger:         #EF5A52;
  --info:           #7AA7E0;
  --danger-text:    var(--eml-ink);       /* text on a danger fill */
  --overlay:        rgba(0, 0, 0, .66);
}

[data-theme="light"] {
  color-scheme: light;
  --bg:             var(--eml-paper);
  --surface:        var(--eml-white);
  --surface-2:      #F8F7F3;
  --sunken:         #E9E6DF;
  --brand:          var(--eml-garnet);
  --on-brand:       var(--eml-paper);
  --border:         var(--eml-rule-light);
  --border-strong:  #8F8A83;
  --border-control: #7D7871;              /* 3.8:1 on paper */
  --text:           var(--eml-ink);       /* 16.9:1 */
  --text-2:         #3B3835;              /* 10.2:1 */
  --muted:          var(--eml-stone);     /*  6.1:1 */
  --accent:         var(--eml-garnet);    /* glow fails on paper: garnet takes the job, 13.5:1 */
  --accent-text:    var(--eml-garnet);
  --on-accent:      var(--eml-paper);
  --focus:          var(--eml-garnet);
  --primary-bg:     var(--eml-ink);
  --primary-text:   var(--eml-paper);
  --ok:             #1E7A4C;
  --warn:           #8A6400;
  --danger:         #B42318;
  --info:           #2F5F9E;
  --danger-text:    var(--eml-white);
  --overlay:        rgba(14, 14, 16, .45);
}


/* 4. SCALE TOKENS ========================================================== */

:root {
  /* type: Voltera caps are 0.75 em, accents reach 1.026 em, so stacked caps use 1.13 */
  --fs-display: clamp(56px, 8vw, 96px);
  --fs-h1:      clamp(40px, 5vw, 56px);
  --fs-h2:      36px;
  --fs-h3:      26px;
  --fs-h4:      20px;
  --fs-lead:    19px;
  --fs-body:    16px;
  --fs-small:   14px;
  --fs-label:   14px;
  --fs-data:    14px;
  --lh-caps:    1.13;
  --lh-text:    1.55;

  /* space: 4 px steps */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* shape */
  --radius:      0;
  --radius-pill: 999px;   /* dots, switches, avatars only */
  --stroke:      1px;
  --focus-ring:  0 0 0 2px var(--bg), 0 0 0 4px var(--focus);

  /* depth: floating layers only (menus, dialogs, toasts) */
  --shadow-1: 0 2px 8px rgba(0, 0, 0, .28);
  --shadow-2: 0 8px 28px rgba(0, 0, 0, .38);

  /* motion: cuts, not slides. The live dot is the only thing that blinks. */
  --t-fast: 120ms;
  --t-base: 180ms;

  --wrap: 1240px;
  --gutter: max(5vw, 16px);
  --control-h: 44px;
}


/* 5. BASE ================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/var(--lh-text) var(--eml-font-text);
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
::selection { background: var(--accent); color: var(--on-accent); }
hr { border: 0; border-top: var(--stroke) solid var(--border); margin: var(--s-8) 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* 6. TYPE ================================================================== */

.eml-display, .eml-h1, .eml-h2, .eml-h3, .eml-h4 {
  font-family: var(--eml-font-display);
  text-transform: uppercase;
  line-height: var(--lh-caps);
  letter-spacing: 0;
  margin: 0;
}
.eml-display { font-size: var(--fs-display); font-weight: 900; font-style: italic; }
.eml-h1      { font-size: var(--fs-h1);      font-weight: 900; }
.eml-h2      { font-size: var(--fs-h2);      font-weight: 900; }
.eml-h3      { font-size: var(--fs-h3);      font-weight: 700; }
.eml-h4      { font-size: var(--fs-h4);      font-weight: 700; }
.eml-lead    { font: 700 var(--fs-lead)/1.4 var(--eml-font-lead); color: var(--text-2); max-width: 62ch; margin: 0; }   /* Glavia Bold only: its Regular draws the hacek wrong */
.eml-text    { font-size: var(--fs-body); max-width: 68ch; margin: 0; }
.eml-small   { font-size: var(--fs-small); color: var(--muted); }
.eml-label   { font-size: var(--fs-label); font-weight: 700; }
.eml-data, .eml-num {
  font-family: var(--eml-font-mono);
  font-weight: 400;
  font-size: var(--fs-data);
  letter-spacing: .02em;
  font-synthesis: none;             /* Ironexa Mono has one weight */
}
.eml-num { text-align: right; white-space: nowrap; }


/* 7. LAYOUT ================================================================ */

.eml-wrap    { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.eml-band    { padding-block: clamp(32px, 5vw, 72px); border-top: var(--stroke) solid var(--border); }
.eml-stack   { display: grid; gap: var(--stack-gap, var(--s-4)); align-content: start; }
.eml-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--s-3)); }
.eml-grid    { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 260px)), 1fr)); }
.eml-split   { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .eml-split { grid-template-columns: 1fr; } }
.eml-grid > *, .eml-split > *, .eml-cluster > * { min-width: 0; }


/* 8. COMPONENTS ============================================================ */

/* 8.0 Optical centring ------------------------------------------------------
   Labels in buttons, segments, tabs and tags are centred on what the eye sees:
   the text box is trimmed to cap height and baseline (text-box), then lifted
   0.06 em so mostly-lowercase labels do not read low. Applies to every
   button-like element so they all line up when placed side by side. */
.eml-btn, .eml-seg button, .eml-tabs [role="tab"], .eml-tag, .eml-count {
  text-box: trim-both cap alphabetic;
}
/* The lift is built into each component's padding as an extra 0.12 em at the bottom. */

/* 8.1 Button ---------------------------------------------------------------
   <button class="eml-btn eml-btn--primary">Saada</button>
   Variants: --primary (one per view), --ghost, --danger, --accent (rare, the one
   accent action on a page), --sm, --icon. Loading: aria-busy="true" keeps width. */
.eml-btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--control-h); padding: 0 var(--s-5) .12em;
  font: 700 var(--fs-label)/1 var(--eml-font-text);
  color: var(--btn-fg); background: var(--btn-bg);
  border: var(--stroke) solid var(--btn-bd); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.eml-btn:hover          { --btn-bd: var(--text); color: var(--btn-fg); }
.eml-btn:active         { transform: translateY(1px); }
.eml-btn[disabled], .eml-btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.eml-btn--primary       { --btn-bg: var(--primary-bg); --btn-fg: var(--primary-text); --btn-bd: var(--primary-bg); }
.eml-btn--primary:hover { --btn-bg: var(--text-2); --btn-bd: var(--text-2); }
.eml-btn--ghost         { --btn-bg: transparent; --btn-bd: transparent; }
.eml-btn--ghost:hover   { --btn-bd: var(--border-strong); }
.eml-btn--danger        { --btn-bg: var(--danger); --btn-fg: var(--danger-text); --btn-bd: var(--danger); }
.eml-btn--accent        { --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-bd: var(--accent); }
.eml-btn--sm            { min-height: 34px; padding: 0 var(--s-3) .12em; font-size: 13px; }
.eml-btn--icon          { width: var(--control-h); padding: 0; }
.eml-btn--icon.eml-btn--sm { width: 34px; }
.eml-btn svg            { width: 18px; height: 18px; flex: none; }
.eml-btn[aria-busy="true"] { color: transparent; position: relative; pointer-events: none; }
.eml-btn[aria-busy="true"]::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--btn-fg); border-right-color: transparent; animation: eml-spin .7s linear infinite;
}
@keyframes eml-spin { to { transform: rotate(360deg); } }

/* Segmented control: <div class="eml-seg" role="group"><button aria-pressed="true"> */
.eml-seg { display: inline-flex; border: var(--stroke) solid var(--border-strong); }
.eml-seg button {
  all: unset; cursor: pointer; padding: 0 var(--s-4) .12em; min-height: 38px; display: inline-flex; align-items: center;
  font: 700 13px/1 var(--eml-font-text); color: var(--muted);
}
.eml-seg button + button { border-left: var(--stroke) solid var(--border-strong); }
.eml-seg button[aria-pressed="true"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.eml-seg button:focus-visible { box-shadow: var(--focus-ring); }

/* 8.2 Field ----------------------------------------------------------------
   <div class="eml-field"><label class="eml-field__label" for="x">Nimi <span class="eml-req">*</span></label>
   <input class="eml-input" id="x" aria-describedby="x-help"><p class="eml-help" id="x-help">…</p></div>
   Labels sit above, never as placeholders. Errors in words below, not only red. */
.eml-field        { display: grid; gap: var(--s-2); align-content: start; }
.eml-field__label { font: 700 var(--fs-label)/1.3 var(--eml-font-text); }
.eml-req          { color: var(--accent-text); }
.eml-help         { margin: 0; font-size: 13px; color: var(--muted); }
.eml-error        { margin: 0; font-size: 13px; color: var(--danger); display: flex; gap: var(--s-2); align-items: baseline; }
.eml-error::before{ content: ""; width: 8px; height: 8px; flex: none; background: var(--danger); transform: rotate(45deg); }
.eml-input, .eml-select, .eml-textarea {
  width: 100%; min-height: var(--control-h); padding: 0 var(--s-3);
  font: 16px/1.4 var(--eml-font-text); color: var(--text);
  background: var(--sunken); border: var(--stroke) solid var(--border-control); border-radius: var(--radius);
  transition: border-color var(--t-fast);
}
.eml-textarea { padding: var(--s-3); min-height: 120px; resize: vertical; }
.eml-input::placeholder, .eml-textarea::placeholder { color: var(--muted); opacity: 1; }
.eml-input:hover, .eml-select:hover, .eml-textarea:hover { border-color: var(--text-2); }
.eml-input:focus-visible, .eml-select:focus-visible, .eml-textarea:focus-visible { border-color: var(--focus); }
.eml-input[aria-invalid="true"], .eml-select[aria-invalid="true"], .eml-textarea[aria-invalid="true"] { border-color: var(--danger); }
.eml-input:disabled, .eml-select:disabled, .eml-textarea:disabled { opacity: .5; cursor: not-allowed; }
.eml-input--num { font-family: var(--eml-font-mono); font-weight: 400; text-align: right; }
.eml-select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
/* input with unit: <div class="eml-affix"><input class="eml-input eml-input--num"><span>€</span></div> */
.eml-affix { display: flex; }
.eml-affix .eml-input { flex: 1; }
.eml-affix span {
  display: inline-flex; align-items: center; padding: 0 var(--s-3); font: 400 14px var(--eml-font-mono); color: var(--muted);
  border: var(--stroke) solid var(--border-control); border-left: 0; background: var(--surface-2);
}

/* 8.3 Check, radio, switch -------------------------------------------------
   <label class="eml-check"><input type="checkbox"> Tekst</label>
   <label class="eml-check"><input type="radio" name="r"> Tekst</label>
   <label class="eml-switch"><input type="checkbox" role="switch"> Tekst</label> */
.eml-check, .eml-switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; min-height: 32px; font-size: 15px; }
.eml-check input {
  /* no ::after on inputs: WebKit does not draw pseudo-elements on <input>.
     The mark is the input's own background, clipped to the content box (4 px inset). */
  appearance: none; -webkit-appearance: none; margin: 0; width: 20px; height: 20px; flex: none; padding: 3px;
  border: 2px solid var(--border-control); background: var(--sunken) content-box; cursor: pointer;
  background-clip: content-box; transition: background-color var(--t-fast), border-color var(--t-fast);
}
.eml-check input[type="radio"] {
  /* The cut square from the brand device: like the tag, the box loses its bottom-right corner (clip-path on the
     input itself, no pseudo-elements), a background layer draws the 2 px diagonal, and the chosen mark is
     a 10 px square with the same cut. */
  --rc: var(--border-control);
  border-color: var(--rc); padding: 0; background-origin: border-box; background-clip: border-box;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
  background: linear-gradient(315deg, transparent 4.2px, var(--rc) 4.2px 6.6px, transparent 6.6px) border-box, var(--sunken);
}
.eml-check input[type="radio"]:hover { --rc: var(--text-2); }
.eml-check input:checked { border-color: var(--text); background-color: var(--accent); }
.eml-check input[type="radio"]:checked {
  --rc: var(--text);
  background:
    linear-gradient(315deg, transparent 3px, var(--accent) 3px) center/10px 10px no-repeat padding-box,
    linear-gradient(315deg, transparent 4.2px, var(--rc) 4.2px 6.6px, transparent 6.6px) border-box,
    var(--sunken);
}
.eml-check input:focus-visible, .eml-switch input:focus-visible { box-shadow: var(--focus-ring); }
/* optical centring: the label's visual middle (between cap height and x-height) sits 0.1 em
   below its line-box middle, so the control moves down to meet it */
.eml-check input, .eml-switch input { position: relative; top: 1px; }   /* whole pixel: keeps 2 px strokes sharp at 1x */
.eml-switch input {
  /* the knob is a background dot that slides with background-position */
  appearance: none; -webkit-appearance: none; margin: 0; width: 40px; height: 22px; flex: none; border-radius: var(--radius-pill); cursor: pointer;
  border: 1.5px solid var(--border-control);
  background-color: var(--sunken);
  background-image: radial-gradient(circle closest-side, var(--muted) 0 90%, transparent 97%);
  background-size: 15px 15px; background-repeat: no-repeat; background-position: 2.5px 50%;
  transition: background-color var(--t-fast), background-position var(--t-fast), border-color var(--t-fast);
}
.eml-switch input:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: radial-gradient(circle closest-side, var(--on-accent) 0 90%, transparent 97%);
  background-position: calc(100% - 2.5px) 50%;
}

/* 8.4 Tag (status) ---------------------------------------------------------
   Shape + word, never colour alone.
   <span class="eml-tag eml-tag--ok">Kinnitatud</span>  --ok --warn --danger --info --live --neutral */
.eml-tag {
  --tag: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px calc(5px + .12em) 7px;
  font: 700 12px/1.3 var(--eml-font-text); color: var(--text);
  border: var(--stroke) solid var(--border-strong); white-space: nowrap;
}
.eml-tag::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--tag); }
.eml-tag--ok     { --tag: var(--ok); }
.eml-tag--ok::before     { border-radius: 50%; }                                   /* full dot   */
.eml-tag--warn   { --tag: var(--warn); }
.eml-tag--warn::before   { clip-path: polygon(50% 0, 100% 100%, 0 100%); }          /* triangle   */
.eml-tag--danger { --tag: var(--danger); }
.eml-tag--danger::before { transform: rotate(45deg); }                              /* diamond    */
.eml-tag--info   { --tag: var(--info); }
.eml-tag--info::before   { background: none; border: 2px solid var(--info); border-radius: 50%; } /* ring */
.eml-tag--neutral::before{ background: none; border: 2px solid var(--muted); }      /* empty square */
.eml-tag--live   { --tag: var(--accent); }
.eml-tag--live::before   { border-radius: 50%; animation: eml-blink 2s steps(1) infinite; }

/* 8.5 Table ----------------------------------------------------------------
   <div class="eml-table-wrap"><table class="eml-table"> … <td class="eml-num"> */
.eml-table-wrap { overflow-x: auto; border-top: var(--stroke) solid var(--border-strong); }
.eml-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.eml-table th {
  text-align: left; font: 700 12px/1.2 var(--eml-font-text); color: var(--muted);
  padding: var(--s-3); border-bottom: var(--stroke) solid var(--border-strong); white-space: nowrap;
  position: sticky; top: 0; background: var(--bg);
}
.eml-table td { padding: var(--s-3); border-bottom: var(--stroke) solid var(--border); vertical-align: top; }
.eml-table tbody tr:hover td { background: var(--surface); }
.eml-table tr[aria-selected="true"] td { background: var(--surface-2); }
.eml-table tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.eml-table th.eml-num, .eml-table td.eml-num { text-align: right; }
.eml-table--dense td, .eml-table--dense th { padding: 7px var(--s-3); }
.eml-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.eml-table th[aria-sort] button::after { content: ""; border: 4px solid transparent; }
.eml-table th[aria-sort="ascending"] button::after  { border-bottom-color: var(--text); margin-top: -4px; }
.eml-table th[aria-sort="descending"] button::after { border-top-color: var(--text); margin-top: 4px; }

/* 8.6 Card -----------------------------------------------------------------
   One card = one thing (a bout, a fighter, a stage). */
.eml-card {
  display: grid; align-content: start; gap: var(--s-3); padding: var(--s-5);
  background: var(--surface); border: var(--stroke) solid var(--border);
}
.eml-card--link { text-decoration: none; transition: border-color var(--t-fast); }
.eml-card--link:hover { border-color: var(--border-strong); color: inherit; }
.eml-card__media { margin: calc(-1 * var(--s-5)) calc(-1 * var(--s-5)) var(--s-2); aspect-ratio: 16/9; background: var(--sunken); position: relative; overflow: hidden; }
.eml-card__media.eml-frame { background: radial-gradient(120% 90% at 50% 40%, #7a5d58, #2a1d1d 55%, #0b0909); }
.eml-card__media img { width: 100%; height: 100%; object-fit: cover; }
.eml-card__title { font: 700 var(--fs-h4)/var(--lh-caps) var(--eml-font-display); text-transform: uppercase; margin: 0; }
.eml-card__meta { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); color: var(--muted); font-size: 14px; }
.eml-card__foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding-top: var(--s-3); border-top: var(--stroke) solid var(--border); }

/* 8.7 Navigation -----------------------------------------------------------
   <header class="eml-topbar"><a class="eml-logo">…</a><nav class="eml-nav"><a aria-current="page"> */
.eml-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-8);
  height: 60px; padding-inline: var(--gutter);
  background: var(--brand); color: var(--on-brand);
}
.eml-logo { display: block; height: 22px; color: var(--on-brand); flex: none; }
.eml-logo svg { height: 100%; width: auto; fill: currentColor; }
.eml-nav { display: flex; gap: var(--s-6); overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.eml-nav a {
  display: inline-flex; align-items: center; white-space: nowrap; text-decoration: none;
  font-size: 15px; color: var(--eml-ash); border-bottom: 3px solid transparent;   /* ash on garnet 5.8:1 */
}
.eml-nav a:hover { color: var(--on-brand); }
.eml-nav a[aria-current="page"] { color: var(--on-brand); border-bottom-color: var(--eml-glow); }   /* glow on garnet 8.7:1, both themes */
.eml-topbar__end { margin-left: auto; display: flex; gap: var(--s-3); align-items: center; }

/* Tabs: <div class="eml-tabs" role="tablist"><button role="tab" aria-selected="true">Kõik <span class="eml-count">12</span> */
.eml-tabs { display: flex; gap: var(--s-6); border-bottom: var(--stroke) solid var(--border); overflow-x: auto; }
.eml-tabs [role="tab"] {
  all: unset; cursor: pointer; padding: var(--s-3) 0 calc(var(--s-3) + .12em); display: inline-flex; gap: var(--s-2); align-items: center;
  font: 700 14px/1 var(--eml-font-text); color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.eml-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.eml-tabs [role="tab"]:focus-visible { box-shadow: var(--focus-ring); }
.eml-count { font: 400 12px/1 var(--eml-font-mono); color: var(--muted); }

/* Breadcrumbs: <nav class="eml-crumbs"><a>Etapid</a><a>Etapp 01</a><span aria-current="page">Matšid</span> */
.eml-crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); font-size: 14px; color: var(--muted); }
.eml-crumbs > * + *::before { content: "/"; margin-right: var(--s-2); color: var(--border-strong); }
.eml-crumbs a { text-decoration: none; }
.eml-crumbs [aria-current] { color: var(--text); }

/* Pagination: <nav class="eml-pager"><span class="eml-data">1–25 / 312</span><button class="eml-btn eml-btn--icon eml-btn--sm"> */
.eml-pager { display: flex; align-items: center; gap: var(--s-3); }

/* 8.8 Feedback -------------------------------------------------------------
   Alert stays on the page. Toast leaves by itself. Dialog asks for a decision. */
.eml-alert {
  --al: var(--info);
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-3); padding: var(--s-4);
  background: var(--surface); border: var(--stroke) solid var(--border); border-left: 3px solid var(--al);
}
.eml-alert::before { content: ""; width: 10px; height: 10px; margin-top: 6px; background: var(--al); grid-row: span 2; }
.eml-alert__title { font-weight: 700; }
.eml-alert p { margin: 0; color: var(--text-2); font-size: 15px; grid-column: 2; }
.eml-alert--ok     { --al: var(--ok); }      .eml-alert--ok::before     { border-radius: 50%; }
.eml-alert--warn   { --al: var(--warn); }    .eml-alert--warn::before   { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.eml-alert--danger { --al: var(--danger); }  .eml-alert--danger::before { transform: rotate(45deg); }

.eml-toast {
  display: flex; align-items: center; gap: var(--s-4); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  background: var(--eml-paper); color: var(--eml-ink); box-shadow: var(--shadow-2); max-width: 440px; font-size: 15px;
}
[data-theme="light"] .eml-toast { background: var(--eml-ink); color: var(--eml-paper); }
.eml-toast .eml-btn { --btn-bg: transparent; --btn-fg: currentColor; --btn-bd: transparent; min-height: 34px; text-decoration: underline; }
.eml-toast-region { position: fixed; right: var(--s-6); bottom: var(--s-6); display: grid; gap: var(--s-2); z-index: 60; }

/* Dialog: native <dialog class="eml-dialog">. A dangerous title is a question; the button repeats the action. */
.eml-dialog {
  width: min(520px, calc(100% - 32px)); padding: 0; color: var(--text);
  background: var(--surface); border: var(--stroke) solid var(--border-strong); box-shadow: var(--shadow-2);
}
.eml-dialog::backdrop { background: var(--overlay); }
.eml-dialog__body { padding: var(--s-6); display: grid; gap: var(--s-3); }
.eml-dialog__title { font: 700 var(--fs-h3)/var(--lh-caps) var(--eml-font-display); text-transform: uppercase; margin: 0; }
.eml-dialog__foot { display: flex; justify-content: flex-end; gap: var(--s-3); padding: var(--s-4) var(--s-6); border-top: var(--stroke) solid var(--border); }

/* Empty state: always says what to do next */
.eml-empty { display: grid; justify-items: start; gap: var(--s-3); padding: var(--s-10) var(--s-6); border: var(--stroke) dashed var(--border-strong); }
.eml-empty p { margin: 0; color: var(--text-2); }

/* Skeleton: same shape as the real content, no shimmer */
.eml-skel { background: var(--surface-2); min-height: 14px; }
.eml-skel--text { height: 14px; width: var(--w, 100%); }
.eml-skel--media { aspect-ratio: 16/9; }

/* Progress: <div class="eml-progress" style="--p:.42"><span></span></div> */
.eml-progress { height: 4px; background: var(--surface-2); }
.eml-progress span { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); }

/* 8.9 Avatar ---------------------------------------------------------------*/
.eml-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); font: 700 13px/1 var(--eml-font-text); overflow: hidden;
}
.eml-avatar img { width: 100%; height: 100%; object-fit: cover; }


/* 9. BRAND DEVICE ========================================================= */
/* The 45 degree cut from the brand guide, as UI. Unit u = 1% of the frame's short side,
   set by --u (in px) on the frame. Photos and cards: 8u cut top-left and bottom-right.
   Tags and the radio: cut 0.293 x height bottom-right (Karl, 2026-12-04), diagonally opposite the photo's top-left cut. */

.eml-cut     { --cut: calc(8 * var(--u, 4px)); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.eml-cut--tl { clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut)); }

/* Cut tag: <span class="eml-chip">Peamatš</span>. The one Voltera label in UI.
   On screen it is Voltera Bold with .06em tracking, at least 15 px on a 30 px tag: Black at 13 px was hard to read
   (Karl, 2026-12-04). Print, social and video tags at large sizes stay Voltera Black. */
.eml-chip {
  --h: 30px;
  /* Voltera: ascent = cap height (0.75 em), descent 0.25 em, so a line-height:1 box puts the caps 0.125 em high;
     the .25em top padding centres them (measured within 0.4 px in Chrome and WebKit). Right padding +0.15 x height balances the cut. */
  display: inline-flex; align-items: center; height: var(--h); line-height: 1; text-box: normal;
  padding: .25em calc(.6em + .293 * var(--h) * .5) 0 calc(.6em - .04em);
  font: 700 15px/1 var(--eml-font-display); text-transform: uppercase; letter-spacing: .06em;
  background: var(--accent); color: var(--on-accent);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - .293 * var(--h)), calc(100% - .293 * var(--h)) 100%, 0 100%);
}
.eml-chip--ink { background: var(--text); color: var(--bg); }

/* Live: <span class="eml-live">Otse</span>. Blinks one second on, one off. */
.eml-live { display: inline-flex; align-items: center; gap: .5em; font: 400 var(--fs-data)/1 var(--eml-font-mono); letter-spacing: .04em; text-transform: uppercase; }
.eml-live::before { content: ""; width: .7em; height: .7em; border-radius: 50%; background: var(--eml-glow); flex: none; animation: eml-blink 2s steps(1) infinite; }
.eml-live--off::before { background: var(--muted); animation: none; }
@keyframes eml-blink { 50% { opacity: 0; } }

.eml-clock { font: 400 var(--fs-data)/1 var(--eml-font-mono); font-synthesis: none; font-variant-numeric: tabular-nums; }   /* fixed width: no jitter */

/* Frame: footage or a photo with the brand layout on top. Always paper on footage. */
.eml-frame {
  --u: 7px;
  position: relative; overflow: hidden; color: var(--eml-paper);
  background: radial-gradient(120% 90% at 50% 40%, #7a5d58, #2a1d1d 55%, #0b0909);
}
.eml-frame > img, .eml-frame > video { width: 100%; height: 100%; object-fit: cover; }
.eml-frame__row {
  position: absolute; left: calc(13 * var(--u)); right: calc(13 * var(--u)); top: calc(13 * var(--u));
  display: flex; justify-content: space-between; align-items: center; font: 400 calc(2.6 * var(--u))/1 var(--eml-font-mono); letter-spacing: .04em; text-transform: uppercase;
  text-shadow: 0 calc(.15 * var(--u)) calc(.6 * var(--u)) rgba(0,0,0,.65);
}
.eml-frame__row .eml-live, .eml-frame__row .eml-clock { font-size: inherit; }
.eml-frame__stack {
  position: absolute; left: calc(13 * var(--u)); right: calc(13 * var(--u)); bottom: calc(13 * var(--u));
  display: grid; justify-items: start; gap: calc(2 * var(--u)); filter: drop-shadow(0 calc(.15 * var(--u)) calc(.6 * var(--u)) rgba(0,0,0,.65));
}
.eml-frame__title { font: italic 900 calc(9 * var(--u))/var(--lh-caps) var(--eml-font-display); text-transform: uppercase; margin: 0; }
.eml-frame__title em { font-style: inherit; color: var(--eml-glow); }
.eml-frame__sub   { font: 400 calc(2.8 * var(--u))/1 var(--eml-font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--eml-glow); margin: 0; }
.eml-frame .eml-chip { --h: calc(4.4 * var(--u)); font-size: calc(2.2 * var(--u)); background: var(--eml-glow); color: var(--eml-ink); }
.eml-shade::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,14,16,.55), rgba(14,14,16,0) 35%, rgba(14,14,16,0) 50%, rgba(14,14,16,.82)); }


/* 10. UTILITIES ============================================================ */

.eml-muted   { color: var(--muted); }
.eml-accent  { color: var(--accent-text); }
.eml-right   { margin-left: auto; }
.eml-nowrap  { white-space: nowrap; }
.eml-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eml-grain   { position: relative; }
.eml-grain::after {     /* film grain from the guide, for generated backgrounds only */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08; mix-blend-mode: normal;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.62' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='1.8' intercept='-.4'/%3E%3CfeFuncG type='linear' slope='1.8' intercept='-.4'/%3E%3CfeFuncB type='linear' slope='1.8' intercept='-.4'/%3E%3C/feComponentTransfer%3E%3CfeGaussianBlur stdDeviation='.55'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
