/**
 * Custom CSS pro House of Quantum theme
 * Doplňkové styly k theme.json
 */

/* === UTILITY CLASSES (DRY – stín, rotace, pozadí, užší max šířka; 1350px je z WP/theme) === */
.shadow {
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
}

/* 4 typy rotace – recyklovatelné pro celý web */
.rotate-1 { transform: rotate(-1deg); }
.rotate-2 { transform: rotate(1.6deg); }
.rotate-3 { transform: rotate(5deg); }
.rotate-4 { transform: rotate(-4deg); }

/* Zpětná kompatibilita */
.rotate { transform: rotate(2.6deg); }

/* === GLOBAL MODAL (overlay) === */
.hoq-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.hoq-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.hoq-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hoq-modal__dialog {
    max-width: var(--wp--style--global--content-size);
    width: min(90vw, 720px);
    max-height: 90vh;
    overflow-y: auto;
}

.hoq-modal__close {
    margin-left: auto;
    margin-bottom: var(--wp--preset--spacing--x-small);
}

.hoq-modal__close .wp-block-button__link {
    padding: 0;
    line-height: 1;
    background-color: transparent;
    box-shadow: none;
    font-size: 1.5rem;
}

.hoq-modal__body > *:first-child {
    margin-top: 0;
}

.hoq-modal__body > *:last-child {
    margin-bottom: 0;
}

/* Obsah modalů je na frontendu skrytý; v editoru (bez .wp-site-blocks) zůstává viditelný. */
.wp-site-blocks .hoq-modal-source {
    display: none;
}

/* Pozadí: barva z theme.json + textura (tile), multiply. */
.bg-base-0,
.bg-base-1,
.bg-base-2,
.bg-base-3,
.bg-heading-1,
.bg-heading-2,
.bg-heading-3 {
    background-image: url('../images/texture.jpg');
    background-repeat: repeat;
    background-blend-mode: multiply;
}
.bg-base-0 { background-color: var(--wp--preset--color--base-0); }
.bg-base-1 { background-color: var(--wp--preset--color--base-1); }
.bg-base-2 { background-color: var(--wp--preset--color--base-2); }
.bg-base-3 { background-color: var(--wp--preset--color--base-3); }
.bg-heading-1 { background-color: var(--wp--preset--color--heading-1); }
.bg-heading-2 { background-color: var(--wp--preset--color--heading-2); }
.bg-heading-3 { background-color: var(--wp--preset--color--heading-3); }

/* Nadpisy na barevném pruhu – vždy bílý text (DRY: stačí třída .bg-heading-*) */
.bg-heading-1,
.bg-heading-2,
.bg-heading-3 {
    color: var(--wp--preset--color--white);
}

/* Přepis WP tříd has-*-background-color na uloženém obsahu (DB) – naše barvy vyhrávají */
.wp-block-group.bg-base-0 { background-color: var(--wp--preset--color--base-0); }
.wp-block-group.bg-base-1 { background-color: var(--wp--preset--color--base-1); }
.wp-block-group.bg-base-2 { background-color: var(--wp--preset--color--base-2); }
.wp-block-group.bg-base-3 { background-color: var(--wp--preset--color--base-3); }
.wp-block-group.bg-heading-1 { background-color: var(--wp--preset--color--heading-1); }
.wp-block-group.bg-heading-2 { background-color: var(--wp--preset--color--heading-2); }
.wp-block-group.bg-heading-3 { background-color: var(--wp--preset--color--heading-3); }

