/*
 * =====================================================================
 * SDH TĚCHONÍN – Hlavní stylesheet webu (id_serveru = 172)
 * Verze: 2.0 | Design: Bílo-šedo-červený hasičský
 * Technická specifikace dle system_rules.md, multiserver_widgets.md & update-check.md
 * =====================================================================
 */

/* -----------------------------------------------------------------------
 * 1. DESIGN TOKENY A CSS PROMĚNNÉ
 * ----------------------------------------------------------------------- */
:root {
    /* Primární barva – Hasičská červená */
    --color-primary:       #D32F2F;
    --color-primary-dk:    #B71C1C;
    --color-primary-lt:    #FF5252;
    --color-primary-bg:    #FFF5F5;

    /* Sekundární barva – Tmavá grafitová / slate */
    --color-secondary:     #1A1D20;
    --color-secondary-light:#2D3238;

    /* Akcentní barva ohně / plamene */
    --color-accent:        #FF9800;
    --color-accent-dark:   #F57C00;

    /* Textové barvy */
    --color-text:          #212529;
    --color-text-muted:    #6C757D;
    --color-text-light:    #FFFFFF;

    /* Pozadí sekcí */
    --color-bg:            #FFFFFF;
    --bg-accent-1:         #F4F6F8;
    --bg-accent-2:         #E9ECEF;
    --bg-dark:             #1A1D20;

    /* Rámečky */
    --color-border:        #E0E6ED;
    --color-border-red:    #D32F2F;

    /* Stíny a efekt skla */
    --shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
    --shadow-md:  0 6px 20px rgba(0,0,0,0.09);
    --shadow-lg:  0 12px 35px rgba(0,0,0,0.14);
    --shadow-red: 0 6px 20px rgba(211,47,47,0.22);

    /* Zaoblení */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Typografie */
    --font-heading: 'Outfit', 'Montserrat', 'Segoe UI', sans-serif;
    --font-body:    'Open Sans', 'Segoe UI', Tahoma, sans-serif;

    /* Výška navbaru pro scroll kompenzaci */
    --navbar-height: 72px;
}

/* -----------------------------------------------------------------------
 * 2. ZÁKLADNÍ PRVKY A POVINNÉ ADMIN ODSAZENÍ
 * ----------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

/* Custom container s max-width 1600px pro top-bar a navbar */
.container-custom {
    width: 100%;
    max-width: 1600px !important;
    margin-right: auto;
    margin-left: auto;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
}

/* POVINNÉ: Odsazení pro přihlášeného admina dle system_rules.md sekce 7C */
body.admin-logged-in {
    padding-top: 152px !important;
}

body.admin-logged-in [id]::before {
    content: '';
    display: block;
    height: 152px;
    margin-top: -152px;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6, .brand-title {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-secondary);
}

h1 { font-size: 2.75rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.35rem; }
h5 { font-size: 1.15rem; }
h6 { font-size: 1rem; }

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: var(--color-primary-dk);
    text-decoration: none;
}

.text-hasici-red { color: var(--color-primary) !important; }
.text-hasici-gold { color: var(--color-accent) !important; }

/* -----------------------------------------------------------------------
 * 3. HORNÍ INFORMAČNÍ LIŠTA (Top Bar)
 * ----------------------------------------------------------------------- */
.top-bar {
    background-color: var(--color-secondary);
    color: #E0E0E0;
    font-size: 0.88rem;
    border-bottom: 3px solid var(--color-primary);
}

.top-bar a {
    color: #E0E0E0;
}

.top-bar a:hover {
    color: #FFFFFF;
}

.top-emergency-badge {
    background-color: var(--color-primary);
    color: #FFFFFF !important;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 0 10px rgba(211,47,47,0.4);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0% { box-shadow: 0 0 0 0 rgba(211,47,47,0.5); }
    70% { box-shadow: 0 0 0 8px rgba(211,47,47,0); }
    100% { box-shadow: 0 0 0 0 rgba(211,47,47,0); }
}

.social-icon-fb, .social-icon-ig {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #FFF !important;
    font-size: 0.85rem;
    transition: transform 0.2s;
}

