/*
Theme Name: MŠ Korálek
Author: Jan Ráček
Description: Modern responsive theme for kindergarten
Version: 4.1
*/

/* ===== VARIABLES ===== */
:root {
    --primary: #4CAF50;
    --primary-light: #81C784;
    --primary-dark: #388E3C;
    --secondary: #FF9800;
    --secondary-light: #FFB74D;
    --accent: #E91E63;
    --accent-light: #F48FB1;
    --blue: #2196F3;
    --yellow: #FFEB3B;
    --light: #f8f9fa;
    --dark: #333;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 20px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
    --border-radius: 16px;

    /* Bead colours matching the logo dots */
    --bead-green1: #3CC84A;
    --bead-yellow: #FFD600;
    --bead-orange: #FF6B00;
    --bead-purple: #7B1FA2;
    --bead-blue: #2196F3;
    --bead-green2: #4CAF50;
}

/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Nunito", sans-serif;
    color: var(--dark);
    line-height: 1.6;
    /* padding-top set by header block below */
    background: #f8f9fa;
    overflow-x: hidden;
}

.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* =====================================================
   HEADER – complete rewrite v4.1
   Layout (top→bottom):
   1. header-top       : white bar, logo left-aligned
   2. header-green-section : green painted bg, full width
      └ site-navbar    : white rounded pill card, floated on top
   3. header-vlna      : white strip with the bead-wave image
   ===================================================== */

.site-header {
    position: relative;
    width: 100%;
    z-index: 1000;
    background: #fff;
}

/* ---- 1. WHITE LOGO BAR ---- */
.header-top {
    background: #ffffff;
    padding: 20px 0;
    width: 100%;
}

.header-top-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

.header-logo-link {
    display: block !important;
    margin: 0 auto !important;
    max-width: 100%;
    text-decoration: none !important;
}

.header-logo-img {
    display: block;
    height: 140px;
    width: auto;
    max-width: 100%;
    margin: 0 auto !important;
    object-fit: contain;
}

/* ---- 2. GREEN SECTION ---- */
.header-green-section {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100px;
    padding: 30px 0 50px;
    z-index: 50;
}

/* ---- NAVBAR — white rounded card ---- */
.site-navbar {
    position: relative;
    z-index: 100;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.site-navbar-inner {
    background: #ffffff !important;
    border-radius: 60px !important;
    padding: 6px 30px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 60px;
}

/* Nav list reset - target top level and nested items distinctly */
.navbar-nav, 
.navbar-nav ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-indent: 0 !important;
}

.navbar-nav li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.navbar-nav li::before,
.navbar-nav li::after {
    content: none !important;
    display: none !important;
}

.navbar-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
}

/* Top-level Nav Item */
.navbar-nav > .nav-item {
    position: relative !important;
    display: block !important;
}

.nav-link {
    color: var(--dark) !important;
    font-weight: 700 !important;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    transition: var(--transition) !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    white-space: nowrap;
    font-size: 1.05rem;
    position: relative;
    z-index: 101;
}

.nav-link:hover,
.nav-link.show,
.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
}

/* Dropdown specific styling */
.dropdown-menu {
    position: absolute !important;
    top: calc(100% - 10px) !important; /* Overlap slightly for better hover bridge */
    left: 50% !important;
    transform: translateX(-50%) translateY(20px) !important;
    min-width: 280px !important;
    max-width: 400px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2) !important;
    padding: 15px !important;
    display: none !important;
    z-index: 1000 !important;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Show on hover for desktop */
@media (min-width: 992px) {
    .nav-item.dropdown:hover > .dropdown-menu {
        display: block !important;
        opacity: 1;
        pointer-events: auto;
        transform: translateX(-50%) translateY(10px) !important;
    }
}

/* The subitems themselves */
.dropdown-item {
    padding: 10px 20px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    color: var(--dark) !important; /* Force visibility */
    background: transparent !important;
    transition: var(--transition) !important;
    display: block !important;
    text-decoration: none !important;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
    white-space: normal !important;
    opacity: 1 !important; /* KILL THE FADEIN ANIMATION HIDDEN STATE */
    animation: none !important; /* KILL THE FADEIN ANIMATION */
    height: auto !important; /* Kill any inherited heights */
}