.constrained {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Otrhaný papír – border-image (recyklovatelná třída, obrázek paper seamles.png) */
.torn-paper {
    background-color: var(--wp--preset--color--base-3);
    background-clip: padding-box;
    border-style: solid;
    border-width: 20px;
    border-color: transparent;
    border-image: url("../images/paper seamles.png") 90 fill round;
}

/* === POZADÍ S GRID PATTERNEM === */
body {
    background-color: var(--wp--preset--color--white);
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MCIgaGVpZ2h0PSI4MCIgdmlld0JveD0iMCAwIDgwIDgwIiBmaWxsPSJub25lIj48bGluZSB5MT0iMTkuNSIgeDI9IjgwIiB5Mj0iMTkuNSIgc3Ryb2tlPSIjRERFN0VEIi8+PGxpbmUgeDE9IjE5LjUiIHkxPSI4MCIgeDI9IjE5LjUiIHkyPSIyLjE4NTU3ZS0wOCIgc3Ryb2tlPSIjRERFN0VEIi8+PGxpbmUgeTE9IjU5LjUiIHgyPSI4MCIgeTI9IjU5LjUiIHN0cm9rZT0iI0RERTdFRCI+PC9saW5lPjxsaW5lIHgxPSI1OS41IiB5MT0iODAiIHgyPSI1OS41IiB5Mj0iMi4xODU1N2UtMDgiIHN0cm9rZT0iI0RERTdFRCI+PC9saW5lPjwvc3ZnPg==");
    background-repeat: repeat;
    background-size: 80px 80px;
    overflow-x: hidden;
}

/* WordPress specifický wrapper */
.wp-site-blocks {
    background-color: transparent;
}

/* === GLOBÁLNÍ TYPOGRAFIE === */
/* H1 - výchozí velikost */
h1, .wp-block-heading h1 {
    font-size: var(--wp--preset--font-size--huge);
    line-height: 1.2;
}

/* H2 – line-height a mezera pod nadpisem */
h2, .wp-block-heading h2 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* Odstavce */
p {
    line-height: 1.3;
}

/* === HEADER === */
/* Header template part - transparentní pozadí (grid / paper z body) */
header.wp-block-template-part {
    background-color: transparent;
}

/* Header group: přepiš WP white background na transparentní jen pro site-header */
header.wp-block-template-part .wp-block-group.site-header.has-white-background-color {
    background-color: transparent !important;
}

/* Header wrapper */
.site-header {
    padding: var(--wp--preset--spacing--small);
}

/* Group s logem a site title - žádný padding */
.site-header > .wp-block-group:first-child {
    padding: 0 !important;
}

/* Site logo - žádný padding */
.wp-block-site-logo {
    padding: 0;
}

/* Navigační položky */
.wp-block-navigation-item a {
    font-size: var(--wp--preset--font-size--small);
    font-weight: 400;
    line-height: 1;
    padding: 10px var(--wp--preset--spacing--small);
    background-color: var(--wp--preset--color--white);
    box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: var(--wp--preset--color--black);
    text-transform: lowercase;
    transition: box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wp-block-navigation-item a:hover {
    background-color: #f1f1f1;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.25);
}

/* Submenu v mobilním/overlay menu – stejné "jedno velké" pozadí jako math sticky note (base-0 + textura + průhlednost) */
#modal-1-content > ul > ul > li > ul {
    z-index: 999;
    margin-top: 20px; /* optická mezera nad první položkou */
    background-color: transparent;
}

#modal-1-content > ul > ul > li > ul::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: url('../images/texture.jpg');
    background-repeat: repeat;
    background-blend-mode: multiply;
    opacity: 0.9;
}

/* Submenu položky (NE hlavní odkazy): bez vlastního papírového pozadí, ať je vidět panel pod nimi */
#modal-1-content > ul > ul > li > ul li a.wp-block-navigation-item__content {
    padding: var(--wp--preset--spacing--small);
    background-color: transparent;
    box-shadow: none;
}

/* Hover submenu: čistě bílý řádek nad papírovým panelem */
/* Hover pouze pro submenu položky */
#modal-1-content > ul > ul > li > ul li a.wp-block-navigation-item__content:hover {
    background-color: var(--wp--preset--color--white);
    color: var(--wp--preset--color--black);
}

/* "Most" pro hover – neviditelný pás pod hlavní položkou s submenu,
   aby při cestě myší dolů mezi linkem a boxem submenu nezmizel :hover */
#modal-1-content > ul > ul > li > a.wp-block-navigation-item__content {
    position: relative;
}

#modal-1-content > ul > ul > li > a.wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -20px;
    height: 20px; /* musí odpovídat margin-top submenu */
    background-color: transparent;
}

#modal-1-content > ul > ul > li > button {
    display: none;
}

/* Footer: navigace bez pozadí a stínu (podle předlohy) */
footer .wp-block-navigation-item a {
    background-color: transparent;
    box-shadow: none;
    padding: 0
}

footer .wp-block-navigation-item a:hover {
    box-shadow: none;
    text-decoration: underline;
}

/* Footer: pravítko jako pseudo-element, přesahuje vlevo; dole ořezáno, aby stránka nerostla */
footer {
    position: relative;
    overflow-x: visible;
    overflow-y: hidden;
    min-height: 680px;
}

footer::after {
    content: '';
    position: absolute;
    bottom: 5%;
    left: 71%;
    width: min(120vw, 1000px);
    height: min(80vw, 667px);
    max-height: 53vh;
    background: url('../images/ruler.png') no-repeat left bottom;
    background-size: contain;
    transform: rotate(231deg);
    transform-origin: bottom left;
    pointer-events: none;
    z-index: 0;
}

footer > .wp-block-group {
    position: relative;
    z-index: 1;
}

/* Site title styling */
.wp-block-site-title {
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 700;
    line-height: 1;
    margin: 0;
}

/* === CONTENT NAVIGATION BAR === */
body.has-hoq-content-navigation {
    padding-bottom: calc(var(--hoq-content-navigation-space, 0px) + var(--wp--preset--spacing--small));
}

.hoq-content-navigation {
    --hoq-nav-gap: 10px;
    --hoq-nav-btn-padding: 8px 14px;
    --hoq-nav-btn-font-size: clamp(14px, 1.35vw, 24px);
    --hoq-nav-btn-line-height: 1.15;
    --hoq-nav-btn-max-width: min(100%, 360px);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    pointer-events: none;
    padding: var(--wp--preset--spacing--small) var(--wp--preset--spacing--small) var(--wp--preset--spacing--small);
    background-color: var(--wp--preset--color--white);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
}

.hoq-content-navigation__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--hoq-nav-gap);
    width: min(100%, var(--wp--style--global--wide-size, 1600px));
    margin: 0 auto;
    pointer-events: auto;
}