.social-icon-fb { background-color: #3b5998; }
.social-icon-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.social-icon-fb:hover, .social-icon-ig:hover { transform: scale(1.1); }

/* -----------------------------------------------------------------------
 * 4. NAVIGACE A MEGAMENU (System Rules & Update Check)
 * ----------------------------------------------------------------------- */
.hlavni-navbar {
    background-color: #FFFFFF;
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 1rem;
    transition: background 0.3s;
}

.brand-emblem {
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: #FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: var(--shadow-red);
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--color-secondary);
    line-height: 1;
    display: block;
}

.brand-subtitle {
    font-size: 0.78rem;
    color: var(--color-primary);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
}

.hlavni-navbar .nav-link {
    color: var(--color-secondary) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

/* Skrytí výchozí Bootstrap trojúhelníkové šipky pro zachování pouze FontAwesome ikony */
.hlavni-navbar .dropdown-toggle::after,
.nav-link.dropdown-toggle::after,
.dropdown-toggle::after {
    display: none !important;
}

.hlavni-navbar .nav-link:hover,
.hlavni-navbar .nav-item.active .nav-link {
    color: var(--color-primary) !important;
    background-color: var(--color-primary-bg);
}

/* POVINNÉ: Styly pro Megamenu & Jednoduché menu z update-check.md a system_rules.md */
@media (min-width: 992px) {
    #zahlavi_menu {
        position: relative;
    }
    .navbar-nav {
        position: static !important;
    }
    .mega-dropdown {
        position: static !important;
    }
    .mega-menu-content {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background-color: var(--color-secondary) !important;
        border-top: 3px solid var(--color-primary);
        display: block;
        visibility: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        z-index: 1000;
        position: absolute;
        box-shadow: var(--shadow-lg);
        padding: 1.5rem;
    }
    .menu-trigger-hover .mega-dropdown:hover > .mega-menu-content,
    .mega-dropdown.show > .mega-menu-content {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }

    /* Rotace šipek v menu při hover / show / collapse */
    .style-icon, .submenu-arrow, .l3-toggle-box i {
        display: inline-block;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        font-size: 0.8em;
        margin-left: 0.35rem;
    }

    .nav-item.dropdown:hover > .nav-link .style-icon,
    .nav-item.dropdown.show > .nav-link .style-icon,
    .nav-item.dropdown .dropdown-toggle[aria-expanded="true"] .style-icon {
        transform: rotate(180deg) !important;
    }

    .dropdown-submenu:hover .submenu-arrow,
    .dropdown-submenu.show-l3 .submenu-arrow,
    .l3-toggle-box[aria-expanded="true"] .submenu-arrow {
        transform: rotate(180deg) !important;
    }

    /* Flyout rozbalovací menu 2. úrovně */
    .simple-dropdown .dropdown-menu {
        min-width: 260px;
        padding: 0.5rem 0;
        background: linear-gradient(180deg, #1C2024 0%, #14171A 100%) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-top: 3px solid var(--color-primary) !important;
        border-radius: 0 0 10px 10px !important;
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35) !important;
        margin-top: 0;
        transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
        transform: translateY(6px);
    }

    .menu-trigger-hover .simple-dropdown:hover > .dropdown-menu,
    .simple-dropdown.show > .dropdown-menu,
    .nav-item.dropdown:hover > .dropdown-menu {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: translateY(0);
    }

    .simple-dropdown .dropdown-item-wrapper {
        position: relative;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    }

    .simple-dropdown .dropdown-item-wrapper:last-child {
        border-bottom: none;
    }

    .simple-dropdown .simple-l2-link {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.75rem 1.35rem;
        color: #E2E8F0 !important;
        font-weight: 500;
        font-size: 0.93rem;
        text-decoration: none !important;
        transition: all 0.2s ease;
        position: relative;
        background: transparent;
    }

    .simple-dropdown .simple-l2-link:hover,
    .simple-dropdown .dropdown-item-wrapper:hover > .l2-simple-container > .simple-l2-link {
        color: #FFFFFF !important;
        background-color: rgba(211, 47, 47, 0.18) !important;
        padding-left: 1.65rem;
    }

    .simple-dropdown .simple-l2-link::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background-color: var(--color-primary);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .simple-dropdown .simple-l2-link:hover::before,
    .simple-dropdown .dropdown-item-wrapper:hover > .l2-simple-container > .simple-l2-link::before {
        opacity: 1;
    }

    .simple-dropdown .l3-toggle-box {
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        padding: 0.6rem 0.9rem;
        cursor: pointer;
        transition: color 0.2s ease;
    }

    .simple-dropdown .l3-toggle-box:hover,
    .simple-dropdown .dropdown-item-wrapper:hover .l3-toggle-box {
        color: #FFFFFF;
    }

    .simple-dropdown .dropdown-submenu {
        position: relative;
    }

    .simple-dropdown .dropdown-submenu .simple-l3-list {
        position: absolute;
        top: 0;
        left: 100%;
        min-width: 220px;
        background: #212529 !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-left: 3px solid var(--color-primary) !important;
        border-radius: 0 8px 8px 8px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
        display: none;
        padding: 0.4rem 0;
    }

    .simple-dropdown .dropdown-submenu:hover .simple-l3-list,
    .simple-dropdown .dropdown-submenu.show-l3 .simple-l3-list {
        display: block !important;
    }

    .simple-dropdown .simple-l3-link {
        display: block;
        padding: 0.55rem 1.15rem;
        color: #CBD5E1 !important;
        font-size: 0.88rem;
        font-weight: 500;
        text-decoration: none !important;
        transition: all 0.2s ease;
    }

    .simple-dropdown .simple-l3-link:hover {
        color: #FFFFFF !important;
        background-color: rgba(211, 47, 47, 0.15) !important;
        padding-left: 1.45rem;
    }
}

