/* ==========================================================================
   Malacara Esquí — Home 2026/27 (templates/core/home_redesign.html)
   Colores y tipografía de la marca: azul noche, burdeos y naranja; Barlow Condensed
   para títulos y DM Sans para el texto (site-fonts.css, DESIGN.md).
   Móvil primero. Sin animaciones de entrada ni vídeo.
   ========================================================================== */

:root {
    --home-noche: var(--brand-dark, #002340);
    --home-burdeos: var(--brand-primary, #870023);
    --home-burdeos-hover: #a3002b;
    /* Naranja de marca oscurecido para que el texto blanco pase AA (≥4,5:1). */
    --home-naranja: var(--action, #c44a1a);
    --home-naranja-hover: var(--action-hover, #a93e15);
    --home-whatsapp: #0f7f39;
    --home-whatsapp-hover: #0c6b30;
    --home-tinta: var(--brand-ink, #1e293b);
    --home-gris: var(--brand-muted, #5c6570);
    --home-suave: #f4f6f9;
    --home-borde: rgba(0, 35, 64, 0.12);
    --home-radio: 14px;
    --home-hueco: clamp(3rem, 7vw, 5rem);
}

.home-pagina {
    font-family: 'DM Sans', 'DM Sans Fallback', 'Segoe UI', system-ui, sans-serif;
    color: var(--home-tinta);
    overflow-x: clip;
}

.home-pagina h2,
.home-pagina h3 {
    font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif;
    text-wrap: balance;
}

/* Anclas #servicios y #tipos-clase: el título queda bajo el menú fijo.
   --navbar-h lo fija base.html con la altura real del menú (ResizeObserver). */
.home-ancla {
    scroll-margin-top: calc(var(--navbar-h, 102px) + 1rem);
}

/* --------------------------------------------------------------------------
   Botones y enlaces
   -------------------------------------------------------------------------- */

.home-botones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .home-botones {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.home-botones--centro {
    justify-content: center;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.7rem 1.25rem;
    border: 2px solid transparent;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.home-btn--reservar {
    background: var(--home-naranja);
    color: #fff;
}

.home-btn--reservar:hover {
    background: var(--home-naranja-hover);
    color: #fff;
}

.home-btn--whatsapp {
    background: var(--home-whatsapp);
    color: #fff;
}

.home-btn--whatsapp:hover {
    background: var(--home-whatsapp-hover);
    color: #fff;
}

.home-btn--linea {
    background: #fff;
    color: var(--action-hover, #a93e15);
    border-color: var(--home-naranja);
}

.home-btn--linea:hover {
    background: var(--home-naranja);
    color: #fff;
}

.home-enlace {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    color: var(--home-burdeos);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.home-enlace:hover {
    color: var(--home-burdeos-hover);
}

/* Anillo de foco con ≥3:1 contra lo que tiene al lado: burdeos en las secciones claras
   (~10:1 sobre blanco; el naranja de marca da 2,8:1) y naranja sobre el azul noche (~6:1). */
.home-pagina a:focus-visible,
.home-pagina summary:focus-visible {
    outline: 3px solid var(--home-burdeos);
    outline-offset: 3px;
    box-shadow: none;
    border-radius: 6px;
}

.home-portada a:focus-visible,
.home-club__caja a:focus-visible,
.home-cierre a:focus-visible {
    outline-color: var(--brand-secondary, #ff6b35);
}

/* --------------------------------------------------------------------------
   Portada: en móvil, texto y botones antes de la foto (4:5); desde 768 px, 16:9;
   desde 992 px el texto a la izquierda sobre la foto, con el profesor a la derecha.
   -------------------------------------------------------------------------- */

.home-portada {
    margin-top: var(--navbar-h, 76px);
    background: var(--home-noche);
    color: #fff;
}

.home-portada__texto {
    max-width: 40rem;
    padding: 1.75rem 16px 2rem;
}

.home-portada__titulo {
    margin: 0 0 0.75rem;
    font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif;
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    text-wrap: balance;
    color: #fff;
}

.home-portada__frase {
    margin: 0 0 0.75rem;
    font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif;
    font-size: clamp(1.3rem, 3.5vw, 1.65rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85); /* sin salmón (manual 2027): 11,8:1 sobre el marino de la portada */
}

.home-portada__entradilla {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
}

.home-portada__resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.home-portada__resumen li + li::before {
    content: "·";
    margin-right: 0.6rem;
    opacity: 0.7;
}

.home-portada__enlace {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    margin-top: 0.75rem;
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.home-portada__enlace:hover {
    color: #9dd3e9; /* hielo sobre marino, 9,8:1; sin salmón (manual 2027) */
}

.home-portada__ayuda {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
}

.home-portada__foto {
    display: block;
}

.home-portada__foto img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 50% 50%;
}

@media (min-width: 768px) {
    .home-portada__texto {
        padding: 2.5rem 24px;
    }

    .home-portada__foto img {
        aspect-ratio: 16 / 9;
    }
}

/* Dos columnas desde 1280 px (más estrecho, el texto no cabe en la suya). El texto va sobre el
   fondo liso y la foto llena la suya hasta los bordes del bloque. La caja es más alta que 16:9,
   así que `cover` recorta solo los lados: con la foto centrada, el grupo (del 21 % al 79 % del
   ancho) cabe entero mientras la caja no baje de 1,05:1 (a 1280 px ronda 1,2:1; a 1200 px quedaba al límite). */
@media (min-width: 1280px) {
    .home-portada__inner {
        display: grid;
        /* El texto se alinea con el contenido de la página (1320 px centrados) y la foto llega
           hasta el borde derecho de la pantalla, también en monitores anchos. */
        --home-portada-lado: max(0px, (100vw - 1320px) / 2);
        grid-template-columns: max(41.667%, calc(var(--home-portada-lado) + 550px)) minmax(0, 1fr);
    }

    .home-portada__foto {
        position: relative;
    }

    .home-portada__foto img {
        position: absolute;
        inset: 0;
        height: 100%;
        aspect-ratio: auto;
    }

    /* Funde solo el borde izquierdo con el fondo; estrecho para no tapar a nadie. */
    .home-portada__foto::after {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 5%;
        pointer-events: none;
        background: linear-gradient(90deg, var(--home-noche), rgba(0, 35, 64, 0));
    }

    .home-portada__texto {
        align-self: center;
        max-width: none; /* el ancho lo da la columna; el tope de móvil aquí estrecharía el texto */
        padding: 2.5rem 24px 2.5rem calc(24px + var(--home-portada-lado));
    }

    .home-portada__titulo {
        font-size: clamp(2.2rem, 3.6vw, 3.1rem);
    }
}

/* --------------------------------------------------------------------------
   Secciones
   -------------------------------------------------------------------------- */

.home-seccion {
    padding: var(--home-hueco) 0;
}

.home-seccion--suave {
    background: var(--home-suave);
}

.home-cabecera {
    max-width: 46rem;
    margin: 0 auto 2rem;
    text-align: center;
}

.home-cabecera h2 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--home-burdeos);
}

.home-cabecera p {
    margin: 0;
    font-size: 1.05rem;
    color: var(--home-gris);
}

.home-centrado {
    margin: 1.5rem 0 0;
    text-align: center;
}

.home-etiqueta {
    margin: 0 0 0.35rem;
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--home-burdeos);
}

.home-precio {
    margin: 0;
    font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--home-noche);
}

.home-lista {
    margin: 0 0 1.5rem;
    padding-left: 1.2rem;
}

.home-lista li {
    margin-bottom: 0.35rem;
}

.home-enlaces {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Rejillas y tarjetas */
.home-rejilla {
    display: grid;
    gap: 1rem;
}

@media (min-width: 576px) {
    .home-rejilla--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .home-rejilla--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .home-rejilla--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Clases (#servicios): 2 por fila desde 576 px, las 4 en una fila desde 1200 px. */
@media (min-width: 576px) {
    .home-rejilla--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .home-rejilla--4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Desplegables bajo las tarjetas (más específico que el margen de .home-faq). */
.home-servicios .home-servicios__mas {
    margin-top: 2rem;
}

.home-tarjeta {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--home-borde);
    border-radius: var(--home-radio);
}

.home-tarjeta h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--home-noche);
}

.home-tarjeta p {
    margin: 0;
}

.home-tarjeta__icono {
    font-size: 1.5rem;
    color: var(--home-burdeos);
}

.home-tarjeta__acciones {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Confianza: 2 por fila en móvil, una fila de 4 en ordenador
   -------------------------------------------------------------------------- */

.home-confianza__lista {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 992px) {
    .home-confianza__lista {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
}

.home-confianza__item {
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--home-borde);
    border-radius: var(--home-radio);
}

.home-confianza__item i {
    font-size: 1.25rem;
    color: var(--home-burdeos);
}

.home-confianza__item h3 {
    margin: 0.5rem 0 0.25rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--home-noche);
}

.home-confianza__item p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--home-gris);
}

/* --------------------------------------------------------------------------
   Club: franja compacta; en móvil texto y botón antes de la foto (4:5)
   -------------------------------------------------------------------------- */

.home-club {
    padding-top: 0;
}

.home-club__caja {
    display: grid;
    overflow: hidden;
    background: var(--home-noche);
    color: #fff;
    border-radius: var(--home-radio);
}

@media (min-width: 768px) {
    .home-club__caja {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
    }
}

.home-club__texto {
    padding: 1.75rem 1.25rem;
}

@media (min-width: 992px) {
    .home-club__texto {
        padding: 2.5rem;
    }
}

.home-club__texto .home-etiqueta {
    color: rgba(255, 255, 255, 0.85);
}

.home-club__texto h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.home-club__texto p {
    color: rgba(255, 255, 255, 0.92);
}

.home-club__precio {
    font-family: 'Barlow Condensed', 'Barlow Condensed Fallback', 'DM Sans', 'DM Sans Fallback', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
}

.home-club__foto {
    display: block;
}

.home-club__foto img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 50%;
}

@media (min-width: 768px) {
    .home-club__foto img {
        aspect-ratio: 16 / 9;
    }
}

/* --------------------------------------------------------------------------
   Clases: tabla de particulares (desplegable de #servicios)
   -------------------------------------------------------------------------- */

.home-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.home-tabla caption {
    caption-side: top;
    padding: 0 0 0.4rem;
    font-weight: 700;
    color: var(--home-tinta);
    text-align: left;
}

.home-tabla th,
.home-tabla td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--home-borde);
    text-align: left;
}

.home-tabla thead th {
    font-size: 0.85rem;
    color: var(--home-gris);
}

.home-tabla__nota {
    font-size: 0.92rem;
    color: var(--home-gris);
}

/* --------------------------------------------------------------------------
   Fotos de esquí y snowboard: 1:1, dos columnas iguales; en móvil una tras otra
   -------------------------------------------------------------------------- */

.home-disciplinas {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .home-disciplinas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.home-disciplina {
    margin: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--home-borde);
    border-radius: var(--home-radio);
}

.home-disciplina img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: 50% 50%;
}

.home-disciplina figcaption {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.home-disciplina h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--home-noche);
}

/* --------------------------------------------------------------------------
   Equipo: dos columnas; foto 4:3
   -------------------------------------------------------------------------- */

.home-equipo {
    display: grid;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 992px) {
    .home-equipo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3rem;
    }
}

