/* COCINA - CSS COMPLETO Y MEJORADO (versión 3)
   Paleta: Crema (#FAF7F2), Terracota (#B85042) y Verde Oliva (#4A6B53)
   La primera versión está guardada en estilos-original.css
*/

/* Desplazamiento suave al saltar a Saladas / Dulces */
html {
    scroll-behavior: smooth;
}

/* Estilo general de la web */
body {
    background-color: #FAF7F2;
    color: #2E2B28;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

/* Títulos con tipografía serif, más "de recetario" */
h1, h2 {
    font-family: Georgia, 'Times New Roman', serif;
}

/* Título principal */
h1 {
    color: #8C3B2B;
    font-size: 38px;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

/* Todos los enlaces */
a {
    color: #B85042;
    transition: all 0.2s ease;
}

a:hover {
    color: #8C3B2B;
}

/* Cabecera y navegación */
header {
    max-width: 900px;
    margin: 0 auto 24px auto;
    background-color: #F2EAE1;
    background-image: linear-gradient(135deg, #F8F1E9 0%, #F2EAE1 100%);
    padding: 24px 30px;
    border: 1px solid #D5C5B3;
    border-top: 5px solid #B85042;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(46, 43, 40, 0.04);
}

header p {
    margin-top: 0;
    margin-bottom: 18px;
    color: #5C554E;
    font-size: 16px;
    font-style: italic;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

nav a {
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    color: #4A6B53;
    background-color: rgba(74, 107, 83, 0.08);
}

nav a:hover {
    color: #FFFFFF;
    background-color: #4A6B53;
}

nav a:focus {
    outline: 2px solid #4A6B53;
    outline-offset: 2px;
    background-color: #EFF4F0;
}

/* Sección en la que estás (Inicio, Saladas o Dulces) */
nav a[aria-current] {
    color: #FFFFFF;
    background-color: #4A6B53;
}

/* Contenedor principal */
main {
    max-width: 900px;
    margin: 0 auto 30px auto;
}

/* Ruta de navegación: Inicio › Saladas › Receta */
.migas {
    margin: 0 0 12px 4px;
    font-size: 14px;
    color: #5C554E;
}

.migas a {
    font-weight: bold;
    text-decoration: none;
}

.migas a:hover {
    text-decoration: underline;
}

/* Secciones y artículos */
section, article {
    background-color: #FFFFFF;
    border: 1px solid #E3D7C8;
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(46, 43, 40, 0.03);
    scroll-margin-top: 16px;
}

h2 {
    color: #4A6B53;
    font-size: 28px;
    margin-top: 0;
    margin-bottom: 12px;
}

h3 {
    color: #8C3B2B;
    font-size: 20px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #DFC9B4;
    padding-bottom: 6px;
    margin-top: 28px;
    margin-bottom: 16px;
}

/* Subgrupos de ingredientes (base, relleno, cobertura...) */
h4 {
    color: #4A6B53;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    margin-bottom: 8px;
}

/* Receta destacada */
#destacada {
    background-color: #EFF4F0;
    padding: 30px;
    border: 2px solid #4A6B53;
}

#destacada h2 {
    color: #8C3B2B;
}

/* Botones para saltar a Saladas / Dulces */
.atajos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}

.atajos a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border: 2px solid #4A6B53;
    border-radius: 999px;
    background-color: #FFFFFF;
    color: #4A6B53;
    font-weight: bold;
    text-decoration: none;
}

.atajos a:hover {
    background-color: #4A6B53;
    color: #FFFFFF;
}

.atajos span {
    background-color: #B85042;
    color: #FFFFFF;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 12px;
}

