/**
 * MyWebStore Hero block frontend styles.
 */
.wp-block-mywebstore-hero.mws-hero-block {
    --mws-hero-block-desktop-height: 720px;
    --mws-hero-block-mobile-height: 720px;
    box-sizing: border-box;
    position: relative;
    width: 100vw;
    max-width: 100vw;
    height: var(--mws-hero-block-desktop-height);
    min-height: var(--mws-hero-block-desktop-height);
    margin-inline: calc(50% - 50vw);
    margin-block-end: var(--mws-hero-block-after-gap, clamp(2.5rem, 6vw, 6rem));
    overflow: clip;
    background: var(--mws-color-bg-inverse, #111111);
    color: var(--mws-color-on-media, var(--mws-color-text-inverse, #ffffff));
}

.wp-block-mywebstore-hero.mws-hero-block * {
    box-sizing: border-box;
}

.wp-block-mywebstore-hero.mws-hero-block--fullscreen {
    height: calc(100vh - var(--mws-header-height, 72px));
    min-height: calc(100vh - var(--mws-header-height, 72px));
    height: calc(100svh - var(--mws-header-height, 72px));
    min-height: calc(100svh - var(--mws-header-height, 72px));
}

body.mws-transparent-hero-header .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--fullscreen:first-child {
    height: 100vh;
    min-height: 100vh;
    height: 100svh;
    min-height: 100svh;
}

body.mws-transparent-hero-header .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--manual-height:first-child {
    margin-top: 0;
}

body.mws-full-screen-hero .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--fullscreen:first-child {
    height: calc(100vh - var(--mws-header-height, 72px));
    min-height: calc(100vh - var(--mws-header-height, 72px));
    height: calc(100svh - var(--mws-header-height, 72px));
    min-height: calc(100svh - var(--mws-header-height, 72px));
}

body.mws-full-screen-hero.mws-transparent-hero-header .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--fullscreen:first-child {
    height: 100vh;
    min-height: 100vh;
    height: 100svh;
    min-height: 100svh;
}

body.mws-full-screen-hero .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--manual-height:first-child,
body.mws-transparent-hero-header .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--manual-height:first-child {
    height: var(--mws-hero-block-desktop-height);
    min-height: var(--mws-hero-block-desktop-height);
}

/*
 * Keep every media layer pinned to the Hero stage. Absolute positioning on
 * the media itself prevents global image resets or intrinsic aspect ratios
 * from collapsing the visible image inside a full-height Hero.
 */
.mws-hero-block__stage,
.mws-hero-block__slot,
.mws-hero-block__picture {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}

.mws-hero-block__slot--mobile {
    display: none;
}

.mws-hero-block__media,
.mws-hero-block__empty {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
}

.mws-hero-block__media--responsive,
.mws-hero-block__media--desktop {
    object-position: var(--mws-hero-desktop-position, center center);
    transform: scale(var(--mws-hero-desktop-scale, 1));
    transform-origin: var(--mws-hero-desktop-position, center center);
}

.mws-hero-block__media--mobile {
    object-position: var(--mws-hero-mobile-position, center center);
    transform: scale(var(--mws-hero-mobile-scale, 1));
    transform-origin: var(--mws-hero-mobile-position, center center);
}

.mws-hero-block__empty {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%) 0 0 / 32px 32px,
        linear-gradient(315deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%) 0 0 / 32px 32px,
        var(--mws-color-bg-inverse, #111111);
}

/* Hero media/height switch: intentionally earlier than compact content layout. */
@media (max-width: 900px) {
    .wp-block-mywebstore-hero.mws-hero-block {
        height: var(--mws-hero-block-mobile-height);
        min-height: var(--mws-hero-block-mobile-height);
    }

    .wp-block-mywebstore-hero.mws-hero-block--fullscreen {
        height: 100vh;
        min-height: 100vh;
        height: 100svh;
        min-height: 100svh;
    }

    body.mws-full-screen-hero .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--manual-height:first-child,
    body.mws-transparent-hero-header .mws-site-main .mws-entry-content > .wp-block-mywebstore-hero.mws-hero-block--manual-height:first-child {
        height: var(--mws-hero-block-mobile-height);
        min-height: var(--mws-hero-block-mobile-height);
    }

    .mws-hero-block__slot--desktop {
        display: none;
    }

    .mws-hero-block__slot--mobile {
        display: block;
    }

    .mws-hero-block__media--responsive {
        object-position: var(--mws-hero-mobile-position, center center);
        transform: scale(var(--mws-hero-mobile-scale, 1));
        transform-origin: var(--mws-hero-mobile-position, center center);
    }

    .mws-hero-block__foreground-picture {
        width: min(var(--mws-hero-logo-width-mobile, 180px), 100%);
    }
}


/* Hero text overlay layer. Uses the existing theme typography, button and focus tokens. */
.mws-hero-block__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: var(--mws-hero-overlay-color, var(--mws-color-bg-inverse, #000000));
    opacity: var(--mws-hero-overlay-opacity, 0.45);
}

.mws-hero-block__content {
    position: absolute;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: clamp(0.85rem, 1.6vw, 1.25rem);
    --mws-hero-text: var(--mws-color-on-media, var(--mws-color-text-inverse, #ffffff));
    --mws-hero-muted: var(--mws-color-on-media-muted, color-mix(in srgb, var(--mws-hero-text) 86%, transparent));
    --mws-hero-subtle: var(--mws-color-on-media-subtle, color-mix(in srgb, var(--mws-hero-text) 72%, transparent));
    --mws-hero-eyebrow-color: var(--mws-color-on-media-eyebrow, var(--mws-hero-muted));
    width: min(var(--mws-hero-content-width, 720px), calc(100% - 2 * clamp(1.25rem, 5vw, 4rem)));
    color: var(--mws-hero-text);
    font-family: var(--mws-font-body);
    text-align: center;
}

.mws-hero-block__content-h--left {
    left: clamp(1.25rem, 5vw, 4rem);
    align-items: flex-start;
    text-align: left;
}

.mws-hero-block__content-h--center {
    left: 50%;
    align-items: center;
    text-align: center;
    transform: translateX(-50%);
}

.mws-hero-block__content-h--right {
    right: clamp(1.25rem, 5vw, 4rem);
    align-items: flex-end;
    text-align: right;
}

.mws-hero-block__content-v--top {
    top: clamp(4.5rem, 12vh, 8rem);
}

.mws-hero-block__content-v--center {
    top: 50%;
}

.mws-hero-block__content-v--bottom {
    bottom: clamp(2rem, 10vh, 6rem);
}

.mws-hero-block__content-h--center.mws-hero-block__content-v--center {
    transform: translate(-50%, -50%);
}

.mws-hero-block__content-h--left.mws-hero-block__content-v--center,
.mws-hero-block__content-h--right.mws-hero-block__content-v--center {
    transform: translateY(-50%);
}


.mws-hero-block__foreground-picture {
    display: block;
    width: min(var(--mws-hero-logo-width-desktop, 240px), 100%);
    max-width: 100%;
    flex: 0 0 auto;
}

.mws-hero-block__foreground-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.mws-hero-block__eyebrow,
.mws-hero-block__title,
.mws-hero-block__description {
    margin: 0;
}

.mws-hero-block__eyebrow {
    color: var(--mws-hero-eyebrow-color);
}

/*
 * Keep the Hero title colour component-owned on the frontend.
 * The extra component scope ensures this rule outranks the global uncoloured
 * heading fallback without relying on !important, matching editor behaviour.
 */
.mws-hero-block__content .mws-hero-block__title {
    color: var(--mws-hero-text);
}

.mws-hero-block__description {
    color: var(--mws-hero-muted);
}

.mws-hero-block__eyebrow {
    font-family: var(--mws-font-body);
    font-size: var(--mws-hero-eyebrow-size-desktop, 13px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.mws-hero-block__title {
    font-family: var(--mws-font-heading);
    font-size: clamp(var(--mws-hero-title-size-mobile, 42px), 5vw, var(--mws-hero-title-size-desktop, 64px));
    font-weight: var(--mws-font-weight-heading);
    line-height: 0.98;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.mws-hero-block__description {
    max-width: 62ch;
    font-family: var(--mws-font-body);
    font-size: var(--mws-hero-text-size-desktop, 18px);
    line-height: 1.55;
    text-wrap: pretty;
}

.mws-hero-block__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mws-hero-button-gap-desktop, var(--mws-button-gap, 0.75rem));
    align-items: center;
    margin-top: 0.2rem;
}

.mws-hero-block__content-h--left .mws-hero-block__actions {
    justify-content: flex-start;
}

.mws-hero-block__content-h--center .mws-hero-block__actions {
    justify-content: center;
}

.mws-hero-block__content-h--right .mws-hero-block__actions {
    justify-content: flex-end;
}

.mws-hero-block__button {
    min-width: 0;
}

.mws-hero-block__button--secondary {
    background: transparent;
    color: var(--mws-hero-text, var(--mws-color-on-media, #ffffff));
    border-color: currentColor;
}

.mws-hero-block__button--secondary:hover {
    background: color-mix(in srgb, currentColor 14%, transparent);
    color: var(--mws-hero-text, var(--mws-color-on-media, #ffffff));
    border-color: currentColor;
}

/* Optional background-video control. Hidden unless enabled and the active media is video. */
.mws-hero-block__video-control {
    position: absolute;
    right: clamp(1rem, 2.5vw, 2rem);
    bottom: clamp(1rem, 2.5vw, 2rem);
    z-index: 4;
    display: inline-grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid color-mix(in srgb, currentColor 48%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--mws-color-bg-inverse, #111111) 76%, transparent);
    color: var(--mws-color-on-media, #ffffff);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.mws-hero-block__video-control[hidden] {
    display: none;
}

.mws-hero-block__video-control:hover {
    background: color-mix(in srgb, var(--mws-color-bg-inverse, #111111) 90%, transparent);
}

.mws-hero-block__video-control:focus-visible {
    outline: var(--mws-button-focus-outline-width, 2px) solid var(--mws-button-focus, currentColor);
    outline-offset: var(--mws-button-focus-outline-offset, 3px);
}

.mws-hero-block__video-control-icon {
    position: relative;
    display: block;
    width: 14px;
    height: 14px;
}

.mws-hero-block__video-control[data-state="playing"] .mws-hero-block__video-control-icon::before,
.mws-hero-block__video-control[data-state="playing"] .mws-hero-block__video-control-icon::after {
    content: "";
    position: absolute;
    top: 1px;
    width: 4px;
    height: 12px;
    border-radius: 1px;
    background: currentColor;
}

.mws-hero-block__video-control[data-state="playing"] .mws-hero-block__video-control-icon::before {
    left: 2px;
}

.mws-hero-block__video-control[data-state="playing"] .mws-hero-block__video-control-icon::after {
    right: 2px;
}

.mws-hero-block__video-control[data-state="paused"] .mws-hero-block__video-control-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 1px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid currentColor;
}

@media (prefers-reduced-motion: reduce) {
    .mws-hero-block__video-control {
        display: none !important;
    }
}

/* Compact Hero content layout follows the canonical theme shell breakpoint. */
@media (max-width: 767px) {
    .mws-hero-block__content {
        width: min(var(--mws-hero-content-width, 720px), calc(100% - 2rem));
        gap: 0.85rem;
    }

    .mws-hero-block__content-h--left,
    .mws-hero-block__content-h--right,
    .mws-hero-block__content-h--center {
        left: 50%;
        right: auto;
        align-items: center;
        text-align: center;
        transform: translateX(-50%);
    }

    .mws-hero-block__content-v--top {
        top: clamp(4.25rem, 12vh, 6rem);
    }

    .mws-hero-block__content-v--center {
        top: 50%;
    }

    .mws-hero-block__content-h--left.mws-hero-block__content-v--center,
    .mws-hero-block__content-h--right.mws-hero-block__content-v--center,
    .mws-hero-block__content-h--center.mws-hero-block__content-v--center {
        transform: translate(-50%, -50%);
    }

    .mws-hero-block__content-v--bottom {
        bottom: clamp(1.5rem, 8vh, 4rem);
    }

    .mws-hero-block__eyebrow {
        font-size: var(--mws-hero-eyebrow-size-mobile, 12px);
    }

    .mws-hero-block__title {
        font-size: var(--mws-hero-title-size-mobile, 42px);
    }

    .mws-hero-block__description {
        font-size: var(--mws-hero-text-size-mobile, 16px);
    }

    .mws-hero-block__actions {
        gap: var(--mws-hero-button-gap-mobile, 10px);
        justify-content: center;
    }

    .mws-hero-block--mobile-buttons-inline .mws-hero-block__actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
    }

    .mws-hero-block--mobile-buttons-stacked .mws-hero-block__actions {
        flex-direction: column;
        flex-wrap: nowrap;
        width: auto;
    }

    .mws-hero-block--mobile-button-width-auto .mws-hero-block__button {
        width: auto;
        max-width: 100%;
    }

    .mws-hero-block--mobile-button-width-full .mws-hero-block__actions {
        width: 100%;
    }

    .mws-hero-block--mobile-button-width-full .mws-hero-block__button {
        width: min(100%, var(--mws-hero-mobile-button-max-width, 320px));
    }
}
