/*
Theme Name: Recetinas
Theme URI: https://recetinas.com
Author: Luis del Hoyo
Description: Tema personalizado para sitio web de cocina con Schema JSON-LD y función de impresión.
Version: 1.0.0
*/

/* ==========================================================================
   1. LAYOUT Y CABECERA GLOBAL
   ========================================================================== */
.site-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
}

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 20px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
}

.site-title a {
    color: #222;
    text-decoration: none;
    font-weight: bold;
}

.site-description {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.nav-menu a:hover {
    color: #0066cc;
}

/* ==========================================================================
   2. PÁGINA SINGLE (RECETA INDIVIDUAL) Y FICHA TÉCNICA MODERNA
   ========================================================================== */
.receta-single-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
    min-width: 0; /* Evita desbordamiento en flexbox y CSS grid */
}

/* Ajustes para la imagen principal dentro de la columna */
.receta-imagen-principal {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    border-radius: 8px;
    margin: 20px 0;
}

.receta-imagen-principal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* FICHA TÉCNICA MODERNA (GRID Y CARDS) */
.receta-detalles-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 25px 0 35px 0;
    padding: 16px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.detalle-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.detalle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Tarjeta de tiempo total ligeramente resaltada */
.detalle-card.destacada {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.detalle-card.destacada .detalle-icon {
    color: #16a34a;
    background: #dcfce7;
}

/* Iconos */
.detalle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: #f1f5f9;
    color: #0f172a;
    flex-shrink: 0;
}

/* Textos internos */
.detalle-info {
    display: flex;
    flex-direction: column;
}

.detalle-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #64748b;
    line-height: 1.1;
}

.detalle-valor {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    margin-top: 2px;
}

.detalle-valor small {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

@media (max-width: 480px) {
    .receta-detalles-box {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
}

.receta-ingredientes ul {
    list-style: none;
    padding-left: 0;
}

.receta-ingredientes li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.receta-acciones {


    margin: 15px 0;
    text-align: right;
}

.btn-imprimir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #2e7d32;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-imprimir:hover {
    background-color: #1b5e20;
}

/* ==========================================================================
   3. ARCHIVOS Y CUADRÍCULA DE TARJETAS
   ========================================================================== */
.recetas-archive-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: system-ui, -apple-system, sans-serif;
}

.archive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.recetas-filtro-box select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
}

