/* =========================================
   1. RESET A ZÁKLADNÍ TYPOGRAFIE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    /* Pojistka pro parallax: tmavé pozadí body */
    background-color: #111;
    color: #2c3e50;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

p {
    margin-bottom: 1.5rem;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- ZÁKLAD PRO ROLOVACÍ STRÁNKU --- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

.bg-light { background-color: #f8fafc !important; }
.bg-white { background-color: #ffffff !important; }

/* =========================================
   2. HLAVIČKA A NAVIGACE (GLASSMORPHISM)
   ========================================= */

/* Hlavička zůstává při scrollování stát na místě (Parallax) */
header {
    position: sticky;
    top: 0;
    z-index: 1; /* Kladný z-index zaručí, že fotka na PC nezmizí */

    /* Výchozí nastavení pro hlavní stranu index.php */
    padding: 140px 0 100px 0;
    height: auto;
    min-height: 400px;

    width: 100%;
    background-image: url('img/uvod3.jpg'); /* Správná relativní cesta */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #333;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
    z-index: 0;
}

header .container,
header h1,
header p {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    font-size: 1em;
    font-weight: 200;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    margin-top: 0;
}

/* Masivní nadpis na úvodní obrazovce */
header h1 {
    font-size: 4.0em;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    text-align: center;
}

/* Skleněná navigace (Matné sklo) */
nav.main-nav {
    background-color: rgba(26, 26, 26, 0.45);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
}

nav.main-nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

nav.main-nav ul li {
    display: inline;
    margin: 0 25px;
}

nav.main-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 500;
    transition: color 0.3s;
}

nav.main-nav a:hover, nav.main-nav a.active {
    color: #4dabf7;
}

/* =========================================
   2B. ÚPRAVA PRO PODSTRÁNKY (CENÍK, SLUŽBY)
   ========================================= */

/* Pokud se jedná o podstránku, zmenšíme výšku fotky na elegantní sub-banner */
body.subpage header {
    height: 25vh;
    min-height: 220px;
    padding: 0;
}

body.subpage header h1 {
    font-size: 3.5em;
    letter-spacing: -1.5px;
}

/* Styly pro tabulky a dlaždice specifické pro podstránky (např. Ceník/Služby) */
body.subpage .services-page,
body.subpage .price-page {
    padding: 60px 0;
    position: relative;
    z-index: 10;
    background-color: #f4f6f8;
}

/* =========================================
   3. SEKCE (VPLOUVAJÍ PŘES HLAVIČKU)
   ========================================= */

/* Každá sekce vyjede fyzicky přes sticky hlavičku */
section {
    position: relative;
    z-index: 10; /* Sekce musí mít vždy vyšší z-index než hlavička (1) */
    padding: 140px 0;
    box-shadow: 0 -20px 50px rgba(0,0,0,0.1); /* Stín pro hloubku překrytí */
    overflow: hidden;
    background-color: #f4f6f8; /* Základní barva pozadí sekce */
}

#o-nas {
    margin-top: 0;
}

/* Obrovské, sebevědomé nadpisy */
h2 {
    font-size: 3.5em;
    font-weight: 800;
    margin-bottom: 50px;
    color: #111;
    text-align: center;
    letter-spacing: -1.5px;
}

/* =========================================
   4. DLAŽDICE A MŘÍŽKA
   ========================================= */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tile {
    background: #ffffff;
    border-radius: 24px; /* Extrémně zaoblené rohy */
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03); /* Velmi jemný, rozptýlený stín */
    border: 1px solid rgba(0,0,0,0.04);
    /* Plynulá "spring" animace */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Po najetí myší karta plynule povyroste a stín se prohloubí */
.tile:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.tile h3 {
    font-size: 1.4em;
    color: #111;
    margin-bottom: 15px;
}

.tile p {
    color: #555;
    flex-grow: 1;
    margin-bottom: 25px;
}

.tile-link {
    display: inline-block;
    font-weight: 600;
    color: #0071e3;
    text-decoration: none;
    align-self: flex-start;
    padding: 8px 16px;
    background: rgba(0, 113, 227, 0.1);
    border-radius: 8px;
    transition: all 0.2s;
}

.tile-link:hover {
    background: #0071e3;
    color: #fff;
}

/* =========================================
   5. KONTAKT, OTEVÍRACÍ DOBA A TLAČÍTKA
   ========================================= */
/* Pilulková tlačítka */
.btn {
    display: inline-block;
    background-color: #0071e3;
    color: white !important;
    padding: 14px 32px;
    border-radius: 999px; /* Tvar pilulky */
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 113, 227, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-weight: 600;
    letter-spacing: -0.3px;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

.btn:hover {
    background-color: #0077ED;
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.4);
}

.btn:active {
    transform: scale(0.97); /* Fyzická odezva při kliknutí */
}

.logo {
    display: block;
    margin: 30px auto;
    max-width: 220px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: stretch;
}

.opening-table {
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0;
    background-color: transparent;
    width: 100%;
}

.opening-table td {
    padding: 15px 10px;
    font-size: 1.1em;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
}

.opening-table tr:last-child td {
    border-bottom: none;
}

.opening-table td:first-child {
    font-weight: 700;
    color: #000;
}

.opening-table .closed td {
    color: #e74c3c;
    text-align: center;
}

/* =========================================
   6. ROLOVACÍ ANIMACE (REVEAL - APPLE STYLE)
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    filter: blur(10px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.tile:nth-child(1).reveal { transition-delay: 0.0s; }
.tile:nth-child(2).reveal { transition-delay: 0.1s; }
.tile:nth-child(3).reveal { transition-delay: 0.2s; }
.tile:nth-child(4).reveal { transition-delay: 0.3s; }

/* =========================================
   7. HORIZONTÁLNÍ SCROLLOVÁNÍ (AKTUALITY)
   ========================================= */
.horizontal-scroll-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 10px 30px 10px;
    margin: -10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.horizontal-scroll-container::-webkit-scrollbar {
    display: none;
}

.news-tile {
    min-width: 300px;
    max-width: 320px;
    flex: 0 0 auto;
    scroll-snap-align: center;
}

.news-date {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 10px;
    display: block;
    font-weight: 600;
    text-transform: uppercase;
}

/* =========================================
   8. KONTAKTNÍ FORMULÁŘ A MODAL
   ========================================= */
.contact-form {
    text-align: left;
}

.contact-form .form-group {
    margin-bottom: 15px;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: #444;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    background-color: #f9fafb;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #0071e3;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fff;
    margin: 15% auto;
    padding: 40px 30px;
    width: 90%;
    max-width: 450px;
    border-radius: 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.modal.success .modal-content { border-top: 6px solid #28a745; color: #28a745; }
.modal.error .modal-content { border-top: 6px solid #dc3545; color: #dc3545; }

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}
.close:hover { color: #111; }

/* =========================================
   9. PATIČKA (FOOTER - SVĚTLÝ DESIGN)
   ========================================= */
footer {
    position: relative;
    z-index: 10; /* Důležité: Zakryje úvodní fotku s trávou */
    background-color: #f8fafc !important; /* Světlé pozadí ladící se zbytkem webu */
    color: #555555 !important; /* Tmavě šedý text pro skvělou čitelnost */
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid #e2e8f0;
}

footer p {
    margin-bottom: 10px;
    font-size: 0.9em;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

footer li {
    display: inline-block;
}

footer a {
    color: #0071e3;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

footer a:hover {
    opacity: 0.7;
}

/* SEO třída pro skrytí prvků před lidmi, ale ponechání pro roboty a AI */
.seo-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* =========================================
   12. POPUP ČLÁNKY (AKTUALITY MODAL)
   ========================================= */
.article-modal {
    display: none;
    position: fixed;
    z-index: 100000; /* Musí být úplně nad vším */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(15px); /* Skleněný efekt na pozadí */
    opacity: 0;
    transition: opacity 0.4s ease;
}

.article-modal.show {
    opacity: 1;
}

.article-modal-content {
    background-color: #fff;
    margin: 5vh auto;
    padding: 50px;
    width: 90%;
    max-width: 800px; /* Rozumná velikost na PC */
    max-height: 90vh;
    overflow-y: auto; /* Kolečko myši funguje jen uvnitř popupu */
    border-radius: 24px;
    position: relative;
    transform: translateY(50px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.article-modal.show .article-modal-content {
    transform: translateY(0) scale(1);
}

.close-article {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 35px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    line-height: 1;
    background: #f0f0f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-article:hover {
    color: #111;
    background: #e0e0e0;
}

/* --- Styly pro obsah samotného článku --- */
#article-body h2 {
    font-size: 2.2em;
    color: #111;
    margin-bottom: 10px;
    text-align: left;
    letter-spacing: -1px;
}

#article-body .date {
    display: block;
    font-size: 0.9em;
    color: #888;
    margin-bottom: 30px;
    font-weight: 600;
    text-transform: uppercase;
}

#article-body p {
    font-size: 1.1em;
    line-height: 1.7;
    color: #444;
    margin-bottom: 20px;
}

#article-body .marked-text {
    background-color: #0071e3;
    color: white;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
}

#article-body img, #article-body .article-img, #article-body .article-img_hvt {
    display: block;
    margin: 30px auto;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

/* =========================================
   10. RESPONZIVITA (MOBILY)
   ========================================= */
.menu-toggle {
    display: none;
    font-size: 2em;
    color: white;
    cursor: pointer;
    margin-left: 20px;

}

@media (max-width: 768px) {
    .container { width: 92% !important; padding: 0; }

    section { padding: 80px 0; }
    h2 { font-size: 2.5em; letter-spacing: -1px; margin-bottom: 30px; }

    /* Výchozí hlavička pro mobil na hlavní straně */
    header { height: auto; min-height: 250px; padding: 100px 0; }
    header h1 { font-size: 2.8em; letter-spacing: -1px; }

    /* Úprava hlavičky podstránek pro mobil */
    body.subpage header { height: 20vh; min-height: 160px; padding: 0; }
    body.subpage header h1 { font-size: 2.2em; }

    nav.main-nav {
        background-color: transparent;
        box-shadow: none;
        padding: 0;
        position: fixed;
        top: 15px;
        right: 15px;
        width: auto;
        z-index: 1000;
        border: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

.menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        background-color: rgba(26, 26, 26, 0.25);
        color: white;
        border-radius: 50%;
        font-size: 1.5em;
        margin: 0;
        box-shadow: 0 4px 15px rgba(26, 26, 26, 0.4);
        z-index: 1001;
        position: relative;
        transition: transform 0.2s ease; /* Lehká animace samotného tlačítka */
    }

    /* Efekt zmenšení tlačítka při dotyku prstem */
    .menu-toggle:active {
        transform: scale(0.9);
    }

    .nav-links {
        display: flex; /* Místo none použijeme flex, ale skryjeme ho vizuálně */
        flex-direction: column;
        background-color: rgba(26, 26, 26, 0.20);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        width: 220px;
        text-align: right;
        position: absolute;
        top: 70px; /* Trochu posunuto dolů pro efekt najetí */
        right: 0;
        left: auto;
        padding: 20px;
        border-radius: 20px;
        box-shadow: 0 15px 40px rgba(0,0,0,0.3);

        /* --- APPLE ANIMACE ROZBALENÍ --- */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-15px) scale(0.95); /* Výchozí stav: zmenšené a posunuté nahoru */
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        pointer-events: none; /* Zabrání nechtěnému kliknutí na neviditelné odkazy */
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1); /* Najede na své místo */
        pointer-events: auto; /* Opět zapne možnost klikání */
    }

    .nav-links li { margin: 15px 0; }

    /* Oprava mřížky na jeden sloupec */
    .contact-grid { grid-template-columns: 1fr; }

    /* Vyřešení mezer mezi kartami aktualit na mobilu */
    .horizontal-scroll-container {
        padding: 10px 0 25px 0;
        margin: 0;
    }

    .news-tile {
        min-width: 85%; max-width: 85%;
        margin-left: 15px;
    }

    .horizontal-scroll-container .news-tile:last-child {
        margin-right: 15px;
    }

}
    /* Zrušení černého parallax pozadí pro podstránky (články, služby atd.) */
body.subpage {
    background-color: #f4f6f8;
}
/* Zajištění, aby obsah na podstránkách neprůhledně překryl sticky hlavičku */
body.subpage main {
    position: relative;
    z-index: 10;
    background-color: #f4f6f8;
}

/* =========================================
   EFEKT VYNOŘENÍ PŘI SCROLLOVÁNÍ (REVEAL)
   ========================================= */
.reveal {
    opacity: 0;
    transform: translateY(50px); /* Prvek je na začátku posunutý o 50px dolů */
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Plynulá animace s lehkým zhoupnutím */
}

.reveal.active {
    opacity: 1;
    transform: translateY(0); /* Návrat na původní pozici */
}