.hoq-content-navigation.hoq-content-navigation--dense {
    --hoq-nav-gap: 8px;
    --hoq-nav-btn-padding: 7px 12px;
    --hoq-nav-btn-font-size: clamp(13px, 1.15vw, 20px);
    --hoq-nav-btn-max-width: min(100%, 320px);
}

.hoq-content-navigation__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: var(--hoq-nav-btn-max-width);
    padding: var(--hoq-nav-btn-padding);
    background-color: var(--wp--preset--color--base-1);
    color: var(--wp--preset--color--black);
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
    font-family: var(--wp--preset--font-family--karmina);
    font-size: var(--hoq-nav-btn-font-size);
    line-height: var(--hoq-nav-btn-line-height);
    text-decoration: none;
    white-space: normal;
    text-align: center;
    text-wrap: balance;
    transform: var(--hoq-content-navigation-rotation, none);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.hoq-content-navigation__button.hoq-content-navigation__button--compact {
    --hoq-nav-btn-padding: 6px 10px;
    --hoq-nav-btn-font-size: clamp(12px, 1vw, 18px);
}

.hoq-content-navigation__button:hover,
.hoq-content-navigation__button:focus-visible {
    background-color: var(--wp--preset--color--yellow);
    color: var(--wp--preset--color--black);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.35);
}

@media (max-width: 640px) {
    .hoq-content-navigation {
        --hoq-nav-gap: 6px;
        --hoq-nav-btn-padding: 6px 10px;
        --hoq-nav-btn-font-size: clamp(12px, 3.8vw, 16px);
        --hoq-nav-btn-max-width: 100%;
        padding-inline: 12px;
        padding-bottom: 12px;
    }

    .hoq-content-navigation__button {
        transform: none !important;
    }
}


.wp-block-site-title a {
    text-decoration: none;
    color: var(--wp--preset--color--black);
}

/* === INTRO SCIENTIST BLOCK === */
/* Hlavní wrapper – padding zde (style.spacing v patternu způsoboval invalid block) */
.intro-scientist-block {
    position: relative;
    overflow: hidden;
    
    padding: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--x-small);
}

/* Intro content wrapper – šířka, rotace, stín z utility tříd (.constrained .rotate .shadow) v patternu */
.intro-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Nový wrapper po přesunu nadpisu: první alignwide columns v intro sekci */
.intro-scientist-block > .wp-block-columns.alignwide:first-child {
    position: relative;
    z-index: 0;
    isolation: isolate;

    /* Výchozí stav pravítka; lze přepsat z JS nebo přes modifikátor třídy. */
    --ruler-start-rotate: 149deg;
    --ruler-rotate: var(--ruler-start-rotate, 149deg);
    --ruler-done-rotate: 161deg;
    --ruler-start-shift-x: clamp(-220px, -14vw, -120px);
    --ruler-state-shift-x: var(--ruler-start-shift-x, -160px);
}

/* Pravítko – nízký z-index, aby bylo pod fotkou i nadpisem */
.intro-scientist-block > .wp-block-columns.alignwide:first-child::before {
    content: '';
    position: absolute;
    left: -33%;
    top: calc(345px + var(--ruler-offset, 0px));
    width: 760px;
    height: 520px;
    background: url('../images/ruler.png') no-repeat center;
    background-size: contain;
    transform: translateX(clamp(-28vw, calc(var(--ruler-inward, 0px) + var(--ruler-shift-right, 0px) + var(--ruler-state-shift-x, 0px)), 36vw)) rotate(var(--ruler-rotate, 149deg));
    transform-origin: center center;
    pointer-events: none;
    z-index: -1;
    transition: top 0.1s linear, transform 0.6s ease-in-out;
    will-change: transform, top;
}

.intro-scientist-block.animations-done > .wp-block-columns.alignwide:first-child::before {
    --ruler-rotate: var(--ruler-done-rotate, 161deg);
    --ruler-state-shift-x: var(--ruler-done-shift-x, clamp(120px, 12vw, 240px));
}

/*
 * Tužky (DRY): oba bloky s tužkou mají třídu .pencil-1-deco a používají stejný obrázek + JS.
 * - Intro Scientist: dvě tužky – ::before = pencil-2.png (vlevo nahoře), ::after = pencil-1.png (vlevo dole).
 *   Blok MUSÍ mít třídy: intro-scientist-block pencil-1-deco.
 * - Section Media & Notes: jedna tužka – ::after = pencil-1.png (pozice přes --pencil1-left/top/width/height).
 * Obrázek: assets/images/pencil-1.png. Animace/parallax: main.js nastavuje --pencil1-offset, --pencil1-rotation-offset, --pencil1-inward na všech .pencil-1-deco.
 */
.intro-scientist-block::before,
.pencil-1-deco::after {
    content: '';
    position: absolute;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
    z-index: -2;
}

.intro-scientist-block::before {
    left: auto;
    right: -4%;
    top: calc(748px + var(--pencil2-offset, 0px));
    width: 128px;
    height: 520px;
    background-image: url('../images/pencil-2.png');
    transform: translateX(var(--pencil2-inward, 0px)) rotate(calc(-68deg + var(--pencil2-rotation-offset, 0deg)));
    animation: pencil2Enter 0.75s ease-out forwards;
    transition: top 0.1s linear, transform 0.1s linear;
    z-index: -1;
}