.dropdown-item:hover {
    background: var(--primary-light) !important;
    color: white !important;
    transform: translateX(5px);
}

/* Dropdown list items - ensure they don't behave like top-level buttons */
.dropdown-menu .nav-item {
    display: block !important;
    width: 100% !important;
    position: static !important;
    height: auto !important;
}

/* Clear indication of subitems */
.dropdown-toggle::after {
    content: "" !important;
    display: inline-block !important;
    width: 0;
    height: 0;
    margin-left: 10px !important;
    vertical-align: middle !important;
    border-top: 6px solid currentColor !important;
    border-right: 5px solid transparent !important;
    border-left: 5px solid transparent !important;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.nav-item.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* Tall list fix */
.dropdown-menu {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.dropdown-menu::-webkit-scrollbar { width: 8px; }
.dropdown-menu::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.dropdown-menu::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 10px; }


/* Hamburger button (hidden on desktop) */
.navbar-toggler {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.navbar-toggler:hover { background: rgba(0,0,0,0.06); }

.toggler-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ---- 3. VLNA DIVIDER ---- */
.header-vlna {
    background: #ffffff;
    line-height: 0;
    overflow: hidden;
    padding: 4px 0;
}

.header-vlna img {
    display: block;
    width: 100%;
    max-height: 46px;
    object-fit: contain;
}

/* ---- BODY OFFSET ----
   logo bar(~124px) + green section(~120px) + vlna(~54px) ≈ 298px
   Tune this after seeing the real render.
*/
body {
    padding-top: 0;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* Large tablet */
@media (max-width: 1199px) {
    .header-logo-img { height: 85px; }
    .nav-link { padding: 9px 14px !important; font-size: 0.9rem; }
}

/* Tablet */
@media (max-width: 991px) {
    /* padding removed */

    .header-logo-img { height: 75px; }

    .navbar-toggler { display: flex; }

    .navbar-menu {
        display: none;
        position: absolute;
        top: calc(100% + 8px);
        left: 0;
        right: 0;
        background: white;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        padding: 12px;
        z-index: 200;
    }

    .navbar-menu.open { display: block; }

    .navbar-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .nav-link {
        padding: 12px 16px !important;
        justify-content: space-between;
    }

    .dropdown-menu {
        position: static;
        display: none; /* Controlled by JS on mobile */
        box-shadow: none !important;
        border-radius: 8px !important;
        border-left: 3px solid var(--primary) !important;
        margin: 4px 0 4px 12px !important;
        padding: 4px !important;
        width: auto !important;
        min-width: 0 !important;
    }

    .nav-item.dropdown:hover > .dropdown-menu {
        display: none !important; /* Disable hover on mobile */
    }

    .header-green-section { padding-bottom: 10px; }

}

/* Mobile */
@media (max-width: 767px) {
    /* padding removed */
    .header-top { padding: 10px 0 8px; }
    .header-top-inner { padding: 0 15px; }
    .header-logo-img { height: 65px; }

    .site-navbar { margin-top: 6px; }
    .site-navbar-inner { border-radius: 30px; padding: 6px 14px; }
    .header-vlna img { max-height: 36px; }
}

/* Small mobile */
@media (max-width: 575px) {
    /* padding removed */
    .header-logo-img { height: 55px; }

    .header-vlna img { max-height: 28px; }
}

/* ===== HERO SLIDER ===== */
.hero-slider { margin-top: 0; }

.slider-container {
    position: relative;
    height: 500px;
    overflow: hidden;
}

/* Slick arrows */
.slick-prev, .slick-next {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    z-index: 10;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.75);
    border: none; font-size: 0;
    cursor: pointer; transition: var(--transition);
}
.slick-prev:hover, .slick-next:hover { background: rgba(255,255,255,0.95); }
.slick-prev { left: 20px; }
.slick-next { right: 20px; }
.slick-prev:before { font-family: 'Font Awesome 5 Free'; font-weight: 900; font-size: 22px; color: var(--primary); content: '\f053'; }
.slick-next:before { font-family: 'Font Awesome 5 Free'; font-weight: 900; font-size: 22px; color: var(--primary); content: '\f054'; }

/* Slick dots */
.slick-dots {
    position: absolute; bottom: 20px;
    display: flex; justify-content: center;
    width: 100%; list-style: none;
    padding: 0; margin: 0;
}
.slick-dots li { margin: 0 5px; }
.slick-dots button {
    font-size: 0; width: 12px; height: 12px;
    border-radius: 50%; border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer; transition: var(--transition);
}
.slick-dots button:hover,
.slick-dots li.slick-active button {
    background: white; transform: scale(1.2);
}

/* Individual slide */
.slide {
    position: relative;
    outline: none;
    height: 500px;
}

.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.65);
    z-index: 1;
}

