/* ================================================================
   Homepage  (only loaded on the front page)
   ================================================================ */

/* ---- Constrain inner blocks to max 1280px ---- */
.hp-section .wp-block-reviewit-blocks-company-logos,
.hp-section .wp-block-latest-comments {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Reviews carousel ---- */
.hp-reviews .wp-block-latest-comments {
    display: block !important; /* override the CSS grid from latest-comments.css */
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
}

.hp-reviews .wp-block-latest-comments .wp-block-latest-comments__comment {
    padding: 0 10px 4px;
}

/* Equal-height slides — make the track a flex row so all slides share the tallest height */
.hp-reviews .wp-block-latest-comments .slick-track {
    display: flex !important;
}

.hp-reviews .wp-block-latest-comments .slick-slide {
    height: inherit !important;
    display: flex !important;
    flex-direction: column;
    overflow: visible !important;
}

/* Slick wraps each item in an extra <div> — stretch the full chain */
.hp-reviews .wp-block-latest-comments .slick-slide > div,
.hp-reviews .wp-block-latest-comments .slick-slide > div > li {
    width: 100%;
    height: 100%;
}

.hp-reviews .wp-block-latest-comments .rewct-lc-card {
    margin: 4px 0; /* keep box-shadow visible */
    height: 100%;
}

/* Hide per-review score (X/5) in the homepage carousel */
.hp-reviews .rewct-lc-card__score {
    display: none;
}

/* Truncate excerpt to 4 lines */
.hp-reviews .rewct-lc-card__excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: none;
}

/* Carousel arrow buttons */
.hp-carousel-arrows {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    background: transparent;
    color: var(--color-primary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0;
}

.hp-arrow:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ---- Theme overrides — neutralise .hentry/.entry-content rules that bleed in ---- */

/* Remove the extra Storefront margin that creates a gap between the fixed header
   and the hero — only keep the 68px offset for the fixed nav height */
.home #page {
    padding-top: 68px !important;
}
@media (max-width: 768px) {
    .home #page {
        padding-top: 60px !important;
    }
}

/* Remove the h2 underline + excess spacing from section titles */
.hp-section-title {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove h2 underline from CTA title without killing its bottom margin */
.hp-cta-title {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
}

/* Remove h3 top margin inside cards */
.hp-how-title {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

/* Tighten paragraph margin inside cards */
.hp-how-desc {
    margin-bottom: 0 !important;
}

.hp-how-desc + .hp-how-desc {
    margin-top: 10px !important;
}

/* Remove the 1.5em bottom margin Gutenberg/theme adds to every group block */
.entry-content .wp-block-group.hp-section,
.entry-content .wp-block-group.hp-cta {
    margin-bottom: 0 !important;
}

/* ---- Section layout ---- */
.hp-section {
    padding: 80px 5%;
}

.hp-section-alt {
    background: var(--color-bg-light);
}

.hp-section-head {
    max-width: 1280px;
    margin: 0 auto 40px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.hp-section-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary-hover);
    margin-bottom: 8px;
}

.hp-section-title {
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    line-height: 1.2;
    margin: 0;
}

.hp-section-more {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.hp-section-more:hover {
    gap: 10px;
    color: var(--color-primary);
}

.hp-content-wrap {
    max-width: 1280px;
    margin: 0 auto;
}

/* ---- How It Works cards ---- */
.hp-how-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.hp-how-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px 28px;
    border: 1.5px solid var(--color-border);
}

.hp-how-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 206, 201, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.4rem;
}

.hp-how-icon img,
.hp-how-icon svg {
    width: 26px;
    height: 26px;
    display: block;
}

.hp-how-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 10px;
}

.hp-how-desc {
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin: 0;
}

.hp-how-desc + .hp-how-desc {
    margin-top: 10px;
}

/* ---- CTA section ---- */
.hp-cta {
    background: var(--color-primary);
    padding: 80px 5%;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hp-cta::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.hp-cta::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

.hp-cta-inner {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hp-cta-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 14px;
}

.hp-cta-sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.82);
    max-width: 500px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.hp-cta-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hp-btn-white {
    font-size: 0.95rem;
    font-weight: 700;
    color: #007a78;
    background: #fff;
    padding: 13px 30px;
    border-radius: 50px;
    text-decoration: none !important;
    display: inline-block;
    transition: background 0.15s ease;
}

