/* Homepage hero (11/2026) - template-parts/home-hero.php.

   Two layouts:
   - Circle (landscape screens at least 900px wide and 500px tall): the yellow
     circle over a full-bleed image, hero + quotes bar filling the first
     screen. Matches Erin's 1440px mock-up: circle 52% of the width, centred
     20% from the left and 70% down the hero, running off the left and bottom
     edges. The circle is sized by whichever runs out first - the width or the
     hero's height - so it never climbs into the logo/menu on short screens,
     and all its copy is sized from the circle so it always fits inside.
   - Tablet portrait (portrait screens 600px+ wide, Erin's tablet mock-up):
     the circle over the full portrait image, but much bigger - rising from
     the bottom-left corner - with the copy in its lower part, and two quotes
     at a time with dots.
   - Stacked (phones held upright, and narrow or very short landscape screens
     such as phones held sideways): image on top, copy in a yellow arc below. */

.nh-hero,
.nh-quotes {
    --nh-navy: #161e2b;
    --nh-yellow: #f8dc54;
    --nh-quotes-h: 104px;
}

/* ---- hero: desktop & landscape tablets ---- */

/* --nh-h: hero height (first screen minus the quotes bar, never under 560px).
   --nh-d: circle diameter - 52% of the width, or the hero height (x1.02, as in
   the mock-up), whichever is smaller. */
.nh-hero {
    --nh-h: max(560px, calc(100vh - var(--nh-quotes-h)));
    --nh-d: min(52vw, calc(var(--nh-h) * 1.02));
    background-color: var(--nh-navy);
    height: var(--nh-h);
    overflow: hidden;
    position: relative;
}

@supports (height: 100svh) {
    .nh-hero {
        --nh-h: max(560px, calc(100svh - var(--nh-quotes-h)));
    }
}

.nh-hero__media {
    inset: 0;
    position: absolute;
}

.nh-hero__media picture,
.nh-hero__media img {
    display: block;
    height: 100%;
    object-fit: cover;
    object-position: center;
    width: 100%;
}

.nh-hero__panel {
    background-color: var(--nh-yellow);
    border-radius: 50%;
    height: var(--nh-d);
    left: calc(var(--nh-d) * -0.115);
    position: absolute;
    top: calc(70% - var(--nh-d) / 2);
    width: var(--nh-d);
    z-index: 1;
}

/* Positions are % of the circle: 18.75% in = 3.75% of the width from the
   screen edge at full size; 75% wide (so "All the chocolate." wraps after
   "the", as in the mock-up); centred 43% down the circle. Font sizes and
   spacing below are fractions of the circle (--nh-d) for the same reason. */
.nh-hero__content {
    left: 18.75%;
    position: absolute;
    top: 43%;
    transform: translateY(-50%);
    width: 75%;
}

.nh-hero .nh-hero__heading {
    font-family: "bikobold", sans-serif;
    font-size: calc(var(--nh-d) * 0.0885);
    letter-spacing: 0.07em;
    line-height: 1.17;
    margin: 0;
    text-transform: none;
}

.nh-hero__heading-light,
.nh-hero__heading-dark {
    display: block;
}

.nh-hero__heading-light {
    color: #fff;
}

.nh-hero__heading-dark {
    color: var(--nh-navy);
}

.nh-hero .nh-hero__text {
    color: var(--nh-navy);
    font-family: "bikoregular", sans-serif;
    font-size: max(13px, calc(var(--nh-d) * 0.024));
    letter-spacing: 0.1em;
    line-height: 1.5;
    margin: calc(var(--nh-d) * 0.05) 0 calc(var(--nh-d) * 0.069);
}

.nh-hero__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--nh-d) * 0.024);
}