/* Rejilla de tarjetas de recetas (portada) */
.rejilla {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.tarjeta {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background-color: #FFFFFF;
    border: 1px solid #E3D7C8;
    border-radius: 10px;
    color: #2E2B28;
    font-weight: normal;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(46, 43, 40, 0.05);
}

.tarjeta:hover {
    color: #2E2B28;
    background-color: #FFFFFF;
    border-color: #B85042;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 43, 40, 0.12);
}

.tarjeta:focus {
    outline: 2px solid #4A6B53;
    outline-offset: 3px;
}

.tarjeta img {
    width: 100%;
    max-width: none;
    height: 160px;
    max-height: none;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: #F2EAE1;
}

.tarjeta-texto {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 4px;
    padding: 14px 16px 16px 16px;
}

.tarjeta-titulo {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 19px;
    font-weight: bold;
    line-height: 1.3;
    color: #8C3B2B;
}

.tarjeta-desc {
    font-size: 14px;
    color: #5C554E;
}

.tarjeta-datos {
    margin-top: auto;
    padding-top: 8px;
    font-size: 13px;
    font-weight: bold;
    color: #4A6B53;
}

/* Imágenes reducidas y centradas */
img {
    display: block;
    width: 100%;
    max-width: 550px;
    max-height: 360px;
    object-fit: cover;
    margin: 20px auto;
    border: 2px solid #D5C5B3;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Ficha rápida de la receta (raciones, tiempos...) */
.ficha {
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ficha li {
    background-color: #F2EAE1;
    border: 1px solid #DFC9B4;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 14px;
    color: #5C554E;
}

.ficha strong {
    color: #8C3B2B;
}

/* Caja de ingredientes */
.ingredientes {
    background-color: #FDF9F3;
    border: 1px solid #DFC9B4;
    border-radius: 8px;
    padding: 16px 32px;
}

.ingredientes li {
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ingredientes li:hover {
    background-color: #F5EBE0;
}

/* Lista de pasos con números en círculo */
.pasos {
    list-style: none;
    counter-reset: paso;
    padding-left: 0;
}

.pasos li {
    counter-increment: paso;
    position: relative;
    padding-left: 48px;
    line-height: 1.75;
    margin-bottom: 16px;
}

.pasos li::before {
    content: counter(paso);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    border-radius: 50%;
    background-color: #B85042;
    color: #FFFFFF;
    font-weight: bold;
    font-size: 15px;
}

.pasos strong {
    color: #8C3B2B;
}

/* Párrafo destacado dentro de artículos */
article p {
    font-weight: bold;
    font-style: italic;
    color: #4A6B53;
    background-color: #F7FAF8;
    padding: 10px 16px;
    border-left: 4px solid #4A6B53;
    border-radius: 4px;
}

/* Pestañas para recetas con variantes (cocas), solo con CSS */
.variantes {
    position: relative;
}

.tab-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.tab {
    display: inline-block;
    padding: 10px 18px;
    margin: 4px 6px 8px 0;
    border: 2px solid #B85042;
    border-radius: 999px;
    color: #B85042;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab:hover {
    background-color: #FDF3EC;
}

.tab-input:checked + .tab {
    background-color: #B85042;
    color: #FFFFFF;
}

.tab-input:focus-visible + .tab {
    outline: 2px solid #4A6B53;
    outline-offset: 2px;
}

.panel {
    display: none;
}

#tab-cabra:checked ~ #panel-cabra,
#tab-atun:checked ~ #panel-atun {
    display: block;
}

/* Caja de consejo al final de la receta */
.consejo {
    margin-top: 28px;
    background-color: #FDF3EC;
    border: 1px dashed #B85042;
    border-radius: 10px;
    padding: 16px 20px;
}

.consejo h3 {
    margin-top: 0;
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 18px;
}

.consejo p {
    margin: 0;
    padding: 0;
    font-weight: normal;
    font-style: normal;
    color: #2E2B28;
    background-color: transparent;
    border-left: none;
}

/* Enlaces dentro de listas */
li a {
    font-weight: bold;
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 6px;
}

li a:hover {
    color: #FFFFFF;
    background-color: #B85042;
}

/* Pie de página */
footer {
    max-width: 900px;
    margin: 0 auto;
    background-color: #F2EAE1;
    color: #5C554E;
    padding: 12px 16px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #D5C5B3;
    border-radius: 10px;
}

footer p {
    margin: 0;
}

/* Móvil: menos márgenes y títulos algo más pequeños */
@media (max-width: 600px) {
    body {
        padding: 12px;
    }

    header {
        padding: 20px;
    }

    section, article {
        padding: 20px;
    }

    #destacada {
        padding: 20px;
    }

    h1 {
        font-size: 30px;
    }

    h2 {
        font-size: 24px;
    }

    .ingredientes {
        padding: 12px 24px;
    }

    .tab {
        display: block;
        text-align: center;
        margin-right: 0;
    }

    .tarjeta img {
        height: 180px;
    }
}

/* Si el usuario pide menos animaciones, se quitan */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }

    .tarjeta:hover {
        transform: none;
    }
}
