/* =========================================
   1. Nastavení & Proměnné
   ========================================= */
:root {
    /* Barvy */
    --bg: rgba(19, 19, 19, 0.74);
    --surface: #403f3f;
    --header-bg: rgb(32, 32, 37);
    --footer-bg: #1f2025;
    --accent: #ffffff;
    --text: #ffffff;
    --muted: #cfcfcf;
    --border-color: rgba(255, 255, 255, 0.05);

    /* Rozměry a Layout */
    --max-width: 1100px;
    --header-height: 76px;
    --container-padding: 1.5rem;
    --radius: 10px;
    --gap: 1.25rem;

    /* Z-Index vrstvy */
    --z-header: 1000;
    --z-menu-backdrop: 1001;
    --z-menu-dropdown: 1002;
    --z-menu-toggle: 1003;
}

/* =========================================
   2. Reset & Základní styly
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    overflow-x: hidden;
}

main {
    flex: 1;
}

/* Globální reset odkazů - vynucení bílé barvy */
a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover,
a:focus {
    text-decoration: underline;
    outline: none;
}

a:visited,
a:active {
    color: var(--accent);
}

:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.06);
    outline-offset: 3px;
}

/* =========================================
   3. Typografie
   ========================================= */
h1, h2, h3 {
    color: var(--text);
    line-height: 1.2;
}

h1 {
    margin: 20px 0 0.6rem;
    font-size: 2.25rem;
}

h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

p {
    margin: 0 0 1rem;
    color: var(--muted);
}

ul, ol {
    margin: 0 0 1rem 1.25rem;
    color: var(--muted);
}

.site-title {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   4. Layout Komponenty
   ========================================= */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.card {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.04);
}

/* =========================================
   5. Header & Navigace
   ========================================= */
header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    display: flex;
    align-items: center;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.header-flex {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    height: var(--header-height);
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    gap: var(--gap);
}

/* Desktop Navigace */
.desktop-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding: 0;
    gap: 0.7rem;
    list-style: none;
}

.desktop-nav li {
    margin: 0;
    padding: 0;
}

.desktop-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 10px;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
}

.desktop-nav a.active {
    background: rgba(255, 255, 255, 0.12);
    text-decoration: underline;
}

@media (min-width: 751px) {
    .desktop-nav {
        position: absolute;
        top: 50%;
        right: var(--container-padding);
        margin-left: 0;
        transform: translateY(-50%);
    }
}

/* =========================================
   6. Mobilní Menu (Hamburger)
   ========================================= */
#menuToggle {
    display: none;
    position: relative;
    z-index: var(--z-menu-toggle);
}

#menuToggle input {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 44px;
    height: 36px;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

#menuToggle span {
    display: block;
    width: 33px;
    height: 4px;
    margin-bottom: 5px;
    background: var(--accent);
    border-radius: 3px;
    transition: opacity 0.18s ease;
    z-index: 1;
}

/* Skrytí burger ikonky při otevření */
#menuToggle input:checked ~ span {
    opacity: 0;
}

/* Dropdown panel */
#menu {
    position: absolute;
    top: calc(var(--header-height) + 8px);
    right: 0;
    z-index: var(--z-menu-dropdown);
    width: max-content;
    min-width: 140px;
    max-width: 86vw;
    padding: 10px 8px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    list-style: none;
    margin: 0;

    /* Animace */
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
}

#menu li {
    padding: 0;
}

#menu li a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
}

#menu li a:hover {
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

#menuToggle input:checked ~ ul#menu {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Backdrop (tmavé pozadí) */
#menuToggle .menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-menu-backdrop);
    visibility: hidden;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
}

#menuToggle input:checked ~ .menu-backdrop {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* =========================================
   7. Obsah (Intro & Footer)
   ========================================= */
.intro-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 2rem;
    margin-bottom: 3rem;
}

.intro-text h1 {
    text-align: left;
}

.intro-photo {
    justify-self: end;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Footer */
.footer {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    padding: 2rem 0;
    background: transparent;
}

.footer-box {
    width: min(900px, 90%);
    padding: 1.5rem 2rem;
    background: var(--footer-bg);
    color: var(--accent);
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

/* =========================================
   8. Media Queries (Mobilní zobrazení)
   ========================================= */
@media (max-width: 750px) {
    :root {
        --header-height: 64px;
        --gap: 0.6rem;
        --container-padding: 1rem;
    }

    /* Navigace */
    .desktop-nav {
        display: none !important;
    }

    #menuToggle {
        display: block;
        margin-left: auto;
    }

    .site-title {
        max-width: 55%;
    }

    /* Intro sekce */
    .intro-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 0.9rem;
    }

    .intro-text {
        order: 1;
    }

    .intro-photo {
        order: 2;
        justify-self: center;
        max-width: 400px;
        height: auto;
        aspect-ratio: auto;
        margin: 0 auto 0.5rem;
    }
}

/* =========================================
   9. Vynucení bílých odkazů (Safety Check)
   ========================================= */
a, a:visited, a:hover, a:active,
nav a, nav a:visited, .footer a, .card a {
    color: #ffffff !important;
    text-decoration-color: #ffffff !important;
}