/* Prevent subpixel hairline gaps between full-width sections and overlays. */
main {
    display: flow-root;
    background: var(--color-paper);
}

main > :is(section, .section-divider, .section-bg, .section-bg-texture, .contact-bg-section, .catalog-page-bg, .olive-product-top) {
    margin-block: 0;
}

main > :is(section, .section-divider, .section-bg, .section-bg-texture, .contact-bg-section, .catalog-page-bg, .olive-product-top)
+ :is(section, .section-divider, .section-bg, .section-bg-texture, .contact-bg-section, .catalog-page-bg, .olive-product-top) {
    margin-top: -1px;
}

.section-divider {
    position: relative;
    z-index: 20;
    height: 6px;
    margin-block: -1px;
    flex: 0 0 auto;
}

.section-divider--inset {
    margin-block: -1px;
    margin-inline: 5%;
}

main :is(
    .section-bg,
    .contact-bg-section,
    .catalog-page-bg,
    .brands,
    .olives,
    .oil,
    .specialties,
    .partners,
    .legal-hero,
    .legal-body,
    .sp-intro,
    .sp-grid,
    .sp-crosslinks,
    .op-products,
    .about-story,
    .about-quality-section,
    .olives-cat-section,
    .calibres-characteristics,
    .calibres-specifications,
    .calibres-applications,
    .oils-pomace,
    .op-hero--dairy,
    .op-story--dairy,
    .op-uses--dairy,
    .op-crosslinks--dairy,
    .product-characteristics,
    .products-carousel-section,
    .product-sizes,
    .product-packaging,
    .product-cta,
    .dr-crosslinks,
    .olh-hero__slab,
    .olh-why
)::before {
    inset: -1px;
}

main :is([class*="__overlay"], [class*="__bg"]) {
    inset: -1px;
}

main .hero-overlay {
    top: -1px;
    left: -1px;
    width: calc(100% + 2px);
    height: calc(100% + 2px);
}

/* Loaded after page CSS: reserve room for the large overlay header on laptop-height viewports. */
@media (min-width: 768px) and (max-height: 900px) {
    .header {
        padding: 22px 48px 22px 22px;
    }

    .header:not(.scrolled) .logo img {
        height: 88px;
    }

    .hero,
    .about-story,
    .sp-hero,
    .oils-hero,
    .dr-hero,
    .op-hero {
        box-sizing: border-box;
        align-items: center;
        padding-top: clamp(116px, 16vh, 146px);
    }

    .hero {
        justify-content: center;
    }

    .sp-hero,
    .dr-hero {
        justify-content: center;
    }

    .hero-content,
    .sp-hero__inner,
    .oils-hero__inner,
    .dr-hero__inner,
    .op-hero__inner {
        padding-top: 0;
    }

    .hero-card h1,
    .sp-hero__title,
    .oils-hero__title,
    .dr-hero__title {
        font-size: clamp(2.15rem, 4vw, 3.55rem);
    }

    .op-hero__title {
        font-size: clamp(1.95rem, 3.2vw, 2.75rem);
    }

    .hero-card p,
    .sp-hero__subtitle,
    .oils-hero__subtitle,
    .dr-hero__subtitle,
    .op-hero__desc {
        font-size: clamp(0.9rem, 1.25vw, 1rem);
        line-height: 1.48;
    }

    .oils-hero__mask-wrap {
        max-width: 280px;
    }

    .olh-hero__brand {
        top: 116px;
        gap: 6px;
    }

    .olh-hero__copy {
        gap: 6px;
    }

    .olh-hero__title {
        font-size: clamp(2.35rem, 5.2vw, 4.15rem);
        letter-spacing: 0;
    }

    .olh-hero__tagline {
        font-size: clamp(0.8rem, 1.2vw, 0.95rem);
        max-width: 280px;
    }

    .olh-hero__cta {
        margin-top: 8px;
        padding: 9px 20px;
        font-size: 0.8rem;
    }

    .olh-hero__slab {
        padding-bottom: 72px;
    }

    .olh-hero__pack {
        max-width: min(230px, 24vw);
    }

    .olh-hero__flavour-tag {
        bottom: 22px;
        padding: 7px 16px;
        font-size: 0.72rem;
    }

    .op-hero__inner {
        padding-bottom: 54px;
    }

    .op-hero__bottle:nth-child(1) .op-hero__bottle-img { height: clamp(62px, 7vw, 82px); }
    .op-hero__bottle:nth-child(2) .op-hero__bottle-img { height: clamp(84px, 10vw, 118px); }
    .op-hero__bottle:nth-child(3) .op-hero__bottle-img { height: clamp(108px, 13vw, 152px); }
    .op-hero__bottle:nth-child(4) .op-hero__bottle-img { height: clamp(136px, 17vw, 196px); }

    .op-hero--dark .op-hero__bottle:nth-child(1) .op-hero__bottle-img { height: clamp(112px, 15vw, 174px); }
    .op-hero--dark .op-hero__bottle:nth-child(2) .op-hero__bottle-img { height: clamp(150px, 20vw, 236px); }

    .op-hero--dairy .op-hero__bottle-img {
        height: clamp(86px, 10vw, 118px) !important;
    }
}

@media (min-width: 768px) and (max-width: 1280px) {
    .hero-card h1,
    .sp-hero__title,
    .oils-hero__title,
    .dr-hero__title {
        font-size: clamp(2.25rem, 4.4vw, 3.7rem);
    }

    .op-hero__title {
        font-size: clamp(1.95rem, 3.2vw, 2.85rem);
    }

    .oils-hero__inner,
    .dr-hero__inner,
    .op-hero__inner {
        gap: clamp(34px, 5vw, 60px);
    }
}
