/*
Theme Name: Osmerova Child
Theme URI: https://kadence-theme.com/
Version: 1.0.0
Description: Child theme for Kadence Theme
Author: Kadence WP
Author URI: https://kadence-theme.com/
Template: kadence
*/

:root {
    --global-palette3: #333739 !important; /* pouzite na H titulky */
}

body.wp-child-theme-osmerova {
    background: #fff !important;
}

body.wp-child-theme-osmerova a {
    color: var(--osm-cerulean, #0073aa);
}

body.wp-child-theme-osmerova #wrapper {
    height: 100%;
}

body.wp-child-theme-osmerova b, body.wp-child-theme-osmerova strong {
    font-weight: 400;
}

body.wp-child-theme-osmerova body, body.wp-child-theme-osmerova input, body.wp-child-theme-osmerova select, body.wp-child-theme-osmerova optgroup, body.wp-child-theme-osmerova textarea {
    color: black;
}

.content-bg, body.content-style-unboxed .site, #wrapper.site.wp-site-blocks {
    background: var(--osm-morning-mist-20) !important;
}


body.wp-child-theme-osmerova .osmerova-hero-section h1.about-me-title,
body.wp-child-theme-osmerova .osmerova-hero-section-advanced h1.about-me-title,
body.wp-child-theme-osmerova .osmerova-uni-section h1.contact-subtitle {
    max-width: 64rem;
}

body.wp-child-theme-osmerova .osmerova-uni-section.is-mode-standard.contact-hero .osmerova-uni-content-narrow {
    max-width: 54rem;
}

body.wp-child-theme-osmerova header#masthead {
    z-index: 1000; /* Ensure header stays on top of mega menu */
}

body.wp-child-theme-osmerova header#masthead #main-header .site-container {
    max-width: none;
}

body.wp-child-theme-osmerova header#masthead #main-header .header-navigation .menu {
    gap: 1rem;
}

body.wp-child-theme-osmerova header#masthead #main-header .header-navigation .menu .osmerova-cta-btn__label {
    letter-spacing: 0.03em;
}

body.wp-child-theme-osmerova header#masthead #main-header .secondary-navigation .secondary-menu-container > ul > li.menu-item > a {
    display: flex;
}

body.wp-child-theme-osmerova header#masthead #main-header ul#primary-menu > li.current_page_item .osmerova-cta-btn .underline-hover {
    transform: scaleX(1);
}

/* =========================================
   Custom Footer Styles
   ========================================= */

body.wp-child-theme-osmerova .site-footer {
    background: var(--osm-morning-mist-33);
    padding-top: 10rem;
    padding-bottom: 2rem;
    width: 100%;
    position: relative;
    z-index: 10; /* Ensure it sits above fixed elements if any */
}

body.wp-child-theme-osmerova .site-footer__container {
    margin: 0 5vw;
}

/* --- Grid Layout --- */
body.wp-child-theme-osmerova .site-footer__grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile default */
    gap: 3rem;
    margin-bottom: 6rem;
}

@media (min-width: 768px) {
    body.wp-child-theme-osmerova site-footer__grid {
        grid-template-columns: 1fr 1fr; /* Tablet */
        gap: 4rem;
    }
}

@media (min-width: 1024px) {
    body.wp-child-theme-osmerova .site-footer__grid {
        /* Desktop: 1st column is 2fr, others 1fr */
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 3rem;
    }
}

/* --- Typography & Elements --- */

body.wp-child-theme-osmerova .footer-heading {
    text-transform: uppercase;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: #000;
}

