/* --- FUENTES Y VARIABLES --- */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --primary: #006994; /* Azul Egeo */
    --secondary: #556B2F; /* Verde Oliva */
    --accent: #D4AF37; /* Dorado */
    --bg-color: #f9f9f9;
    --text-color: #333;
    --white: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    margin-top: 0; /* Reset margen superior */
}

/* --- NAVEGACIÓN (Solo Pantalla) --- */
.navbar {
    background: var(--white);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin-left: 20px;
    font-weight: bold;
    transition: color 0.3s;
}
.nav-links a:hover { color: var(--secondary); }

/* --- CONTENEDORES --- */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), url('https://images.unsplash.com/photo-1498579150354-977475b7ea0b?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
}
.hero h1 { color: white; font-size: 3.5rem; margin-bottom: 0.5rem; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.hero p { font-size: 1.2rem; font-style: italic; }

/* --- TARJETAS (Para Índices) --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex; /* Ajuste para flexibilidad */
    flex-direction: column;
}
.card:hover { transform: translateY(-5px); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 1.5rem; text-align: center; flex-grow: 1; }
.card-title { font-size: 1.2rem; font-weight: bold; margin: 0; color: var(--secondary); }

/* --- DISEÑO DE RECETA INDIVIDUAL (Pantalla) --- */
.recipe-header {
    text-align: center;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}
