/**
 * RecipesAddict — Modern V2 design system
 * Full visual refresh while preserving HTML structure.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&display=swap');

:root {
    --v2-orange: #e85d04;
    --v2-orange-dark: #dc2f02;
    --v2-orange-soft: #fff4eb;
    --v2-green: #2d6a4f;
    --v2-green-light: #40916c;
    --v2-green-soft: #ecfdf3;
    --v2-ink: #1b1b1f;
    --v2-muted: #5c5c66;
    --v2-line: #ebe8e3;
    --v2-cream: #faf8f5;
    --v2-white: #ffffff;
    --v2-radius: 16px;
    --v2-radius-lg: 24px;
    --v2-shadow: 0 4px 24px rgba(27, 27, 31, 0.06);
    --v2-shadow-lg: 0 20px 50px rgba(27, 27, 31, 0.1);
    --v2-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-head: 'Fraunces', Georgia, serif;
}

body:not(.theme-custom-colors) {
    --primary: var(--v2-orange);
    --primary-dark: var(--v2-orange-dark);
    --primary-light: #f48c06;
    --accent: var(--v2-green);
    --accent-dark: #1b4332;
    --text-primary: var(--v2-ink);
    --text-secondary: var(--v2-muted);
    --text-muted: #8b8b96;
    --bg-primary: var(--v2-white);
    --bg-secondary: var(--v2-cream);
    --bg-tertiary: var(--v2-orange-soft);
    --border: var(--v2-line);
    --radius: var(--v2-radius);
    --radius-lg: var(--v2-radius-lg);
    --shadow-sm: var(--v2-shadow);
    --shadow-md: var(--v2-shadow);
    --shadow-lg: var(--v2-shadow-lg);
    --shadow-xl: var(--v2-shadow-lg);
}

/* ── Base ── */
body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4,
.site-title,
.hero h1,
.latest-recipes > h2,
.featured-posts > h2,
.platform-features-section h2,
.single-recipe .recipe-header h1 {
    font-family: var(--font-head);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

.container {
    max-width: 1240px;
}

/* ── Header ── */
.site-header {
    padding: 1rem 0;
    border-bottom: 1px solid transparent;
    background: rgba(250, 248, 245, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.site-header.is-scrolled {
    padding: 0.65rem 0;
    border-bottom-color: var(--border);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 0 var(--border), var(--v2-shadow) !important;
}

.header-content {
    gap: 1.25rem;
}

.main-nav a {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    padding: 0.35rem 0;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--primary);
}

.nav-cta {
    background: var(--v2-green-soft) !important;
    color: var(--v2-green) !important;
    border: 1.5px solid color-mix(in srgb, var(--v2-green) 25%, transparent) !important;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-cta:hover {
    background: var(--v2-green) !important;
    color: #fff !important;
    border-color: var(--v2-green) !important;
    box-shadow: 0 6px 20px rgba(45, 106, 79, 0.25);
}

.btn-login {
    background: var(--primary) !important;
    border-radius: 999px !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(232, 93, 4, 0.25) !important;
}

.search-input {
    background: var(--v2-white);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8125rem;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.user-avatar {
    background: linear-gradient(135deg, var(--primary), var(--v2-orange-dark)) !important;
}

/* ── Hero ── */
.hero:not(.hero-has-bg) {
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(232, 93, 4, 0.18), transparent),
        radial-gradient(ellipse 60% 50% at 100% 50%, rgba(45, 106, 79, 0.12), transparent),
        linear-gradient(165deg, #1b1b1f 0%, #2d2419 45%, #1a2e24 100%);
}

.hero.hero-has-bg {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.52)),
        var(--hero-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero {
    color: #fff;
    padding: clamp(4rem, 10vw, 7rem) 0 clamp(3.5rem, 8vw, 6rem);
    min-height: clamp(420px, 55vh, 560px);
    display: flex;
    align-items: center;
}

.hero::before {
    background:
        radial-gradient(circle at 15% 40%, rgba(232, 93, 4, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 85% 70%, rgba(64, 145, 108, 0.12) 0%, transparent 40%);
    animation: heroGlow 12s ease-in-out infinite alternate;
}

.hero.hero-has-bg::before {
    opacity: 0.45;
}

@keyframes heroGlow {
    0% { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

.hero h1 {
    font-size: clamp(2.25rem, 5.5vw, 3.75rem) !important;
    font-weight: 600 !important;
    line-height: 1.08 !important;
    text-shadow: none !important;
    max-width: 14ch;
    margin-left: auto;
    margin-right: auto;
}

.hero p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.2rem) !important;
    opacity: 0.88 !important;
    max-width: 540px;
    text-shadow: none !important;
    font-weight: 400;
}

.hero-search-container {
    max-width: 580px;
    margin-top: 2rem !important;
}

.hero-search-wrapper {
    border-radius: 999px;
    padding: 6px 6px 6px 20px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.hero-search-icon {
    color: var(--primary) !important;
}

.hero-search-btn {
    background: linear-gradient(135deg, var(--primary), var(--v2-orange-dark)) !important;
    box-shadow: 0 4px 16px rgba(232, 93, 4, 0.35) !important;
    border-radius: 999px !important;
    padding: 14px 24px !important;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
    margin-top: 1.75rem;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    transition: transform 0.3s var(--v2-ease), background 0.3s, border-color 0.3s;
}

.hero-pill:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

.hero-pill-accent {
    background: var(--v2-green);
    border-color: var(--v2-green-light);
    color: #fff;
}

.hero-pill-accent:hover {
    background: var(--v2-green-light);
    color: #fff;
}

/* ── Category bar ── */
.category-nav-wrapper {
    background: var(--v2-white);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: var(--header-offset, 72px);
    z-index: 800;
    box-shadow: 0 1px 0 var(--border);
}

.category-nav-scroll {
    padding: 0.25rem 0;
    gap: 0.5rem;
}

.category-nav-pill {
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.45rem 0.95rem;
    border: 1px solid var(--border);
    background: var(--v2-cream);
}

.category-nav-pill:hover {
    background: var(--v2-white);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--v2-shadow);
}

.pill-count {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    font-size: 0.6875rem;
    padding: 0.1rem 0.45rem;
}

.category-nav-pill:hover .pill-count {
    background: var(--primary);
    color: #fff;
}

/* ── Section titles ── */
.latest-recipes,
.featured-posts,
.platform-features-section,
.home-community-section {
    padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.latest-recipes > h2,
.featured-posts > h2,
.platform-features-section h2,
.home-community-section h2 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    text-align: center;
    margin-bottom: 0.5rem;
    position: relative;
}

.section-eyebrow {
    display: block;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.35rem;
}

.section-lead {
    text-align: center;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 2.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ── Homepage community ── */
.home-community-section {
    background: linear-gradient(180deg, rgba(45, 106, 79, 0.06) 0%, transparent 100%);
}

.home-community-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.home-community-lead {
    max-width: 680px;
}

.home-community-steps {
    list-style: none;
    margin: 0 auto 2.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    max-width: 960px;
}

.home-community-steps li {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: var(--bg-primary);
    border: 1px solid rgba(45, 106, 79, 0.12);
    border-radius: var(--radius-lg, 16px);
    padding: 1.15rem 1.1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.home-community-step-num {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--v2-green-dark, #2d6a4f));
}

.home-community-steps strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.home-community-steps p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.home-community-grid {
    margin-bottom: 2rem;
}

.home-community-grid .community-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: #059669;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    z-index: 1;
}

.home-community-grid .recipe-image {
    position: relative;
    display: block;
}

.home-community-grid .community-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.35rem;
}

.home-community-empty {
    text-align: center;
    padding: 1.5rem 1rem 2rem;
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 1.5rem;
}

.home-community-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

@media (max-width: 768px) {
    .home-community-steps {
        grid-template-columns: 1fr;
    }
}

/* ── Featured books (homepage) ── */
.home-featured-books-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 6%, var(--bg-primary)) 0%, var(--bg-primary) 100%);
}

.home-featured-books-intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 2.5rem;
}

.home-featured-books-intro h2 {
    margin-bottom: 0.75rem;
}

.home-featured-books-grid {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 0;
}

.home-featured-books-grid .bookstore-card-body h3 {
    font-size: 1.2rem;
    margin: 0 0 0.35rem;
    line-height: 1.3;
}

.home-featured-books-cta {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* ── Grids & cards ── */
.recipes-grid,
.posts-grid,
.platform-grid {
    gap: 1.5rem;
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.recipe-card,
.post-card,
.platform-card {
    border-radius: var(--v2-radius-lg);
    border: 1px solid var(--border);
    background: var(--v2-white);
    overflow: hidden;
    box-shadow: var(--v2-shadow);
    transition: transform 0.4s var(--v2-ease), box-shadow 0.4s var(--v2-ease), border-color 0.3s;
}

.recipe-card:hover,
.post-card:hover,
.platform-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--v2-shadow-lg);
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
}

.recipe-image {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.recipe-image::before {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 50%) !important;
    opacity: 0;
    transition: opacity 0.35s;
    z-index: 2;
}

.recipe-card:hover .recipe-image::before {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 55%) !important;
}