/* Email Link */
body.wp-child-theme-osmerova .footer-email-link {
    font-family: 'Merchant', serif; /* Ensure this font is loaded */
    font-size: var(--osm-h2-size, 2.2rem);
    font-weight: var(--osm-h2-weight, 300);
    line-height: 1.1;
    color: #000;
    text-decoration: none;
    display: block;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

@media (min-width: 1024px) {
    body.wp-child-theme-osmerova .footer-email-link {
        font-size: 3rem;
    }
}

body.wp-child-theme-osmerova .footer-email-link:hover {
    color: var(--osm-cerulean, #0073aa);
}

/* Description Text */
body.wp-child-theme-osmerova .footer-desc {
    font-family: 'Figtree', sans-serif;
    font-size: 0.9rem;
    color: #333;
    max-width: 400px;
    line-height: 1.6;
}

/* Address & Contact */
body.wp-child-theme-osmerova .footer-address {
    font-family: 'Figtree', sans-serif;
    font-size: 0.9rem;
    color: #333;
    font-style: normal;
    line-height: 1.6;
}

body.wp-child-theme-osmerova .footer-address a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

body.wp-child-theme-osmerova .footer-address a:hover {
    text-decoration: underline;
}

/* Navigation */
body.wp-child-theme-osmerova .footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.wp-child-theme-osmerova .footer-nav-list li {
    margin-bottom: 0.75rem;
}

body.wp-child-theme-osmerova .footer-nav-list a {
    font-family: 'Figtree', sans-serif;
    font-size: 0.9rem;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.wp-child-theme-osmerova .footer-nav-list a:hover {
    color: var(--osm-cerulean, #0073aa);
}

/* Hours */
body.wp-child-theme-osmerova .footer-hours {
    font-family: 'Figtree', sans-serif;
    font-size: 0.9rem;
    color: #333;
}

/* --- Bottom Bar --- */
body.wp-child-theme-osmerova .site-footer__bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /*border-top: 1px solid rgba(0,0,0,0.1);*/
    padding-top: 2rem;
    color: #888;
    font-size: 0.8rem;
    font-family: 'Figtree', sans-serif;
    gap: 1rem;
}

@media (min-width: 768px) {
    body.wp-child-theme-osmerova .site-footer__bottom {
        flex-direction: row;
        align-items: center;
    }
}

/* =========================================
   Mega Menu Styles (Decoupled Overlay)
   ========================================= */

.osmerova-mm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 899; /* Between page and menu */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.osmerova-mm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 30vh; /* Ensure enough height */
    z-index: 900; /* Below header (1000) but above content */
    visibility: hidden; /* Hidden initially for GSAP */
    clip-path: inset(0 0 100% 0); /* Initial curtain state */

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    background: linear-gradient(var(--osm-morning-mist-33), var(--osm-morning-mist-20)), white;
}

body.wp-child-theme-osmerova .osmerova-mm-container {
    width: 100%;
    margin: 0 auto;
    padding-top: 6rem; /* Push content below header */
    padding-bottom: 3rem;

    /* Grid Layout for Split View */
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 768px) {
    body.wp-child-theme-osmerova .osmerova-mm-container {
        grid-template-columns: 40% 60%; /* Menu Left, Image Right */
        gap: 4rem;
    }
}

/* Menu Column */
body.wp-child-theme-osmerova .osmerova-mm-col-menu {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

body.wp-child-theme-osmerova .osmerova-mm-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

body.wp-child-theme-osmerova .osmerova-mm-list li {
    width: 100%;
    text-align: left;
}

body.wp-child-theme-osmerova .osmerova-mm-list li a {
    font-family: var(--osm-h3-family);
    font-size: var(--osm-h3-size);
    font-weight: var(--osm-h3-weight);
    color: #000;
    text-decoration: none;
    padding: 0.5rem 2rem;
    display: inline-block;
    transition: color 0.3s ease;
}

body.wp-child-theme-osmerova .osmerova-mm-list li a:hover {
    color: var(--osm-cerulean, #0073aa);
}

/* Image Column */
body.wp-child-theme-osmerova .osmerova-mm-col-image {
    display: none !important; /* Hidden - not used by default */
    height: 450px;
    align-items: center;
    justify-content: center;
    position: relative;
}

@media (min-width: 768px) {
    body.wp-child-theme-osmerova .osmerova-mm-col-image {
        display: flex;
    }
}

.mm-image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#osmerova-mm-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0; /* Hidden initially, handled by JS */
}

body.wp-child-theme-osmerova.post-template-default.single-post .content-container.site-container{
    max-width: none;
    margin: 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

body.wp-child-theme-osmerova.post-template-default.single-post .content-area  {
    margin-top: 7rem;
    margin-bottom: 5rem;
}

body.wp-child-theme-osmerova.post-template-default.single-post .content-container.site-container #main {
    max-width: 52rem;
}

body.wp-child-theme-osmerova.post-template-default.single-post .entry.single-entry {
    box-shadow: none;
    background: transparent !important;
}

body.wp-child-theme-osmerova.post-template-default.single-post .entry-header {
    min-height: 40vh;
    justify-content: center;
    display: flex;
    flex-flow: column;
    gap: 2rem;
}

body.wp-child-theme-osmerova.post-template-default.single-post .entry-header .entry-meta {
    display: none;
}

body.wp-child-theme-osmerova.post-template-default.single-post .entry-taxonomies a {
    font-size: var(--osm-h4-size, 1rem);
    font-weight: var(--osm-h4-weight, 500);
    text-transform: uppercase;
    letter-spacing: 0.225rem;
}


body.wp-child-theme-osmerova.post-template-default.single-post .entry-content .wp-block-heading {
    line-height: 1.2;
}

body.wp-child-theme-osmerova.post-template-default.single-post .wp-site-blocks .content-container .post-thumbnail.alignwide {
    margin-left: calc(50% - var(--global-vw, 100vw) / 2) !important;
    margin-right: calc(50% - var(--global-vw, 100vw) / 2) !important;
    max-width: 100vw !important;
    height: 36vh !important;
    padding-bottom: 0;
}


body.wp-child-theme-osmerova.post-template-default.single-post .entry-related {
    background: transparent;
}



body.wp-child-theme-osmerova .popup-drawer .drawer-inner {
    background: linear-gradient(var(--osm-morning-mist-33), var(--osm-morning-mist-20)), white;
    color: black;
}

body.wp-child-theme-osmerova .popup-drawer .drawer-inner .drawer-nav-drop-wrap .drawer-sub-toggle {
    color: black;
}

body.wp-child-theme-osmerova .mobile-menu-container.drawer-menu-container ul#mobile-menu > li:hover > a.osmerova-cta-btn .osmerova-cta-btn__label,
body.wp-child-theme-osmerova .mobile-menu-container.drawer-menu-container ul.sub-menu > li:hover > a.osmerova-cta-btn .osmerova-cta-btn__label {
    color: var(--osm-cerulean, #0073aa);
    transition: color 0.3s ease;
}

body.wp-child-theme-osmerova .mobile-menu-container.drawer-menu-container ul#mobile-menu .osmerova-cta-btn__label {
    font-family: var(--osm-h3-family);
    font-weight: var(--osm-h3-weight);
    font-size: var(--osm-h3-size);
}


body.wp-child-theme-osmerova .mobile-menu-container.drawer-menu-container ul#mobile-menu a.osmerova-cta-btn {
    width: auto;
}

body.wp-child-theme-osmerova .mobile-menu-container.drawer-menu-container ul#mobile-menu a.osmerova-cta-btn .osmerova-cta-btn__underline-container {
    display: none;
}


body.wp-child-theme-osmerova section.osmerova-uni-section.contact-hero {
    padding-top: 12rem;
}


/* =========================================
   Mobile Menu Focus Mode & Desktop Fix
   ========================================= */

body.wp-child-theme-osmerova .mobile-menu-container .osmerova-mega-menu-trigger .sub-menu a.osmerova-cta-btn {
    padding-left: 0;
    padding-right: 0;
    width: auto;
}

body.wp-child-theme-osmerova section.osmerova-uni-section.contact-hero {
    padding-top: 12rem;
}


/* =========================================
   Mobile Menu Focus Mode & Desktop Fix
   ========================================= */

/* 1. Hide Standard Dropdown on Desktop */
@media (min-width: 1024px) {
    .osmerova-mega-menu-trigger .sub-menu {
        display: none !important;
    }
}

/* 2. Mobile Focus Mode & Submenu Overrides */
@media (max-width: 1023px) {
    /* When the menu is focused (a submenu is open) */
    .mobile-menu-focused > li:not(.is-active-focus) {
        opacity: 0.2;
        transition: opacity 0.3s ease;
        filter: grayscale(100%);
    }

    /* The active item stays fully visible */
    .mobile-menu-focused > li.is-active-focus {
        opacity: 1;
    }

    /* Force Submenu to be present but hidden for GSAP */
    .mobile-menu-container .osmerova-mega-menu-trigger .sub-menu {
        display: block !important;
        height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: none !important; /* Disable theme transitions */
    }

    /* Toggle Button Hover State */
    .mobile-menu-container .osmerova-mega-menu-trigger:hover .drawer-sub-toggle {
        color: var(--osm-cerulean, #0073aa);
    }

    /* Hide default drawer toggle for our custom trigger */
    .mobile-menu-container .osmerova-mega-menu-trigger .drawer-sub-toggle {
        display: none !important;
    }
}


/* =========================================
   Global Preloader
   ========================================= */

.osmerova-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(var(--osm-morning-mist-33), var(--osm-morning-mist-20)), white;
    z-index: 999999; /* Highest priority */
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   NEW Custom Single Post Template Styles
   (Mapped from original .single-post preferences)
   ========================================= */

/* 1. Hero Section (Full Width) */
.osmerova-single-hero {
    width: 100vw;
    position: relative;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    height: 45vh;
    overflow: hidden;
    margin-bottom: 4rem;
}

.osmerova-single-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 2. Main Layout Container */
.osmerova-single-article {
    margin-top: 7rem; /* Matches old .content-area */
    margin-bottom: 5rem;
}

.osmerova-content-container {
    max-width: 52rem; /* Matches old #main width preference */
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* 3. Entry Header & Meta */
.osmerova-entry-header {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem; /* Matches old .entry-header */
    justify-content: center;
}

.osmerova-entry-header h1.entry-title {
    line-height: 1.1;
    margin: 0;
}

.osmerova-meta-cats {
    /* Matches old .entry-taxonomies a styles */
    font-size: var(--osm-h4-size, 1rem);
    font-weight: var(--osm-h4-weight, 500);
    text-transform: uppercase;
    letter-spacing: 0.225rem;
    color: var(--osm-cerulean, #0073aa);
}

.osmerova-meta-cats a {
    color: inherit;
    text-decoration: none;
}

.osmerova-meta-date {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    font-family: 'Figtree', sans-serif;
}

/* 4. Content Typography */
.osmerova-content-container .entry-content h2,
.osmerova-content-container .entry-content h3,
.osmerova-content-container .entry-content h4 {
    line-height: 1.2; /* Matches old .wp-block-heading */
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

/* 5. Related Posts Section */
.osmerova-related-section {
    padding: 5rem 0;
    margin-top: 6rem;
}

.osmerova-related-header {
    text-align: center;
    margin-bottom: 6rem;
}

.osmerova-related-title {
    text-align: center;
}

.osmerova-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1200px; /* Wider than text content */
    margin: 0 auto;
    padding: 0 2rem;
}

@media (min-width: 768px) {
    .osmerova-related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

.osmerova-related-card {
    background: var(--osm-morning-mist-33);
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.osmerova-related-card-content {
    gap: 1rem;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    flex: 1;
    justify-content: stretch;
}

.osmerova-related-card .related-thumb-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/10;
    flex: 1;
}

.osmerova-related-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.osmerova-related-card:hover img {
    transform: scale(1.05);
}

.osmerova-related-card h3 {
    margin: 0.5rem 0 0 0;
    font-size: 1.35rem;
    line-height: 1.3;
}

.osmerova-related-card h3 a {
    text-decoration: none;
    color: #000;
}

.related-excerpt {
    color: #555;
    margin-bottom: 1rem;
}

.related-cta {
    margin-top: auto;
}

/* =========================================
   Global Animated Noise (Grain) - Config
   ========================================= */

:root {
    /* 1. HUSTOTA (Density): 0.03 (jemný) - 0.15 (silný) */
    --noise-opacity: 0.6;

    /* 2. FARBA (Color):
       'none'      = Čierny šum (pre svetlé weby)
       'invert(1)' = Biely šum (pre tmavé weby)
    */
    --noise-filter: none;

    /* 3. VEĽKOSŤ (Grain Size): Menšie číslo = jemnejší piesok */
    --noise-size: 200px;

    /* 4. BLEND MODE: 'normal' alebo 'overlay' (pre prirodzené splynutie) */
    --noise-blend: color-burn;


    /* NOVÉ: RÝCHLOSŤ ANIMÁCIE
           0.2s = Veľmi rýchle (digitálny glitch)
           0.5s = Štandard (film)
           1.5s = Pomalé (plávajúci prach)
        */
    --noise-speed: 2s;
}

.osmerova-noise-overlay {
    /*display: none;*/
    position: fixed;
    width: 150%;
    height: 150vh;
    left: -25%;
    top: -25%;

    /*background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");*/


    /* OPTIMALIZÁCIA 3: Návrat k PNG (rýchlejšie pre GPU ako SVG filter) */
    background-image: url("./assets/img/noise-blue-1.png");
    background-repeat: repeat;

    background-size: var(--noise-size);
    animation: bg-animation var(--noise-speed) steps(2) infinite;
    opacity: var(--noise-opacity);
    filter: var(--noise-filter);
    mix-blend-mode: var(--noise-blend);

    visibility: visible;
    pointer-events: none;
    z-index: 999998;

    /* OPTIMALIZÁCIA 2: Hint pre prehliadač */
    will-change: transform;
}

@keyframes bg-animation {
    0% { transform: translate(0,0) }
    10% { transform: translate(-5%,-5%) }
    20% { transform: translate(-10%,5%) }
    30% { transform: translate(5%,-10%) }
    40% { transform: translate(-5%,15%) }
    50% { transform: translate(-10%,5%) }
    60% { transform: translate(15%,0) }
    70% { transform: translate(0,10%) }
    80% { transform: translate(-15%,0) }
    90% { transform: translate(10%,5%) }
    100% { transform: translate(5%,0) }
}

@media (prefers-reduced-motion: reduce) {
    .osmerova-noise-overlay {
        animation: none;
    }
}