.recipe-title { font-size: 3rem; margin-bottom: 0.5rem; }
.recipe-origin { font-style: italic; color: #666; display: block; margin-bottom: 1rem; }
.recipe-history { 
    background-color: #fffbf0; 
    padding: 1.5rem; 
    border-radius: 8px; 
    text-align: justify; 
    font-size: 0.95rem; 
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent);
}
.recipe-img {
    width: 100%; height: 400px; object-fit: cover; 
    border-radius: 10px; margin-top: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.recipe-content { display: flex; flex-wrap: wrap; gap: 3rem; }
.ingredients {
    flex: 1; min-width: 250px;
    background: #fff; padding: 2rem; border-radius: 10px;
    border-left: 5px solid var(--secondary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.steps { flex: 2; min-width: 300px; }

/* Listas */
.ingredients ul { padding-left: 20px; list-style: none; }
.ingredients li { margin-bottom: 10px; border-bottom: 1px dashed #eee; padding-bottom: 5px; }
.steps ol { counter-reset: item; list-style-type: none; padding: 0; }
.steps li { position: relative; padding-left: 50px; margin-bottom: 20px; }
.steps li::before {
    content: counter(item); counter-increment: item;
    position: absolute; left: 0; top: 0;
    width: 35px; height: 35px;
    background: var(--primary); color: white;
    border-radius: 50%; text-align: center; line-height: 35px;
    font-weight: bold; font-family: 'Playfair Display', serif;
}

/* --- BOTÓN DE IMPRESIÓN --- */
.btn-print {
    position: fixed; bottom: 30px; right: 30px; /* Flotante */
    background: var(--secondary); color: white;
    padding: 15px 25px; border-radius: 50px;
    border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-weight: bold; cursor: pointer; font-size: 1rem;
    z-index: 1000; transition: transform 0.2s;
}
.btn-print:hover { transform: scale(1.05); }

/* =========================================
   ESTILOS DE IMPRESIÓN (SOLO PDF/PAPEL)
   ========================================= */
@media print {
    @page { margin: 1.5cm; size: letter; }
    
    body { background: white; color: black; font-size: 10pt; }
    
    /* Ocultar elementos de UI */
    .navbar, .btn-print, .hero { display: none !important; }

    .container { width: 100%; max-width: 100%; padding: 0; margin: 0; box-shadow: none; }

    /* --- CABECERA DE PÁGINA (LOGO) --- */
    .print-header {
        display: block !important;
        text-align: center; margin-bottom: 1rem;
        border-bottom: 2px solid var(--primary); padding-bottom: 5px;
    }
    .print-header h1 { font-size: 20pt; margin: 0; color: var(--primary) !important; }
    .print-header p { margin: 0; font-style: italic; font-size: 10pt; }

    /* --- AJUSTES PARA EL INDEX (1 PÁGINA) --- */
    .index-intro { font-size: 10pt; text-align: justify; margin-bottom: 1.5rem; }
    
    /* Grid compacta para el index */
    .grid { 
        display: grid; 
        grid-template-columns: 1fr 1fr; /* 2 columnas forzadas */
        gap: 1rem; margin-top: 1rem; 
    }
    .card { 
        box-shadow: none; border: 1px solid #ccc; 
        flex-direction: row; /* Imagen a la izquierda */
        align-items: center; height: auto;
    }
    .card img { 
        width: 80px; height: 80px; /* Imagen pequeña */
        object-fit: cover; flex-shrink: 0;
    }
    .card-content { padding: 0.5rem 1rem; text-align: left; }
    .card-title { font-size: 11pt; margin-bottom: 0; }
    .card p { font-size: 9pt; margin: 0; display: none; /* Ocultar descripciones largas en index print */ }

    /* --- AJUSTES PARA RECETAS (1 PÁGINA) --- */
    .recipe-header {
        display: flex; align-items: flex-start; justify-content: space-between;
        text-align: left; border-bottom: 1px solid #ccc; 
        margin-bottom: 1rem; padding-bottom: 0.5rem;
    }
    .header-text { flex: 1; }
    .recipe-title { font-size: 22pt; margin: 0; line-height: 1.1; color: var(--primary) !important; }
    .recipe-origin { font-size: 9pt; margin: 2px 0 5px 0; }
    .recipe-history {
        font-size: 9pt; padding: 5px; background: none; border: none; 
        text-align: justify; margin-bottom: 0; color: #444;
    }
    
    /* Imagen pequeña flotando a la derecha */
    .recipe-img {
        width: 180px !important; height: 160px !important;
        object-fit: cover; margin: 0 0 0 15px; border-radius: 4px; box-shadow: none;
    }

    /* Columnas lado a lado */
    .recipe-content { display: flex !important; flex-wrap: nowrap !important; gap: 1.5rem; margin-top: 0; }
    
    .ingredients {
        flex: 0 0 35%; /* 35% ancho */
        padding: 0; border: none; background: transparent !important;
        border-right: 1px solid #eee; box-shadow: none;
        font-size: 9pt;
    }
    .steps { flex: 1; padding: 0; font-size: 10pt; }
    
    /* Ahorro de espacio en listas */
    .steps li { margin-bottom: 8px; padding-left: 2.5rem; page-break-inside: avoid; }
    .ingredients li { margin-bottom: 4px; border-bottom: 1px solid #eee; }
    .steps li::before {
        width: 1.5rem; height: 1.5rem; line-height: 1.5rem; font-size: 0.8rem;
        background: white !important; color: var(--primary) !important;
        border: 1px solid var(--primary);
    }
    h3 { font-size: 12pt; margin-bottom: 8px; border-bottom: 1px solid #ccc; display: inline-block; }
    
    a { text-decoration: none; color: black; }
}
/* =========================================
   RESPONSIVE & MENÚ HAMBURGUESA
   ========================================= */
.hamburger {
    display: none; /* Oculto en PC */
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary);
    user-select: none;
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
        flex-wrap: wrap; /* Permite que el menú caiga abajo */
    }

    .hamburger {
        display: block; /* Visible en Móvil */
    }

    .nav-links {
        display: none; /* Oculto por defecto */
        width: 100%;
        flex-direction: column;
        background: var(--white);
        margin-top: 1rem;
        border-top: 1px solid #eee;
        animation: fadeIn 0.3s ease;
    }

    .nav-links.active {
        display: flex; /* Se muestra al activar */
    }

    .nav-links a {
        margin: 0;
        padding: 15px;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }
    
    .recipe-title { font-size: 2rem; }
    .hero h1 { font-size: 2.5rem; }
    .container { padding: 1rem; }
    .recipe-img { height: 250px; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.print-header { display: none; }