/* Po dokončení animací odstraníme animation a resetujeme transform */
.intro-scientist-block.animations-done::before {
    transform: translateX(var(--pencil2-inward, 0px)) rotate(calc(-68deg + var(--pencil2-rotation-offset, 0deg)));
}

/* pencil-1 – sdílená tužka; pozice/velikost přes CSS vars (intro má vlastní override níže) */
.pencil-1-deco::after {
    z-index: -1;
    left: var(--pencil1-left, -10.2%);
    top: calc(var(--pencil1-top, 712x) + var(--pencil1-offset, 0px));
    width: var(--pencil1-width, 492px);
    height: var(--pencil1-height, 492px);
    background-image: url('../images/pencil-1.png');
    transform: translateX(var(--pencil1-inward, 0px)) rotate(calc(51.64deg + var(--pencil1-rotation-offset, 0deg)));
    filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
    transition: top 0.1s linear, transform 0.1s linear;
}

.intro-scientist-block.pencil-1-deco::after {
    left: auto;
    right: -5%;
    top: calc(902px + var(--pencil1-offset, 0px));
    width: 236px;
    height: 560px;
    transform: translateX(calc(var(--pencil1-inward, 0px) * -1)) rotate(calc(-59deg + var(--pencil1-rotation-offset, 0deg)));
    animation: pencil1Enter 0.8s ease-out forwards;
}

.intro-scientist-block.animations-done.pencil-1-deco::after {
    transform: translateX(calc(var(--pencil1-inward, 0px) * -1)) rotate(calc(-59deg + var(--pencil1-rotation-offset, 0deg)));
}

/* H1 title wrapper – nad fotkou */
.intro-content .intro-title-wrapper {
    position: relative;
    z-index: 6;
    margin-bottom: -50px;
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

/* Keyframe animace pro on load */
@keyframes pencil2Enter {
    from {
        right: -4%;
        top: 700px;
        transform: translateX(calc(var(--pencil2-inward, 0px) + 24vw)) rotate(calc(-62deg + var(--pencil2-rotation-offset, 0deg)));
    }
    to {
        right: -4%;
        top: 748px;
        transform: translateX(var(--pencil2-inward, 0px)) rotate(calc(-68deg + var(--pencil2-rotation-offset, 0deg)));
    }
}

@keyframes pencil1Enter {
    from {
        right: -5%;
        top: 860px;
        transform: translateX(calc(var(--pencil1-inward, 0px) * -1 + 22vw)) rotate(calc(-54deg + var(--pencil1-rotation-offset, 0deg)));
    }
    to {
        right: -5%;
        top: 902px;
        transform: translateX(calc(var(--pencil1-inward, 0px) * -1)) rotate(calc(-59deg + var(--pencil1-rotation-offset, 0deg)));
    }
}

/* H1 styling – rotace a stín z utility (.rotate .shadow) v patternu na nadpisu */
.intro-title {
    position: relative;
    display: inline-block;
    --intro-title-bg-color: var(--wp--preset--color--heading-1);
    padding: 0.55rem 1.6rem 0.68rem;
    line-height: 1.1 !important;
    color: var(--wp--preset--color--white);
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-wrap: balance;
    transform: rotate(3.2deg);
}

.intro-title::before,
.intro-title::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
}

.intro-title::before {
    border-radius: 2px;
    background-color: var(--intro-title-bg-color);
    background-image: url('../images/texture.jpg');
    background-repeat: repeat;
    background-blend-mode: multiply;
    box-shadow: 0 6px 12px rgba(26, 40, 63, 0.22);
}

.intro-title::after {
    inset: -1px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    background: transparent;
}

/* Photo styling – nad pravítkem (rules) */
.intro-photo {
    position: relative;
    z-index: 5;
    margin-bottom: 0;
    max-width: 259px;
    align-self: flex-start;
    transition: none;
}

.intro-photo img {
    box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
    height: auto;
    width: 100%;
    transform: none;
    transition: none;
    pointer-events: none;
}

/* Wrapper kolem .intro-photo nesmí mít horní odsazení. */
.intro-scientist-block .wp-block-group:has(> .intro-photo) {
    padding-top: 0 !important;
}

/* Text content – pozadí přes .bg-base-* v patternu; zde jen padding */
.intro-text-content > * {
    box-sizing: border-box;
    padding-left: 28px;
    padding-right: 28px;
}

/* V intro-scientist textovem bloku drzet oba vnitrni stacky vzdy 50/50 bez ohledu na delku obsahu */
.intro-scientist-block .intro-text-content > .wp-block-group.is-horizontal.is-nowrap {
    display: flex;
    flex-wrap: nowrap;
}

.intro-scientist-block .intro-text-content > .wp-block-group.is-horizontal.is-nowrap > .wp-block-group {
    flex: 1 1 0;
    width: 50%;
    min-width: 0;
}

