/* Variables de color y estética general */
:root {
    --color-primario: #5b7c70;
    --color-secundario: #f9f9f9;
    --color-texto: #555555;
    --color-titulos: #333333;
    --color-suave: #6b6b6b; /* gris con contraste AA sobre blanco (antes #888) */
    --fuente-principal: 'Helvetica Neue', Arial, sans-serif;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: var(--fuente-principal);
    color: var(--color-texto);
    background-color: #ffffff;
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

/* Margen para que el scroll a anclas no quede pegado a la cabecera */
:target { scroll-margin-top: 1rem; }

img { max-width: 100%; }

.icono {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
}

.icono-linea {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.visualmente-oculto {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- Cabecera Transparente --- */
header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    padding: 1.5rem 0;
    box-sizing: border-box;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 45px;
    width: auto;
    filter: brightness(0) invert(1);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: #ffffff;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    transition: color 0.3s;
    white-space: nowrap;
}

nav a:hover, nav a.active {
    color: #a3b899;
}

/* Cabecera blanca de las páginas internas (antes con !important en cada HTML,
   lo que anulaba el efecto hover del menú) */
header.header-solida {
    position: relative;
    background-color: #ffffff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.header-solida nav a { color: var(--color-texto); text-shadow: none; }
.header-solida nav a:hover,
.header-solida nav a.active { color: var(--color-primario); }
.header-solida .logo img { filter: none; }

/* --- Sección Hero (Vídeo Background) --- */
.hero-video-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh; /* evita el salto por la barra del navegador en móvil */
    min-height: 480px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #5b7c70; /* color de respaldo mientras carga el vídeo */
}

.hero-video-container video {
    will-change: auto;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-content-exacto {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    padding: 0 1rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    line-height: 0.9;
}

.logo-malbo {
    font-size: clamp(3.6rem, 24vw, 6.5rem);
    font-weight: 300;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.logo-atencion {
    font-size: clamp(2.9rem, 19vw, 5.2rem);
    font-weight: 300;
    color: #ffffff;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero-subcategories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 3rem;
    margin: 0;
    color: #ffffff;
    font-size: 1.1rem;
    letter-spacing: 2px;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.hero-footer-left {
    position: absolute;
    bottom: 2.5rem;
    left: 3rem;
    z-index: 2;
    text-align: left;
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.hero-footer-left p { margin: 0; }

.hero-footer-left a {
    color: inherit;
    text-decoration: none;
}
.hero-footer-left a:hover { text-decoration: underline; }

.hero-footer-right {
    position: absolute;
    bottom: 2.5rem;
    right: 3rem;
    z-index: 2;
    display: flex;
    gap: 1.2rem;
}

.hero-footer-right a {
    color: #ffffff;
    font-size: 1.2rem;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
    transition: opacity 0.3s;
    line-height: 1;
}

.hero-footer-right a:hover { opacity: 0.8; }

/* --- Sección Talleres --- */
.seccion-talleres {
    scroll-margin-top: 0;
    max-width: 1400px;
    margin: 5rem auto;
    padding: 0 3rem;
}

.talleres-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3.5rem;
    align-items: start;
}

.talleres-texto-lateral {
    grid-row: span 2;
    background-color: #f8f8f8;
    padding: 3.5rem 2.5rem;
    color: #555555;
    font-size: 0.95rem;
    line-height: 1.7;
}

.talleres-texto-lateral h2 {
    font-size: 1.8rem;
    color: #333333;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.talleres-texto-lateral h3 {
    font-size: 1.3rem;
    color: #333333;
    font-weight: 400;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.tarjeta-taller-nueva {
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tarjeta-taller-nueva img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    margin-bottom: 1rem;
    background-color: #e8ecea; /* tono suave mientras carga, en vez de blanco */
}

.foto-ancha, .content-row img, .foto-perfil { background-color: #e8ecea; }

.tarjeta-taller-nueva h3 {
    font-size: 1.25rem;
    color: #333333;
    font-weight: 400;
    margin: 0.5rem 0;
}

.datos-taller-nueva {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    color: var(--color-suave);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.tarjeta-taller-nueva p {
    font-size: 0.95rem;
    color: #555555;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Pie de cada tarjeta (antes estilos en línea repetidos) */
.tarjeta-horario {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #eaeaea;
    font-size: 0.95rem;
    color: var(--color-primario);
}
.tarjeta-taller-nueva .tarjeta-horario p { margin: 0; flex-grow: 0; color: inherit; }
.tarjeta-horario a { color: inherit; }

/* --- Layout Página "Sobre mí" --- */
.contenedor-sobre-mi {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 3rem;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 4rem;
    align-items: start;
}

.sidebar-cv {
    background-color: #f7f7f7;
    padding: 2.5rem;
    height: fit-content;
}

.sidebar-cv img.foto-perfil {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.sidebar-cv h1 {
    font-size: 1.8rem;
    color: var(--color-titulos);
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.sidebar-cv ul {
    list-style: none;
    padding-left: 0;
    color: var(--color-texto);
    font-size: 0.9rem;
    line-height: 1.6;
}

.sidebar-cv ul li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.2rem;
}

.sidebar-cv ul li::before {
    content: "•";
    color: var(--color-primario);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

.sidebar-cv img.logo-inferior {
    width: 100%;
    height: auto;
    margin-top: 2rem;
}

.contenido-principal-sobre-mi { padding-top: 1rem; }

.contenido-principal-sobre-mi p {
    color: var(--color-texto);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.contenido-principal-sobre-mi h2 {
    font-size: 2rem;
    color: var(--color-titulos);
    font-weight: 300;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.contenido-principal-sobre-mi img.foto-ancha {
    width: 100%;
    height: 350px;
    object-fit: cover;
    margin: 2.5rem 0;
    border-radius: 4px;
    display: block;
}

.contenido-principal-sobre-mi ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.contenido-principal-sobre-mi ul li {
    color: var(--color-texto);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    position: relative;
    padding-left: 1.2rem;
}

.contenido-principal-sobre-mi ul li::before {
    content: "•";
    color: var(--color-primario);
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

/* --- Overlay Protección por Contraseña (área de alumnos) --- */
.password-overlay {
    position: fixed;
    inset: 0;
    background-color: #f4f6f5;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1rem;
}

.password-box {
    background-color: white;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
}

.password-box .password-logo {
    height: 50px;
    margin-bottom: 1rem;
    filter: invert(40%) sepia(10%) saturate(1000%) hue-rotate(100deg);
}

.password-box h1 {
    color: var(--color-primario);
    font-weight: 400;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.password-box p {
    color: #555;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.password-box input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem; /* 16px: evita el zoom automático en iPhone */
}

.password-box button {
    width: 100%;
    background-color: var(--color-primario);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.password-box button:hover { background-color: #4a665b; }

.password-box .error-msg {
    color: #c9302c;
    font-size: 0.85rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.oculto { display: none !important; }

@media (max-width: 480px) {
    .password-box { padding: 2rem 1.5rem; }
}

/* --- Layout Sección Alumnos (Banners Acordeón) --- */
.contenedor-acordeon {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.intro-alumnos {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.intro-alumnos h1 {
    color: var(--color-primario);
    font-size: 2rem;
    font-weight: 400;
}

.acordeon-banner {
    background-color: var(--color-secundario);
    color: var(--color-primario);
    cursor: pointer;
    padding: 1.5rem 2rem;
    width: 100%;
    border: none;
    text-align: left;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 500;
    letter-spacing: 1px;
    transition: background-color 0.4s;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.acordeon-banner:hover, .banner-activo {
    background-color: #e8ecea;
}

.acordeon-banner:focus-visible {
    outline: 2px solid var(--color-primario);
    outline-offset: 2px;
}

.acordeon-banner::after {
    content: '\002B';
    font-size: 1.5rem;
    color: var(--color-primario);
    font-weight: bold;
    margin-left: 1rem;
}

.banner-activo::after { content: "\2212"; }

.acordeon-panel {
    padding: 0 1rem;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    visibility: hidden; /* el contenido cerrado no se lee ni se tabula */
    transition: max-height 0.6s ease-out, visibility 0s linear 0.6s;
    margin-bottom: 1rem;
}

.acordeon-panel.abierto {
    visibility: visible;
    transition: max-height 0.6s ease-out, visibility 0s;
}

.titulo-modulo {
    color: var(--color-primario);
    font-size: 2rem;
    font-weight: 300;
}

.text-block h3 { font-weight: 400; font-size: 1.5rem; color: var(--color-titulos); }
.text-block h3.h3-pequeno { font-size: 1.2rem; }
.text-block ul { padding-left: 1rem; color: var(--color-texto); }
.content-full h3 { font-weight: 400; font-size: 1.5rem; color: var(--color-titulos); }

.content-row {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin: 4rem 0;
}

.content-row.reverse { flex-direction: row-reverse; }

.content-row > img,
.content-row > .grupo-imagenes {
    width: 45%;
    flex-shrink: 0;
}

.content-row img {
    max-height: 500px;
    object-fit: cover;
    border-radius: 4px;
}

.grupo-imagenes img {
    display: block;
    width: 100%;
    height: 240px;
    max-height: none;
}
.grupo-imagenes img + img { margin-top: 1rem; }

.text-block {
    width: 55%;
    color: #555;
    line-height: 1.8;
}

.text-block p { margin-bottom: 1.2rem; }

.content-full {
    margin: 3rem 0;
    color: #555;
    line-height: 1.8;
}

.bibliografia {
    font-size: 0.85rem;
    color: var(--color-suave);
    margin-top: 3rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

/* --- Página 404 --- */
.pagina-404 {
    max-width: 700px;
    margin: 6rem auto;
    padding: 0 2rem;
    text-align: center;
}
.pagina-404 h1 { color: var(--color-primario); font-weight: 300; font-size: 2.2rem; }
.pagina-404 a { color: var(--color-primario); }

/* --- Footer y Scroll Flecha Minimalista --- */
.footer-simple {
    background-color: #ffffff;
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.95rem;
    color: var(--color-suave);
    border-top: 1px solid #f0f0f0;
    margin-top: 3rem;
}

.scroll-top-container { margin-bottom: 1.5rem; }

.scroll-top-btn {
    display: inline-block;
    color: #8a8a8a;
    font-size: 1.5rem;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.scroll-top-btn:hover {
    color: var(--color-primario);
    transform: translateY(-5px);
}

/* --- Responsive --- */
@media (max-width: 1150px) {
    .talleres-layout {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    .talleres-texto-lateral {
        grid-row: auto;
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .content-row, .content-row.reverse {
        flex-direction: column;
        gap: 2rem;
        margin: 2rem 0;
    }
    .content-row > img, .content-row > .grupo-imagenes, .text-block {
        width: 100%;
    }
    .contenedor-sobre-mi {
        grid-template-columns: 1fr;
    }
    .contenido-principal-sobre-mi img.foto-ancha { height: 240px; }
}

@media (max-width: 700px) {
    .talleres-layout { grid-template-columns: 1fr; }
    .talleres-texto-lateral { padding: 2.5rem 1.5rem; }
    .seccion-talleres, .contenedor-sobre-mi { padding: 0 1.25rem; }
    .contenedor-acordeon { padding: 0 1rem; }
    .acordeon-banner { padding: 1.2rem 1.25rem; font-size: 1.05rem; }
    .acordeon-panel { padding: 0; }

    .nav-container { padding: 0 1.25rem; }
    nav ul { gap: 1.25rem; }
    nav a { font-size: 0.9rem; }
    .logo img { height: 38px; }

    .hero-content-exacto { gap: 1.75rem; }
    .hero-subcategories { font-size: 0.85rem; gap: 0.5rem 1.4rem; letter-spacing: 1.5px; }
    .hero-footer-left { left: 1.25rem; bottom: 1.5rem; font-size: 0.85rem; }
    .hero-footer-right { right: 1.25rem; bottom: 1.5rem; }
}

@media (max-width: 360px) {
    nav ul { gap: 0.9rem; }
    nav a { font-size: 0.85rem; letter-spacing: 0; }
    .logo img { height: 32px; }
}

/* Móvil en horizontal / pantallas bajas: evita que el contacto pise el título */
@media (max-height: 520px) and (orientation: landscape) {
    .hero-video-container { min-height: 340px; }
    .hero-content-exacto { gap: 1rem; margin-bottom: 2.5rem; }
    .logo-malbo { font-size: clamp(2.6rem, 15vh, 4.2rem); }
    .logo-atencion { font-size: clamp(2.1rem, 12vh, 3.4rem); }
    .hero-subcategories { font-size: 0.85rem; }
    .hero-footer-left { bottom: 0.9rem; font-size: 0.8rem; line-height: 1.35; }
    .hero-footer-right { bottom: 0.9rem; }
}
