/*
 * Magnetky Hero Slider — split hero: text vlevo, polaroid slideshow vpravo.
 * Crossfade + Ken Burns, barvy a fonty přebírá z child theme (--magnetky-*).
 */

.mhs-hero {
    --mhs-primary: var(--magnetky-primary, #E07A5F);
    --mhs-primary-dark: var(--magnetky-primary-dark, #C65D45);
    --mhs-secondary: var(--magnetky-secondary, #F2CC8F);
    --mhs-dark: var(--magnetky-dark, #2D3142);
    --mhs-dark-soft: var(--magnetky-dark-soft, #4F5D75);
    --mhs-cream: var(--magnetky-cream, #F5F0E8);
    --mhs-white: var(--magnetky-white, #FFFFFF);
    --mhs-interval: 6000ms;

    position: relative;
    overflow: hidden;
    border-radius: 28px;
    background:
        radial-gradient(42rem 42rem at 108% -20%, rgba(242, 204, 143, 0.35), transparent 60%),
        radial-gradient(36rem 36rem at -15% 115%, rgba(224, 122, 95, 0.16), transparent 60%),
        var(--mhs-cream);
    /* Na širokoúhlých monitorech drží hero kompaktní tvar karty
       místo roztažení přes celou šířku obsahu */
    max-width: 1360px;
    margin: 0 auto 3rem;
}

.mhs-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: center;
    gap: clamp(1.5rem, 3.5vw, 3.5rem);
    padding: clamp(1.75rem, 3.5vw, 3rem) clamp(1.5rem, 4vw, 3.5rem);
}

/* Fotka vlevo, text vpravo (jako původní hero); v DOM je text první kvůli čtečkám */
.mhs-hero__media {
    order: -1;
}

/* ---------- Text ---------- */

.mhs-hero__title {
    font-family: var(--font-display, 'DM Serif Display'), Georgia, serif;
    font-size: clamp(2.1rem, 4.5vw, 3.4rem);
    line-height: 1.12;
    color: var(--mhs-dark);
    margin: 0 0 1rem;
}

.mhs-hero__subtitle {
    font-family: var(--font-body, 'Plus Jakarta Sans'), sans-serif;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.6;
    color: var(--mhs-dark-soft);
    max-width: 34rem;
    margin: 0 0 1.8rem;
}

/* Tmavší korálová + velký tučný text = WCAG kontrast pro large text (4.15:1 ≥ 3:1) */
.mhs-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-body, 'Plus Jakarta Sans'), sans-serif;
    font-weight: 700;
    font-size: 1.175rem;
    color: var(--mhs-white);
    background: var(--mhs-primary-dark);
    padding: 0.95rem 1.9rem;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 10px 24px -8px rgba(198, 93, 69, 0.55);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.mhs-hero__cta:hover,
.mhs-hero__cta:focus-visible {
    background: #A84A35;
    color: var(--mhs-white);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -10px rgba(168, 74, 53, 0.6);
}

.mhs-hero__cta-arrow {
    transition: transform 0.25s ease;
}

.mhs-hero__cta:hover .mhs-hero__cta-arrow {
    transform: translateX(4px);
}

/* Štítky s klíčovými slovy pod CTA */
.mhs-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.6rem;
    list-style: none;
    margin: 1.6rem 0 0;
    padding: 0;
}

.mhs-hero__tags li {
    font-family: var(--font-body, 'Plus Jakarta Sans'), sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mhs-primary-dark);
    background: var(--mhs-white);
    border: 1px solid rgba(224, 122, 95, 0.35);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    box-shadow: 0 2px 8px rgba(45, 49, 66, 0.06);
}

/* ---------- Stage (polaroid slideshow) ---------- */

.mhs-hero__media {
    position: relative;
    justify-self: center;
    width: min(100%, clamp(380px, 32vw, 480px));
}

.mhs-hero__stage {
    position: relative;
    outline: none;
}

.mhs-hero__stage:focus-visible {
    box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.5);
    border-radius: 22px;
}

/* Rotated backdrop card for depth */
.mhs-hero__frame {
    position: absolute;
    inset: 4% -4% -4% 4%;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--mhs-secondary), var(--mhs-primary));
    opacity: 0.85;
    transform: rotate(4deg);
}

.mhs-hero__slides {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 20px;
    background: var(--mhs-white);
    padding: 12px;
    box-shadow: 0 24px 48px -18px rgba(45, 49, 66, 0.35);
}

