/*
Theme Name: Matanot Ktanot Plus
Theme URI: https://matanot-ktanot.co.il/
Author: Antigravity
Author URI: https://google.com
Description: A stunning, high-speed, mobile-first Hebrew theme designed specifically for premium ad-free food blogs and subscription platforms. Features dynamic client-side recipe parsing, RTL interactive checklists, and a native local-storage Favorites dashboard.
Version: 1.1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: matanot-ktanot-plus-wordpress
Domain Path: /languages
Tags: food, blog, responsive-layout, translation-ready, custom-menu, custom-background, featured-images, rtl-language-support
*/

/* -------------------------------------------------------------
   CORE DESIGN SYSTEM & RESET (RTL FIRST)
   ------------------------------------------------------------- */
:root {
    /* Fallback Default Variables - Overwritten dynamically in wp_head */
    --primary: #9dc400; /* Fresh Premium Lime */
    --primary-hover: #7b9c00;
    --primary-light: rgba(157, 196, 0, 0.08);
    --secondary: #e66b5b; /* Organic Terracotta/Salmon */
    --dark: #1b2e25; /* Deep Slate Forest Green */
    --dark-muted: #3d594b;
    --light-bg: #fdfdfb; /* Warm Neutral Cream */
    --card-bg: #ffffff;
    --border: rgba(27, 46, 37, 0.08);
    --border-hover: rgba(157, 196, 0, 0.3);
    
    /* Typography defaults */
    --font-heading: 'Rubik', 'Assistant', sans-serif;
    --font-body: 'Assistant', sans-serif;
    
    /* Layout & Shadows */
    --shadow-sm: 0 4px 12px rgba(27, 46, 37, 0.03);
    --shadow-md: 0 12px 32px rgba(27, 46, 37, 0.06);
    --shadow-lg: 0 20px 48px rgba(27, 46, 37, 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    direction: rtl;
    text-align: right;
    font-size: 17px;
    line-height: 1.65;
    background-color: var(--light-bg);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* -------------------------------------------------------------
   TYPOGRAPHY
   ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--dark);
    margin-bottom: 0.5em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }

@media (min-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.0rem; }
    h3 { font-size: 1.5rem; }
}

/* -------------------------------------------------------------
   HEADER & NAVIGATION (Universal Sidebar Toggle & Search Integration)
   ------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(253, 253, 251, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* Brand Group: Logo + Hamburger together on the right (RTL first-child = right) */
.header-brand-group {
    display: flex;
    flex-direction: row-reverse; /* In RTL context, row-reverse = left-to-right: logo left, hamburger right */
    align-items: center;
    gap: 10px;
    order: 1; /* First in RTL = rightmost side */
    position: relative;
    z-index: 1002;
}

/* Brand Branding/Logo Alignment */
.site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Logo text + subtitle group next to the logo (styles set dynamically in wp_head) */
.brand-text-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    gap: 1px;
}

.brand-text-group:hover .brand-logo-text {
    color: var(--primary);
}

.site-logo {
    max-height: 48px;
    width: auto;
}

/* Constrain WordPress custom logo to header height */
.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    max-height: 52px !important;
    width: auto !important;
    display: block;
}