@media (max-width: 781px) {
    .intro-scientist-block.pencil-1-deco::after {
        display: none;
    }

    .intro-scientist-block .intro-text-content > .wp-block-group.is-horizontal.is-nowrap {
        flex-wrap: wrap;
    }

    .intro-scientist-block .intro-text-content > .wp-block-group.is-horizontal.is-nowrap > .wp-block-group {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Sloupce s textem nad pravítkem (ruler je ::before na .intro-content s z-index 2) */
.intro-text-columns {
    position: relative;
    z-index: 3;
    max-width: var(--wp--style--global--content-size);
    margin: auto;
}
/* Section Video – stejný vnitřní padding jako intro-text-content, aby vnitřní okraje obsahu lícovaly */
.section-video__media {
    box-sizing: border-box;
    padding-left: var(--wp--preset--spacing--small);
    padding-right: var(--wp--preset--spacing--small);
}

/* Pruh nadpisu – group, který má jen nadpis (h1–h6), se přizpůsobí délce textu; v gridu/flexu nestahuje výšku */
.wp-block-group:has(> .wp-block-heading:only-child),
.wp-block-group:has(> h1:only-child),
.wp-block-group:has(> h2:only-child),
.wp-block-group:has(> h3:only-child),
.wp-block-group:has(> h4:only-child),
.wp-block-group:has(> h5:only-child),
.wp-block-group:has(> h6:only-child) {
    width: fit-content;
    align-self: start;
    margin-left: auto;
    margin-right: auto;
}

/* === SECTION CONTENT (pozadí přes .bg-heading-* a .bg-base-* na groupách) === */

/* === SECTION MEDIA & NOTES (videa v řádku vlevo, sticky note vpravo; tužka DRY .pencil-1-deco) === */
.section-media-notes-block {
    position: relative;
    overflow: hidden;
    padding: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--x-small);
}

.section-media-notes-block.pencil-1-deco {
    --pencil1-left: -8%;
    --pencil1-top: 50%;
    --pencil1-width: 310px;
    --pencil1-height: 310px;
}

/* Sticky note – základní padding (i mimo stack) */
.sticky-note {
    padding: var(--wp--preset--spacing--small) !important;
}

/* Sticky note v gridu – výška jen podle obsahu, ne na výšku celého řádku */
.wp-block-group.is-layout-grid > .sticky-note,
.wp-block-group-is-layout-grid > .sticky-note {
    align-self: start;
}

/* Stack překrývajících se poznámek – kliknutí mění pořadí (z-index). Šířka notes = max-width 320px (obsah ji může zmenšit). */
.sticky-notes-stack {
    position: relative;
    min-height: 340px;
}

.sticky-notes-stack .sticky-note {
    position: absolute;
    padding: var(--wp--preset--spacing--small) !important;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

.sticky-notes-stack .sticky-note:hover {
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

/* 4 výchozí pozice v stacku – kombinovat s .rotate-* a .bg-base-* */
.sticky-notes-stack .note-pos-1 { top: 10px; left: -20px; z-index: 1; }
.sticky-notes-stack .note-pos-2 { top: 131px; left: 62px; z-index: 2; }
.sticky-notes-stack .note-pos-3 { top: -26px; left: -22px; z-index: 3; }
.sticky-notes-stack .note-pos-4 { top: 12px; left: 144px; z-index: 4; }

/* První položka stacku jako fotka – žádný padding (aby při hoveru nebyl bílý rámeček), hover stín zůstává */
.sticky-note--photo {
    padding: 0 !important;
    background: none !important;
    background-image: none !important;
    max-width: 280px;
}

/* Obálka fotky v collage – přepis padding/margin z theme.json (core/group) a WP image bloku */
.collage-photo-wrap.wp-block-group,
.collage-photo-wrap .wp-block-image {
    padding: 0 !important;
    margin: 0 !important;
}

.collage-photo-wrap .wp-block-image img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}

.sticky-note--photo img {
    display: block;
    width: 100%;
    height: auto;
}

/* Crumpled paper deco – pravý dolní roh; enter animace + scroll přes CSS vars (jako ruler/pencil); obsah nastřed */
.crumpled-paper-deco {
    position: relative;
    overflow: hidden;
    padding: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--x-small);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crumpled-paper-deco::after {
    content: '';
    position: absolute;
    right: calc(-10% + var(--crumpled-shift-right, 0px));
    bottom: calc(-5% + var(--crumpled-offset, 0px));
    width: 200px;
    height: 200px;
    background: url('../images/crumpled-paper.png') no-repeat center;
    background-size: contain;
    transform: translateX(var(--crumpled-inward, 0px));
    pointer-events: none;
    z-index: 10;
    animation: crumpledPaperEnter 1.5s ease forwards;
    transition: bottom 0.1s linear, transform 0.1s linear;
}

.crumpled-paper-deco.animations-done::after {
    right: calc(-10% + var(--crumpled-shift-right, 0px));
    bottom: calc(-5% + var(--crumpled-offset, 0px));
    transform: translateX(var(--crumpled-inward, 0px));
}

@keyframes crumpledPaperEnter {
    from {
        right: -50vw;
        bottom: -200px;
    }
    to {
        right: -10%;
        bottom: -5%;
    }
}

/* Nadpis collage – samostatná poznámka nad stackem, odsazení dolů */
.crumpled-paper-deco .collage-title {
    margin-bottom: var(--wp--preset--spacing--small);
    position: relative;
    z-index: 999;
}

/* Stack v collage – vnější kontejner, mezery */
.crumpled-paper-deco .sticky-notes-stack {
    margin-top: var(--wp--preset--spacing--medium);
    margin-bottom: var(--wp--preset--spacing--medium);
}

/* Pile = vnitřní wrapper hromádky. Rozměry jen zde (obsah je position:absolute, do výšky nezasahuje). */
.crumpled-paper-deco .sticky-notes-pile {
    --pile-width: 592px;
    --pile-min-height: 260px;
    --photo-vertical-center: 23%;
    position: relative;
    width: var(--pile-width);
    max-width: 100%;
    min-height: var(--pile-min-height);
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.crumpled-paper-deco .sticky-notes-pile .sticky-note {
    position: absolute;
}

/* V této sekci jen textové notes cca 40 % širší; texty nastřed */
.crumpled-paper-deco .sticky-notes-pile .sticky-note:not(.sticky-note--photo) {
    max-width: 580px;
    text-align: center;
}

.crumpled-paper-deco .sticky-notes-pile .sticky-note:not(.sticky-note--photo) p,
.crumpled-paper-deco .sticky-notes-pile .sticky-note:not(.sticky-note--photo) .wp-block-heading {
    text-align: center;
}

/* Pozice notes: absolute vůči .sticky-notes-pile. Fotka (pos-1): výš = menší --photo-vertical-center (42% = výš než 50%). */
.crumpled-paper-deco .sticky-notes-pile .note-pos-1 {
    top: var(--photo-vertical-center);
    left: 50%;
    transform: translate(-50%, -50%) rotate(2.6deg);
    z-index: 1;
}
.crumpled-paper-deco .sticky-notes-pile .note-pos-2 { top: 54px; left: 48px; z-index: 2; }
.crumpled-paper-deco .sticky-notes-pile .note-pos-3 { top: 98px; left: 26px; z-index: 3; }
.crumpled-paper-deco .sticky-notes-pile .note-pos-4 { top: 6px; left: 182px; z-index: 4; }

/* === SECTION PHOTO OVERLAY (obrázek absolute – pozice přes --photo-overlay-img-left/top) === */
.section-photo-overlay-block {
    --photo-overlay-min-height: 574px;
}
.section-photo-overlay-block .photo-overlay__image-wrap {
    position: relative;
    width: 70%;
    margin-left: auto;
    margin-right: auto;
    min-height: var(--photo-overlay-min-height);
    overflow: visible;
}

/* Obrázek absolute – vyplní výšku wrapu, posun přes --photo-overlay-img-left/top */
.section-photo-overlay-block .photo-overlay__img {
    position: absolute;
    left: var(--photo-overlay-img-left, -220px);
    top: var(--photo-overlay-img-top, 0);
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.section-photo-overlay-block .photo-overlay__img img {
    width: 100%;
    height: 100%;
    object-fit: inherit;
}

.section-photo-overlay-block .photo-overlay__text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--wp--preset--spacing--small);
    box-sizing: border-box;
}

/* === SECTION ROLL TIMELINE (velký papír + horizontální scroll) === */
.roll-section-block {
    position: relative;
    padding: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--x-small);
}

.roll-section-paper {
    position: relative;
    max-width: min(60vw, 900px);
    z-index: 2;
}

.roll-section-paper img {
    display: block;
    width: 100%;
    height: auto;
}

/* Wrapper is added by roll-scrollbar.js so the scrollbar can sit below the
   horizontally scrolling content while sharing its full-bleed width. */
.roll-section__scroll-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    min-width: 0;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.roll-section__scroll-outer {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;

    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: var(--wp--preset--spacing--small);
    padding-left: var(--wp--preset--spacing--small);
    scrollbar-width: none;
}

.roll-section__scroll-outer::-webkit-scrollbar,
.roll-section__scroll-outer .roll-section__scroll-inner::-webkit-scrollbar {
    display: none;
    height: 0;
}

.roll-section__scroll-outer .roll-section__scroll-inner {
    scrollbar-width: none;
}

.roll-scrollbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    gap: 0;
    width: 100%;
    padding: 0 var(--wp--preset--spacing--small);
    margin: var(--wp--preset--spacing--x-small) 0 0;
}

