/*
 * Osobytosti — design tokens (docs/ui_spec.md).
 * The five palette colors below are the ONLY color literals in the codebase.
 * Components consume role variables (--bg, --text, …), never palette tokens.
 */

:root {
    /* Palette — strict monochrome, max 5 colors */
    --c-paper: #faf9f6;
    --c-ink: #0b0b0b;
    --c-ink-soft: #232322;
    --c-mid: #73716b;     /* 4.6 : 1 on paper (WCAG AA for small text) */
    --c-line: #dedcd4;

    /* Typography */
    --font-primary: "Arial Narrow", "Arial Nova Cond", "Helvetica Neue Condensed", Arial, sans-serif;
    --font-primary-stretch: condensed;
    --font-secondary: "Times New Roman", Times, "Liberation Serif", serif;

    --fs-display: clamp(2.6rem, 4.5vw, 4.5rem);
    --fs-h2: clamp(1.8rem, 2.6vw, 2.6rem);
    --fs-lead: 1.25rem;
    --fs-body: 1.0625rem;
    --fs-small: 0.875rem;
    --fs-micro: 0.75rem;
    --fs-error-code: clamp(6rem, 18vw, 16rem);

    --lh-tight: 1.05;
    --lh-snug: 1.25;
    --lh-body: 1.6;

    --ls-normal: 0;
    --ls-wide: 0.08em;
    --ls-wider: 0.2em;

    --measure: 85ch;

    /* Spacing */
    --sp-1: 0.5rem;
    --sp-2: 1rem;
    --sp-3: 1.5rem;
    --sp-4: 2.5rem;
    --sp-5: 4rem;
    --sp-6: 6rem;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 0.2s;
    --dur-mid: 0.45s;
    --dur-slow: 0.9s;
    --stagger: 60ms;      /* delay step between rising content blocks */
    --rise-shift: 10px;   /* content rises from this offset on enter */
    --leave-shift: 6px;   /* #main lifts by this offset on leave */
    --nudge: 6px;         /* gallery list item shift on hover/focus */
    --pop-scale: 1.06;    /* "pop-out" zoom of nav items and text buttons on hover/focus */
    --image-zoom: 1.03;   /* admin photo card image on hover */
    --hover-dim: 0.7;     /* link opacity on hover */

    /* Inline separators ("CZ / EN", "Light / Dark") */
    --sep-gap: 0.4em;

    /* Component sizes */
    --list-indent: 1.2em;                          /* rich-text ul/ol */
    --content-image-w: clamp(6rem, 12vw, 10rem);   /* intro small image */
    --field-gap: 0.25rem;                          /* label ↔ input */
    --select-arrow-space: 1.5em;                   /* room for the "↓" */
    --textarea-h: clamp(4.5em, 14vh, 8em);

    /* Admin layout */
    --admin-nav-w: 15rem;       /* sidebar width */
    --admin-content-w: 72rem;   /* max width of the main column */
    --admin-form-w: 28rem;      /* narrow forms (login, password, user) */
    --admin-form-medium-w: 52rem; /* two-language forms (cs | en columns) */
    --meter-h: 3px;             /* storage meter bar */
    --admin-thumb-w: 3rem;      /* cover thumbnail in tables */
    --admin-card-w: 13rem;      /* photo card in the portfolio photo grid */
    --admin-card-min-phone: 9rem; /* photo card on phones (2 columns) */
    --admin-preview-w: 14rem;   /* image field preview */
    --admin-controls-min-w: 12rem; /* image field controls beside the preview */
    --admin-focus-max-h: min(32rem, 60vh); /* focus point dialog photo */
    --admin-focus-dot: 0.875rem; /* focus point marker */
    --admin-url-w: 22rem;      /* URL / clipped text columns in tables */
    --admin-aside-w: 16rem;     /* reference column beside a form (email placeholders) */
    --admin-editor-form-w: 34rem; /* client gallery editor: form column beside the live preview */
    --client-thumb-min: 9rem;   /* client gallery grid: narrowest column before columns drop */
    --select-ring: 3px;         /* selected photo: width of each ring of the double outline */
    --client-bar-h: 4.5rem;     /* client gallery sticky bar; the hero height is measured below it */
    --client-hero-min-h: 20rem; /* hero never shorter than this (short / narrow viewports) */
    --client-hero-text-w: 48rem; /* hero text block */
    --client-gutter-min: max(1.5rem, var(--safe-x)); /* client gallery side margin: grows with the width (client_gallery.css) */
    --client-gutter-max: 12rem;
    --client-preview-w: 1440px; /* admin live preview: logical viewport, scaled to fit */
    --client-preview-h: 900px;
    --client-preview-ratio: 1.6; /* = w / h above */
    /* Widest the preview gets: 1 : 1, or 80vh tall (HEIGHT_SHARE in gallery_preview.js). */
    --client-preview-max-w: min(var(--client-preview-w), calc(80vh * var(--client-preview-ratio)));
    --ratio-square: 1 / 1;      /* client gallery thumbnail box (photo contained, not cropped) */
    --ratio-portrait: 4 / 5;    /* admin image previews, thumbnails and photo cards */
    --ratio-og: 1200 / 630;     /* OG image preview */
    --editor-min-h: 7em;        /* rich-text editor area (block mode) */

    /* Responsive (docs/responsive_spec.md). Media queries cannot read custom
       properties, so the breakpoints are literal — use exactly these queries:
         stacked (public):  (max-width: 63.99rem), (orientation: portrait)
         drawer (admin):    (max-width: 63.99rem)
         phone (both):      (max-width: 39.99rem)
       Input queries: hover-only effects inside (hover: hover); bigger hit
       areas inside (pointer: coarse). */
    --tap-min: 2.75rem;                    /* minimal hit area on touch */
    --stack-media-h: max(50svh, 16rem);    /* photo height in the stacked layout */
    /* Notch / rounded corners in landscape (viewport-fit=cover); 0 elsewhere. */
    --safe-x: max(env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
    --stack-gutter: max(var(--sp-4), var(--safe-x)); /* side padding of stacked content */
    --nav-band-h: 3.5rem;                  /* compact navbar band / admin drawer bar */
    --burger-w: 1.5rem;                    /* width of the burger lines */
    --burger-gap: 0.4rem;                  /* distance between the two lines */
    --drawer-w: min(20rem, 85vw);          /* admin drawer width */
    --stream-max-h: calc(100svh - var(--nav-band-h) - 2 * var(--sp-3)); /* portrait gallery stream: photo fits the screen */
    --error-media-h: 35svh;                /* stacked error page: code panel */

    /* Layers & shape */
    --z-nav: 500;
    --z-overlay: 800;
    --z-lightbox: 900;
    --radius: 0;
    --nav-blur: 6px;            /* backdrop-filter blur of the navbar band and the stacked menu panel */

    /* Text over a photo — client gallery hero. */
    --on-photo: var(--c-paper);
    --photo-scrim: var(--c-ink);  /* the dark overlay; its opacity is a gallery setting */
}

/* Theme roles (light only) */
:root {
    color-scheme: light;
    --bg: var(--c-paper);
    --surface: var(--c-line);
    --text: var(--c-ink);
    --text-soft: var(--c-ink-soft);
    --muted: var(--c-mid);
    --rule: var(--c-line);
    --backdrop: color-mix(in srgb, var(--c-paper) 96%, transparent);
    --pop-shadow: 0 0.35em 0.9em color-mix(in srgb, var(--c-ink) 22%, transparent);
}

/* Phone: smaller display floor, tighter gutter, client bar as tall as the band. */
@media (max-width: 39.99rem) {
    :root {
        --fs-display: clamp(2.2rem, 4.5vw, 4.5rem);
        --stack-gutter: max(var(--sp-3), var(--safe-x));
        --client-bar-h: var(--nav-band-h);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --dur-fast: 0.01ms;
        --dur-mid: 0.01ms;
        --dur-slow: 0.01ms;
    }
}

/* Scrollbars are hidden site-wide (public pages and admin); scrolling still works. */
* {
    scrollbar-width: none;
}

::-webkit-scrollbar {
    display: none;
}
