:root {
    --color-primary: #C3272B; /* Deep Maple Red */
    --color-primary-hover: #A01F22;
    --color-bg: #FDFBF7; /* Soft Cream */
    --color-surface: #FFFFFF;
    --color-text: #1E2325; /* Slate Black */
    --color-text-light: #5C676D;
    --color-accent: #E6A817; /* Gold */
    --color-pine: #2E4F42; /* Forest Green */
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-text);
    line-height: 1.2;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Utilities */
.hidden { display: none !important; }
.alert-warning {
    background-color: rgba(230, 168, 23, 0.15);
    border-left: 4px solid var(--color-accent);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}
.skeleton-text {
    width: 60%;
    height: 2.5rem;
    margin-bottom: 1rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, #e3e3e3 25%, #d1d1d1 50%, #e3e3e3 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    color: transparent !important;
}
.skeleton-desc { height: 1.2rem; width: 80%; }
.skeleton-card { height: 350px; background: #e0e0e0; border-radius: var(--radius-md); }
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font-body);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}
.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(195, 39, 43, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-secondary:hover {
    background-color: rgba(195, 39, 43, 0.05);
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(253, 251, 247, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}
.nav-links a {
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
}
.nav-links a:hover {
    color: var(--color-primary);
}

/* --- SEARCH & CATEGORY FILTER --- */
.controls-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.control-input, .control-select {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: var(--transition-fast);
}

.control-input {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
}

.control-select {
    flex-basis: 200px;
    cursor: pointer;
}

.control-input:focus, .control-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(189, 42, 46, 0.1);
}

/* --- ADVERTISEMENT PLACEHOLDERS --- */
.ad-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

.ad-label {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.ad-placeholder {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
    font-family: monospace;
}

.ad-leaderboard {
    width: 100%;
    max-width: 728px;
    height: 90px;
}

.ad-rectangle {
    width: 300px;
    height: 250px;
    margin: 0 auto;
}

.ad-infeed {
    grid-column: 1 / -1; /* spans full width of grid */
}

.affiliate-disclosure {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0,0,0,0.02);
    border-radius: var(--radius-md);
}

.affiliate-link {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.affiliate-link:hover {
    color: var(--color-pine);
}

/* ================= 5. HOME VIEW COMPONENTS ================= */
.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    margin-top: 70px;
    overflow: hidden;
    background: var(--color-text);
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: background-image 0.8s ease-in-out;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 800px;
}

.badge {
    background-color: var(--color-accent);
    color: var(--color-text);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero h1 {
    font-size: 4rem;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
}

/* Home View: Latest Recipes Grid */
.latest-recipes {
    padding: 6rem 2rem 8rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

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

.recipe-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 3rem 2rem;
}

.recipe-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipe-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.recipe-card-img-wrapper {
    position: relative;
    padding-top: 66.66%; /* 3:2 Aspect Ratio */
    overflow: hidden;
}

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

.recipe-card:hover .recipe-card-img {
    transform: scale(1.08);
}

.recipe-card-content {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.recipe-card-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.recipe-card-title a {
    color: var(--color-text);
}

.recipe-card-title a:hover {
    color: var(--color-primary);
}

.recipe-card-tags {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.recipe-card-btn {
    margin-top: auto;
    align-self: flex-start;
    color: var(--color-text-light);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.recipe-card:hover .recipe-card-btn {
    color: var(--color-primary);
}

.recipe-card-btn::after {
    content: " →";
    transition: var(--transition);
}
.recipe-card:hover .recipe-card-btn::after {
    margin-left: 5px;
}

/* Recipe Detail View */
.breadcrumb {
    padding: 8rem 2rem 0;
    margin-bottom: -1rem;
}

.recipe-details-header {
    text-align: center;
    margin: 4rem 0 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.display-title {
    font-size: 3.5rem;
    color: var(--color-text);
}

.recipe-section {
    padding-bottom: 5rem;
}

.recipe-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.recipe-image-container {
    height: 100%;
    min-height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.recipe-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-info {
    padding: 3rem 3rem 3rem 0;
}

.ingredients-box, .instructions-box {
    margin-bottom: 2.5rem;
}

.ingredients-box h3, .instructions-box h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.ingredients-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.ingredients-list li {
    position: relative;
    padding-left: 1.5rem;
}
.ingredients-list li::before {
    content: "•";
    color: var(--color-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.instructions-box p {
    white-space: pre-line;
    color: var(--color-text-light);
    line-height: 1.8;
}

/* Newsletter Section */
.newsletter-section {
    background-color: var(--color-pine);
    color: white;
    padding: 6rem 2rem;
    text-align: center;
}

.newsletter-container {
    max-width: 700px;
}

.newsletter-text h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.newsletter-form {
    margin-top: 2rem;
    background: rgba(255,255,255,0.05);
    padding: 2rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group input {
    flex: 1;
    padding: 1rem;
    border-radius: var(--radius-sm);
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
}

.casl-checkbox {
    display: flex;
    align-items: flex-start;
    text-align: left;
    gap: 0.75rem;
    font-size: 0.85rem;
    opacity: 0.8;
}
.casl-checkbox input[type="checkbox"] {
    margin-top: 0.25rem;
}

.form-msg { margin-top: 1rem; font-weight: bold; }

/* Footer */
.main-footer {
    background-color: var(--color-text);
    color: white;
    padding: 4rem 2rem 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand h3 {
    color: white;
    margin-bottom: 1rem;
}
.footer-brand p { opacity: 0.7; }

.footer-links h4, .footer-contact h4 {
    color: white;
    margin-bottom: 1.5rem;
}
.footer-links ul { list-style: none; }
.footer-links li { margin-bottom: 0.75rem; }
.footer-links a { color: rgba(255,255,255,0.7); }
.footer-links a:hover { color: var(--color-accent); }

.footer-contact address {
    font-style: normal;
    opacity: 0.7;
    margin-bottom: 1rem;
    line-height: 1.8;
}
.footer-contact a { color: var(--color-accent); }

.unsubscribe-note {
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.5;
    font-size: 0.9rem;
}

/* PIPEDA Banner */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    background: var(--color-surface);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    border-left: 5px solid var(--color-primary);
    transform: translateY(150%);
    animation: slideUp 0.5s forwards 1s;
}
@keyframes slideUp { to { transform: translateY(0); } }

.cookie-content h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.cookie-content p { font-size: 0.9rem; color: var(--color-text-light); }
.cookie-actions { display: flex; gap: 1rem; white-space: nowrap; }

/* Responsive */
@media (max-width: 900px) {
    .recipe-grid { grid-template-columns: 1fr; }
    .cookie-banner { flex-direction: column; text-align: center; }
    .display-title { font-size: 2.8rem; }
}
@media (max-width: 600px) {
    .hero h1 { font-size: 2.5rem; }
    .input-group { flex-direction: column; }
    .recipe-grid-cards { grid-template-columns: 1fr; }
}