.recetas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.receta-card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.receta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.receta-card-thumbnail {
    width: 100%;
    overflow: hidden;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.recetas-grid img,
.receta-card img,
.receta-card-thumbnail img {
    max-width: 100%;
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.receta-card-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tag-cocina {
    display: inline-block;
    background-color: #eef6ff;
    color: #0066cc;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: 8px;
}

.receta-card-title {
    font-size: 1.2rem;
    margin: 5px 0 10px;
    line-height: 1.3;
}

.receta-card-title a {
    color: #222;
    text-decoration: none;
}

.receta-card-title a:hover {
    color: #0066cc;
}

.recetas-paginacion {
    margin-top: 40px;
    text-align: center;
}

.recetas-paginacion .page-numbers {
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.recetas-paginacion .page-numbers.current {
    background-color: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* ==========================================================================
   4. DISEÑO EDITORIAL / REVISTA - PÁGINA DE INICIO (front-page.php)
   ========================================================================== */
:root {
    --gastro-bg: #faf8f5;
    --gastro-text: #1a1a1a;
    --gastro-muted: #666666;
    --gastro-accent: #c84b31;
    --gastro-border: #e2ded8;
    --gastro-font-serif: "Playfair Display", Georgia, serif;
}

.gastro-front-page {
    background-color: var(--gastro-bg);
    color: var(--gastro-text);
    padding-bottom: 60px;
}

.gastro-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-editorial-wrapper {
    padding: 40px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.hero-main-card {
    background: #ffffff;
    border: 1px solid var(--gastro-border);
    border-radius: 4px;
    overflow: hidden;
}

.hero-img-link {
    display: block;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    height: 440px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-main-card:hover .hero-img {
    transform: scale(1.02);
}

.hero-content {
    padding: 30px;
}

.editorial-badge {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gastro-accent);
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-title {
    font-family: var(--gastro-font-serif);
    font-size: 2.2rem;
    line-height: 1.2;
    margin: 0 0 15px 0;
}

.hero-title a {
    color: var(--gastro-text);
    text-decoration: none;
}

.hero-excerpt {
    color: var(--gastro-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.recipe-meta-inline {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--gastro-muted);
    border-top: 1px solid var(--gastro-border);
    padding-top: 15px;
}

.hero-sidebar {
    background: #ffffff;
    border: 1px solid var(--gastro-border);
    padding: 25px;
    border-radius: 4px;
}

.sidebar-heading {
    font-family: var(--gastro-font-serif);
    font-size: 1.2rem;
    border-bottom: 2px solid var(--gastro-text);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.sidebar-card {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--gastro-border);
}

.sidebar-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-img-link {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

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

.card-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gastro-accent);
    font-weight: 600;
}

.sidebar-title {
    font-size: 0.95rem;
    line-height: 1.3;
    margin: 5px 0 0 0;
}

.sidebar-title a {
    color: var(--gastro-text);
    text-decoration: none;
}

.editorial-categories-bar {
    background: #ffffff;
    border-top: 1px solid var(--gastro-border);
    border-bottom: 1px solid var(--gastro-border);
    padding: 15px 0;
    margin: 20px 0 50px 0;
}

.categories-flex {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.cat-label {
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cat-pill {
    padding: 6px 16px;
    border: 1px solid var(--gastro-border);
    border-radius: 20px;
    color: var(--gastro-text);
    text-decoration: none;
    font-size: 0.85rem;
}

.section-header-editorial {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.section-header-editorial h2 {
    font-family: var(--gastro-font-serif);
    font-size: 1.8rem;
    white-space: nowrap;
    margin: 0;
}

.header-line {
    width: 100%;
    height: 1px;
    background: var(--gastro-border);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.bento-card {
    background: #ffffff;
    border: 1px solid var(--gastro-border);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bento-card.bento-wide {
    grid-column: span 2;
    flex-direction: row;
}

.bento-wide .bento-img-link {
    width: 50%;
}

.bento-wide .bento-content {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-img-link {
    display: block;
    height: 220px;
    overflow: hidden;
}

.bento-wide .bento-img-link {
    height: 100%;
}

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

.bento-content {
    padding: 20px;
}

.bento-title {
    font-family: var(--gastro-font-serif);
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 8px 0;
}

.bento-title a {
    color: var(--gastro-text);
    text-decoration: none;
}

.bento-excerpt {
    font-size: 0.9rem;
    color: var(--gastro-muted);
    margin: 0;
}

/* Adaptación para Pantallas Móviles */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-card.bento-wide {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-card.bento-wide {
        grid-column: span 1;
        flex-direction: column;
    }
    .bento-wide .bento-img-link,
    .bento-wide .bento-content {
        width: 100%;
    }
    .hero-img {
        height: 280px;
    }
}

/* ==========================================================================
   5. PIE DE PÁGINA GLOBAL
   ========================================================================== */
.site-footer {
    background-color: #1a1a1a;
    color: #cccccc;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info a {
    color: #ffffff;
    text-decoration: none;
}

.footer-tagline {
    font-size: 0.85rem;
    color: #888;
    margin-top: 5px;
}

/* ==========================================================================
   6. IMPRESIÓN (@media print)
   ========================================================================== */
@media print {
    header,
    footer,
    nav,
    aside,
    .site-header,
    .site-footer,
    .sidebar,
    .comments-area,
    .receta-acciones,
    #wpadminbar,
    .receta-ingredientes input[type="checkbox"] {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
        line-height: 1.5;
        margin: 0;
        padding: 0;
    }

    .receta-single-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .receta-titulo {
        font-size: 22pt;
        margin-bottom: 5px;
        color: #000000;
    }

    .receta-detalles-box {
        border: 1px solid #999999 !important;
        background-color: #f9f9f9 !important;
        padding: 10px !important;
        margin: 15px 0 !important;
        display: flex !important;
        justify-content: space-between !important;
    }

    .receta-imagen-principal img {
        max-height: 250px;
        width: auto;
        object-fit: cover;
        margin: 10px 0;
        page-break-inside: avoid;
    }

    .receta-ingredientes,
    .receta-pasos,
    .receta-pasos li {
        page-break-inside: avoid;
    }

    .receta-ingredientes li {
        border-bottom: 1px dotted #ccc;
        padding: 4px 0;
    }

    .receta-single-container::after {
        content: "Receta impresa desde: " attr(data-url);
        display: block;
        font-size: 9pt;
        color: #666;
        margin-top: 30px;
        border-top: 1px solid #ccc;
        padding-top: 5px;
    }
}

/* ==========================================================================
   SIDEBAR MODERNO DE RECETAS
   ========================================================================== */

/* Layout de 2 columnas */
.receta-layout-grid {
    display: grid;
    grid-template-columns: 1fr 340px; /* Receta amplia a la izquierda, Sidebar de 340px a la derecha */
    gap: 40px;
    padding: 40px 0;
    align-items: start;
}

/* Hacer que el Sidebar se quede pegado al hacer scroll (Sticky) */
.receta-sidebar {
    position: sticky;
    top: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Tarjetas/Widgets del Sidebar */
.widget-editorial {
    background: #ffffff;
    border: 1px solid var(--gastro-border, #e2ded8);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.widget-title {
    font-family: var(--gastro-font-serif, Georgia, serif);
    font-size: 1.15rem;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gastro-text, #1a1a1a);
    text-transform: capitalize;
}

/* Widget Autor */
.widget-author {
    text-align: center;
}

.author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid var(--gastro-border, #e2ded8);
}

.author-bio {
    font-size: 0.88rem;
    color: var(--gastro-muted, #666);
    line-height: 1.5;
    margin: 0;
}

/* Widget Recetas Populares */
.sidebar-recipe-item {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--gastro-border, #e2ded8);
}

.sidebar-recipe-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-recipe-thumb {
    flex-shrink: 0;
    width: 65px;
    height: 65px;
    border-radius: 6px;
    overflow: hidden;
}

.sidebar-recipe-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.recipe-cat {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gastro-accent, #c84b31);
    font-weight: 700;
}

.recipe-title {
    font-size: 0.9rem;
    line-height: 1.3;
    margin: 3px 0 0 0;
}

.recipe-title a {
    color: var(--gastro-text, #1a1a1a);
    text-decoration: none;
    transition: color 0.2s ease;
}

.recipe-title a:hover {
    color: var(--gastro-accent, #c84b31);
}

/* Widget Newsletter */
.widget-newsletter {
    background: #fdfbf7;
    border-color: #ebd2c1;
    text-align: center;
}

.newsletter-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.widget-newsletter p {
    font-size: 0.85rem;
    color: var(--gastro-muted, #666);
    margin-bottom: 15px;
}

.newsletter-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gastro-border, #e2ded8);
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.btn-newsletter {
    width: 100%;
    background: var(--gastro-text, #1a1a1a);
    color: #ffffff;
    border: none;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-newsletter:hover {
    background: var(--gastro-accent, #c84b31);
}

/* Responsivo para tablets y móviles */
@media (max-width: 992px) {
    .receta-layout-grid {
        grid-template-columns: 1fr; /* Pasa a 1 sola columna en dispositivos móviles */
    }
    .receta-sidebar {
        position: static;
    }
}

/* ==========================================================================
   CABECERA Y MENÚ DE NAVEGACIÓN MODERNO
   ========================================================================== */

.site-header-modern {
    background-color: #ffffff;
    border-bottom: 1px solid var(--gastro-border, #e2ded8);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-inner-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
    gap: 20px;
}

/* Brand / Logo */
.brand-name {
    font-family: var(--gastro-font-serif, "Playfair Display", Georgia, serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gastro-text, #1a1a1a);
    letter-spacing: -0.5px;
}

.site-title-link {
    text-decoration: none;
}

/* Menú de navegación principal */
.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu-modern {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
}

.nav-menu-modern a {
    text-decoration: none;
    color: var(--gastro-text, #1a1a1a);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.nav-menu-modern a:hover {
    color: var(--gastro-accent, #c84b31);
}

/* Efecto de línea inferior al hacer hover */
.nav-menu-modern a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--gastro-accent, #c84b31);
    transition: width 0.3s ease;
}

.nav-menu-modern a:hover::after {
    width: 100%;
}

/* Buscador integrado */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-search-form {
    display: flex;
    align-items: center;
    background: #f5f3ef;
    border-radius: 20px;
    padding: 5px 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.header-search-form:focus-within {
    border-color: var(--gastro-accent, #c84b31);
    background: #ffffff;
}

.header-search-form input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    width: 130px;
}

.header-search-form button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gastro-muted, #666);
    display: flex;
    align-items: center;
    padding: 0;
}

/* Botón Menú Hamburguesa (Oculto en Escritorio) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--gastro-text, #1a1a1a);
    transition: all 0.3s ease;
}

/* ANIMACIÓN BOTÓN MÓVIL (X al activar) */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   ADAPTACIÓN RESPONSIVA (MÓVILES Y TABLETS)
   ========================================================================== */
@media (max-width: 880px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .header-search-form input {
        width: 100px;
    }

    .main-navigation {
        position: absolute;
        top: 75px;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-bottom: 1px solid var(--gastro-border, #e2ded8);
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        display: none;
        padding: 20px 0;
    }

    .main-navigation.active {
        display: flex;
        justify-content: center;
    }

    .nav-menu-modern {
        flex-direction: column;
        align-items: center;
        gap: 18px;
        width: 100%;
    }
}

/* ==========================================================================
   DESPLEGABLES Y SUBMENÚS (CON SCROLL PARA LISTAS LARGAS)
   ========================================================================== */

/* Posicionamiento relativo en los elementos padre */
.nav-menu-modern li {
    position: relative;
}

/* Ocultar y posicionar el submenú */
.nav-menu-modern .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    
    /* CONTROL DE ALTURA Y SCROLL */
    max-height: 65vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    border: 1px solid var(--gastro-border, #e2ded8);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    
    /* Transición suave */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
}

/* Estilo personalizado elegante para la barra de desplazamiento (Scrollbar) */
.nav-menu-modern .sub-menu::-webkit-scrollbar {
    width: 5px;
}

.nav-menu-modern .sub-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 6px 6px 0;
}

.nav-menu-modern .sub-menu::-webkit-scrollbar-thumb {
    background: var(--gastro-accent, #c84b31);
    border-radius: 4px;
}

/* Mostrar el submenú al hacer hover */
.nav-menu-modern li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Estilos de los enlaces del submenú */
.nav-menu-modern .sub-menu li {
    width: 100%;
}

.nav-menu-modern .sub-menu a {
    display: block;
    padding: 9px 18px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: none; /* Mantener mayúsculas/minúsculas normales */
    color: var(--gastro-text, #1a1a1a);
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* Eliminar la línea inferior animada en los submenús */
.nav-menu-modern .sub-menu a::after {
    display: none;
}

.nav-menu-modern .sub-menu a:hover {
    background-color: #fdfbf7;
    color: var(--gastro-accent, #c84b31);
}

/* Adaptación para pantallas móviles */
@media (max-width: 880px) {
    .nav-menu-modern .sub-menu {
        position: static;
        max-height: none; /* Desactivar límite en móvil para que fluya en el menú lateral */
        overflow-y: visible;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: #f9f9f9;
        padding: 5px 0 5px 15px;
        margin-top: 5px;
        display: none; /* Se integra en el flujo vertical del móvil */
    }

    .nav-menu-modern li:hover > .sub-menu,
    .nav-menu-modern li.focus > .sub-menu {
        display: block;
    }
}

/* ==========================================================================
   VÍDEOS DE YOUTUBE RESPONSIVOS (SOLUCIÓN DEFINITIVA CON ASPECT-RATIO)
   ========================================================================== */

/* 1. Reset de contenedores nativos de WordPress y constructores */
.wp-block-embed-youtube,
.wp-block-embed,
.wp-block-embed__wrapper,
.elementor-video-wrapper,
.receta-video-container {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 200px !important; /* Asegura visibilidad base si algo falla */
    margin: 25px 0 !important;
    padding: 0 !important; /* Eliminamos paddings antiguos */
    display: block !important;
}

/* 2. Forzar aspect-ratio en todos los iframes de vídeo */
.receta-single-container iframe,
.entry-content iframe,
.wp-block-embed iframe,
.receta-video-container iframe,
iframe[src*="youtube.com"],
iframe[src*="youtu.be"] {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9 !important; /* Fuerza la proporción 16:9 sin trucos de padding */
    height: auto !important;
    display: block !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
}

/* RESUMEN FÁCIL DE LA RECETA / PASO A PASO MODERNO */
.receta-pasos ol {
    list-style: none; /* Elimina los números por defecto */
    counter-reset: paso-counter; /* Crea un contador personalizado */
    padding: 0;
    margin: 0;
}

.receta-pasos li {
    counter-increment: paso-counter;
    position: relative;
    padding-left: 48px;
    margin-bottom: 24px;
    line-height: 1.6;
    color: #334155;
    font-size: 1.05rem;
}

/* Círculo con número del paso personalizado */
.receta-pasos li::before {
    content: counter(paso-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background-color: #e2e8f0;
    color: #0f172a;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* ==========================================================================
   ESTILOS PERSONALIZADOS PARA BLOQUES DE LISTA EN GUTENBERG
   ========================================================================== */

/* 1. Opción Checkmark (✓) */
ul.is-style-lista-check {
    list-style: none;
    padding-left: 0;
}
ul.is-style-lista-check li {
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 0.5rem;
}
ul.is-style-lista-check li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: #10b981; /* Verde moderno */
    font-weight: bold;
}

/* 2. Opción Flechas (→) */
ul.is-style-lista-flecha {
    list-style: none;
    padding-left: 0;
}
ul.is-style-lista-flecha li {
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 0.5rem;
}
ul.is-style-lista-flecha li::before {
    content: "➔";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--gastro-accent, #c84b31);
}

/* 3. Opción Números destacados (Círculo con número) */
ol.is-style-lista-numerada-moderna,
ul.is-style-lista-numerada-moderna {
    list-style: none !important;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.is-style-lista-numerada-moderna li {
    position: relative;
    padding-left: 2.8rem;
    line-height: 1.6;
    color: var(--gastro-text, #1a1a1a);
}

.is-style-lista-numerada-moderna li::before {
    content: counter(list-item);
    position: absolute;
    left: 0;
    top: 0.15rem;
    width: 26px;
    height: 26px;
    background-color: #f3eae8;
    color: var(--gastro-accent, #c84b31);
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 4. Opción Pasos Modernos (Badge con color de acento) */
ol.is-style-lista-pasos-modernos,
ul.is-style-lista-pasos-modernos {
    list-style: none !important;
    padding-left: 0;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

ol.is-style-lista-pasos-modernos li,
ul.is-style-lista-pasos-modernos li {
    position: relative;
    padding-left: 3.5rem;
    padding-top: 0.2rem;
    line-height: 1.6;
    color: var(--gastro-text, #1a1a1a);
}

/* Badge con el número usando color de acento (#c84b31) */
ol.is-style-lista-pasos-modernos li::before,
ul.is-style-lista-pasos-modernos li::before {
    content: counter(list-item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    width: 38px;
    height: 32px;
    background-color: var(--gastro-accent, #c84b31); /* <--- Cambiado de negro a terracota */
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(200, 75, 49, 0.2);
}

/* Línea vertical decorativa */
ol.is-style-lista-pasos-modernos li::after,
ul.is-style-lista-pasos-modernos li::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 36px;
    bottom: -16px;
    width: 2px;
    background-color: var(--gastro-border, #e2ded8);
}

/* Ocultar la línea en el último elemento */
ol.is-style-lista-pasos-modernos li:last-child::after,
ul.is-style-lista-pasos-modernos li:last-child::after {
    display: none;
}

/* ==========================================================================
   ESTILOS MODERNOS PARA LA SECCIÓN DE COMENTARIOS
   ========================================================================== */

#comments {
    max-width: 800px;
    margin: 40px auto 0;
    padding-top: 30px;
    border-top: 2px solid #f0edf8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Títulos */
.comments-title, 
.comment-reply-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Lista de Comentarios */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
}

.comment-list .comment,
.comment-list .pingback {
    margin-bottom: 20px;
}

/* Tarjeta individual de comentario */
.comment-body {
    background-color: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment-body:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

/* Cabecera del comentario (Avatar + Nombre + Fecha) */
.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.comment-meta img.avatar {
    border-radius: 50%;
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.comment-author .fn {
    font-weight: 700;
    font-style: normal;
    color: #1a1a1a;
    font-size: 1rem;
    display: block;
}

.comment-metadata {
    font-size: 0.825rem;
    color: #888;
}

.comment-metadata a {
    color: #888;
    text-decoration: none;
}

.comment-metadata a:hover {
    color: #ff8c00;
}

/* Contenido del comentario */
.comment-content {
    color: #4a5568;
    font-size: 0.975rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* Botón Responder */
.comment-reply-link {
    display: inline-block;
    padding: 6px 14px;
    background-color: #f3f4f6;
    color: #4b5563;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.comment-reply-link:hover {
    background-color: #ff8c00;
    color: #ffffff;
}

/* Respuestas anidadas (Hilos) */
.comment-list .children {
    list-style: none;
    padding-left: 20px;
    margin-top: 15px;
    border-left: 3px solid #ff8c00;
}

@media (max-width: 600px) {
    .comment-list .children {
        padding-left: 10px;
    }
}

/* --------------------------------------------------------------------------
   FORMULARIO DE COMENTARIOS (#respond)
   -------------------------------------------------------------------------- */

#respond {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Campos de Texto e Inputs */
.comment-form p {
    margin: 0;
}

.comment-form-comment,
.form-submit,
.comment-notes,
.logged-in-as,
.comment-form-cookies-consent {
    grid-column: span 2;
}

.comment-form label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 6px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #ff8c00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

.comment-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Casilla de verificación de cookies */
.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #6b7280;
}

.comment-form-cookies-consent input {
    margin: 0;
}

/* Botón Publicar Comentario */
.form-submit input[type="submit"] {
    background-color: #ff8c00;
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.form-submit input[type="submit"]:hover {
    background-color: #e07b00;
}

.form-submit input[type="submit"]:active {
    transform: scale(0.98);
}

/* Responsive para pantallas pequeñas */
@media (max-width: 640px) {
    .comment-form {
        grid-template-columns: 1fr;
    }
    .comment-form-author,
    .comment-form-email,
    .comment-form-url {
        grid-column: span 1;
    }
}
/* Ocultar la fecha de publicación en los comentarios */
.comment-metadata,
.comment-date,
.comment-time,
time {
    display: none !important;
}

/* Ocultar la palabra "dice:" al lado del nombre */
.comment-author .says {
    display: none !important;
}

/* ==========================================================================
   ESTILOS PARA LA PÁGINA DE ERROR 404
   ========================================================================== */

.error-404-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.error-code {
    display: block;
    font-size: 6rem;
    font-weight: 900;
    color: #ff8c00;
    line-height: 1;
    margin-bottom: 10px;
}

.error-404-content .page-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.error-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

/* Buscador */
.error-search-form {
    background-color: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #eee;
}

.error-search-form p {
    margin-top: 0;
    margin-bottom: 12px;
    color: #444;
}

/* Botón Inicio */
.error-actions {
    margin-bottom: 50px;
}

.btn-home {
    display: inline-block;
    background-color: #ff8c00;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-home:hover {
    background-color: #e07b00;
    color: #ffffff;
}

/* Sugerencias de Recetas */
.error-recent-posts {
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.error-recent-posts h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 20px;
}

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.recent-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
}

.recent-card:hover {
    transform: translateY(-3px);
}

.recent-card a {
    text-decoration: none;
    color: inherit;
}

.recent-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.recent-card h3 {
    font-size: 0.95rem;
    padding: 12px;
    margin: 0;
    color: #2c3e50;
}

/* ==========================================================================
   ESTILOS PARA LAYOUT CON SIDEBAR EN ARCHIVOS (CATEGORÍAS Y ETIQUETAS)
   ========================================================================== */

/* Contenedor Flex para alinear Contenido y Sidebar */
.layout-con-sidebar {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Columna Principal (Izquierda) */
.layout-con-sidebar .content-area {
    flex: 1;
    min-width: 0;
}

/* Columna Sidebar (Derecha) */
.layout-con-sidebar .sidebar-derecho {
    width: 320px;
    flex-shrink: 0;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--gastro-border, #e2ded8);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

/* Adaptabilidad Móvil */
@media (max-width: 880px) {
    .layout-con-sidebar {
        flex-direction: column;
    }
    
    .layout-con-sidebar .sidebar-derecho {
        width: 100%;
        box-sizing: border-box;
    }
}