/* Site title as direct anchor (no h1 wrapper on inner pages) */
.site-title {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.site-title:hover {
    color: var(--primary);
}

/* Integrated Search Bar inside Header Actions */
.btn-search-trigger {
    background: var(--card-bg);
    border: 1px solid var(--border);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    z-index: 1002;
}

.btn-search-trigger:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* On home page, the floating search trigger is hidden because search bar is shown by default */
.btn-search-trigger.is-home-search {
    display: none;
}

/* Absolute Overlay Search Bar Container */
.search-overlay-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

/* Is visible state for inner pages on trigger press */
.search-overlay-container.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Always shown inline-below header container on home page */
.search-overlay-container.is-visible-home {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    border-bottom: none;
    padding: 16px 20px 8px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: none;
    background: transparent;
}

/* On DESKTOP: only when .is-active, the overlay covers the header row itself (centered) */
@media (min-width: 768px) {
    .search-overlay-container.is-active:not(.is-visible-home) {
        top: 0;
        height: 100%;
        border-bottom: none;
        background: rgba(253, 253, 251, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: none;
        padding: 0 24px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-overlay-container.is-active:not(.is-visible-home) .search-overlay-inner {
        width: 55%;
        max-width: 680px;
    }

    /* On DESKTOP home page: the always-visible search bar sits centered IN the
       header row (between logo and action buttons), not below the header. */
    .search-overlay-container.is-visible-home {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100%;
        max-width: none;
        margin: 0;
        padding: 0 24px;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none; /* let clicks pass through to header buttons */
        z-index: 998;         /* below brand-group/actions (1002) so buttons stay clickable */
    }

    .search-overlay-container.is-visible-home .search-overlay-inner {
        pointer-events: auto; /* the search form itself is interactive */
        width: 45%;
        max-width: 520px;
        margin: 0 auto;
    }
}

.search-overlay-inner {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.header-search-form {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.header-search-form input[type="search"] {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 12px 48px 12px 48px; /* Space on both sides: right for X, left for 🔍 */
    border-radius: 30px;
    font-size: 15px;
    color: var(--dark);
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-align: right; /* RTL text alignment */
}

.header-search-form input[type="search"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-md);
}

/* Search submit icon on the PHYSICAL LEFT side */
.header-search-submit {
    position: absolute;
    left: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--dark-muted);
    transition: var(--transition);
    z-index: 5;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-search-submit:hover {
    color: var(--primary);
}

/* Clear button (X) on the PHYSICAL RIGHT side – clears input text, does NOT close overlay */
.search-clear-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: var(--dark-muted);
    transition: var(--transition);
    z-index: 5;
    padding: 4px;
    display: none; /* Hidden when input is empty */
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border);
}

.search-clear-btn:hover {
    background: var(--border-hover);
    color: var(--secondary);
}

/* Show clear button when input has content (toggled by JS) */
.search-clear-btn.is-visible {
    display: flex;
}

/* On home page inline search: hide clear-btn by default (handled by JS) */
.is-visible-home .header-search-form input[type="search"] {
    padding-right: 16px; /* No clear btn on home page by default */
}

/* Header Actions Controls */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    order: 2; /* In RTL header actions sit on the left */
    position: relative;
    z-index: 1002;
}

.btn-favorites-trigger {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.05rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    z-index: 1002;
}

.btn-favorites-trigger:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.btn-favorites-trigger .fav-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 8.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(230, 107, 91, 0.4);
}

/* Menu Toggle Button displayed on BOTH Desktop & Mobile (8degree fly inspired) */
.menu-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    z-index: 1001;
    transition: var(--transition);
}

.menu-toggle:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.menu-toggle span {
    display: block;
    width: 17px;
    height: 2px;
    background-color: var(--dark);
    transition: var(--transition);
}

/* -------------------------------------------------------------
   UNIVERSAL SIDEBAR DRAWER WITH DYNAMIC CLOSE BUTTON (✕)
   ------------------------------------------------------------- */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: -360px; /* Slide out from right */
    width: 100%;
    max-width: 340px;
    height: 100%;
    background: var(--card-bg);
    z-index: 1050;
    box-shadow: -10px 0 40px rgba(27, 46, 37, 0.15);
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
}

.mobile-nav-overlay.is-active {
    right: 0;
}

/* Dark Dimmer Backdrop */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 46, 37, 0.4);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(4px);
    transition: opacity 0.4s ease;
}