.nh-hero .nh-hero__button {
    border: 1px solid var(--nh-navy);
    box-sizing: border-box;
    color: var(--nh-navy);
    display: inline-block;
    font-family: "bikobold", sans-serif;
    font-size: max(11px, calc(var(--nh-d) * 0.0183));
    letter-spacing: 0.14em;
    line-height: 1.2;
    min-width: calc(var(--nh-d) * 0.254);
    padding: calc(var(--nh-d) * 0.0202) calc(var(--nh-d) * 0.0404);
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nh-hero .nh-hero__button--solid {
    background-color: var(--nh-navy);
    color: #fff;
}

.nh-hero .nh-hero__button--outline {
    background-color: transparent;
}

.nh-hero .nh-hero__button--solid:hover,
.nh-hero .nh-hero__button--solid:focus-visible {
    background-color: #fff;
    border-color: #fff;
    color: var(--nh-navy);
}

.nh-hero .nh-hero__button--outline:hover,
.nh-hero .nh-hero__button--outline:focus-visible {
    background-color: var(--nh-navy);
    color: #fff;
}

/* ---- quotes bar ---- */

.nh-quotes {
    align-items: center;
    background-color: var(--nh-navy);
    box-sizing: border-box;
    color: #fff;
    display: flex;
    height: var(--nh-quotes-h);
    padding: 0 48px;
    position: relative;
}

.nh-quotes__track {
    display: flex;
    flex: 1;
    height: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.nh-quotes__track::-webkit-scrollbar {
    display: none;
}

.nh-quotes__track:focus-visible {
    outline: 1px solid var(--nh-yellow);
    outline-offset: -1px;
}

.nh-quotes__item {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    flex: 0 0 25%;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 0 24px;
    scroll-snap-align: start;
}

.nh-quotes__quote {
    margin: 0;
    max-width: 260px;
}

.nh-quotes .nh-quotes__quote p {
    color: #fff;
    font-family: "bikoregular", sans-serif;
    font-size: 12px;
    letter-spacing: 0.02em;
    line-height: 1.45;
    margin: 0;
    text-transform: none;
}

.nh-quotes__quote p::before,
.nh-quotes__quote p::after {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
    font-weight: bold;
    line-height: 0;
    position: relative;
    top: 0.32em;
}

.nh-quotes__quote p::before {
    content: "\201C";
    margin-right: 6px;
}

.nh-quotes__quote p::after {
    content: "\201D";
    margin-left: 6px;
}

.nh-quotes__source {
    margin-top: 8px;
}

.nh-quotes__source cite {
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    font-style: italic;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Publication logos (theme img/press/ or uploaded): white on transparent. */
.nh-quotes__logo {
    display: block;
    height: auto;
    max-height: 26px;
    max-width: 140px;
    width: auto;
}

/* The round Great Taste badge needs more height to read at the same weight. */
.nh-quotes__logo.nh-quotes__logo--badge {
    max-height: 40px;
}

.nh-quotes__arrow {
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    height: 40px;
    opacity: 0.7;
    padding: 10px 7px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
}

.nh-quotes__arrow:hover,
.nh-quotes__arrow:focus-visible {
    opacity: 1;
}

.nh-quotes__arrow svg {
    display: block;
    height: 100%;
    width: 100%;
}

.nh-quotes__arrow--prev {
    left: 12px;
}

.nh-quotes__arrow--next {
    right: 12px;
}

.nh-quotes__dots {
    display: none;
}

@media (max-width: 1279px) {
    .nh-quotes__item {
        flex-basis: 33.333%;
    }
}

/* ---- stacked layout: image on top, copy in a yellow arc below ----
   Phones held upright, and narrow or very short landscape screens such as
   phones held sideways. */

@media (max-width: 599px), (max-height: 500px), (max-width: 899px) and (min-aspect-ratio: 1001/1000) {
    .nh-hero {
        background-color: var(--nh-yellow);
        height: auto;
        min-height: 0;
    }

    .nh-hero__media {
        height: min(112vw, max(62vh, 320px));
        inset: auto;
        position: relative;
    }

    .nh-hero__media picture,
    .nh-hero__media img {
        object-position: center top;
    }

    .nh-hero__panel {
        border-radius: 50% 50% 0 0 / min(20vw, 110px) min(20vw, 110px) 0 0;
        display: block;
        height: auto;
        left: auto;
        margin-top: max(-20vw, -110px);
        padding: 13vw 6.6vw 12vw;
        position: relative;
        top: auto;
        width: auto;
    }

    .nh-hero__content {
        margin: 0 auto;
        max-width: 600px;
        position: static;
        transform: none;
        width: auto;
    }

    .nh-hero .nh-hero__heading {
        font-size: max(34px, min(10.4vw, 64px));
        letter-spacing: 0.05em;
        line-height: 1.13;
    }

    .nh-hero .nh-hero__text {
        font-size: max(15px, min(4.1vw, 19px));
        letter-spacing: 0.07em;
        line-height: 1.75;
        margin: 8vw 0;
    }

    .nh-hero .nh-hero__text br {
        display: none;
    }

    .nh-hero__buttons {
        flex-direction: column;
        gap: 12px;
    }

    .nh-hero .nh-hero__button {
        font-size: 15px;
        letter-spacing: 0.16em;
        min-width: 0;
        padding: 17px 20px;
        width: 100%;
    }

}

/* ---- tablet portrait: circle over the full portrait image ----
   Measured from Erin's 820px-wide tablet mock-up. Everything is in vw and
   anchored to the bottom of the hero: the circle is 120% of the width,
   centred 39% from the left and 3.5vw above the bottom; the copy is 7.3vw
   from the left and ends 12vw above the bottom. The hero is the mock-up's
   proportions (147.5vw tall) but never taller than the screen; the image
   fills whatever is above the circle. */

@media (min-width: 600px) and (max-aspect-ratio: 1/1) {
    .nh-hero {
        --nh-h: min(147.5vw, 100vh);
        min-height: 0;
    }

    @supports (height: 100svh) {
        .nh-hero {
            --nh-h: min(147.5vw, 100svh);
        }
    }

    /* Bottom-aligned: on squarer iPads (3:4) the screen is shorter than the
       mock-up, so crop foliage off the top rather than hide the products
       behind the circle. */
    .nh-hero__media picture,
    .nh-hero__media img {
        object-position: center bottom;
    }

    .nh-hero__panel {
        bottom: -56.4vw;
        height: 119.8vw;
        left: -20.9vw;
        top: auto;
        width: 119.8vw;
    }

    .nh-hero__content {
        bottom: 68.5vw;
        left: 28.2vw;
        top: auto;
        transform: none;
        width: 72vw;
    }

    .nh-hero .nh-hero__heading {
        font-size: 7.1vw;
        line-height: 1.1;
    }

    .nh-hero .nh-hero__text {
        font-size: 2.3vw;
        letter-spacing: 0.08em;
        margin: 4.4vw 0 5.6vw;
    }

    .nh-hero__buttons {
        gap: 3.6vw;
    }

    .nh-hero .nh-hero__button {
        font-size: 1.95vw;
        letter-spacing: 0.16em;
        min-width: 26.8vw;
        padding: 2.4vw 3vw;
    }

    /* Two quotes at a time, centred, with dots instead of arrows. */
    .nh-quotes {
        display: block;
        height: auto;
        padding: 6.3vw 4vw 4.5vw;
    }

    .nh-quotes__item {
        flex-basis: 50%;
        text-align: center;
    }

    .nh-quotes__quote {
        max-width: none;
    }

    .nh-quotes .nh-quotes__quote p {
        font-size: max(14px, 2vw);
    }

    .nh-quotes__quote p::before,
    .nh-quotes__quote p::after {
        font-family: inherit;
        font-size: inherit;
        font-weight: normal;
        line-height: inherit;
        margin: 0;
        top: 0;
    }

    .nh-quotes__source {
        margin-top: 1.6vw;
    }

    .nh-quotes__source cite {
        font-size: max(17px, 2.5vw);
    }

    .nh-quotes__logo {
        margin: 0 auto;
        max-height: max(28px, 3.6vw);
        max-width: 200px;
    }

    .nh-quotes__logo.nh-quotes__logo--badge {
        max-height: max(48px, 6.4vw);
    }

    .nh-quotes__arrow {
        display: none;
    }

    .nh-quotes__dots {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-top: 6vw;
    }

    .nh-quotes__dots span {
        background-color: rgba(255, 255, 255, 0.35);
        border-radius: 50%;
        height: 9px;
        width: 9px;
    }

    .nh-quotes__dots span.is-active {
        background-color: #fff;
    }
}

/* Landscape screens in the stacked layout (phones held sideways) get the
   landscape image - centre it. */
@media (max-height: 500px) and (min-aspect-ratio: 1001/1000), (max-width: 899px) and (min-aspect-ratio: 1001/1000) {
    .nh-hero__media picture,
    .nh-hero__media img {
        object-position: center;
    }
}

/* ---- stacked layout: one quote at a time, with dots ---- */

@media (max-width: 599px), (max-height: 500px), (max-width: 899px) and (min-aspect-ratio: 1001/1000) {
    .nh-quotes {
        display: block;
        height: auto;
        padding: 34px 20px 26px;
    }

    .nh-quotes__item {
        flex-basis: 100%;
        padding: 0 8px;
        text-align: center;
    }

    .nh-quotes__quote {
        max-width: 420px;
    }

    .nh-quotes .nh-quotes__quote p {
        font-size: 16px;
    }

    .nh-quotes__quote p::before,
    .nh-quotes__quote p::after {
        font-family: inherit;
        font-size: inherit;
        font-weight: normal;
        line-height: inherit;
        margin: 0;
        top: 0;
    }

    .nh-quotes__source {
        margin-top: 14px;
    }

    .nh-quotes__source cite {
        font-size: 22px;
    }

    .nh-quotes__logo {
        margin: 0 auto;
        max-height: 32px;
        max-width: 190px;
    }

    .nh-quotes__logo.nh-quotes__logo--badge {
        max-height: 56px;
    }

    .nh-quotes__arrow {
        display: none;
    }

    .nh-quotes__dots {
        display: flex;
        gap: 10px;
        justify-content: center;
        margin-top: 20px;
    }

    .nh-quotes__dots span {
        background-color: rgba(255, 255, 255, 0.35);
        border-radius: 50%;
        height: 9px;
        width: 9px;
    }

    .nh-quotes__dots span.is-active {
        background-color: #fff;
    }
}

/* Up to 1280px customize.css adds 12px of padding under the logo link, and
   the next image in the logo sprite showed through it as white marks under
   the white homepage logo. Clip the sprite to the logo itself. */
.nibble-home-hero header.main-site-header h1 a,
.nibble-home-hero header.main-site-header #logo a {
    background-clip: content-box;
}

/* ---- "Navy (for light images)" logo & menu option ---- */

.nibble-home-hero--dark-header:not(.scrolled) header.main-site-header h1 a,
.nibble-home-hero--dark-header:not(.scrolled) header.main-site-header #logo a {
    background-position: 0 0 !important;
}

@media (min-width: 1280px) {
    .nibble-home-hero--dark-header:not(.scrolled) header.main-site-header nav > ul > li > a,
    .nibble-home-hero--dark-header:not(.scrolled) header.main-site-header nav > ul > li > span,
    .nibble-home-hero--dark-header:not(.scrolled) header.main-site-header nav li.sign-in-links ul li a {
        color: var(--nh-navy, #161e2b);
    }

    /* The white basket icon is a sprite; darken it rather than add a navy one. */
    .nibble-home-hero--dark-header:not(.scrolled) header.main-site-header a#my-basket-link:after {
        filter: brightness(0);
    }
}
