/**
 * Homepage Styles - Modern Editorial Layout
 */

:root {
    --font-serif: 'Playfair Display', Georgia, serif;
}

/* ============================================
   HERO SECTION (Featured Recipe with Background)
   ============================================ */
.hero {
    position: relative;
    background-color: #2D2424;
    color: white;
    padding: var(--space-16) 0;
    min-height: 520px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Background Image */
.hero-bg-image {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-bg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Improved overlay for better text contrast */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.75) 40%,
        rgba(0, 0, 0, 0.5) 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
}

/* Hero Grid Layout */
.hero .container {
    position: relative;
    z-index: 2;
}

.hero-grid {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 900px) {
    .hero-grid {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
        gap: var(--space-16);
    }
}

/* Hero Text Content */
.hero-text-content {
    max-width: 600px;
}

.hero-label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-4);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: var(--space-4);
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

.hero-desc {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--space-8);
    max-width: 500px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 14px 36px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(199, 107, 92, 0.4);
}

.hero-btn:hover {
    background: white;
    color: var(--dark-brown);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Hero Search Card */
.hero-search-card {
    background: white;
    padding: var(--space-8);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    color: var(--dark-brown);
}

.hero-search-card h2 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
    color: var(--dark-brown);
}

.hero-search-form {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.search-input-group {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group .search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.hero-search-input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface);
    transition: all 0.2s;
}

.hero-search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(199, 107, 92, 0.1);
}

.hero-search-btn {
    padding: 14px 24px;
    background: var(--dark-brown);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.hero-search-btn:hover {
    background: #1a1a1a;
}

.hero-quick-tags {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hero-quick-tags span {
    margin-right: 8px;
    font-weight: 600;
}

.hero-quick-tags a {
    color: var(--primary);
    text-decoration: none;
    margin-right: 10px;
    display: inline-block;
    transition: color 0.2s;
}

.hero-quick-tags a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ============================================
   CATEGORY PILLS SCROLL
   ============================================ */
.categories-section {
    padding: var(--space-5) 0;
    border-bottom: 1px solid var(--divider);
    background: white;
    position: sticky;
    top: var(--header-height, 70px);
    z-index: 40;
}

.categories-scroll {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--surface);
    border-radius: 30px;
    color: var(--dark-brown);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-pill:hover {
    background: white;
    border-color: var(--divider);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.category-pill.active {
    background: var(--dark-brown);
    color: white;
}

.category-pill--more {
    background: var(--light-peach);
    color: var(--primary);
    font-weight: 600;
}

.category-pill--more:hover {
    background: var(--medium-peach);
}

.pill-icon {
    font-size: 1.1rem;
}

/* ============================================
   MAIN CONTENT LAYOUT
   ============================================ */
.main-content {
    padding: var(--space-12) 0;
    background-color: #FDFBF7;
}

.content-layout {
    display: grid;
    gap: var(--space-8);
}

@media (min-width: 1024px) {
    .content-layout {
        grid-template-columns: 1fr 320px;
        gap: var(--space-12);
    }
}

.content-main {
    min-width: 0;
}

/* Feed Header */
.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-brown);
}

.shuffle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: white;
    border: 1px solid var(--divider);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.shuffle-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--light-peach);
}

/* Recipe Grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
}

/* Recipe Card Hover - "View Recipe" overlay */
.recipe-card {
    position: relative;
}

.recipe-card__link::after {
    content: 'View Recipe';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 36, 36, 0.85);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    pointer-events: none;
}

.recipe-card__image-wrapper:hover .recipe-card__link::after,
.recipe-card:hover .recipe-card__link::after {
    opacity: 1;
}

/* Load More */
.load-more-wrapper {
    text-align: center;
    margin-top: var(--space-12);
}

.load-more-btn {
    background: white;
    border: 2px solid var(--divider);
    padding: 14px 40px;
    border-radius: 30px;
    font-weight: 600;
    color: var(--dark-brown);
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    border-color: var(--dark-brown);
    background: var(--dark-brown);
    color: white;
}

/* ============================================
   SIDEBAR
   ============================================ */
.content-sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .content-sidebar {
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
    }
}

.sidebar-widget {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.widget-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid #F4EBE6;
    color: var(--dark-brown);
}

/* Trending List */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.trending-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: inherit;
    padding: var(--space-2);
    margin: calc(var(--space-2) * -1);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.trending-item:hover {
    background: var(--light-peach);
    transform: translateX(4px);
}

.trending-rank {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: #E0E0E0;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

/* Highlight top 3 */
.trending-item:nth-child(1) .trending-rank,
.trending-item:nth-child(2) .trending-rank,
.trending-item:nth-child(3) .trending-rank {
    color: var(--primary);
}

.trending-details {
    flex: 1;
    min-width: 0;
}

.trending-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 2px;
    color: var(--dark-brown);
}

.trending-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #F59E0B;
    font-weight: 500;
}

.trending-image {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.widget-link {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

.widget-link:hover {
    text-decoration: underline;
}

/* Newsletter/Promo Widget */
.sidebar-widget--promo {
    background: linear-gradient(135deg, var(--dark-brown) 0%, #4a4040 100%);
    color: white;
    text-align: center;
}

.sidebar-widget--promo h3 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: var(--space-2);
}

.sidebar-widget--promo p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    margin-bottom: var(--space-5);
}

.newsletter-form input {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: none;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.newsletter-form input:focus {
    outline: 2px solid var(--primary);
}

.newsletter-form button {
    width: 100%;
    padding: 12px;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-form button:hover {
    background: #b85a4a;
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tags-cloud a {
    display: inline-block;
    padding: 6px 14px;
    background: var(--surface);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tags-cloud a:hover {
    background: var(--dark-brown);
    color: white;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-6);
    color: var(--text-muted);
}

.empty-state__icon svg {
    width: 100%;
    height: 100%;
}

.empty-state__title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--dark-brown);
    margin-bottom: var(--space-2);
}

.empty-state__text {
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 899px) {
    .hero {
        min-height: auto;
        padding: var(--space-10) 0;
    }

    .hero-search-card {
        padding: var(--space-6);
    }

    .hero-search-form {
        flex-direction: column;
    }

    .hero-search-btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }
}
