/* ══════════════════════════════════════════════════════════════════════════
   Základ — Digitální případy DAOZ (07 §3)

   Reset, písma, typografie, rozvržení a utility. Komponenty jsou
   v components.css. Jen tokeny z tokens.css, žádné hexy (05-POKYNY §3.3).
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Písma: self-hosted WOFF2 subsety (07 §3.2, §3.3) ────────────────────── */
@font-face {
    font-family: Barlow;
    src: url("../fonts/barlow-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0100-017F, U+02C6-02DC, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2199;
}

@font-face {
    font-family: Barlow;
    src: url("../fonts/barlow-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0100-017F, U+02C6-02DC, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2199;
}

@font-face {
    font-family: "Barlow Condensed";
    src: url("../fonts/barlow-condensed-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0100-017F, U+02C6-02DC, U+2010-2027, U+2030-203A, U+20AC, U+2122, U+2190-2199;
}

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

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

@media (min-width: 1040px) {
    html {
        font-size: 17px;
    }
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-0);
    color: var(--text-2);
    font-family: var(--font-text);
    font-size: var(--fs-base);
    line-height: 1.55;
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

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

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* ── Typografie ──────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4 {
    margin: 0 0 var(--space-3);
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--text-1);
    text-transform: uppercase;
    letter-spacing: var(--track-head);
}

h1 {
    font-size: var(--fs-4xl);
    line-height: 1.06;
}

h2 {
    font-size: var(--fs-3xl);
    line-height: 1.15;
}

h3 {
    font-size: var(--fs-2xl);
    line-height: 1.2;
}

h4 {
    font-size: var(--fs-xl);
    line-height: 1.3;
}

p {
    margin: 0 0 var(--space-4);
    max-width: 68ch;
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--jantar);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-thickness: 3px;
}

strong,
b {
    font-weight: 700;
    color: var(--text-1);
}

small {
    font-size: var(--fs-sm);
}

code,
kbd,
samp {
    font-family: var(--font-mono);
    font-size: .9em;
    background: var(--bg-2);
    padding: .1em .4em;
    border-radius: var(--radius-s);
}

hr {
    height: 1px;
    margin: var(--space-6) 0;
    border: 0;
    background: var(--border);
}

::selection {
    background: var(--jantar);
    color: var(--on-jantar);
}

/* ── Fokus a pohyb ───────────────────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

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

/* ── Rozvržení ───────────────────────────────────────────────────────────── */
.l-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-5);
}

.l-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.l-page__main {
    flex: 1 0 auto;
}

.u-container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

@media (min-width: 760px) {
    .u-container {
        padding-inline: var(--space-6);
    }
}

.u-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.u-mono {
    font-family: var(--font-mono);
    font-size: var(--fs-mono);
    letter-spacing: .02em;
}

.u-muted {
    color: var(--text-3);
}

.u-stack > * + * {
    margin-top: var(--space-4);
}

/* Odkaz „přeskočit na obsah" pro klávesnici (07 §12). */
.u-skip {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--jantar);
    color: var(--on-jantar);
    font-weight: 700;
    border-radius: var(--radius-s);
}

.u-skip:focus {
    top: var(--space-4);
}

/* Varianty loga podle tématu: obě jsou v HTML, zobrazuje se ta správná
   (07 §4.2 — tmavá verze nikdy na tmavém podkladu). */
.logo-light {
    display: none;
}

:root[data-theme="light"] .logo-dark {
    display: none;
}

:root[data-theme="light"] .logo-light {
    display: block;
}