@media (max-width: 991px) {
    .mega-menu-content {
        display: none;
        background-color: var(--color-secondary-light);
    }
    .mega-dropdown.show .mega-menu-content {
        display: block;
    }
}

/* -----------------------------------------------------------------------
 * 5. HERO SEKCE A CAROUSEL
 * ----------------------------------------------------------------------- */
.hero-section {
    position: relative;
    overflow: hidden;
    background-color: var(--color-secondary);
}

.hero-section .carousel-item {
    height: 72vh;
    min-height: 520px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(26,29,32,0.7) 0%, rgba(26,29,32,0.85) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background-color: rgba(211,47,47,0.25);
    color: #FF8A8A;
    border: 1px solid rgba(211,47,47,0.5);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 30px;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-badge-fire {
    background-color: rgba(255,152,0,0.25);
    color: #FFB74D;
    border-color: rgba(255,152,0,0.5);
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-description {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.88);
    max-width: 720px;
    margin-bottom: 2.25rem;
}

/* Tlačítka sboru */
.btn-hasici {
    background-color: var(--color-primary);
    color: #FFFFFF !important;
    font-weight: 700;
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-primary);
    transition: all 0.25s ease;
}

.btn-hasici:hover {
    background-color: var(--color-primary-dk);
    border-color: var(--color-primary-dk);
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

.btn-hasici-outline {
    background-color: #FFFFFF;
    color: var(--color-primary) !important;
    font-weight: 700;
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease;
}

.btn-hasici-outline:hover {
    background-color: var(--color-primary);
    color: #FFFFFF !important;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-red);
}

/* Na tmavé hero sekci zachovat světlou verzi outline tlačítka */
.hero-section .btn-hasici-outline {
    background-color: rgba(255, 255, 255, 0.1);
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF;
    box-shadow: none;
}

.hero-section .btn-hasici-outline:hover {
    background-color: #FFFFFF;
    color: var(--color-secondary) !important;
    border-color: #FFFFFF;
    transform: translateY(-2px);
}

/* -----------------------------------------------------------------------
 * 6. STATISTIKY A KLÍČOVÉ KARTY
 * ----------------------------------------------------------------------- */
.sekce-stats {
    background-color: var(--bg-accent-1);
    border-bottom: 1px solid var(--color-border);
}

.stat-card {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--color-primary);
    transition: transform 0.25s, box-shadow 0.25s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2.2rem;
}

.stat-cislo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-secondary);
    line-height: 1;
}

.stat-popis {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* -----------------------------------------------------------------------
 * 7. AKTUALITY KARTY A DYNAMICKÉ TŘÍDY BARVA1-5 (System Rules 3)
 * ----------------------------------------------------------------------- */
.subheading-badge {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-primary);
    display: block;
    margin-bottom: 0.4rem;
}