.recipe-image img {
    transition: transform 0.6s var(--v2-ease);
}

.recipe-card:hover .recipe-image img {
    transform: scale(1.08);
}

.recipe-card-content {
    padding: 1.25rem 1.35rem 1.35rem;
}

.recipe-category {
    font-size: 0.6875rem !important;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent) !important;
    background: var(--v2-green-soft);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    display: inline-block;
}

.recipe-card-content h3 {
    font-size: 1.125rem;
    font-family: var(--font-head);
    margin: 0.5rem 0 0.4rem;
}

.recipe-card-content h3 a {
    color: var(--text-primary);
}

.recipe-card-content h3 a:hover {
    color: var(--primary);
}

.recipe-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.recipe-card-meta span {
    background: var(--v2-cream);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}

/* Post cards */
.post-card .post-image {
    height: 200px;
    overflow: hidden;
}

.post-card .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--v2-ease);
}

.post-card:hover .post-image img {
    transform: scale(1.06);
}

.post-card .post-content {
    padding: 1.35rem;
}

.post-card h3 {
    font-family: var(--font-head);
    font-size: 1.125rem;
}

/* Platform cards */
.platform-features-section {
    background: linear-gradient(180deg, var(--v2-cream) 0%, var(--v2-white) 100%);
}

.platform-card {
    padding: 1.5rem;
    border-radius: var(--v2-radius);
}

