/* Rozvržení a tvary podle předlohy geovap.cz (skill geovap-design),
   barvy podle původní aplikace WebSupport: tmavě modrá hlavička/patička,
   zlatý akcent, červený Helpdesk. Písmo Montserrat, mřížka 4 px. */

/* Montserrat (SIL Open Font License) – uložené lokálně, bez načítání z Google Fonts.
   Variabilní font: jeden soubor pokrývá řezy 300–700. */
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("fonts/montserrat-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "Montserrat";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("fonts/montserrat-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* původní paleta WebSupport */
    --navy: #0a3758;
    --blue-deep: #0b375a;
    --blue: #1d5a8c;
    --slate: #0a3758;
    --accent: #f0b400;
    --accent-light: #ffd34d;
    --danger: #e0473a;
    --danger-dark: #8a1f17;
    --text: #1f2933;
    --muted: #5f6b7a;
    --surface: #f3f6f9;
    --surface-2: #d9e1e8;
    --highlight: #e3edf6;
    --border: #d9e1e8;
    --deco: #b7cde0;
    --deco-light: #d3e0ea;

    --brand: var(--blue);
    --brand-dark: var(--navy);

    --grad-blue: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
    --grad-cta: linear-gradient(90deg, var(--blue) 0%, var(--navy) 100%);
    --grad-danger: linear-gradient(90deg, #e85a4d 0%, var(--danger) 100%);

    --shadow-card: 0 0 20px 0 rgba(10, 55, 88, .07);
    --shadow-float: 0 0 20px 0 rgba(0, 0, 0, .3);
    --shadow-cta: -3px 24px 32px 0 rgba(10, 55, 88, .18);

    --radius: 6px;
    --radius-card: 30px;
    --radius-pill: 30px;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --page-width: 1224px;
}

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

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-weight: 400;
    font-size: 15px;
    color: var(--muted);
    background: var(--surface);
    line-height: 1.6;
}
body { overflow-x: clip; }

/* Patička vždy dole i při málo obsahu */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; transition: color .25s linear; }
a:hover { color: var(--navy); }
.rich a, .card a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }

strong, b { font-weight: 700; }

/* Nadpis sekce jako „Subsystémy / Moduly“ na geovap.cz: tmavě břidlicový, pod ním linka s oranžovou tečkou */
h1 {
    position: relative;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 40px;
    padding-bottom: 20px;
    color: var(--slate);
}
h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 100%;
    background: var(--accent);
}
h1:focus { outline: none; }

h2 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--slate);
    margin: 48px 0 16px;
}
section > h2:first-of-type { margin-top: 24px; }
h2[id] { scroll-margin-top: 16px; }

/* Obsah ležící hned pod šikmou hranou hlavičky */
.content > :first-child:not(.deco) { margin-top: 0; }

/* Oddělovač s oranžovou tečkou pod nadpisem karty (dlaždice geovap.cz)
   a pod nadpisy sekcí v detailu verze (Popis změn, Instalace, Stažení, …) */
.card h2,
.contact h2 {
    position: relative;
    margin: 0 0 20px;
    padding-bottom: 20px;
}
.version-section {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.card h2::before,
.contact h2::before,
.version-section::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5px;
    height: 1px;
    background: var(--surface-2);
}
.card h2::after,
.contact h2::after,
.version-section::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 100%;
    background: var(--accent);
}

/* Obsah textů z DB */
.rich img { max-width: 100%; height: auto; border-radius: var(--radius); }

.file-icon { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; }

/* dvousloupcový layout: obsah + boční menu (Informace, Aplikace) */
.with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 32px;
    align-items: start;
}

@media (max-width: 800px) {
    .with-sidebar { grid-template-columns: 1fr; }
    .with-sidebar > .sidemenu { order: -1; }
}

.sidemenu {
    position: sticky;
    top: 24px;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 12px;
}
@media (max-width: 800px) { .sidemenu { position: static; } }

.sidemenu h3 {
    margin: 12px 0 4px;
    padding: 4px 16px;
    font-size: .72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
}
.sidemenu-items > h3:first-child { margin-top: 4px; }