.home-equipo__texto h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--home-burdeos);
}

.home-equipo__texto p {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.home-equipo__empleo {
    margin: 1rem 0 0;
    font-size: 0.95rem;
}

.home-equipo__foto {
    margin: 0;
}

.home-equipo__foto img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: 50% 50%;
    border-radius: var(--home-radio);
}

/* Plano comprobado del punto de encuentro de Astún */
.home-plano {
    display: block;
    width: 100%;
    max-width: 592px;
    height: auto;
    aspect-ratio: 592 / 427;
    object-fit: contain;
    border-radius: 10px;
    background: var(--home-suave);
}

/* Mapa incrustado del punto de encuentro de Candanchú: mismo marco que el plano de Astún */
.home-mapa {
    display: block;
    width: 100%;
    max-width: 592px;
    aspect-ratio: 592 / 427;
    border: 0;
    border-radius: 10px;
    background: var(--home-suave);
}

/* Mapa de Google al pulsar (static/js/mapa-al-pulsar.js): aviso y botón hasta que el visitante lo abre */
.mapa-al-pulsar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    text-align: center;
    background: var(--home-suave);
}

.mapa-al-pulsar__aviso {
    max-width: 36ch;
    margin: 0;
}

.mapa-al-pulsar.is-cargado {
    padding: 0;
}