.drawer-backdrop.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* Close Button in Sidebar Drawer */
.btn-close-menu {
    position: absolute;
    top: 20px;
    left: 20px; /* Aligned to left in RTL drawer */
    background: var(--light-bg);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn-close-menu:hover {
    color: var(--secondary);
    border-color: var(--secondary);
    transform: rotate(90deg);
}

/* Drawer Logo Branding */
.drawer-branding {
    margin: 30px 0 40px;
    text-align: center;
}

/* Drawer Menu Items Styles */
.mobile-nav-overlay ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-overlay li {
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.mobile-nav-overlay li:last-child {
    border-bottom: none;
}

.mobile-nav-overlay a {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
    display: block;
}

.mobile-nav-overlay a:hover {
    color: var(--primary);
    transform: translateX(-4px);
}

/* ---- Nested submenus: indentation + expand/collapse ---- */
/* Parent row holds the label link + the toggle arrow on one line */
.drawer-menu-list .menu-parent-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.drawer-menu-list .menu-parent-row > a {
    flex: 1 1 auto;
}

/* Expand/collapse arrow button (injected by JS) */
.submenu-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--light-bg);
    border: 1px solid var(--border);
    color: var(--dark-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.submenu-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.submenu-toggle .chev {
    display: inline-block;
    transition: transform 0.3s ease;
}

/* Open state: rotate arrow + highlight */
.menu-item-has-children.is-open > .menu-parent-row .submenu-toggle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.menu-item-has-children.is-open > .menu-parent-row .submenu-toggle .chev {
    transform: rotate(180deg);
}

/* Sub-menu list: indented, collapsed by default */
.mobile-nav-overlay .sub-menu {
    display: none;
    gap: 0;
    margin: 10px 0 2px;
    padding-right: 14px; /* RTL indent */
    border-right: 2px solid var(--primary-light);
}

.mobile-nav-overlay .menu-item-has-children.is-open > .sub-menu {
    display: flex;
}

.mobile-nav-overlay .sub-menu li {
    border-bottom: none;
    padding: 7px 0;
}

.mobile-nav-overlay .sub-menu a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-muted);
}

.mobile-nav-overlay .sub-menu a:hover {
    color: var(--primary);
}

/* Deeper nesting indents further automatically via the same rules */
.mobile-nav-overlay .sub-menu .sub-menu {
    margin-top: 8px;
}

/* Bottom Actions Area in Sidebar Drawer */
.drawer-bottom-actions {
    margin-top: auto;
    padding-top: 30px;
    border-top: 2px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-drawer-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 30px;
    font-size: 14.5px;
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
}

.btn-drawer-action.btn-login {
    background: var(--primary);
    color: white !important;
    box-shadow: 0 4px 10px rgba(157, 196, 0, 0.2);
}

.btn-drawer-action.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(157, 196, 0, 0.3);
}

.btn-drawer-action.btn-logout {
    background: var(--light-bg);
    color: var(--dark-muted) !important;
    border: 1px solid var(--border);
}

.btn-drawer-action.btn-logout:hover {
    border-color: var(--secondary);
    color: var(--secondary) !important;
}

.btn-drawer-action.btn-favs {
    background: rgba(230, 107, 91, 0.06);
    color: var(--secondary) !important;
    border: 1px solid rgba(230, 107, 91, 0.15);
}

.btn-drawer-action.btn-favs:hover {
    background: rgba(230, 107, 91, 0.1);
    transform: translateY(-2px);
}

/* -------------------------------------------------------------
   HORIZONTAL CATEGORY SCROLL SLIDER (תפריט קטגוריות מהיר)
   ------------------------------------------------------------- */
.category-slider-container {
    max-width: var(--max-width);
    margin: 20px auto 0;
    padding: 0 20px;
}

.category-slider-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 4px;
    scrollbar-width: none; /* Firefox hide scroll */
    -ms-overflow-style: none; /* IE hide scroll */
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
}

.category-slider-track::-webkit-scrollbar {
    display: none; /* Safari/Chrome hide scroll */
}

.category-slider-item {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 84px;
    cursor: pointer;
}

.category-slider-img-wrap {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin-bottom: 8px;
    background-color: var(--card-bg);
}

.category-slider-item:hover .category-slider-img-wrap {
    transform: scale(1.08) translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.category-slider-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-slider-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--dark);
    transition: var(--transition);
    white-space: nowrap;
}

.category-slider-item:hover .category-slider-title {
    color: var(--primary-hover);
}