.mhs-hero__slide {
    position: absolute;
    inset: 12px;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.9s ease;
    pointer-events: none;
}

.mhs-hero__slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.mhs-hero__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Ken Burns — pomalý zoom, sudé fotky opačným směrem */
.mhs-hero__slide.is-active img {
    animation: mhs-kenburns calc(var(--mhs-interval) + 1200ms) ease-out forwards;
}

.mhs-hero__slide:nth-child(even).is-active img {
    animation-name: mhs-kenburns-alt;
}

@keyframes mhs-kenburns {
    from { transform: scale(1.02) translate(0, 0); }
    to   { transform: scale(1.12) translate(-1.5%, 1.5%); }
}

@keyframes mhs-kenburns-alt {
    from { transform: scale(1.02) translate(0, 0); }
    to   { transform: scale(1.12) translate(1.5%, -1.5%); }
}

/* ---------- Controls ---------- */

/* Ovládání jako overlay pill dole na fotce — nezabírá výšku pod sliderem */
.mhs-hero__controls {
    position: absolute;
    left: 50%;
    bottom: 1.6rem;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 999px;
    padding: 0.4rem 0.7rem;
    box-shadow: 0 6px 18px rgba(45, 49, 66, 0.2);
}

.mhs-hero__arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--mhs-dark);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.mhs-hero__arrow:hover,
.mhs-hero__arrow:focus-visible {
    background: var(--mhs-primary);
    color: var(--mhs-white);
    transform: scale(1.08);
}

/* Na zařízeních s myší jsou šipky skryté, dokud uživatel nenajede na slider
   (tečky zůstávají viditelné pořád); na dotykových zařízeních se nezobrazují
   vůbec — tam funguje swipe + tečky */
@media (hover: hover) {
    .mhs-hero__arrow {
        opacity: 0;
        transition: opacity 0.25s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

    .mhs-hero__media:hover .mhs-hero__arrow,
    .mhs-hero__arrow:focus-visible {
        opacity: 1;
    }
}

@media (hover: none) {
    .mhs-hero__arrow {
        display: none;
    }
}

.mhs-hero__dots {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mhs-hero__dot {
    position: relative;
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(45, 49, 66, 0.25);
    cursor: pointer;
    overflow: hidden;
    transition: width 0.35s ease, background 0.35s ease;
}

.mhs-hero__dot.is-active {
    width: 34px;
    background: rgba(224, 122, 95, 0.3);
}

/* Progress výplň aktivní tečky, synchronizovaná s intervalem.
   Skutečný element (ne ::after) — animationend z něj řídí autoplay. */
.mhs-hero__dot-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--mhs-primary);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

.mhs-hero__dot.is-active .mhs-hero__dot-fill {
    animation: mhs-progress var(--mhs-interval) linear forwards;
}

.mhs-hero.is-paused .mhs-hero__dot.is-active .mhs-hero__dot-fill {
    animation-play-state: paused;
}

@keyframes mhs-progress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ---------- Photo-only layout (uvnitř existujícího hero sloupce) ---------- */

.mhs-hero--photo {
    background: none;
    border-radius: 0;
    margin: 0;
    /* Padding drží natočený rám uvnitř sloupce s overflow:hidden */
    padding: 1.5rem 1.5rem 0.75rem;
}

.mhs-hero--photo .mhs-hero__media {
    margin-inline: auto;
    width: min(100%, 380px);
}

/* ---------- Video layout (full-width video s overlay textem) ---------- */

.mhs-hero--video {
    padding: 0;
    /* Výška = přesně výška obrazovky mínus hlavička → hero lícuje se spodkem
       viewportu (ne menší, ne větší). svh řeší mobilní lišty prohlížeče.
       min-height je jen pojistka pro extrémně nízká okna. */
    height: calc(100svh - var(--header-height, 120px));
    min-height: 420px;
    /* Full-bleed až k okrajům okna — vylomení z Gutenberg/Blocksy kontejneru */
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
}

.mhs-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tmavý gradient zleva, aby byl text čitelný na jakémkoli záběru */
.mhs-hero__video-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(45, 49, 66, 0.8) 0%, rgba(45, 49, 66, 0.52) 45%, rgba(45, 49, 66, 0.06) 72%);
}

.mhs-hero--video .mhs-hero__title,
.mhs-hero--video .mhs-hero__subtitle {
    text-shadow: 0 1px 12px rgba(45, 49, 66, 0.45);
}

.mhs-hero--video {
    /* Přisátí k hlavičce — zruší vertikální odsazení obsahu nad herem */
    margin-top: calc(-1 * var(--theme-content-vertical-spacing, 0px));
}

