/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BÁSICA
   ======================================== */
:root {
    --color-bg: #ffffff;
    --color-text: #202124;  
    --color-accent: #1a73e8; /* Tu Azul */
    --color-meta: #5f6368;
    
    --header-height: 55px;
    --radius: 6px; 
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
a:hover { color: var(--color-accent); }

img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; padding: 0; margin: 0; }

/* =========================================
   2. HEADER (PC) - ESTILO NEGRO MATE (MODERNO)
   ======================================== */
.site-header {
    position: relative;
    height: var(--header-height);
    background: #212121; 
    color: #ffffff;
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); 
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-container {
    width: 100%; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 20px;
    display: flex; 
    align-items: center; 
    justify-content: space-between;
}

/* --- LOGO Y TÍTULO --- */
.site-branding { margin-right: auto; display: flex; align-items: center; }
.site-title { font-weight: 800; font-size: 1.3rem; margin: 0; line-height: 1; }
.site-title a { color: #ffffff; text-decoration: none; }
.custom-logo-link img { max-height: 35px; width: auto; }

/* --- MENÚ PC --- */
.desktop-nav { margin: 0 20px; }
.desktop-nav ul { display: flex; gap: 20px; font-weight: 500; font-size: 0.9rem; }

/* Enlaces con un blanco un poco más "apagado" para ir con el mate */
.desktop-nav li a { 
    color: #b0b3b8; /* Gris claro mate */
    transition: all 0.2s ease; 
}
.desktop-nav li a:hover { 
    color: #ffffff; /* Blanco puro al pasar el ratón */
    opacity: 1; 
}

/* --- ICONOS BLANCOS (MÓVIL) --- */
.search-toggle-mobile, .mobile-toggle { color: #ffffff !important; }
.bar { background-color: #ffffff !important; }


/* =========================================
   3. BUSCADOR (PÍLDORA)
   ======================================== */
.search-form { display: block; width: 300px; }
.search-field {
    width: 100%; background: #f1f3f4; border: none;
    border-radius: 99px; padding: 6px 20px; outline: none;
    font-size: 0.95rem; color: #333; font-family: inherit;
    transition: all 0.2s ease;
}
.search-field:focus { background: #fff; box-shadow: 0 0 0 2px var(--color-accent); }

.mobile-toggle, .search-toggle-mobile, .mobile-menu-container { display: none; }


/* =========================================
   4. GRID / INDEX (RESPONSIVE MEJORADO)
   ======================================== */
.container {
    max-width: 1400px;
    margin: 40px auto; 
    padding: 0 20px;
}

/* Rejilla 4 Columnas (PC Grande) */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px; /* Ajuste leve para mejor espacio */
}

/* --- AGREGADO: 3 Columnas en Laptops medianas (hasta 1200px) --- */
@media (max-width: 1200px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tarjeta */
.grid-item { position: relative; }

/* IMAGEN 16:9 ESTRICTO */
.post-thumbnail-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9; 
    overflow: hidden;
    border-radius: var(--radius);
    background: #f0f0f0;
}

.post-thumbnail-link img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: opacity 0.2s ease;
}

.post-thumbnail-link:hover img { opacity: 0.9; }

/* TÍTULO */
.entry-title {
    font-size: 1.05rem;
    margin-top: 12px;
    margin-bottom: 0;
    line-height: 1.4;
    font-weight: 700;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.2em; 
}

.entry-title a { text-decoration: none; }
.entry-title a:hover { color: var(--color-accent); }


/* =========================================
   5. PAGINACIÓN (Estilo Negro Mate)
   ======================================== */
.pagination-container { margin: 60px 0; text-align: center; clear: both; }
.pagination .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

.pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; 
    background-color: #f1f3f4; 
    color: var(--color-text);
    border-radius: 4px; 
    font-weight: 600; font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none; 
}

.pagination .page-numbers:hover { 
    background-color: #e8eaed; 
    color: #212121; 
}

.pagination .page-numbers.current {
    background-color: #212121; 
    color: white;
}

.pagination h2.screen-reader-text { display: none; }


/* =========================================
   6. SINGLE POST
   ======================================== */
.container-single {
    max-width: 760px; 
    margin: 0 auto;
    padding-bottom: 60px;
}

.entry-header-single { margin-bottom: 20px; }

.entry-title-single {
    font-size: 1.6rem; 
    font-weight: 700; 
    line-height: 1.3;
    margin-bottom: 0;
    color: #111;
}

.entry-content {
    font-size: 1.05rem; 
    line-height: 1.6; 
    color: #2c2c2c; 
    font-family: var(--font-main); 
}

.entry-content p { margin-bottom: 1.2em; }

.entry-content h2 { 
    margin-top: 1.5em; margin-bottom: 0.5em;
    font-weight: 700; font-size: 1.4rem; line-height: 1.3;
}

.entry-content h3 { 
    margin-top: 1.5em; font-weight: 600; font-size: 1.2rem; 
}

.entry-content a {
    color: var(--color-accent);
    font-weight: 600;
    text-decoration: underline; 
    text-underline-offset: 3px;
}
.entry-content a:hover { text-decoration: none; }

.separator { border: 0; border-top: 1px solid #eee; margin: 40px 0; }

.related-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.related-thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; transition: opacity 0.2s; }
.related-thumb:hover img { opacity: 0.8; }
.related-post-title { font-size: 0.95rem; line-height: 1.4; margin: 0; }
.related-post-title a { font-weight: 600; color: var(--color-text); }
.related-post-title a:hover { color: var(--color-accent); }

/* =========================================
   7. VERSIÓN MÓVIL Y TABLET (Hasta 990px)
   ========================================= */

/* CAMBIO: Se activa menú hamburguesa en 990px */
@media (max-width: 990px) {
    
    /* --- A) Header Móvil --- */
    .mobile-toggle { display: block; order: 1; }
    .site-branding { order: 2; flex-grow: 1; justify-content: center; margin: 0; }
    .header-search-wrapper { order: 3; }
    .desktop-nav { display: none; }

    /* Estilos Botón Hamburguesa */
    .mobile-toggle { width: 30px; height: 30px; background: transparent; border: none; cursor: pointer; padding: 0; position: relative; z-index: 2000; color: #333; }
    .bar { display: block; width: 100%; height: 2px; background-color: currentColor; position: absolute; left: 0; transition: all 0.3s ease-in-out; border-radius: 2px; }
    .bar-top { top: 4px; } .bar-mid { top: 14px; } .bar-bot { top: 24px; }
    .mobile-toggle.active .bar-top { top: 14px; transform: rotate(45deg); }
    .mobile-toggle.active .bar-mid { opacity: 0; }
    .mobile-toggle.active .bar-bot { top: 14px; transform: rotate(-45deg); }

    /* Buscador Móvil */
    .search-toggle-mobile { display: block; background: none; border: none; padding: 0; color: #333; }
    .search-bar-container { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; padding: 15px; border-bottom: 1px solid #ddd; z-index: 900; }
    .search-bar-container.active { display: block; }
    .search-form { width: 100%; }

    /* --- B) Menú Desplegable --- */
    .mobile-menu-container { 
        display: block; 
        position: absolute; 
        top: 100%; left: 0; right: 0; 
        background: #fff; 
        max-height: 0; overflow: hidden; 
        transition: max-height 0.4s ease-in-out, padding 0.4s; 
        border-bottom: 1px solid #eee; 
        box-shadow: 0 5px 10px rgba(0,0,0,0.05);
        z-index: 999;
    }

    .mobile-menu-container.active { max-height: 80vh; padding: 20px; overflow-y: auto; }
    
    .mobile-menu-container li a { 
        display: block; 
        padding: 15px 0; 
        font-size: 1.1rem; 
        border-bottom: 1px solid #f5f5f5;
        /* IMPORTANTE: Color oscuro para que se lea sobre el fondo blanco */
        color: #202124 !important; 
    }

    /* --- C) Grid Adaptable (Tablets vs Móviles) --- */
    /* En Tablets (de 600px a 990px): 2 Columnas */
    .post-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px; 
    }
    
    .post-thumbnail-link { aspect-ratio: 16 / 9; }

    .entry-title {
        height: auto; 
        -webkit-line-clamp: 4; 
        margin-bottom: 20px; 
        font-size: 1.2rem;
    }

    /* Single Post Ajustes */
    .entry-title-single { font-size: 1.4rem; line-height: 1.3; }
    .entry-content { font-size: 1rem; }

    /* Artículos relacionados en 2 columnas en Tablet */
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }

    .error-404 .page-title { font-size: 5rem; }
}

/* --- D) AJUSTE EXTRA: Solo Celulares Pequeños (Menos de 600px) --- */
@media (max-width: 600px) {
    
    .post-grid, .related-grid { grid-template-columns: 1fr; }

    /* TARJETA DE RECETA EN MÓVIL */
    .hikari-recipe-card {
        padding: 12px !important;
        margin: 20px 0 !important;
    }

    .recipe-title {
        font-size: 1.1rem !important;
        margin-bottom: 10px !important;
    }

    /* Ajuste de Texto General (Un poco más pequeño en móvil) */
    .hikari-ingredients-list li,
    .hikari-preparation-list li {
        font-size: 0.95rem !important;
    }

    /* Preparación: Bolitas pequeñas */
    .hikari-preparation-list li {
        margin-bottom: 12px !important;
        padding-bottom: 12px !important;
        padding-left: 28px !important; 
    }

    .hikari-preparation-list li::before {
        width: 20px !important;
        height: 20px !important;
        line-height: 20px !important;
        font-size: 0.75rem !important;
        top: 2px !important;
        font-weight: 700 !important;
    }
}


/* =========================================
   8. FOOTER (PIE DE PÁGINA) - Contrast Fix
   ========================================= */
.site-footer {
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 40px 0;
    margin-top: auto; 
    text-align: center;
    font-size: 0.9rem;
    
    /* CAMBIO: Usamos #444 en lugar de gris claro para pasar el test de contraste */
    color: #444; 
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-widget-area {
    text-align: center; 
    margin-bottom: 20px; 
    display: flex;
    justify-content: center;
}

/* --- MENÚ DEL FOOTER --- */
.footer-navigation {
    margin-bottom: 20px;
}

.footer-navigation ul {
    display: inline-flex; 
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    background-color: #f1f3f4; 
    border-radius: 99px;      
    padding: 10px 30px;       
    margin: 0;
}

.footer-navigation a {
    color: #333; /* Texto casi negro para máximo contraste */
    font-weight: 600; /* Un poco más grueso ayuda a la legibilidad */
}

.footer-navigation a:hover {
    color: var(--color-accent);
}

.site-info {
    font-size: 0.85rem;
    /* CAMBIO: De #999 (muy claro) a #555 (gris medio oscuro) */
    color: #555; 
}

/* =========================================
   9. PÁGINA 404 (ERROR)
   ========================================= */
.error-404 {
    text-align: center;
    padding: 60px 0 100px;
}

.error-404 .page-title {
    font-size: 8rem; 
    font-weight: 900;
    color: #e0e0e0; 
    line-height: 1;
    margin: 0;
}

.page-content p {
    font-size: 1.2rem;
    color: var(--color-meta);
}

.btn-home {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background-color: var(--color-accent); 
    color: white;
    font-weight: 600;
    border-radius: 99px;
    transition: background 0.2s;
}

.btn-home:hover {
    background-color: #1557b0; 
    color: white;
}

/* =========================================
   10. FORMULARIO DE CONTACTO (HIKARI)
   ========================================= */
.hikari-contact-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.hikari-form .form-group { margin-bottom: 20px; text-align: left; }

.hikari-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.hikari-form input[type="text"],
.hikari-form input[type="email"],
.hikari-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: border 0.2s, box-shadow 0.2s;
}

.hikari-form input:focus,
.hikari-form textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    outline: none;
}

.hikari-btn-submit {
    display: inline-block;
    width: 100%;
    padding: 14px;
    background-color: var(--color-text); /* Negro Mate */
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.hikari-btn-submit:hover {
    background-color: var(--color-accent); /* Azul al pasar ratón */
}

/* Mensajes de Alerta */
.hikari-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 500;
}
.hikari-alert.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.hikari-alert.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* =========================================
   11. TARJETAS DE RECETA (ESTILO UNIFICADO)
   ========================================= */

/* Estilo base para AMBAS cajas */
.hikari-recipe-card {
    background: #fdfbf7; 
    border: 1px solid #e8e0cd;
    border-radius: 8px;
    padding: 30px; 
    margin: 40px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.recipe-title {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 1.4rem;
    color: #4a4a4a;
    border-bottom: 2px solid #e8e0cd;
    padding-bottom: 10px;
    display: inline-block;
}

/* --- ESTILOS DE LA LISTA DE INGREDIENTES (Compacto) --- */
.hikari-ingredients-list {
    list-style: none !important;
    padding: 0; margin: 0;
}

.hikari-ingredients-list li {
    padding: 6px 0; 
    margin: 0;
    border-bottom: 1px solid #eee; 
    font-size: 1rem;
    color: #333;
    display: flex;
    align-items: center; 
    line-height: 1.3;
}

.hikari-ingredients-list li:last-child {
    border-bottom: none;
}

.check-icon {
    color: var(--color-accent); /* Mantenemos el azul vivo aquí para destacar */
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.1rem;
    line-height: 1;
}

/* --- ESTILOS DE LA LISTA DE PREPARACIÓN (Más aireada) --- */
.hikari-preparation-list {
    counter-reset: hikari-step-counter;
    list-style: none !important;
    padding: 0; margin: 0;
}

.hikari-preparation-list li {
    position: relative;
    padding-left: 50px; 
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e0e0e0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
}

.hikari-preparation-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* EL CÍRCULO CON EL NÚMERO */
.hikari-preparation-list li::before {
    counter-increment: hikari-step-counter;
    content: counter(hikari-step-counter);
    position: absolute;
    left: 0;
    top: -2px;
    width: 35px;
    height: 35px;
    
    /* CAMBIO AQUÍ: Negro Mate en lugar de Azul */
    background-color: var(--color-text); 
    
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}