.roll-scrollbar[hidden] {
    display: none;
}

.roll-scrollbar__track {
    position: relative;
    flex: 1 1 auto;
    height: 18px;
    background: url('../images/paper seamles.png') center / cover, #d8d0c0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
    touch-action: none;
    cursor: pointer;
}

.roll-scrollbar__thumb {
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    background: url('../images/Texturelabs_Paper_367M 2.png') center / cover, #f4efe4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    cursor: grab;
    touch-action: none;
}

.roll-scrollbar.is-dragging .roll-scrollbar__thumb {
    cursor: grabbing;
}

.roll-scrollbar__end {
    flex: 0 0 auto;
    width: 22px;
    height: 28px;
    padding: 0;
    border: 0;
    background: url('../images/Texturelabs_Paper_367M 2.png') center / cover, #e6dfcf;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
    cursor: pointer;
}

.roll-scrollbar__end--start {
    border-radius: 6px 0 0 6px;
}

.roll-scrollbar__end--finish {
    border-radius: 0 6px 6px 0;
}

.roll-scrollbar.is-at-start .roll-scrollbar__end--start,
.roll-scrollbar.is-at-end .roll-scrollbar__end--finish {
    opacity: 0.5;
}

.roll-section__scroll-inner {
    display: flex;
    gap: var(--wp--preset--spacing--medium);
    align-items: flex-start;
}