.slide-link {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.slide-content {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    width: 90%;
    max-width: 800px;
}

/* White card inside slide (thumbnail + title) */
.slide-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.95);
    border-radius: var(--border-radius);
    padding: 16px 20px 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    max-width: 220px;
    transition: var(--transition);
}

.slide-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}

.slide-thumb {
    width: 180px;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    display: block;
}

.slide-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
    text-align: center;
}

/* Default slide (no posts) */
.slide-card--default {
    max-width: 500px;
    background: rgba(255,255,255,0.9);
    padding: 30px 40px;
}

.slide-card--default .slide-title {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-dark);
}

.slide-subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
}

.slide-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}
.slide-btn:hover { background: var(--primary-dark); color: white; }

/* ===== FOOTER ===== */
.site-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 50px 0 25px;
    margin-top: 60px;
    position: relative;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 10px;
    background: linear-gradient(90deg, var(--bead-green1), var(--bead-yellow), var(--bead-orange), var(--bead-purple), var(--bead-blue), var(--bead-green2));
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.footer-logo-container { flex: 0 0 200px; text-align: center; }

.footer-logo {
    width: 150px; height: auto;
    border-radius: 50%;
    background: white; padding: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: var(--transition);
}

.footer-logo:hover { transform: rotate(8deg) scale(1.05); }

.footer-info { flex: 1; min-width: 350px; text-align: center; }
.footer-title { font-size: 1.8rem; margin-bottom: 20px; font-weight: 700; }

.footer-contact p {
    margin-bottom: 10px; font-size: 1.1rem;
    display: flex; justify-content: center;
    align-items: center; gap: 10px;
}

.footer-copyright {
    margin-top: 30px; padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center; font-size: 0.9rem; opacity: 0.8;
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 991px) {
    /* padding removed */

    .slider-container { height: 400px; }
    .slide-content { padding: 25px; }

    .sidebar { margin-top: 30px; }
    .content-card { padding: 30px; }

    .archive-post-card .row,
    .search-result-card .row { flex-direction: column; }

    .post-thumbnail { min-height: 250px; }
    .search-result-thumbnail { min-height: 200px; margin-bottom: 15px; }
}

/* Mobile large */
@media (max-width: 767px) {
    /* padding removed */

    .header-top { padding: 12px 0 0; }
    .header-container { padding: 0 15px; justify-content: center; }

    .slick-dots { bottom: -57px; }
    .slide-content { top: 35%; }

    .result-meta,
    .post-meta { flex-direction: column; gap: 8px; }

    .suggestions { flex-direction: column; align-items: center; }
    .search-pagination .nav-links { flex-wrap: wrap; }
    .archive-pagination ul { flex-wrap: wrap; }

    .footer-content { flex-direction: column; text-align: center; gap: 30px; }
    .footer-logo-container { margin-bottom: 15px; }
    .footer-info { min-width: auto; }
    .footer-contact p { justify-content: center; }
}

/* Mobile small */
@media (max-width: 575px) {
    /* padding removed */

    .slider-container { height: 350px; }

    .slide-content { padding: 20px; }

    .content-card { padding: 20px 15px; }
    .page-title { font-size: 1.8rem; }
    .sidebar { padding: 20px; }
    .widget-title { font-size: 1.3rem; }

    .navbar-toggler { width: 40px; height: 40px; top: -38px; }
}

/* ===== ANIMATIONS ===== */
.content-card, .sidebar, .slide {
    animation: fadeUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.widget li, .dropdown-item {
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
}

.widget li:nth-child(1) { animation-delay: 0.1s; }
.widget li:nth-child(2) { animation-delay: 0.2s; }
.widget li:nth-child(3) { animation-delay: 0.3s; }
.widget li:nth-child(4) { animation-delay: 0.4s; }
.widget li:nth-child(5) { animation-delay: 0.5s; }