/* Sbalování menu na mobilu (komponenta SideMenu) */
.sidemenu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.sidemenu-summary { display: none; }
@media (max-width: 800px) {
    .sidemenu-summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 16px;
        border-radius: 14px;
        cursor: pointer;
        color: var(--slate);
    }
    .sidemenu-summary-text { display: grid; line-height: 1.3; }
    .sidemenu-summary-text small {
        font-size: .72rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: var(--muted);
    }
    .sidemenu-chevron {
        flex-shrink: 0;
        width: 10px;
        height: 10px;
        border-right: 2px solid var(--blue);
        border-bottom: 2px solid var(--blue);
        margin-top: -4px;
        transform: rotate(45deg);
        transition: transform .25s var(--ease), margin .25s var(--ease);
    }
    .sidemenu-toggle:checked + .sidemenu-summary .sidemenu-chevron { margin-top: 4px; transform: rotate(225deg); }
    .sidemenu-toggle:focus-visible + .sidemenu-summary { outline: 2px solid var(--blue); outline-offset: 2px; }
    .sidemenu-items { display: none; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
    .sidemenu-toggle:checked ~ .sidemenu-items { display: block; }
}

.sidemenu a, .sidemenu span.disabled {
    display: block;
    padding: 8px 16px;
    border-radius: 14px;
    color: var(--text);
    font-weight: 500;
    font-size: .92rem;
    transition: background .25s linear, color .25s linear;
}

.sidemenu a:hover { background: var(--surface); color: var(--blue); }
.sidemenu a.active {
    background: var(--grad-blue);
    color: #fff;
    font-weight: 700;
}
.sidemenu span.disabled { color: #a3adb8; cursor: not-allowed; }

.card {
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 28px 32px;
    margin-bottom: 24px;
}
@media (max-width: 600px) { .card { padding: 20px; } }

.attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 20px 4px 0;
    font-weight: 500;
}

.file-generic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius);
    background: var(--muted);
    color: #fff;
    font-size: .55rem;
    font-weight: 700;
    text-transform: uppercase;
}

.alert-error {
    background: #fff;
    color: var(--danger-dark);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 12px 16px;
    margin-bottom: 16px;
    font-weight: 500;
}

.alert-info {
    background: var(--highlight);
    color: var(--slate);
    border-left: 4px solid var(--blue);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 24px;
}

/* Přihlašovací karta uprostřed pod hlavičkou */
.login-wrap {
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    border-radius: 2.5rem;
    box-shadow: var(--shadow-card);
    padding: 40px;
}
.login-wrap h1 { font-size: 1.5rem; text-align: center; }
.login-wrap h1::after { left: calc(50% - 6px); }
.login-wrap .btn { width: 100%; margin-top: 8px; }
@media (max-width: 480px) { .login-wrap { padding: 28px 20px; } }
.form-narrow { max-width: 400px; margin: 0 auto; }
.form-row { display: grid; gap: 4px; margin-bottom: 16px; }
.form-row label {
    font-weight: 500;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.form-row input {
    padding: 12px 16px;
    border: 1px solid var(--surface-2);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color .25s linear, background .25s linear;
}
.form-row input:focus {
    outline: none;
    border-color: var(--blue);
    background: #fff;
}

/* Tlačítko-pilulka s oranžovým přechodem jako na geovap.cz */
.btn {
    display: inline-block;
    background: var(--grad-cta);
    color: #fff;
    border: 0;
    border-radius: var(--radius-pill);
    padding: 12px 32px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-cta);
    transition: transform .25s var(--ease), filter .25s linear;
}
.btn:hover { color: #fff; filter: brightness(1.06); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
/* bílá pilulka („Zobrazit další kontakty“) a tmavá („Videoukázka“) */
.btn-white { background: #fff; color: var(--slate); box-shadow: 0 0 20px 0 rgba(0, 0, 0, .3); }
.btn-white:hover { color: var(--blue-deep); }
.btn-dark { background: var(--slate); box-shadow: none; }
.btn-danger { background: var(--grad-danger); box-shadow: -3px 24px 32px 0 rgba(224, 71, 58, .2); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.muted { color: var(--muted); }

/* Rychlá navigace v detailu verze */
.quicknav { display: flex; flex-wrap: wrap; gap: 8px; }
.quicknav a {
    padding: 4px 16px;
    border: 2px solid var(--blue-deep);
    border-radius: var(--radius-pill);
    color: var(--blue-deep);
    font-weight: 500;
    font-size: .88rem;
    transition: background .25s linear, color .25s linear;
}
.quicknav a:hover { background: var(--blue-deep); color: #fff; }

/* Box se stažením aktuální verze – střídmý rámeček jako v původní verzi,
   s modrou linkou vlevo a tlačítkem v novém stylu */
.download-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    border-radius: 14px;
    padding: 20px 24px;
}
.download-box dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 0; }
.download-box dt { color: var(--muted); }
.download-box dd { margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--slate); }

/* Tabulky příruček a historie – čisté řádky s linkami (původní verze), zaoblený rámeček */
.grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.grid td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
    transition: background .15s linear;
}
.grid tr:last-child td { border-bottom: 0; }
.grid tr:hover td { background: var(--surface); }
.grid tr.selected td { background: var(--highlight); font-weight: 700; color: var(--slate); }
.grid tr.selected td:first-child { box-shadow: inset 4px 0 0 var(--blue); }
.grid .icon { width: 44px; padding-left: 16px; }
.grid .num { text-align: right; white-space: nowrap; color: var(--muted); }
.grid tr.selected .num { color: var(--slate); }
.grid .action { text-align: right; white-space: nowrap; padding-right: 16px; }
.grid a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(29, 90, 140, .35); }
.grid a:hover { text-decoration-color: currentColor; }
.grid .action a { font-weight: 500; }
/* na mobilu skryjeme datum a velikost, aby se tabulka vešla */
@media (max-width: 600px) {
    .grid .num { display: none; }
    .download-box .btn { width: 100%; text-align: center; }
}
.grid-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; color: var(--muted); }