.roll-section__card {
    flex: 0 0 auto;
    max-width: 26rem;
}

.roll-section__card--large {
    max-width: 58rem;
}

.roll-section__image-main,
.roll-section__image-main img {
    display: block;
    width: 100%;
    height: auto;
}

.roll-section__image-small,
.roll-section__image-small img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: var(--wp--preset--spacing--small);
}

.roll-section__badge {
    margin-bottom: var(--wp--preset--spacing--small);
}

/* === MEDIA QUERIES === */

/* Od tabletu dolů – photo overlay bez odsazení obrázku */
@media (max-width: 1024px) {
    .section-photo-overlay-block {
        --photo-overlay-img-left: 0;
        --photo-overlay-img-top: 0;
    }
}

/* Do 1450px - skrýt černý marker v intro */
@media (max-width: 1450px) {
    .intro-scientist-block::before {
        display: none;
    }
}

/* Do 1200px - skrýt tužku v section-media-notes */
@media (max-width: 1200px) {
    .section-media-notes-block.pencil-1-deco::after {
        display: none;
    }
}

/* Do 1200px - skrýt zmačkaný papír (crumpled paper deco) na mobilu */
@media (max-width: 1200px) {
    .crumpled-paper-deco::after {
        display: none;
    }
}

/* Do 800px - zmenšit H1 na x-large */
@media (max-width: 800px) {
    /* Globální H1 */
    h1, .wp-block-heading h1 {
        font-size: var(--wp--preset--font-size--x-large);
    }
    
    /* Specificky intro-title */
    .intro-title {
        font-size: var(--wp--preset--font-size--x-large) !important;
    }
}

/* === SECTION MATH & NOTES (grid s math bloky, toggle notes, dark pattern pozadí) === */
.section-math-notes {
    background-image: url('../images/pattern_dark.jpg');
    background-repeat: repeat;
    background-size: auto;
    padding: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--x-small);
}

/* Sticky notes v této sekci: pozadí (barva + textura) na 90 % opacity – ::before za obsahem */
.section-math-notes .math-formulas-stack .sticky-note,
.section-math-notes .math-formulas-stack.sticky-note {
    position: relative; /* jen zde; .sticky-notes-stack .sticky-note má position: absolute */
}
.section-math-notes .sticky-note.bg-base-0,
.section-math-notes .sticky-note.bg-base-1,
.section-math-notes .sticky-note.bg-base-2,
.section-math-notes .sticky-note.bg-base-3,
.section-math-notes .sticky-note.bg-heading-1,
.section-math-notes .sticky-note.bg-heading-2,
.section-math-notes .sticky-note.bg-heading-3 {
    background-color: transparent !important;
    background-image: none !important;
}
.section-math-notes .sticky-note::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-repeat: repeat;
    background-blend-mode: multiply;
}
/* Jen notes s math vzorci – textura na 90 % opacity */
.section-math-notes .math-formulas-stack .sticky-note::before,
.section-math-notes .math-formulas-stack.sticky-note::before {
    opacity: 0.9;
}
.section-math-notes .sticky-note.bg-base-0::before {
    background-image: url('../images/texture.jpg');
    background-color: var(--wp--preset--color--base-0);
}
.section-math-notes .sticky-note.bg-base-1::before {
    background-image: url('../images/texture.jpg');
    background-color: var(--wp--preset--color--base-1);
}
.section-math-notes .sticky-note.bg-base-2::before {
    background-image: url('../images/texture.jpg');
    background-color: var(--wp--preset--color--base-2);
}
.section-math-notes .sticky-note.bg-base-3::before {
    background-image: url('../images/texture.jpg');
    background-color: var(--wp--preset--color--base-3);
}
.section-math-notes .sticky-note.bg-heading-1::before {
    background-image: url('../images/texture.jpg');
    background-color: var(--wp--preset--color--heading-1);
}
.section-math-notes .sticky-note.bg-heading-2::before {
    background-image: url('../images/texture.jpg');
    background-color: var(--wp--preset--color--heading-2);
}
.section-math-notes .sticky-note.bg-heading-3::before {
    background-image: url('../images/texture.jpg');
    background-color: var(--wp--preset--color--heading-3);
}

/* Math formulas stack – vzorečky ve sticky-note s větším písmem a modrou z vars */
.math-formulas-stack .wp-block-math,
.math-formulas-stack figure.wp-block-math {
    text-align: center;
    margin: 0;
    font-size: var(--wp--preset--font-size--large);
    color: var(--wp--preset--color--blue);
}

.math-formulas-stack .wp-block-math p,
.math-formulas-stack figure.wp-block-math p {
    text-align: center;
    margin: 0;
    font-size: inherit;
    color: inherit;
}

/* === HOMEPAGE LANDING – HOUSE & SCIENTISTS === */
.landing-scientists-column {
    /* keeps list reasonably narrow on large screens */
    max-width: 32rem;
}

