/* ==========================================================================
   9. Responzivní design a Hamburger Menu
   ========================================================================== */

/* --- Tlačítko Hamburger Menu (skryté na desktopu) --- */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -1.5px;
}

.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
    width: 30px;
    height: 3px;
    background-color: var(--color-secondary);
    border-radius: 4px;
    position: absolute;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.hamburger-inner::before, .hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before { top: -8px; }
.hamburger-inner::after { bottom: -8px; }

/* Animace na křížek, když je menu otevřené (.nav-open je na <body>) */
body.nav-open .hamburger-inner {
    background-color: transparent;
}
body.nav-open .hamburger-inner::before {
    transform: translateY(8px) rotate(45deg);
}
body.nav-open .hamburger-inner::after {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Tablety a menší notebooky (do 992px) --- */
@media (max-width: 1048px) {
    .site-main {
    padding-top: 70px; /* Zvětšeno z 50px */
}

    /* Zobrazení hamburger tlačítka */
    .mobile-menu-toggle {
        display: block;
    }

    /* Hlavička - zachováme vedle sebe logo a hamburger */
    .header-container {
        justify-content: space-between;
        padding-top: 10px;
        padding-bottom: 10px;
		margin: 5px auto 5px auto;
    }
    
    /* Podnadpis loga se na tabletu může zmenšit/skrýt pro úsporu místa */
    .header-headline h3 { font-size: 1.4rem; }
    .header-headline h4 { font-size: 0.75rem; }

    /* Mobilní výsuvný panel navigace */
    .header-right {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 350px;
        height: 100vh;
        background-color: var(--color-bg);
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
        transition: right 0.3s ease-in-out;
        z-index: 999;
        display: flex;
        flex-direction: column;
        padding: 90px 30px 40px;
        overflow-y: auto;
    }

    body.nav-open .header-right {
        right: 0;
    }
    
    body.nav-open {
        overflow: hidden; /* Zamezí scrollování obsahu pod menu */
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .header-element {
        width: 100%;
        border-bottom: 1px solid #eaeaea;
        padding-bottom: 15px;
    }

    .header-action {
        width: 100%;
        margin-top: 10px;
    }
    
    .header-action .btn {
        width: 100%;
        display: block;
    }

    /* Hero sekce - jeden sloupec */
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
        max-width: 650px;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
    .events-grid > .event-card:nth-child(3) {
        display: none;
    }

    .events-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 40px; }
}

@media (max-width: 900px) {
    /* Převrácení pořadí textu a fotky, aby nebyly dvě fotky na mobilu pod sebou */
    .about-split__content { order: -1; }
}

/* --- Mobilní telefony (do 768px) --- */
@media (max-width: 768px) {
    .site-main {
        padding-top: 90px; 
    }
    /* Skrytí podnadpisu u loga pro opravdu malé displeje */
    .header-headline h4 { display: none; }
    
    /* Úpravy paddingů - plošné zmenšení všech obřích mezer na mobilech */
    .hero-section, .events-section, .about-split, .invite-section, 
    .join-hero, .join-target, .join-philosophy, .join-benefits, 
    .join-contact-section, .contact-hero, .contact-content, 
    .gallery-header, .past-events, .about-hero-section, 
    .single-event-header { 
        padding-top: 30px !important; 
        padding-bottom: 30px !important; 
    }

    .hero-content h1 { 
        font-size: 2.2rem; 
        line-height: 1.2;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    .hero-buttons .btn {
        width: 100%;
        display: block;
        padding: 13px 20px;
        font-size: 0.95rem;
        white-space: normal;
        text-align: center;
    }

    .subtitle-badge {
        font-size: 0.7rem;
        padding: 6px 12px;
        letter-spacing: 0.3px;
        margin-bottom: 18px;
    }

    .hero-image {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .hero-image img {
        border-width: 6px;
        border-radius: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .events-grid { grid-template-columns: 1fr; }

    /* Výzva k náboru - blokové zobrazení */
    .invite-box {
        flex-direction: column;
        text-align: center;
        padding: 35px 25px;
        gap: 25px;
    }
    
    .invite-action { width: 100%; }
    .invite-action .btn { display: block; width: 100%; }

    /* Patička - jeden sloupec */
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .footer-col { text-align: center; }
    .social-icons { justify-content: center; }
    .contact-list li { justify-content: center; text-align: center; }
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .events-grid > .event-card:nth-child(3) {
        display: flex;
    }

    /* --- Subpages Responsive Fixes --- */
    /* O nás */
    .about-heading { font-size: 2.2rem; }
    .about-description { margin-bottom: 30px !important; }
    .about-image-wrapper img { height: 300px; }
    .about-image-wrapper::before { height: 40px; top: -10px; }
    
    /* Kontakt */
    .contact-hero h1 { font-size: 2.2rem; }
    .contact-grid { gap: 2rem; }
    .contact-info { text-align: center; }
    .info-list { align-items: center; }
    .info-item { align-items: center; flex-direction: column; text-align: center; gap: 0.5rem; }
    
    /* Galerie & Kalendář */
    .gallery-title, .calendar-header h1 { font-size: 2.2rem; }
    
    /* Nábor */
    .join-title { font-size: 2.2rem; }
    .philosophy-text h2 { font-size: 1.8rem; }
    .target-grid { grid-template-columns: 1fr; }
    
    /* Single Event */
    .single-event-title { font-size: 2.2rem; }
    .single-event-meta { flex-direction: column; gap: 12px; }

    /* Objednat - inline override */
    .page-order .events-grid { grid-template-columns: 1fr !important; }
    .page-order .contact-info-box { text-align: center; }
    .page-order .contact-info-box h2 { font-size: 2rem !important; }
    .page-order .section-header h2 { font-size: 2rem !important; }
    .page-order .contact-form-box { padding: 30px 20px !important; }
    .page-order .join-contact-section,
    .page-order .events-section,
    .page-order .join-philosophy { padding: 40px 0 !important; }
    .page-order .hero-section { padding-bottom: 20px !important; }
    .join-philosophy { padding: 40px 0; }
}

/* --- Malé mobilní telefony (do 480px) --- */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-section {
        padding-top: 15px !important;
        padding-bottom: 25px !important;
    }

    .hero-content h1 {
        font-size: 1.85rem;
        line-height: 1.22;
        margin-bottom: 18px;
    }

    .hero-content p {
        font-size: 0.98rem;
        margin-bottom: 25px;
        max-width: 100%;
    }

    .subtitle-badge {
        font-size: 0.65rem;
        padding: 5px 10px;
        letter-spacing: 0.2px;
        margin-bottom: 15px;
		margin-top: 15px;
    }

    .hero-buttons {
        max-width: 100%;
        gap: 10px;
    }

    .hero-buttons .btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .hero-image img {
        border-width: 5px;
        border-radius: 14px;
    }
}

/* ==========================================================================
   10. UX / UI Vylepšení (Animace, validace, smooth scroll)
   ========================================================================== */

/* Plynulé scrollování pro ukotvené odkazy */
html {
    scroll-behavior: smooth;
}

/* Hover efekty pro karty událostí a galerie */
.event-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Hover efekty pro tlačítka */
.btn {
    transition: all 0.3s ease;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Vizuální označení chybějících povinných políček po odeslání */
.custom-contact-form.was-validated input:invalid,
.custom-contact-form.was-validated textarea:invalid,
.custom-contact-form.was-validated select:invalid {
    border-color: var(--color-primary) !important;
    background-color: rgba(209, 34, 41, 0.05) !important; /* Lehounce zprůhledněná primární červená */
}

/* Tlačítko Zpět nahoru */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary); /* Barva dle šablony */
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    filter: brightness(0.85); /* Mírně ztmaví primární červenou po přejetí */
    transform: translateY(-3px);
}

