/**
 * Frontpage Styles
 *
 * Styles for the redesigned homepage with full-width hero section,
 * feature cards, category pills, and article listings.
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */

.frontpage-hero {
    position: relative;
    min-height: 420px;
    background-image: url('https://www.tyrereviews.com/images/article/best-all-weather-tyres-tested.jpg');
    background-size: cover;
    background-position: top center;
    margin-top: 55px; /* Account for fixed navbar */
    padding-top: 0px; /* Extra padding at top on desktop */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: clip; /* Prevent horizontal overflow without clipping dropdowns vertically */
    max-width: 100vw; /* Ensure hero doesn't exceed viewport width */
}

.frontpage-hero-content {
    position: relative;
    text-align: center;
    padding: 60px 20px;
    width: 100%;
    max-width: 1140px; /* Match Bootstrap container width */
    margin: 0 auto;
}

.frontpage-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    background: none;
    padding: 0;
    border: none;
    border-left: none;
    border-bottom: none;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 0, 0, 0.3);
}

.frontpage-hero-subtitle {
    font-size: 1.15rem;
    color: #fff;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.8),
        0 0 16px rgba(0, 0, 0, 0.5),
        0 0 32px rgba(0, 0, 0, 0.3);
}


/* ==========================================================================
   Universal Search - Hero Variant
   ========================================================================== */

.universal-search-hero {
    max-width: 600px;
    margin: 0 auto;
}

.universal-search-hero .input-group {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    overflow: visible;
}

.universal-search-hero .unified-search {
    border: none;
    padding: 16px 20px;
    font-size: 1.1rem;
    border-radius: 8px 0 0 8px;
}

.universal-search-hero .unified-search:focus {
    box-shadow: none;
    outline: none;
}

.universal-search-hero .btn-primary {
    padding: 16px 28px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 0 8px 8px 0;
    background: var(--tyre-reviews-blue);
    border: none;
}

.universal-search-hero .btn-primary:hover {
    background: var(--tyre-reviews-blue-dark);
}

.universal-search-hero .search-suggestions {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}


/* ==========================================================================
   Feature Cards (in hero)
   ========================================================================== */

.frontpage-hero-features {
    margin-top: 2.5rem;
    --bs-gutter-x: 3rem;
}

.frontpage-feature-card {
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.frontpage-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.frontpage-feature-card .card-body {
    padding: 1rem;
}

.frontpage-feature-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.frontpage-feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.frontpage-feature-icon-tests {
    background: #e8f1fc;
    color: #1a5fb4;
}

.frontpage-feature-icon-reviews {
    background: #fff3e0;
    color: #f59e0b;
}

.frontpage-feature-icon-compare {
    background: #e8f5e9;
    color: #28a745;
}

.frontpage-feature-card .card-title {
    font-weight: 600;
    margin-bottom: 0;
}

.frontpage-feature-card .card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    color: #6c757d;
}

.frontpage-feature-card .btn-primary,
.frontpage-feature-card a.btn-primary:link,
.frontpage-feature-card a.btn-primary:visited {
    background-color: var(--tyre-reviews-blue);
    border-color: var(--tyre-reviews-blue);
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    border-radius: 6px;
    color: #fff;
}

.frontpage-feature-card .btn-primary:hover,
.frontpage-feature-card a.btn-primary:hover,
.frontpage-feature-card a.btn-primary:focus,
.frontpage-feature-card a.btn-primary:active {
    background-color: var(--tyre-reviews-blue-dark);
    border-color: var(--tyre-reviews-blue-dark);
    color: #fff;
}


/* ==========================================================================
   Frontpage-specific Layout Adjustments
   ========================================================================== */

/* Remove top margin from #whitebg when on frontpage (hero handles spacing) */
.frontpage-whitebg {
    margin-top: 0 !important;
}

/* Hide breadcrumbs on frontpage */
.frontpage-whitebg .breadcrumb {
    display: none;
}


/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablets and smaller desktops */
@media (max-width: 991.98px) {
    .frontpage-hero {
        min-height: 380px;
        padding-top: 30px;
    }

    .frontpage-hero-title {
        font-size: 2rem;
    }

    .frontpage-hero-subtitle {
        font-size: 1rem;
    }
}

/* Mobile devices */
@media (max-width: 767.98px) {
    .frontpage-hero {
        min-height: auto;
        margin-top: 56px;
        padding-top: 20px;
    }

    .frontpage-hero-content {
        padding: 40px 16px;
    }

    .frontpage-hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }

    .frontpage-hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    /* Hero search adjustments for mobile */
    .universal-search-hero .input-group {
        flex-wrap: wrap;
        border-radius: 8px;
    }

    .universal-search-hero .input-group .unified-search {
        flex: 1 1 0;
        border-radius: 0 8px 0 0 !important;
        text-align: center;
    }

    .universal-search-hero .input-group .search-input-icon {
        border-radius: 8px 0 0 0 !important;
    }

    .universal-search-hero .input-group .btn-primary {
        border-radius: 0 0 8px 8px !important;
        flex: 0 0 100%;
        margin-left: 0;
        border: none;
    }

    /* Feature cards on mobile */
    .frontpage-feature-card .card-body {
        padding: 1rem 0.75rem;
    }

    .frontpage-feature-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

}

/* Small mobile devices */
@media (max-width: 575.98px) {
    .frontpage-hero-title {
        font-size: 1.4rem;
    }

}
