/* ==========================================================================
   Základ – reset, typografie, ikony, přístupnost
   ========================================================================== */

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

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

    /* Kotvy se nesmí schovat pod lepkavou hlavičku */
    scroll-padding-top: calc(var(--header-height) + var(--space-md));
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-ink);
    text-wrap: balance;
}

p,
ul,
ol,
figure,
blockquote,
fieldset {
    margin: 0;
}

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

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
}

fieldset {
    padding: 0;
    border: 0;
    min-width: 0;
}

address {
    font-style: normal;
}

strong {
    font-weight: 600;
    color: var(--color-ink);
}

/* Viditelný focus pro ovládání klávesnicí */
:focus-visible {
    outline: 2px solid var(--color-accent-strong);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Ikony (Material Symbols) – pevná šířka zabrání rozhození layoutu
   během načítání písma, kdy se zobrazuje název ikony jako text */
.icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    overflow: hidden;
    font-family: "Material Symbols Outlined";
    font-size: 1.25rem;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    font-feature-settings: "liga";
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    user-select: none;
}

/* Text dostupný jen pro čtečky obrazovky */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 100;
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
    color: var(--color-surface);
    background-color: var(--color-ink);
    border-radius: var(--radius-sm);
    transform: translateY(-200%);
    transition: transform var(--transition-fast);
}

.skip-link:focus {
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