.platform-card-icon {
    font-size: 2rem;
    transition: transform 0.35s var(--v2-ease);
}

.platform-card:hover .platform-card-icon {
    transform: scale(1.15) rotate(-4deg);
}

.platform-card-badge.free {
    background: var(--v2-green-soft);
    color: var(--v2-green);
    border-radius: 999px;
    font-size: 0.625rem;
    letter-spacing: 0.06em;
}

.platform-card-badge:not(.free) {
    border-radius: 999px;
    font-size: 0.625rem;
}

/* ── Buttons ── */
.btn {
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    padding: 0.75rem 1.5rem;
    transition: transform 0.25s var(--v2-ease), box-shadow 0.25s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--v2-orange-dark) 100%) !important;
    box-shadow: 0 4px 16px rgba(232, 93, 4, 0.28);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(232, 93, 4, 0.35);
}

.btn-secondary {
    background: var(--v2-cream);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--v2-white);
    border-color: var(--primary);
    color: var(--primary);
}

/* ── Single recipe ── */
.single-recipe {
    background: var(--v2-cream);
}

.recipe-container {
    background: var(--v2-white);
    border-radius: var(--v2-radius-lg);
    overflow: hidden;
    box-shadow: var(--v2-shadow);
    margin: 1.5rem auto 3rem;
    max-width: 900px;
}

