/* Utilities */
.center {
    text-align: center;
}

.section-header {
    margin-bottom: var(--space-xl);
}

.section-header h2 {
    font-size: 2.25rem;
    margin-bottom: var(--space-xs);
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 1.125rem;
}

/* Navbar */
.navbar {
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--space-sm) 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}

.nav-links {
    display: none;
    /* Mobile first hidden, see media queries */
    gap: var(--space-md);
}

.nav-links a {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    color: var(--color-text-primary);
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-search {
    flex: 0 1 250px;
}

.nav-search input {
    padding: 8px 12px;
    font-size: 0.875rem;
    border-radius: 20px;
    background-color: var(--color-bg-soft);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.nav-search input:focus {
    background-color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(140, 94, 88, 0.1);
}

@media (min-width: 768px) {
    .nav-links {
        display: flex;
    }
}

/* Hero */
.hero {
    background-color: var(--color-bg-soft);
    padding: var(--space-xxl) 0;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    align-items: center;
}

.hero-text {
    text-align: center;
}

.hero-tag {
    display: inline-block;
    background: #e6dcd8;
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: var(--space-md);
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.hero-text p {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.7;
}

.hero-image img {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

@media (min-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }

    .hero-text {
        text-align: left;
    }

    .hero-text h1 {
        font-size: 3.5rem;
    }
}

/* Categories Section */
.categories-section {
    padding-bottom: var(--space-xs);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.category-card {
    position: relative;
    display: block;
    border-radius: 50%;
    /* Circle look optionally, or square */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    text-align: center;
    border-radius: 12px;
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.category-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: #fff;
    padding: var(--space-md) var(--space-sm) var(--space-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-card:hover img {
    transform: scale(1.1);
}

@media (min-width: 600px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Recipe Cards */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: var(--space-lg);
}

.card {
    background: var(--color-bg-light);
    border: 1px solid transparent;
    /* Cleaner look */
    border-radius: 0;
    overflow: visible;
    transition: transform 0.2s ease;
    position: relative;
    /* Essential for stretched link */
}

.card:hover .card-title a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%;
    /* 4:3 Aspect Ratio */
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: var(--space-sm);
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-img-wrapper img {
    transform: scale(1.03);
}

.card-content {
    padding: 0;
    /* Remove padding for cleaner magazine style */
    text-align: center;
}

.card-meta {
    font-size: 0.75rem;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.card-title {
    font-size: 1.5rem;
    /* Larger titles */
    line-height: 1.3;
    margin-bottom: var(--space-xs);
}

.card-title a {
    color: var(--color-text-primary);
    /* Make this the clickable surface for the whole card */
}

.card-title a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.card-footer {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-top: var(--space-xs);
    border-top: none;
    padding-top: 0;
}

@media (min-width: 600px) {
    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .recipe-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Newsletter Section */
.newsletter-section {
    background-color: var(--color-primary);
    color: #fff;
    text-align: center;
    padding: var(--space-xxl) 0;
    margin-top: var(--space-xl);
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-content h2 {
    color: #fff;
    margin-bottom: var(--space-sm);
}

.newsletter-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-md);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

@media (min-width: 600px) {
    .newsletter-form {
        flex-direction: row;
    }
}

.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
}

.newsletter-form button {
    background-color: var(--color-secondary);
    color: var(--color-text-primary);
    border: none;
    padding: 12px 24px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* --- Animations --- */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

/* --- Robust Cookie Consent Widget (Floating) --- */
.cookie-widget-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #222;
    color: #fff;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9998;
    transition: transform 0.2s;
}

.cookie-widget-btn:hover {
    transform: scale(1.05);
}

.cookie-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* --- Cookie Consent Modal --- */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
}

.cookie-modal-overlay.open {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

.cookie-modal {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.cookie-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

.cookie-body {
    padding: 20px;
    overflow-y: auto;
}

.cookie-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.cookie-option:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.option-info strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.option-info small {
    color: #666;
    font-size: 0.85rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--color-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

input:disabled+.slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-footer {
    padding: 20px;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.cookie-footer button {
    flex: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Modern Footer */
footer {
    background-color: var(--color-bg-soft);
    border-top: 1px solid var(--color-border);
    padding: var(--space-xl) 0 var(--space-lg);
    color: var(--color-text-secondary);
    margin-top: var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
    text-align: left;
}

.footer-col h3 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.footer-col h4 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}

.footer-col ul li {
    margin-bottom: var(--space-xs);
}

.footer-col a {
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-lg);
    font-size: 0.875rem;
}

@media (min-width: 600px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .footer-content {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }
}