.card-novinka {
    background: #FFFFFF;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
}

.card-novinka:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-lt);
    transform: translateY(-4px);
}

/* Hasičská sekční themathing (barva1-5) */
.barva1 { border-top: 4px solid var(--color-primary) !important; }
.barva2 { border-top: 4px solid var(--color-secondary) !important; }
.barva3 { border-top: 4px solid var(--color-accent) !important; }
.barva4 { border-top: 4px solid #1976D2 !important; }
.barva5 { border-top: 4px solid #8E0000 !important; }

.admin-edit-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    padding: 4px 8px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

/* -----------------------------------------------------------------------
 * 8. EMERGENCY BANNER & PODSTRÁNKY
 * ----------------------------------------------------------------------- */
.sekce-emergency {
    background: linear-gradient(135deg, #B71C1C 0%, #D32F2F 100%);
    position: relative;
    overflow: hidden;
}

.btn-emergency-lg {
    font-size: 1.25rem;
    font-weight: 800;
    padding: 0.85rem 2rem;
    border-radius: 40px;
    letter-spacing: 0.5px;
}

.subpage-header-banner {
    background-image: url('/obrazky/slide/slide1.jpg');
    background-size: cover;
    background-position: center;
    position: relative;
    border-bottom: 4px solid var(--color-primary);
}

/* -----------------------------------------------------------------------
 * 9. RESPONSIVE A SPOLEČNÉ UPLIKACE
 * ----------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-title { font-size: 2.1rem; }
    .hero-description { font-size: 1rem; }
    .hero-section .carousel-item { height: 60vh; min-height: 440px; }
}

.scroll-top-wrapper {
    position: fixed;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    text-align: center;
    z-index: 9999;
    background-color: var(--color-primary);
    color: #FFFFFF;
    width: 44px;
    height: 44px;
    line-height: 44px;
    right: 25px;
    bottom: 25px;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.scroll-top-wrapper.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top-wrapper:hover {
    background-color: var(--color-primary-dk);
    transform: scale(1.1);
}

/* -----------------------------------------------------------------------
 * 10. PREMIUM STYLY KARET NOVINEK A ARCHIVU
 * ----------------------------------------------------------------------- */
.news-card,
.news-card-premium {
    background: #FFFFFF;
    border-radius: 14px !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06) !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.news-card:hover,
.news-card-premium:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(211, 47, 47, 0.15) !important;
    border-color: rgba(211, 47, 47, 0.3) !important;
}

.news-img-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: var(--color-secondary);
}

.news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-card:hover .news-img-wrapper img,
.news-card-premium:hover .news-img-wrapper img {
    transform: scale(1.06);
}

.news-content {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.6rem;
    color: var(--color-secondary);
    transition: color 0.2s ease;
}

.news-card:hover .news-title,
.news-card-premium:hover .news-title {
    color: var(--color-primary);
}

.karta-kategorie {
    background-color: var(--color-primary) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    text-transform: uppercase;
}

.news-meta {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.news-perex {
    font-size: 0.92rem;
    color: #4A5568;
    line-height: 1.6;
    flex-grow: 1;
}

.news-btn-corner,
.btn-main {
    background-color: var(--color-primary) !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    padding: 0.45rem 1.2rem !important;
    border-radius: 8px !important;
    border: none !important;
    transition: all 0.2s ease !important;
}

.news-btn-corner:hover,
.btn-main:hover {
    background-color: var(--color-primary-dk) !important;
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.35) !important;
}

.admin-edit-corner {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

/* Náhledové obrázky pro archiv novinek v nastenka.php */
.news-card-image-wrapper {
    position: relative;
    min-height: 180px;
    height: 100%;
    overflow: hidden;
    background-color: var(--color-secondary);
    border-radius: 14px 0 0 14px;
}

.news-card-archive-img {
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.news-card-premium:hover .news-card-archive-img {
    transform: scale(1.06);
}

@media (max-width: 767px) {
    .news-card-image-wrapper {
        border-radius: 14px 14px 0 0;
        height: 200px;
        min-height: 200px;
    }
}