/* -------------------------------------------------------------
   RECIPE METADATA TOGGLES & BADGES (HOMEPAGE & CARDS)
   ------------------------------------------------------------- */
.dish-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dish-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.dish-card-img-link {
    display: block;
    text-decoration: none;
}

.dish-card-img-wrapper {
    position: relative;
    padding-top: 72%; /* Crop ratio */
    overflow: hidden;
}

.dish-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dish-card:hover img {
    transform: scale(1.06);
}

.dish-card-favorite-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--dark);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    z-index: 10;
    transition: var(--transition);
}

.dish-card-favorite-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
}

.dish-card-favorite-btn.is-active {
    color: var(--secondary);
}

.dish-card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dish-card-meta {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--secondary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.dish-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-card-excerpt {
    font-size: 14.5px;
    color: var(--dark-muted);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.dish-card-footer {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dish-card-readmore {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dish-card-readmore::after {
    content: '←';
    transition: var(--transition);
}

.dish-card:hover .dish-card-readmore::after {
    transform: translateX(-4px);
}

/* -------------------------------------------------------------
   POST GRID & ARCHIVES
   ------------------------------------------------------------- */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.hero-heading {
    text-align: center;
    margin: 20px 0 40px;
}

.hero-heading h1 {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hero-heading p {
    color: var(--dark-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 10px auto 0;
}

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 576px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 992px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

/* -------------------------------------------------------------
   SINGLE RECIPE POST (Premium Visual Layout)
   ------------------------------------------------------------- */
.recipe-hero {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
}

.recipe-hero-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .recipe-hero-image {
        height: 460px;
    }
}

.recipe-header-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    margin-top: -50px;
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.recipe-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 13.5px;
    font-weight: 700;
}

.meta-badge {
    background: var(--light-bg);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 30px;
    color: var(--dark-muted);
}

.meta-badge.category {
    background: var(--primary-light);
    color: var(--primary-hover);
    border-color: rgba(157, 196, 0, 0.2);
}

.recipe-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.recipe-main-title {
    font-size: 2.0rem;
    font-weight: 800;
    line-height: 1.25;
}

.recipe-save-button {
    background: var(--light-bg);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.recipe-save-button:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.recipe-save-button.is-active {
    background: rgba(230, 107, 91, 0.05);
    color: var(--secondary);
    border-color: var(--secondary);
}

.recipe-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 800px;
    margin: 40px auto 0;
}

.recipe-body-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.recipe-body-content p {
    margin-bottom: 1.4em;
}

/* -------------------------------------------------------------
   ADVANCED HEADING-SENSITIVE RECIPE CHECKLIST (COLON `:` DETECT)
   ------------------------------------------------------------- */
.ingredients-checklist-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    margin: 30px 0;
    box-shadow: var(--shadow-sm);
}

.ingredients-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.ingredients-checklist-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingredients-checklist-title::before {
    content: '🛒';
}

.ingredients-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--light-bg);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.ingredients-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
}

.checklist-table {
    width: 100%;
    border-collapse: collapse;
}

/* Standard checklist item row */
.checklist-item {
    display: flex;
    align-items: center;
    padding: 13px 10px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover {
    background-color: var(--light-bg);
}

.checklist-checkbox-container {
    order: 2; /* Checkbox to the right */
    margin-left: 14px;
    display: flex;
    align-items: center;
}

.checklist-text {
    order: 1; /* Text to the left */
    flex-grow: 1;
    font-weight: 500;
    font-size: 16px;
    transition: var(--transition);
}

.custom-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-hover);
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    transition: var(--transition);
}