.recipe-hero-image {
    border-radius: 0;
    max-height: 480px;
    overflow: hidden;
}

.recipe-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-content-wrapper {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.recipe-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
}

.recipe-breadcrumb {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.recipe-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.recipe-breadcrumb a:hover {
    color: var(--primary);
}

.recipe-meta-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--v2-cream);
    border-radius: var(--v2-radius);
    border: 1px solid var(--border);
}

.meta-item {
    text-align: center;
    padding: 0.5rem;
}

.meta-item strong {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.recipe-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--v2-cream);
    border-radius: var(--v2-radius);
    border: 1px solid var(--border);
}

.recipe-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Nutrition facts: legacy style.css uses white text on a gradient; v2 uses a cream card */
.recipe-section.nutrition-section {
    color: var(--text-primary);
    box-shadow: none;
}

.recipe-section.nutrition-section .nutrition-item {
    background: var(--v2-white);
    border: 1px solid var(--border);
    backdrop-filter: none;
}

.recipe-section.nutrition-section .nutrition-item strong {
    color: var(--text-primary);
}

.recipe-section.nutrition-section .nutrition-item span {
    color: var(--text-muted);
    opacity: 1;
}

.recipe-author-box {
    border-radius: var(--v2-radius);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--v2-green-soft), var(--v2-white));
}

/* ── Footer ── */
.site-footer {
    background: var(--v2-ink) !important;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 4rem;
    text-align: left !important;
    border-top: none;
    padding: 0 !important;
}

.site-footer .container > div {
    padding: 3.5rem 0 2rem !important;
    border-top: none !important;
}

.site-footer h3,
.site-footer h4 {
    color: #fff !important;
    font-family: var(--font-head);
    font-weight: 600;
}

.site-footer p,
.site-footer li a {
    color: rgba(255, 255, 255, 0.6) !important;
}

.site-footer li a:hover {
    color: var(--primary-light) !important;
}

