/* =============================================================
   Homepage Preview — fresh layout, not the existing shortcodes.
   Scoped under .hp-preview to avoid leaking into other pages.
   ============================================================= */

.hp-preview {
    --hp-bg: #fafaf8;
    --hp-surface: #ffffff;
    --hp-ink: #14110f;
    --hp-ink-muted: #555;
    --hp-line: #e8e4dd;
    --hp-brand: var(--primary-color, #b32b1c);
    --hp-brand-deep: #8a1f15;
    --hp-accent: #2d6a4f;

    background: var(--hp-bg);
    color: var(--hp-ink);
    font-family: var(--primary-font, 'Work Sans'), sans-serif;
    line-height: 1.5;
}

.hp-preview *,
.hp-preview *::before,
.hp-preview *::after {
    box-sizing: border-box;
}

/* Shared eyebrows + buttons */
.hp-eyebrow {
    color: var(--hp-brand);
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.hp-eyebrow--light { color: rgba(255, 255, 255, 0.85); }

.hp-btn {
    align-items: center;
    border: 1.5px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 15px;
    font-weight: 700;
    gap: 6px;
    justify-content: center;
    line-height: 1.2;
    min-height: 48px;
    padding: 0 22px;
    text-decoration: none;
    transition: filter 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.hp-btn--primary { background: var(--hp-brand); color: #fff !important; }
.hp-btn--primary:hover { filter: brightness(0.92); color: #fff !important; }
.hp-btn--ghost { background: transparent; border-color: var(--hp-ink); color: var(--hp-ink) !important; }
.hp-btn--ghost:hover { background: var(--hp-ink); color: #fff !important; }
.hp-btn--white { background: #fff; color: var(--hp-brand) !important; border-color: #fff; }
.hp-btn--white:hover { background: rgba(255,255,255,0.92); color: var(--hp-brand) !important; }
.hp-btn--lg { min-height: 56px; padding: 0 28px; font-size: 16px; }

/* Section primitives */
.hp-section {
    margin: 0 auto;
    max-width: 1280px;
    padding: 64px 24px;
}
.hp-section__head {
    margin-bottom: 28px;
    max-width: 720px;
}
.hp-section__head--with-link {
    align-items: end;
    display: flex;
    justify-content: space-between;
    max-width: none;
    flex-wrap: wrap;
    gap: 16px;
}
.hp-section__title {
    color: var(--hp-ink);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0;
}
.hp-section__link {
    color: var(--hp-brand);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.hp-section__link:hover { text-decoration: underline; }

/* ============ 1. Utility strip ============ */
.hp-utility {
    background: var(--hp-ink);
    color: #fff;
    position: relative;
    z-index: 1;
}

/* When the theme's main header becomes sticky during scroll, hide the
   utility strip so we don't get a duplicate dark band stacked under the
   white sticky header. The strip is only useful at the very top of the
   page; once the user has scrolled past it, the sticky header takes over
   that role. Uses :has() so it scopes only to the homepage-preview. */
body:has(.header.header--sticky) .hp-preview .hp-utility {
    display: none;
}
.hp-utility__inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 14px 20px;
    justify-content: center;
    margin: 0 auto;
    max-width: 1280px;
    padding: 10px 24px;
}
.hp-utility__pill {
    align-items: center;
    color: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.hp-utility__pill::before {
    background: var(--hp-accent);
    border-radius: 50%;
    content: "";
    display: inline-block;
    height: 6px;
    margin-right: 8px;
    width: 6px;
}
.hp-utility__link {
    color: #fff;
    font-weight: 600;
    margin-left: auto;
    text-decoration: none;
}
.hp-utility__link:hover { text-decoration: underline; color: #fff; }

/* ============ 2. Hero ============ */
.hp-hero {
    /* background-color is set inline by the shortcode; the fallback below
       only kicks in if the inline color is missing for any reason. */
    background-color: #14110f;
    overflow: hidden;
    position: relative;
}

/* Solid-color mode: just the inline background-color is shown, no overlay. */
.hp-hero--color {
    /* nothing extra — section's inline bg-color provides the look. */
}

/* Mode: image (default) — single bg layer, inline-styled in markup */
.hp-hero__bg {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    inset: 0;
    position: absolute;
    z-index: 0;
}

/* Mode: video — full-bleed muted loop (HTML5 file) */
.hp-hero__media {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    width: 100%;
    z-index: 0;
}

/* Mode: video via YouTube/Vimeo iframe. Iframes can't `object-fit: cover`
   their content, so we scale the iframe up to ~177% of its container
   (16:9 = 177vh wide for full-height fit) and translate to center it.
   This crops the letterboxing on both sides and gives a true background
   effect. The wrapper hides overflow. */
.hp-hero__media-wrap--embed {
    height: 100%;
    inset: 0;
    overflow: hidden;
    pointer-events: none; /* iframe steals clicks otherwise */
    position: absolute;
    width: 100%;
    z-index: 0;
}
.hp-hero__media--embed {
    border: 0;
    height: 56.25vw; /* 16:9 of viewport width */
    left: 50%;
    min-height: 100%;
    min-width: 177.78vh; /* 16:9 of viewport height (100vh * 16/9) */
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
}

/* Mode: slider — stacked layers cross-fading via CSS keyframes
   Each slide is delayed by 6s so the cycle length must equal
   (slides * 6s). 4 slides → 24s loop. Adjust if slide count changes. */
.hp-hero__slider {
    inset: 0;
    position: absolute;
    z-index: 0;
}
.hp-hero__slide {
    animation: hpHeroSlideFade 24s infinite;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    inset: 0;
    opacity: 0;
    position: absolute;
}
@keyframes hpHeroSlideFade {
    0%, 20%   { opacity: 1; }
    25%, 95%  { opacity: 0; }
    100%      { opacity: 0; }
}

/* Shared darkening overlay — sits above the media but below the text.
   Opacity is driven by --hp-hero-overlay (0-1) set inline on .hp-hero.
   Solid black so 0 = transparent and 100 = fully opaque, with an even,
   linear range in between. */
.hp-hero__overlay {
    background: rgba(0, 0, 0, var(--hp-hero-overlay, 0.6));
    inset: 0;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}
.hp-hero__inner {
    margin: 0 auto;
    max-width: 1280px;
    padding: 96px 24px 80px;
    position: relative;
    z-index: 2;
}
.hp-hero__title {
    color: #fff;
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 0 0 18px;
    max-width: 920px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.18);
}
.hp-hero__title-accent {
    background: linear-gradient(90deg, #ffd56b, #ffb147);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hp-hero__lede {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    line-height: 1.55;
    margin: 0 0 28px;
    max-width: 620px;
}
.hp-hero__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 56px;
}
.hp-hero__ctas .hp-btn--ghost {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff !important;
    backdrop-filter: blur(2px);
}
.hp-hero__ctas .hp-btn--ghost:hover {
    background: #fff;
    color: var(--hp-ink) !important;
    border-color: #fff;
}
.hp-hero__metrics {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    display: grid;
    gap: 0;
    grid-template-columns: repeat(4, 1fr);
    padding: 22px 8px;
}
.hp-metric {
    border-right: 1px solid var(--hp-line);
    padding: 6px 14px;
    text-align: center;
}
.hp-metric:last-child { border-right: 0; }
.hp-metric__num {
    color: var(--hp-ink);
    display: block;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1;
    margin-bottom: 4px;
}
.hp-metric__label {
    color: var(--hp-ink-muted);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ============ 3. Use cases ============ */
.hp-usecases__grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.hp-usecase {
    background: var(--hp-surface);
    border: 1px solid var(--hp-line);
    border-radius: 12px;
    color: var(--hp-ink) !important;
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.hp-usecase:hover {
    border-color: var(--hp-brand);
    box-shadow: 0 12px 30px rgba(20, 17, 15, 0.08);
    transform: translateY(-2px);
    color: var(--hp-ink) !important;
}
.hp-usecase__icon {
    align-items: center;
    background: rgba(179, 43, 28, 0.08);
    border-radius: 10px;
    color: var(--hp-brand);
    display: inline-flex;
    font-size: 22px;
    height: 48px;
    justify-content: center;
    line-height: 1;
    margin-bottom: 14px;
    width: 48px;
}
.hp-usecase:hover .hp-usecase__icon {
    background: var(--hp-brand);
    color: #fff;
}
.hp-usecase__title {
    color: var(--hp-ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 6px;
}
.hp-usecase__blurb {
    color: var(--hp-ink-muted);
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.hp-usecase__cta {
    color: var(--hp-brand);
    font-size: 14px;
    font-weight: 700;
}

/* ============ 4. Inventory grid ============ */
.hp-inventory__grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, 1fr);
}
.hp-inventory__card.ps-product {
    background: var(--hp-surface);
    border: 1px solid var(--hp-line);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.hp-inventory__card.ps-product:hover {
    border-color: var(--hp-brand);
    box-shadow: 0 12px 30px rgba(20, 17, 15, 0.06);
}
.hp-inventory .ps-product__container { padding: 14px 16px 18px; }

/* ============ 5. How it works ============ */
.hp-howitworks { background: var(--hp-surface); border-top: 1px solid var(--hp-line); border-bottom: 1px solid var(--hp-line); max-width: none; padding-left: 0; padding-right: 0; }
.hp-howitworks > .hp-section__head { padding: 0 24px; margin: 0 auto 28px; max-width: 1280px; }
.hp-steps {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(4, 1fr);
    list-style: none;
    margin: 0 auto;
    max-width: 1280px;
    padding: 0 24px;
}
.hp-step {
    background: var(--hp-bg);
    border: 1px solid var(--hp-line);
    border-radius: 12px;
    padding: 28px 22px;
    position: relative;
}
.hp-step__num {
    align-items: center;
    background: var(--hp-brand);
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: 18px;
    font-weight: 800;
    height: 40px;
    justify-content: center;
    margin-bottom: 16px;
    width: 40px;
}
.hp-step__title {
    color: var(--hp-ink);
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
}
.hp-step__body {
    color: var(--hp-ink-muted);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
}

/* ============ 6. Why us ============ */
.hp-whyus__grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
}
.hp-whyus__cell {
    background: var(--hp-surface);
    border: 1px solid var(--hp-line);
    border-radius: 12px;
    padding: 22px 22px 24px;
}
.hp-whyus__icon {
    align-items: center;
    background: rgba(45, 106, 79, 0.08);
    border-radius: 10px;
    color: var(--hp-accent);
    display: inline-flex;
    font-size: 22px;
    height: 48px;
    justify-content: center;
    line-height: 1;
    margin-bottom: 14px;
    width: 48px;
}
.hp-whyus__cell h3 {
    color: var(--hp-ink);
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
}
.hp-whyus__cell p {
    color: var(--hp-ink-muted);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

/* ============ 7. Dealer strip ============ */
.hp-dealer-strip {
    background: linear-gradient(135deg, var(--hp-ink) 0%, #2a221d 100%);
    color: #fff;
}
.hp-dealer-strip__inner {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1280px;
    padding: 56px 24px;
}
.hp-dealer-strip__title {
    color: #fff;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 4px 0 8px;
}
.hp-dealer-strip__lede {
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    margin: 0;
    max-width: 520px;
}

/* ============ 8. FAQ ============ */
.hp-faq__list {
    list-style: none;
    margin: 0;
    max-width: 880px;
    padding: 0;
}
.hp-faq__item {
    border-bottom: 1px solid var(--hp-line);
    padding: 4px 0;
}
.hp-faq__item:first-child { border-top: 1px solid var(--hp-line); }
.hp-faq__item details { padding: 16px 0; }
.hp-faq__q {
    color: var(--hp-ink);
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
    list-style: none;
    padding-right: 32px;
    position: relative;
}
.hp-faq__q::-webkit-details-marker { display: none; }
.hp-faq__q::after {
    color: var(--hp-brand);
    content: "+";
    font-size: 24px;
    font-weight: 400;
    position: absolute;
    right: 0;
    top: -4px;
    transition: transform 0.15s ease;
}
.hp-faq__item details[open] .hp-faq__q::after { content: "−"; }
.hp-faq__a {
    color: var(--hp-ink-muted);
    font-size: 15px;
    line-height: 1.6;
    margin: 10px 0 0;
    padding-right: 36px;
}

/* ============ 9. Final CTA ============ */
.hp-final-cta {
    background:
        linear-gradient(135deg, rgba(179, 43, 28, 0.92), rgba(138, 31, 21, 0.92)),
        url('https://staging.nustore.io/storage/nustore-tw/sheds/mrzhBNI9bIej8OyMl~PVUg==.webp') center/cover no-repeat;
    color: #fff;
    padding: 80px 24px;
    text-align: center;
}
.hp-final-cta__title {
    color: #fff;
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 12px;
}
.hp-final-cta__lede {
    color: rgba(255, 255, 255, 0.9);
    font-size: 17px;
    margin: 0 auto 28px;
    max-width: 520px;
}
.hp-final-cta__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
.hp-final-cta .hp-btn--primary {
    background: #fff;
    color: var(--hp-brand) !important;
}
.hp-final-cta .hp-btn--ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff !important;
}
.hp-final-cta .hp-btn--ghost:hover {
    background: #fff;
    color: var(--hp-brand) !important;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .hp-inventory__grid { grid-template-columns: repeat(3, 1fr); }
    .hp-whyus__grid { grid-template-columns: repeat(2, 1fr); }
    .hp-steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .hp-section { padding: 48px 18px; }
    .hp-section__title { font-size: 26px; }
    .hp-hero__inner { padding: 72px 18px 56px; }
    .hp-hero__title { font-size: 38px; }
    .hp-hero__lede { font-size: 16px; }
    .hp-hero__metrics {
        grid-template-columns: repeat(2, 1fr);
        padding: 14px 6px;
    }
    .hp-metric {
        border-bottom: 1px solid var(--hp-line);
        padding: 12px 8px;
    }
    .hp-metric:nth-last-child(-n+2) { border-bottom: 0; }
    .hp-metric:nth-child(2n) { border-right: 0; }
    .hp-inventory__grid { grid-template-columns: repeat(2, 1fr); }
    .hp-whyus__grid { grid-template-columns: 1fr; }
    .hp-steps { grid-template-columns: 1fr; padding: 0 18px; }
    .hp-howitworks > .hp-section__head { padding: 0 18px; }
    .hp-dealer-strip__inner { padding: 40px 18px; }
    .hp-utility__link { margin-left: 0; }
    .hp-faq__q { font-size: 16px; }
}
