/* -------------------------------------------------------
   Hero Block
   Follows the site colour toggle via --body-bg / --body-text
   ------------------------------------------------------- */

.wp-block-beech-hero {
    background-color: var(--body-bg);
    color: #1E1E1E;
    --body-text: #1E1E1E;
    display: block;
    position: relative;
    transition: background-color 150ms ease, color 150ms ease;
}

/* ── Hero content panel ──────────────────────────────── */

.hero__inner {
    min-height: calc(100svh - var(--header-offset, 5rem));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--block-space) * 0.5) var(--gutter) calc(var(--block-space) * 1.5);
}

.hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

/* ── Pills row ───────────────────────────────────────── */

.hero__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    justify-content: center;
    align-items: center;
}

.hero__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 1.25rem 0.45rem;
    border-radius: 3rem;
    background-color: #ffffff;
    font-family: var(--wp--preset--font-family--mono);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #111414;
    line-height: 1.2;
    white-space: nowrap;
    cursor: default;
}

a.hero__pill {
    cursor: pointer;
    transition: background-color 150ms ease;
}

a.hero__pill:hover {
    background-color: var(--pill-hover-bg, #f0f0f0);
}

/* ── Heading + subtitle wrapper ──────────────────────── */

.hero__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.75rem;
    padding: 1rem 0;
    width: 100%;
}

/* ── Heading ─────────────────────────────────────────── */

.hero__heading {
    font-family: var(--wp--preset--font-family--champion);
    font-size: clamp(4rem, 7vw, 88px);
    font-weight: 400;
    font-style: normal;
    line-height: 1;
    letter-spacing: 0.005em;
    margin: 0;
    text-transform: none;
    width: 100%;
}


/* Word-by-word entrance animation (Splitting.js adds .splitting + --word-index) */
.hero__heading.splitting .word {
    opacity: 0.1;
    animation-name: slideUp;
    animation-duration: 300ms;
    animation-fill-mode: forwards;
    animation-timing-function: ease-in-out;
    animation-iteration-count: 1;
    animation-delay: calc(80ms * var(--word-index));
}

/* Looser line-height when there is no subtitle beneath the heading */
.hero__content--no-subtitle .hero__heading {
    /* line-height: 1.2;
    max-width: 100vw; */
}

/* The highlighted word – custom animated SVG underline */
.wp-block-beech-hero .hero__heading .hero__heading-em {
    font-style: normal;
    text-decoration: none;
    display: inline-block;
    position: relative;
    z-index: 0;
    /* creates stacking context so ::before sits behind */
    padding-bottom: 0;
    --hero-underline-color: var(--wp--preset--color--yellow);
    /* Background-coloured halo cuts the underline away behind descenders */
    -webkit-text-stroke: 5px var(--body-bg);
    paint-order: stroke fill;
}

/* Dark mode overrides */
body.dark-mode .wp-block-beech-hero .hero__heading .hero__heading-em {
    --hero-underline-color: #ffffff;
}

@media (prefers-color-scheme: dark) {
    body:not(.light-mode) .wp-block-beech-hero .hero__heading .hero__heading-em {
        --hero-underline-color: #ffffff;
    }
}

/* The underline itself – sits behind the text via z-index: -1 */
.wp-block-beech-hero .hero__heading .hero__heading-em::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 24px;
    background-color: var(--hero-underline-color);
    /* Even sine-like wave: 60 px tile, shallower amplitude */
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2060%2024%22%3E%3Cpath%20d%3D%22M0%2C12%20C10%2C7%2020%2C7%2030%2C12%20C40%2C17%2050%2C17%2060%2C12%22%20stroke%3D%22black%22%20stroke-width%3D%227%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
    -webkit-mask-repeat: repeat-x;
    -webkit-mask-size: 60px 24px;
    -webkit-mask-position: 0 0;
    mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2060%2024%22%3E%3Cpath%20d%3D%22M0%2C12%20C10%2C7%2020%2C7%2030%2C12%20C40%2C17%2050%2C17%2060%2C12%22%20stroke%3D%22black%22%20stroke-width%3D%227%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
    mask-repeat: repeat-x;
    mask-size: 60px 24px;
    mask-position: 0 0;
    animation: heroUnderlineSnake 1.05s linear infinite;
}

/* Scroll the tile start point so the wave flows like a snake */
@keyframes heroUnderlineSnake {
    from {
        -webkit-mask-position: 0 0;
        mask-position: 0 0;
    }

    to {
        -webkit-mask-position: 60px 0;
        mask-position: 60px 0;
    }
}