.site-footer [style*="border-top"] {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

.site-footer [style*="text-align: center"] p {
    color: rgba(255, 255, 255, 0.45) !important;
}

/* ── Submit / community pages ── */
.submit-recipe-page,
.community-recipes-page {
    background: var(--v2-cream);
}

.submit-recipe-form,
.submit-success-card {
    border-radius: var(--v2-radius-lg);
    box-shadow: var(--v2-shadow);
}

.submit-recipe-hero,
.community-hero {
    background:
        radial-gradient(ellipse 70% 80% at 50% 0%, rgba(45, 106, 79, 0.08), transparent),
        var(--v2-cream) !important;
}

.recipe-photo-gallery {
    display: flex;
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0.85rem 0 0.25rem;
    margin-top: -0.25rem;
    scrollbar-width: thin;
}

.recipe-photo-thumb {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    transition: border-color 0.2s, transform 0.15s;
}

.recipe-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.recipe-photo-thumb.is-active {
    border-color: var(--accent, #e85d04);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.2);
}

.recipe-photo-thumb:hover {
    transform: translateY(-2px);
}

/* ── Recipe stock photo gallery (in-content) ── */
.recipe-gallery-section {
    margin: 2rem 0;
}

.recipe-gallery-lead {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: -0.35rem 0 1.25rem;
    line-height: 1.55;
}

.recipe-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 640px) {
    .recipe-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.recipe-gallery-figure {
    margin: 0;
}

.recipe-gallery-open {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: var(--v2-radius);
    overflow: hidden;
    cursor: zoom-in;
    background: var(--v2-white);
    border: 1px solid var(--border);
    transition: transform 0.2s var(--v2-ease), box-shadow 0.2s;
}

.recipe-gallery-open:hover {
    transform: translateY(-2px);
    box-shadow: var(--v2-shadow);
}

.recipe-gallery-open img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.recipe-gallery-figure--featured {
    grid-column: 1 / -1;
}

.recipe-gallery-figure--featured .recipe-gallery-open img {
    aspect-ratio: 16 / 10;
    max-height: min(52vh, 480px);
}

.recipe-gallery-credit {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    line-height: 1.3;
}

.recipe-gallery-credit a {
    color: var(--text-muted);
    text-decoration: underline;
}

.recipe-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.recipe-gallery-lightbox[hidden] {
    display: none !important;
}

.recipe-gallery-lightbox-inner {
    position: relative;
    max-width: min(960px, 100%);
    width: 100%;
}

.recipe-gallery-lightbox-img {
    width: 100%;
    max-height: min(80vh, 720px);
    object-fit: contain;
    border-radius: var(--v2-radius);
    display: block;
    margin: 0 auto;
}

.recipe-gallery-lightbox-caption {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.recipe-gallery-lightbox-close,
.recipe-gallery-lightbox-prev,
.recipe-gallery-lightbox-next {
    position: absolute;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.2s;
}

.recipe-gallery-lightbox-close:hover,
.recipe-gallery-lightbox-prev:hover,
.recipe-gallery-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.recipe-gallery-lightbox-close {
    top: -48px;
    right: 0;
}

.recipe-gallery-lightbox-prev {
    left: -56px;
    top: 50%;
    transform: translateY(-50%);
}

.recipe-gallery-lightbox-next {
    right: -56px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .recipe-gallery-lightbox-prev {
        left: 0.25rem;
    }
    .recipe-gallery-lightbox-next {
        right: 0.25rem;
    }
    .recipe-gallery-lightbox-close {
        top: 0.25rem;
        right: 0.25rem;
    }
}

body.recipe-gallery-lightbox-open {
    overflow: hidden;
}

/* ── Scroll reveal ── */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.75s var(--v2-ease), transform 0.75s var(--v2-ease);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

/* ── Back to top ── */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--v2-shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--v2-ease);
    z-index: 900;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--v2-orange-dark);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 3.5rem 0 3rem;
    }

    .hero h1 {
        max-width: none;
    }

    .hero-actions {
        gap: 0.5rem;
    }

    .hero-pill {
        font-size: 0.75rem;
        padding: 0.45rem 0.85rem;
    }

    .category-nav-wrapper {
        top: 60px;
    }

    .recipe-container {
        margin: 0;
        border-radius: 0;
    }

    .single-recipe {
        background: var(--v2-white);
    }
}

@keyframes btnRipple {
    to { transform: scale(2.5); opacity: 0; }
}

/* ── Listing pages ── */
.recipes-page,
.search-page,
.blog-page {
    background: var(--v2-cream);
    padding: 2rem 0 3rem;
}

.recipes-page .container,
.search-page .container {
    background: var(--v2-white);
    border-radius: var(--v2-radius-lg);
    padding: 2rem;
    box-shadow: var(--v2-shadow);
    border: 1px solid var(--border);
}

.recipes-filters {
    background: var(--v2-cream);
    border-radius: var(--v2-radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

/* ── Recipes listing page ── */
.recipes-page-header {
    text-align: center;
    padding: 2.5rem 1rem 2rem !important;
    margin-bottom: 2rem !important;
    background: linear-gradient(180deg, var(--v2-cream) 0%, var(--v2-white) 100%);
    border-radius: var(--v2-radius-lg);
    border: 1px solid var(--border);
}

.recipes-page .recipes-page-header h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 0.75rem;
}

.recipes-page .recipes-page-header h1::after {
    display: none;
}

.recipes-page-header .page-description {
    max-width: 560px;
    margin: 0 auto;
    color: var(--text-secondary);
}

.recipes-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.recipes-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.15rem;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: var(--v2-white);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.recipes-filter-toggle:hover,
.recipes-filter-toggle.is-active {
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
    background: var(--v2-green-soft, color-mix(in srgb, var(--primary) 8%, var(--v2-white)));
    color: var(--primary);
}

.recipes-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
}