/* Zarovnání papíru se seznamem vědců na levou hranu s H1 */
.landing-hero-block .torn-paper {
    margin-left: 0;
    margin-right: auto;
}

.landing-scientists-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.landing-scientists-list .wp-block-post-title {
    margin: 0;
}

.landing-scientists-list .wp-block-post-title a {
    display: inline-block;
    position: relative;
    padding: var(--wp--preset--spacing--x-small) 0;
    color: var(--wp--preset--color--blue);
    text-decoration: none;
    font-weight: 400;
}

.landing-scientists-list .wp-block-post-title a:hover,
.landing-scientists-list .wp-block-post-title a:focus-visible,
/* Aktivní položka při hoveru nad domem (hitmap) */
.landing-scientists-list .wp-block-post-title a.is-active-room {
    color: #1639d7;
}

/* Animované podtržení (inspirace "Underline 1") */
.landing-scientists-list .wp-block-post-title a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0.16em;
    background-color: #1639d7;
    opacity: 0;
    transform: translate3d(0, 0.25em, 0);
    transition: opacity 220ms ease, transform 220ms ease;
}

.landing-scientists-list .wp-block-post-title a:hover::after,
.landing-scientists-list .wp-block-post-title a:focus-visible::after,
.landing-scientists-list .wp-block-post-title a.is-active-room::after {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.landing-house-column {
    display: flex;
    justify-content: center;
}

.landing-house-wrapper {
    position: relative;
    max-width: 900px;
    width: 100%;
    /* posun domu výš pod menu, část je mimo viewport jako ve Figmě */
    margin-top: calc(-2 * var(--wp--preset--spacing--large));
    margin-left: auto;
    margin-right: auto;
    z-index: 0;
}

.landing-house-base {
    position: fixed;
    top: -7px;
    max-width: none;
    z-index: -1; /* základní dům zůstává v pozadí */
    transition: top 0.25s ease;
}

.landing-house-base img {
    display: block;
    width: 100%;
    height: auto;
}

/* Šířka domu se automaticky drží šířky .landing-house-wrapper (viz position: fixed bez left),
   proto zde jen doladíme svislou pozici tak, aby zůstal vidět i na menších rozlišeních (do 860px). */
@media (max-width: 1300px) {
    .landing-house-base {
        top: 300px;
    }
}

@media (max-width: 1100px) {
    .landing-house-base {
        top: 220px;
    }
}

@media (max-width: 960px) {
    .landing-house-base {
        top: 160px;
    }
}

/* Pod 860px dům opouští position:fixed a řadí se normálně do toku –
   na úzkých obrazovkách (kdy se sloupce zalamují) tak klidně skončí pod textovým blokem. */
@media (max-width: 860px) {
    .landing-house-wrapper {
        margin-top: 0;
    }

    .landing-house-base {
        position: static;
        top: auto;
        z-index: 0;
    }
}

.landing-house-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 1; /* overlay nad domem i wrapperem */
}

.landing-house-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.landing-house-overlay.is-visible:active img {
    filter: brightness(1.10);
    transition: filter 0.15s ease;
}

.landing-house-overlay img {
    display: block;
    width: 100%;
    height: auto;
}

/* Pera pro landing hero – využívá existující .pencil-1-deco logiku */
.landing-hero-block {
    position: relative;
    min-height: 620px;
    padding-top: var(--wp--preset--spacing--small);
    padding-right: var(--wp--preset--spacing--x-small);
    padding-bottom: var(--wp--preset--spacing--medium);
    padding-left: var(--wp--preset--spacing--x-small);
}

/* Levá žlutá tužka + žlutá tužka vpravo dole – pseudo-elementy hero bloku (inspirováno intro-scientist-block) */
.landing-hero-block::before,
.landing-hero-block::after {
    content: '';
    position: absolute;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

/* Žlutá tužka vlevo nahoře – contain zachová poměr stran */
.landing-hero-block::before {
    left: 2%;
    top: -15%;
    width: 400px;
    height: 1000px;
    background-image: url('../../patterns/pencil.png');
    background-position: center;
    transform-origin: center bottom;
    transform: rotate(-27deg);
    z-index: 999;

}

/* Dvě tužky v pravém dolním rohu – šířka pevná, výška auto = bez deformace */
.landing-hero-block::after {
    right: -280px;
    bottom: -270px;
    width: 670px;
    height: 790px;
    position: absolute;
    background-image: url('../images/pencils.png');
    background-repeat: no-repeat, no-repeat;
    /* background-position: 8% 40%, 100% 100%; */
    transform: rotate(-10deg);
    }

/* Na mobilu schovat pera, aby nepřekrývala obsah (dům se zmenšuje výše a schovává až pod 860px) */
@media (max-width: 1400px) {
    .landing-hero-block::before,    
    .landing-hero-block::after {
       display: none;
    }
}

/* Do 600px - zmenšit H1 na large */
@media (max-width: 600px) {
    /* Globální H1 */
    h1, .wp-block-heading h1 {
        font-size: var(--wp--preset--font-size--large);
    }
    
    /* Specificky intro-title */
    .intro-title {
        font-size: var(--wp--preset--font-size--large) !important;
    }
}