/* Mobile: shorter tile so the animation scrolls the right distance */
@keyframes heroUnderlineSnakeMobile {
    from {
        -webkit-mask-position: 0 0;
        mask-position: 0 0;
    }

    to {
        -webkit-mask-position: 40px 0;
        mask-position: 40px 0;
    }
}

/* ── Subtitle ────────────────────────────────────────── */

.hero__subtitle {
    font-family: var(--wp--preset--font-family--headings);
    font-size: clamp(1.125rem, 2.5vw, 2rem);
    line-height: 1.26;
    letter-spacing: -0.01em;
    max-width: 48rem;
    margin: 0;
}

/* ── Button ──────────────────────────────────────────── */

.hero__button {
    display: inline-block;
    text-decoration: none;
    color: #111414;
    background-color: var(--wp--preset--color--yellow);
    border: solid 1px var(--wp--preset--color--yellow);
    padding: 0.6rem 1.5rem 0.65rem;
    border-radius: 3rem;
    transition: all 150ms ease;
    position: relative;
    line-height: 1;
    font-size: 14px;
    white-space: nowrap;
}

.hero__button:hover {
    background-color: #111414;
    border-color: #111414;
    color: #ffffff;
}

/* ── Colour dots row ─────────────────────────────────── */

.hero__dots {
    display: flex;
    gap: 4px;
    align-items: center;
    cursor: pointer;
}

@keyframes heroDotJump {

    0%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-7px);
    }
}

.hero__dots:hover .hero__dot {
    animation: heroDotJump 0.4s ease both;
}

.hero__dots:hover .hero__dot:nth-child(1) {
    animation-delay: 0ms;
}

.hero__dots:hover .hero__dot:nth-child(2) {
    animation-delay: 50ms;
}

.hero__dots:hover .hero__dot:nth-child(3) {
    animation-delay: 100ms;
}

.hero__dots:hover .hero__dot:nth-child(4) {
    animation-delay: 150ms;
}

/* dot 5 hover/leave is handled by JS for a smooth return transition */

@keyframes heroDotJumpLast {
    0% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-7px);
    }

    100% {
        transform: translateY(-4px);
    }
}

.hero__dot {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hero__dot:nth-child(1) {
    background-color: var(--wp--preset--color--yellow);
}

.hero__dot:nth-child(2) {
    background-color: var(--wp--preset--color--rorange);
}

.hero__dot:nth-child(3) {
    background-color: var(--wp--preset--color--pink);
}

.hero__dot:nth-child(4) {
    background-color: var(--wp--preset--color--green);
}

.hero__dot:nth-child(5) {
    background-color: var(--wp--preset--color--blue);
}

/* ── Wide hero image ─────────────────────────────────── */

.hero__image-wrap {
    padding: 0 var(--gutter) var(--gutter);
}

.hero__img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    aspect-ratio: 21 / 9;
    object-fit: cover;
    border-radius: 12px;
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 768px) {
    .hero__inner {
        padding: var(--block-space) var(--gutter) calc(var(--block-space) * 0.75);
    }

    .hero__content {
        gap: 1.25rem;
    }

    .hero__text {
        gap: 1rem;
        padding: 0.5rem 0;
    }

    .hero__pills {
        max-width: 300px;
    }


    .hero__heading {
        font-size: clamp(1.5rem, 10vw, 3.5rem);
    }

    .hero__subtitle {
        font-size: clamp(1.2rem, 4vw, 1.5rem);
    }

    .hero__content--has-button {
        gap: 3rem;
    }

    .hero__img {
        aspect-ratio: 4 / 3;
        border-radius: 8px;
    }



    /* Squiggle: thinner stroke, higher frequency (40 px tile vs 60 px) */
    .wp-block-beech-hero .hero__heading .hero__heading-em::before {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2040%2024%22%3E%3Cpath%20d%3D%22M0%2C12%20C7%2C7%2013%2C7%2020%2C12%20C27%2C17%2033%2C17%2040%2C12%22%20stroke%3D%22black%22%20stroke-width%3D%224%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
        -webkit-mask-size: 40px 24px;
        mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2040%2024%22%3E%3Cpath%20d%3D%22M0%2C12%20C7%2C7%2013%2C7%2020%2C12%20C27%2C17%2033%2C17%2040%2C12%22%20stroke%3D%22black%22%20stroke-width%3D%224%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
        mask-size: 40px 24px;
        animation-name: heroUnderlineSnakeMobile;
    }
}