.mapa-al-pulsar iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: inherit;
}

/* --------------------------------------------------------------------------
   Preguntas frecuentes (details/summary: teclado y lector de pantalla sin JS)
   -------------------------------------------------------------------------- */

.home-faq {
    max-width: 52rem;
    margin: 0 auto;
    border-top: 1px solid var(--home-borde);
}

.home-faq__item {
    border-bottom: 1px solid var(--home-borde);
}

.home-faq__item summary {
    position: relative;
    min-height: 44px;
    padding: 1rem 2.5rem 1rem 0;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--home-noche);
}

.home-faq__item summary::-webkit-details-marker {
    display: none;
}

.home-faq__item summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--home-burdeos);
}

.home-faq__item[open] summary::after {
    content: "−";
}

.home-faq__respuesta p {
    margin: 0 0 1rem;
    line-height: 1.6;
    color: var(--home-tinta);
}

/* --------------------------------------------------------------------------
   Reserva final
   -------------------------------------------------------------------------- */

.home-cierre {
    padding: var(--home-hueco) 0;
    background: var(--home-noche);
    color: #fff;
    text-align: center;
}

.home-cierre h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.9rem, 4.5vw, 2.75rem);
    font-weight: 800;
    color: #fff;
}

.home-cierre p {
    max-width: 40rem;
    margin: 0 auto 1.5rem;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.9);
}

.home-cierre__llamar {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    margin-top: 1rem;
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.home-cierre__llamar:hover {
    color: #9dd3e9; /* hielo sobre marino, 9,8:1 */
}

@media (prefers-reduced-motion: reduce) {
    .home-btn {
        transition: none;
    }
}