.recipes-results-info {
    margin: 0;
}

.recipes-results-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.55rem 1rem;
    background: var(--v2-cream);
    border-radius: 999px;
    border: 1px solid var(--border);
}

.recipes-filter-panel {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    background: var(--v2-cream);
    border: 1px solid var(--border);
    border-radius: var(--v2-radius-lg);
    overflow: visible;
}

.recipes-filter-panel[hidden] {
    display: none !important;
}

.recipes-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
    overflow: visible;
}

.recipes-filter-form .filter-group {
    margin: 0;
    position: relative;
    z-index: 1;
}

.recipes-filter-form .filter-group.is-open {
    z-index: 30;
}

.recipes-filter-form .filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.filter-picker {
    position: relative;
}

.filter-picker__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.filter-picker__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border-radius: var(--v2-radius);
    border: 1.5px solid var(--border);
    background: var(--v2-white);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.filter-picker__trigger:hover {
    border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.filter-picker.is-open .filter-picker__trigger,
.filter-picker__trigger:focus-visible {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.filter-picker__trigger.has-value .filter-picker__value {
    color: var(--text-primary);
}

.filter-picker__value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.filter-picker__chevron {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.filter-picker.is-open .filter-picker__chevron {
    transform: rotate(180deg);
}

.filter-picker__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--v2-white);
    border: 1px solid var(--border);
    border-radius: var(--v2-radius);
    box-shadow: var(--v2-shadow-lg);
    overflow: hidden;
}

.filter-picker__menu[hidden] {
    display: none !important;
}

.filter-picker__search-wrap {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--v2-cream);
}

.filter-picker__search {
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: calc(var(--v2-radius) - 2px);
    background: var(--v2-white);
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.filter-picker__search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent);
}

.filter-picker__list {
    max-height: 220px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.35rem;
}

.filter-picker__option {
    display: block;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: none;
    border-radius: calc(var(--v2-radius) - 2px);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.filter-picker__option:hover,
.filter-picker__option:focus-visible {
    outline: none;
    background: color-mix(in srgb, var(--primary) 8%, var(--v2-white));
}

.filter-picker__option.is-selected {
    background: color-mix(in srgb, var(--primary) 12%, var(--v2-white));
    color: var(--primary);
    font-weight: 700;
}

.filter-picker__option.is-hidden {
    display: none;
}

.filter-picker__empty {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.recipes-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.recipes-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.recipes-active-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.recipes-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--v2-white);
    border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.recipes-filter-chip:hover {
    background: color-mix(in srgb, var(--primary) 8%, var(--v2-white));
    border-color: var(--primary);
}

.recipes-filter-chip span {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1;
}

.recipes-clear-all {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-left: 0.25rem;
}

.recipes-clear-all:hover {
    text-decoration: underline;
}

.recipes-page .recipes-grid.recipes-grid--three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.recipes-page .recipe-categories {
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.recipes-page .recipe-category {
    font-size: 0.7rem;
}

.recipes-page .recipe-card-btn {
    margin-top: 1.25rem;
    align-self: flex-start;
}

.recipes-page .no-results {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.recipes-page .no-results .btn {
    margin-top: 1rem;
}

@media (max-width: 1100px) {
    .recipes-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .recipes-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .recipes-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recipes-page .recipes-grid.recipes-grid--three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .recipes-filter-grid {
        grid-template-columns: 1fr;
    }

    .recipes-page .recipes-grid.recipes-grid--three {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll,
    .hero::before,
    .recipe-card:hover,
    .post-card:hover {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}