.checklist-item.is-checked .custom-checkbox {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checklist-item.is-checked .custom-checkbox::after {
    content: '✓';
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.checklist-item.is-checked .checklist-text {
    color: var(--dark-muted);
    text-decoration: line-through;
    opacity: 0.65;
}

/* Distinct styling for sub-sections ending in colons (no checkboxes) */
.checklist-subheader {
    display: block;
    padding: 22px 10px 10px;
    font-weight: 800;
    font-size: 16.5px;
    color: var(--primary-hover);
    border-bottom: 2px solid var(--primary-light);
    margin-top: 10px;
    cursor: default;
}

.checklist-subheader:first-child {
    margin-top: 0;
    padding-top: 8px;
}

.checklist-subheader:hover {
    background-color: transparent !important;
}

/* -------------------------------------------------------------
   DYNAMIC HOW-TO-MAKE (INSTRUCTIONS) STYLING
   ------------------------------------------------------------- */
.instructions-section-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 20px;
    margin: 30px 0;
    box-shadow: var(--shadow-sm);
}

.instructions-title {
    font-size: 1.4rem;
    font-weight: 800;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-light);
}

.instructions-title::before {
    content: '🍳';
    margin-left: 8px;
}

.instruction-step {
    display: flex;
    gap: 16px;
    padding: 16px 10px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.instruction-step:last-child {
    border-bottom: none;
}

.instruction-step:hover {
    background-color: var(--light-bg);
}

.instruction-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border: 1px solid rgba(157, 196, 0, 0.2);
    color: var(--primary-hover);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
}

.instruction-step.is-done .instruction-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.instruction-text {
    font-size: 16px;
    line-height: 1.7;
    transition: var(--transition);
}

.instruction-step.is-done .instruction-text {
    color: var(--dark-muted);
    opacity: 0.55;
    text-decoration: line-through;
}

/* Distinct styling for instructions sub-sections ending in colons (no checkboxes) */
.instruction-subheader {
    display: block;
    padding: 24px 10px 10px;
    font-weight: 800;
    font-size: 17px;
    color: var(--primary-hover);
    border-bottom: 2px solid var(--primary-light);
    margin-top: 10px;
    cursor: default;
}

.instruction-subheader:hover {
    background-color: transparent !important;
}

/* -------------------------------------------------------------
   FAVORITES PAGE TEMPLATE
   ------------------------------------------------------------- */
.favorites-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    max-width: 600px;
    margin: 40px auto;
}

.favorites-empty-state .heart-icon {
    font-size: 3.5rem;
    color: var(--secondary);
    margin-bottom: 16px;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.1); }
    28% { transform: scale(1); }
    42% { transform: scale(1.1); }
    70% { transform: scale(1); }
}

.favorites-empty-state h3 {
    margin-bottom: 8px;
}

.favorites-empty-state p {
    color: var(--dark-muted);
    margin-bottom: 24px;
}

.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 30px;
    box-shadow: 0 4px 14px rgba(157, 196, 0, 0.4);
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(157, 196, 0, 0.5);
}

/* -------------------------------------------------------------
   PAYWALL (Paid Memberships Pro Premium Styling)
   ------------------------------------------------------------- */
.pmpro_content_message {
    background: linear-gradient(135deg, var(--dark) 0%, #253e32 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 40px 30px;
    text-align: center;
    margin: 40px 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.pmpro_content_message::before {
    content: '🔒';
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
}

.pmpro_content_message h3 {
    color: white;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.pmpro_content_message p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto 24px;
}

.pmpro_content_message a {
    display: inline-block;
    background: var(--primary);
    color: white !important;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 30px;
    box-shadow: 0 4px 14px rgba(157, 196, 0, 0.4);
    font-size: 1.05rem;
}

.pmpro_content_message a:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Hide WP default widgets/advertisement layouts since it is Ad-Free */
.adsbygoogle, .google-ads, .widget_ads {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
}

/* -------------------------------------------------------------
   FOOTER
   ------------------------------------------------------------- */
.site-footer {
    background-color: var(--dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 40px 20px;
    text-align: center;
    border-top: 5px solid var(--primary);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-logo-wrap {
    margin: 0 auto 16px;
}

.footer-logo-wrap img {
    max-height: 44px;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.footer-navigation ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-navigation a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14.5px;
    font-weight: 600;
}

.footer-navigation a:hover {
    color: var(--primary);
}

.site-footer p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.5);
}