.mhs-hero__video-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding-block: clamp(1.5rem, 4vw, 3.5rem);
    /* Text lícuje s obsahovým kontejnerem (max 1290 px), ne s okrajem okna */
    padding-left: max(clamp(1.5rem, 5vw, 4.5rem), calc((100vw - 1290px) / 2));
    padding-right: clamp(1.5rem, 5vw, 4.5rem);
}

/* Šířku omezují až vnitřní prvky — max-width na kontejneru by se
   s velkým paddingem na ultrawide počítala přes border-box špatně */
.mhs-hero__video-content > * {
    max-width: 40rem;
}

.mhs-hero--video .mhs-hero__title,
.mhs-hero--video .mhs-hero__subtitle {
    color: var(--mhs-white);
}

.mhs-hero--video .mhs-hero__subtitle {
    opacity: 0.92;
}

@media (max-width: 820px) {
    .mhs-hero--video {
        /* Mobil: lícuje se spodkem obrazovky (výška viewportu − hlavička). */
        height: calc(100svh - var(--header-height, 70px));
        min-height: 480px;
    }

    .mhs-hero__video-shade {
        background: linear-gradient(180deg, rgba(45, 49, 66, 0.25) 0%, rgba(45, 49, 66, 0.65) 75%);
    }

    .mhs-hero__video-content {
        justify-content: flex-end;
        align-items: center;
        text-align: center;
    }
}

/* ---------- Strip layout (text + rolující pás fotek + štítky) ---------- */

.mhs-hero--strip {
    padding: clamp(2.25rem, 4.5vw, 4rem) 0 clamp(1.75rem, 3vw, 2.5rem);
}

.mhs-hero__content--center {
    text-align: center;
    max-width: 46rem;
    margin: 0 auto;
    padding: 0 1.5rem clamp(1.75rem, 3.5vw, 2.75rem);
}

.mhs-hero__content--center .mhs-hero__subtitle {
    margin-inline: auto;
}

.mhs-strip {
    overflow: hidden;
    padding: 1rem 0 1.25rem;
    /* Jemné vyblednutí fotek na okrajích pásu */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.mhs-strip__track {
    display: flex;
    gap: clamp(0.9rem, 1.6vw, 1.4rem);
    width: max-content;
    animation: mhs-strip-scroll 55s linear infinite;
    will-change: transform;
}

.mhs-strip:hover .mhs-strip__track {
    animation-play-state: paused;
}

.mhs-strip__card {
    flex: none;
    width: clamp(150px, 16vw, 205px);
    margin: 0;
    background: var(--mhs-white);
    padding: 8px 8px 24px;
    border-radius: 12px;
    box-shadow: 0 12px 28px -12px rgba(45, 49, 66, 0.35);
    transform: rotate(-1.6deg);
}

.mhs-strip__card:nth-child(even) {
    transform: rotate(1.8deg);
}

.mhs-strip__card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

/* Track = 3 identické sady fotek, posun o třetinu = bezešvá smyčka */
@keyframes mhs-strip-scroll {
    to { transform: translateX(calc(-100% / 3)); }
}

.mhs-strip__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem 0.65rem;
    list-style: none;
    max-width: 52rem;
    margin: clamp(1rem, 2vw, 1.5rem) auto 0;
    padding: 0 1.5rem;
}

.mhs-strip__tags li {
    font-family: var(--font-body, 'Plus Jakarta Sans'), sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--mhs-primary-dark);
    background: var(--mhs-white);
    border: 1px solid rgba(224, 122, 95, 0.35);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    box-shadow: 0 2px 8px rgba(45, 49, 66, 0.06);
}

/* ---------- Mobile ---------- */

@media (max-width: 820px) {
    .mhs-hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
        padding-bottom: 2.5rem;
    }

    .mhs-hero__subtitle {
        margin-inline: auto;
    }

    .mhs-hero__tags {
        justify-content: center;
    }

    .mhs-hero__media {
        width: min(100%, 320px);
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .mhs-hero__slide {
        transition-duration: 0.01ms;
    }

    .mhs-hero__slide.is-active img,
    .mhs-hero__dot.is-active .mhs-hero__dot-fill {
        animation: none;
    }

    .mhs-hero__dot.is-active .mhs-hero__dot-fill {
        transform: scaleX(1);
    }

    .mhs-strip__track {
        animation: none;
    }

    .mhs-strip {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }
}