.hp-btn-white:hover {
    color: #007a78;
    background: rgba(255, 255, 255, 0.9);
    text-decoration: none !important;
}

.hp-btn-outline {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    padding: 13px 30px;
    border-radius: 50px;
    text-decoration: none !important;
    display: inline-block;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.hp-btn-outline:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none !important;
}


/* ---- Responsive ---- */
@media (max-width: 900px) {
    .hp-how-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .hp-section {
        padding: 60px 5%;
    }

    .hp-section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* ================================================================
   Hero section
   ================================================================ */

/* Clean gradient background — hide the cover image */
.hero-cover {
    background: linear-gradient(160deg, #e0fffe 0%, #f0fffe 40%, #ffffff 100%) !important;
    min-height: 320px;
    padding: 60px 20px !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
    position: relative !important;
    overflow: hidden;
}

.hero-cover .wp-block-cover__inner-container {
    position: relative;
    z-index: 1;
}

.hero-floating-icon {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
}

.hero-floating-icon.hero-mobile {
    display: none;
}

.hero-floating-icon img {
    width: 100%;
    height: 100%;
    animation: heroSpin 180s linear infinite;
}

@keyframes heroSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Middle-left: anti-clockwise, starts rotated ~90deg (turned sideways) */
.hero-float-a {
    animation: heroFloatA 380s ease-in-out infinite;
}

.hero-float-a img {
    animation-direction: reverse;
    animation-delay: -45s; /* 45/180 * 360 = 90deg — turned sideways */
}

/* Bottom-left: starts rotated ~180deg (upside down) */
.hero-float-b {
    animation: heroFloatB 220s ease-in-out infinite;
}

.hero-float-b img {
    animation-delay: 0s; /* starts at 0deg — normal upright position */
}

/* Middle-right: clockwise, starts slightly rotated ~40deg */
.hero-float-c {
    animation: heroFloatC 340s ease-in-out infinite;
}

.hero-float-c img {
    animation-delay: -20s; /* 20/180 * 360 ≈ 40deg — slightly tilted */
}

/* Bottom-right: starts rotated ~260deg (tilted heavily) */
.hero-float-d {
    animation: heroFloatD 260s ease-in-out infinite;
}

.hero-float-d img {
    animation-delay: -165s; /* 165/180 * 360 = 330deg = -30deg — 30 degrees left */
}

/* Middle-left — starts near search bar, slowly drifts left to edge, returns */
@keyframes heroFloatA {
    0%   { transform: translate(120px, 20px); }
    35%  { transform: translate(55px, 5px); }
    50%  { transform: translate(0, 0); }
    65%  { transform: translate(55px, 8px); }
    100% { transform: translate(120px, 20px); }
}

/* Bottom-left — half off bottom edge, drifts upward to reveal more (never fully shown) */
@keyframes heroFloatB {
    0%   { transform: translate(0, 0); }
    35%  { transform: translate(25px, -60px); }
    50%  { transform: translate(40px, -80px); }
    65%  { transform: translate(20px, -50px); }
    100% { transform: translate(0, 0); }
}

/* Upper-right — gentle drift from top-right corner */
@keyframes heroFloatC {
    0%   { transform: translate(0, 0); }
    35%  { transform: translate(-35px, 25px); }
    50%  { transform: translate(-55px, 40px); }
    65%  { transform: translate(-25px, 18px); }
    100% { transform: translate(0, 0); }
}

/* Bottom-right — 75% visible at rest, drifts slightly further right */
@keyframes heroFloatD {
    0%   { transform: translate(0, 0); }
    30%  { transform: translate(40px, -30px); }
    50%  { transform: translate(55px, -50px); }
    70%  { transform: translate(30px, -20px); }
    100% { transform: translate(0, 0); }
}

.hero-cover img.wp-block-cover__image-background,
.hero-cover video.wp-block-cover__video-background {
    display: none !important;
}

.hero-cover .wp-block-cover__background,
.hero-cover .has-background-dim::before {
    display: none !important;
}

/* Hero typography */
.hero-cover h1,
.hero-cover h2 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: var(--color-text-heading) !important;
    letter-spacing: -0.02em;
    margin-bottom: 0.3em !important;
    text-align: center;
    line-height: 1.3;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.hero-cover h3 {
    font-size: 1.1rem !important;
    font-weight: 400 !important;
    color: var(--color-text-muted) !important;
    margin-bottom: 1.2em !important;
    text-align: center;
    line-height: 1.5;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.hero-cover p {
    font-size: 1rem !important;
    color: var(--color-text-muted) !important;
    margin-bottom: 1.2em !important;
    text-align: center;
    line-height: 1.5;
}

/* Trustpilot-style search bar */
.hero-cover .wp-block-search {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.hero-cover .wp-block-search__inside-wrapper {
    background: #fff !important;
    border-radius: 50px !important;
    border: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    height: 52px;
    overflow: hidden;
    display: flex !important;
    align-items: center;
    transition: box-shadow var(--transition), border-color var(--transition);
    padding: 0 !important;
    width: 100% !important;
}

.hero-cover .wp-block-search__inside-wrapper:focus-within {
    border-color: var(--color-primary) !important;
    box-shadow: 0 2px 16px rgba(0, 206, 201, 0.15);
}

.hero-cover .wp-block-search__input {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 1rem;
    padding: 0 20px !important;
    height: 100%;
    outline: none !important;
    flex: 1;
    width: 100% !important;
}

.hero-cover .wp-block-search__input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.hero-cover .wp-block-search__button {
    background-color: var(--color-primary) !important;
    border: none !important;
    border-radius: 50% !important;
    color: #fff !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    padding: 0 !important;
    margin-right: 7px;
    cursor: pointer;
    transition: background-color var(--transition);
    flex-shrink: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.hero-cover .wp-block-search__button:hover {
    background-color: var(--color-primary-hover) !important;
}

.hero-cover .wp-block-search__button svg {
    fill: #fff;
    width: 20px;
    height: 20px;
}

/* Mobile-specific float keyframes — scaled-down translations for shorter hero */
@keyframes heroFloatMobileA {
    0%   { transform: translate(60px, 10px); }
    35%  { transform: translate(28px, 4px); }
    50%  { transform: translate(0, 0); }
    65%  { transform: translate(28px, 5px); }
    100% { transform: translate(60px, 10px); }
}

@keyframes heroFloatMobileB {
    0%   { transform: translate(0, 0); }
    35%  { transform: translate(15px, -28px); }
    50%  { transform: translate(22px, -40px); }
    65%  { transform: translate(12px, -20px); }
    100% { transform: translate(0, 0); }
}

@keyframes heroFloatMobileD {
    0%   { transform: translate(0, 0); }
    30%  { transform: translate(18px, -18px); }
    50%  { transform: translate(26px, -28px); }
    70%  { transform: translate(14px, -12px); }
    100% { transform: translate(0, 0); }
}

/* Hero mobile responsive */
@media (max-width: 768px) {
    .hero-floating-icon {
        display: none;
    }

    .hero-floating-icon.hero-mobile {
        display: block;
    }

    .hero-mobile.hero-float-a {
        animation-name: heroFloatMobileA;
    }

    .hero-mobile.hero-float-a img {
        animation-delay: -170s;
    }

    .hero-mobile.hero-float-b {
        animation-name: heroFloatMobileB;
    }

    .hero-mobile.hero-float-d {
        animation-name: heroFloatMobileD;
    }

    .hero-cover {
        min-height: auto;
        padding: 36px 16px !important;
    }

    .hero-cover h1,
    .hero-cover h2 {
        font-size: 1.4rem !important;
    }

    .hero-cover h3 {
        font-size: 0.95rem !important;
    }

    .hero-cover p {
        font-size: 0.9rem !important;
        margin-bottom: 1em !important;
    }

    .hero-cover .wp-block-search {
        max-width: 100%;
    }

    .hero-cover .wp-block-search__inside-wrapper {
        height: 46px;
    }

    .hero-cover .wp-block-search__input {
        font-size: 0.9rem;
        padding: 0 16px !important;
    }

    .hero-cover .wp-block-search__button {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px;
        margin-right: 6px;
    }
}