/* Hotline – karty kontaktů */
/* 3 / 2 / 1 karta na řádek podle šířky; neúplný poslední řádek je vystředěný.
   Karta potřebuje ~352 px, aby se nejdelší řádek („pevná linka“ + e-mail) nezalomil. */
.contacts {
    container-type: inline-size;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}
.contacts > .contact { flex: 0 0 min(100%, 420px); }
@container (min-width: 728px) {
    .contacts > .contact { flex-basis: calc((100% - 24px) / 2); }
}
@container (min-width: 1104px) {
    .contacts > .contact { flex-basis: calc((100% - 48px) / 3); }
}
/* úzký telefon: popisek nad hodnotou, aby se e-mail vešel na jeden řádek */
@container (max-width: 359px) {
    .contacts .contact { padding: 28px 16px; }
    .contacts .contact dl { grid-template-columns: 1fr; text-align: center; gap: 0; }
    .contacts .contact dt { margin-top: 8px; font-size: .8rem; }
}
/* dlaždice kontaktu – vycentrovaná jako „Subsystémy“ na geovap.cz */
.contact {
    background: #fff;
    border-radius: 2.5rem;
    box-shadow: var(--shadow-card);
    padding: 32px 28px;
    text-align: center;
    transition: transform .25s var(--ease), box-shadow .25s linear;
}
.contact:hover { transform: translateY(-4px); box-shadow: 0 0 20px 0 rgba(0, 0, 0, .3); }
.contact h2 { font-size: 1.05rem; }
.contact h2::after { left: calc(50% - 6px); }
.contact-name { margin: 0 0 16px; font-weight: 500; color: var(--slate); }
.contact dl { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 4px 12px; margin: 0; font-size: .93rem; text-align: left; }
/* popisky ani telefony/e-maily se nezalamují – šířku hlídá mřížka výše */
.contact dt { color: var(--muted); white-space: nowrap; }
.contact dd { margin: 0; white-space: nowrap; font-weight: 500; }

/* Chybové stránky */
.message-page {
    max-width: 640px;
    margin: 32px auto;
    text-align: center;
    background: #fff;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 40px 32px;
}
.message-page h1::after { left: calc(50% - 6px); }
.message-page code { background: var(--surface); padding: 2px 6px; border-radius: var(--radius); }

.placeholder {
    border: 2px dashed var(--surface-2);
    border-radius: var(--radius-card);
    padding: 32px;
    color: var(--muted);
}

/* Jemný nájezd obsahu při načtení stránky */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}
.content > :not(.deco) { animation: rise-in .5s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .08s; }
.content > *:nth-child(3) { animation-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        transition-duration: .01ms !important;
    }
}
