/* =========================================
   ESTILOS GENERALES
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* el mismo celeste que usa el sitio en modo oscuro (--blue en ingles/shared-topic.css) */
    --sky: #8fa9f0;
    --sky-rgb: 143, 169, 240;
}

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
    /* el texto no se puede seleccionar (script.js), así que tampoco se muestra el cursor de texto */
    cursor: default;
}

/* =========================================
   HEADER Y CARRUSEL
========================================= */
.header {
    position: relative;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1446776877081-d282a0f896e2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.carousel-caption {
    position: absolute;
    top: 35%;
    /* Subido 30% (estaba en 50%) */
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
    width: 100%;
    padding: 0 20px;
}

/* ===== TÍTULO ===== */
.carousel-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.22em;
    font-size: 5.4rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--sky);
    text-shadow:
        0 0 22px rgba(var(--sky-rgb), 0.45),
        0 2px 12px rgba(0, 0, 0, 0.65);
}

/* ∴ antes del nombre */
.brand-mark {
    width: 0.5em;
    height: 0.5em;
    fill: currentColor;
    filter: drop-shadow(0 0 8px rgba(var(--sky-rgb), 0.6));
}

.carousel-title small {
    margin-top: 1.1rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 1.05rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

/* botón de tema claro / oscuro (lo agrega ingles/tema.js) */
.index-actions {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* contador de visitas (initVisitCounter en script.js) */
.index-actions .visit-count {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border-radius: 19px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: white;
    font-family: 'IBM Plex Sans', system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.index-actions .visit-count svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.index-actions .theme-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: white;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s ease;
}

.index-actions .theme-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.index-actions .theme-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* en claro, la foto se oscurece menos */
:root[data-theme='light'] .header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.35)),
        url('https://images.unsplash.com/photo-1446776877081-d282a0f896e2?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80');
}

:root[data-theme='light'] .overlay {
    background: rgba(0, 0, 0, 0.05);
}

/* =========================================
   SELECTOR DE IDIOMAS
========================================= */
.language-switch {
    position: absolute;
    bottom: 70px;
    /* Elevado de 40px a 70px para evitar superposición */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.2rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    padding: 14px 22px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.lang-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
    padding: 8px 10px;
    border-radius: 16px;
}

.lang-item:hover {
    transform: translateY(-4px);
}

.lang-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-bottom: 6px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.lang-text {
    font-size: 0.8rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===== INGLÉS (DISPONIBLE): GRANDE Y CON UN BORDE DE LUZ QUE GIRA ===== */
@property --orbit {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

.lang-item.featured {
    padding: 14px 24px 12px;
    border-radius: 20px;
    background: rgba(8, 14, 32, 0.6);
    box-shadow: 0 0 26px rgba(var(--sky-rgb), 0.28);
}

.lang-item.featured::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--orbit),
            rgba(var(--sky-rgb), 0.15) 0deg,
            var(--sky) 50deg,
            #ffffff 80deg,
            #b48cff 110deg,
            rgba(var(--sky-rgb), 0.15) 170deg,
            rgba(var(--sky-rgb), 0.15) 360deg);
    /* solo se ve el anillo: el centro se recorta con la máscara */
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: orbit 4s linear infinite;
    pointer-events: none;
}

@keyframes orbit {
    to {
        --orbit: 360deg;
    }
}

.lang-item.featured:hover {
    background: rgba(18, 28, 60, 0.7);
    box-shadow: 0 0 34px rgba(var(--sky-rgb), 0.45);
}

.lang-item.featured .lang-icon {
    width: 68px;
    height: 68px;
    box-shadow: 0 0 18px rgba(var(--sky-rgb), 0.55);
}

.lang-item.featured .lang-text {
    font-size: 1rem;
}

.lang-cta {
    margin-top: 7px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--sky);
    color: #0d1430;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
    .lang-item.featured::before {
        animation: none;
    }
}

/* ===== IDIOMAS EN PREPARACIÓN: MÁS CHICOS, EN GRIS ===== */
.lang-item.locked {
    cursor: not-allowed;
}

.lang-item.locked:hover {
    transform: none;
}

.lang-item.locked .lang-icon {
    width: 40px;
    height: 40px;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.45);
    filter: grayscale(1) brightness(0.85);
    opacity: 0.8;
}

.lang-item.locked:hover .lang-icon {
    filter: grayscale(0.4);
}

.lang-item.locked .lang-text {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.75);
}

.development-message {
    margin-top: 2px;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.55);
    transition: color 0.2s ease;
}

/* Al hacer clic en un idioma en preparación: sacudida y el aviso se resalta */
.lang-item.locked.denied {
    animation: lockedShake 0.4s ease;
}

.lang-item.locked.denied .development-message {
    color: var(--sky);
}

@keyframes lockedShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Carrusel de idiomas (lo arma script.js). En pantallas grandes se ven todas las banderas en fila:
   la estructura del carrusel no altera la fila y las flechas y los puntos se ocultan. */
.ls-row,
.ls-view {
    display: contents;
}

.ls-arrow,
.ls-dots {
    display: none;
}

@keyframes lsFromRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: none; }
}

@keyframes lsFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: none; }
}

/* En el celular no entran todas: se ve un idioma por vez */
@media (max-width: 576px) {
    .ls-row {
        display: flex;
    }

    .ls-view {
        display: flex;
    }

    .ls-arrow {
        display: block;
    }

    .ls-dots {
        display: flex;
    }

    .language-switch.is-carousel {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 14px 18px 12px;
        border-radius: 28px;
    }

    .ls-row {
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .ls-view {
        width: 150px;
        display: flex;
        justify-content: center;
        touch-action: pan-y; /* el deslizamiento horizontal lo maneja el carrusel */
        user-select: none;
    }

    .is-carousel .lang-item {
        display: none;
        padding: 8px 14px 10px;
    }

    .is-carousel .lang-item.active {
        display: flex;
    }

    .is-carousel .lang-item:hover {
        transform: none;
    }

    .is-carousel .lang-icon {
        width: 64px;
        height: 64px;
        -webkit-user-drag: none;
    }

    /* con un solo idioma a la vista, su nombre se ve siempre */
    .is-carousel .lang-text {
        position: static;
        opacity: 1;
        margin-top: 2px;
    }

    .is-carousel .development-message {
        margin-top: 6px;
        font-size: 0.68rem;
    }

    .is-carousel .lang-item.locked .lang-icon {
        width: 56px;
        height: 56px;
    }

    .is-carousel .lang-item.featured {
        padding: 12px 20px 10px;
    }

    .is-carousel .lang-item.from-right {
        animation: lsFromRight 0.25s ease;
    }

    .is-carousel .lang-item.from-left {
        animation: lsFromLeft 0.25s ease;
    }

    /* la sacudida de «en desarrollo» tiene prioridad sobre la animación de entrada */
    .is-carousel .lang-item.locked.denied {
        animation: lockedShake 0.4s ease;
    }

    .ls-arrow {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.35);
        background: rgba(255, 255, 255, 0.12);
        color: white;
        font-size: 1.5rem;
        line-height: 1;
        padding-bottom: 3px;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .ls-arrow:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .ls-dots {
        display: flex;
        gap: 8px;
    }

    .ls-dot {
        width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 50%;
        border: none;
        background: rgba(255, 255, 255, 0.35);
        cursor: pointer;
    }

    .ls-dot.active {
        background: white;
    }
}

/* =========================================
   APP PARA ANDROID
========================================= */
.app-promo {
    position: absolute;
    top: 50%;
    right: 28px;
    transform: translateY(-50%);
    z-index: 15;
}

.app-promo-card {
    position: relative;
    width: 240px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px 20px 16px;
    border-radius: 20px;
    background: rgba(8, 14, 32, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 26px rgba(var(--sky-rgb), 0.22);
    color: white;
}

/* el mismo borde de luz que la bandera de inglés (.lang-item.featured::before) */
.app-promo-card::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: conic-gradient(from var(--orbit),
            rgba(var(--sky-rgb), 0.15) 0deg,
            var(--sky) 50deg,
            #ffffff 80deg,
            #b48cff 110deg,
            rgba(var(--sky-rgb), 0.15) 170deg,
            rgba(var(--sky-rgb), 0.15) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: orbit 4s linear infinite;
    animation-delay: -2s;
    pointer-events: none;
}

.app-promo-badge {
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgba(var(--sky-rgb), 0.5);
    color: var(--sky);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-promo-title {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--sky);
    text-shadow: 0 0 14px rgba(var(--sky-rgb), 0.4);
}

.app-promo-text {
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.85);
}

.app-promo-btn {
    align-self: stretch;
    margin-top: 4px;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--sky);
    color: #0d1430;
    text-align: center;
    text-decoration: none;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 0 16px rgba(var(--sky-rgb), 0.45);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.app-promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 24px rgba(var(--sky-rgb), 0.7);
}

.app-promo-meta {
    align-self: center;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.app-promo-help {
    align-self: stretch;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 8px;
    font-size: 0.8rem;
}

.app-promo-help summary {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
}

.app-promo-help summary:hover {
    color: var(--sky);
}

.app-promo-help ol {
    margin: 6px 0 0 18px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.8);
}

.app-promo-help li + li {
    margin-top: 3px;
}

.app-promo-tab {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .app-promo-card::before {
        animation: none;
    }
}

/* por debajo de este ancho la tarjeta pisa el título y las banderas */
@media (max-width: 1180px) {
    .app-promo {
        right: 0;
    }

    .app-promo-tab {
        display: block;
        padding: 10px 8px 10px 10px;
        border: 1px solid rgba(var(--sky-rgb), 0.5);
        border-right: none;
        border-radius: 14px 0 0 14px;
        background: rgba(8, 14, 32, 0.7);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        color: var(--sky);
        font-family: 'IBM Plex Mono', ui-monospace, monospace;
        font-size: 0.72rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        cursor: pointer;
        box-shadow: 0 0 16px rgba(var(--sky-rgb), 0.3);
    }

    .app-promo-card {
        position: absolute;
        top: 50%;
        right: 12px;
        width: min(260px, calc(100vw - 32px));
        transform: translateY(-50%);
        /* abierta queda encima del título: con el vidrio de escritorio se leían los dos textos mezclados */
        background: rgba(8, 14, 32, 0.94);
        display: none;
    }

    .app-promo.open .app-promo-card {
        display: flex;
    }

    .app-promo.open .app-promo-tab {
        visibility: hidden;
    }
}

/* =========================================
   SECCIÓN DE CONTACTO
========================================= */
.infos {
    position: absolute;
    bottom: 15px;
    /* Bajado de 30px a 15px */
    right: 15px;
    /* Reducido el margen derecho */
    z-index: 10;
    transform: scale(0.85);
    /* Reducido el tamaño al 85% */
}

.socials-fixed {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    padding: 15px;
    /* Reducido de 20px a 15px */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 0.9rem;
    /* Reducido de 1rem a 0.9rem */
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
    /* Reducido de 15px a 10px */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Reducido de 12px a 8px */
}

.link {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 6px 10px;
    /* Reducido de 8px 12px a 6px 10px */
    border-radius: 8px;
}

.link:hover {
    color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
}

.contact-mail {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    justify-content: center;
}

.contact-icon {
    font-size: 1.2rem;
    /* Reducido de 1.4rem a 1.2rem */
}

/* =========================================
   PIE DE PÁGINA CON DERECHOS DE AUTOR
========================================= */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 0.8rem;
    z-index: 1000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.footer p {
    margin: 2px 0;
}

.footer a,
.footer-link {
    color: #4CAF50;
    text-decoration: none;
    margin: 0 5px;
    cursor: pointer;
    display: inline-block;
}

.footer a:hover,
.footer-link:hover {
    text-decoration: underline;
}

/* =========================================
   ATRIBUCIÓN DE ICONOS
========================================= */
.attribution {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px 8px;
    border-radius: 5px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.attribution a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: bold;
}

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

/* =========================================
   UTILIDADES
========================================= */
.mb-4 {
    margin-bottom: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.pr-1 {
    padding-right: 0.25rem;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.font-weight-normal {
    font-weight: normal;
}

.d-flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

/* =========================================
   PÁGINAS DE IDIOMA: HUB DE SECCIONES
   (html_add/<idioma>.html)
========================================= */
.lang-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #050914 0%, #0a1330 100%);
    color: #fff;
    padding-bottom: 60px;
}

.lang-page-header {
    padding: 40px 20px 20px;
    text-align: center;
}

.lang-page-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color 0.2s ease;
}

.lang-page-back:hover {
    color: #ffffff;
}

.lang-page-title {
    font-size: 2.4rem;
    font-weight: bold;
    background: linear-gradient(90deg, #001a4d, #0039A6, #0052cc, #0039A6, #001a4d);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientMove 8s ease infinite;
    display: inline-block;
}

.lang-page-subtitle {
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
    font-size: 1rem;
}

/* Grilla de tarjetas del hub (Lectura, Escucha, Dictados, Gramática, Vocabulario) */
.sections-grid {
    max-width: 1000px;
    margin: 40px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.section-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.section-card:hover {
    transform: translateY(-6px);
    border-color: #0039A6;
    background: rgba(0, 57, 166, 0.15);
}

.section-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.section-card-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 6px;
}

.section-card-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================
   PÁGINAS DE IDIOMA: NAVEGACIÓN ENTRE SECCIONES
   (html_add/<idioma>/*.html)
========================================= */
.section-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #050914 0%, #0a1330 100%);
    color: #fff;
    padding-bottom: 60px;
}

.section-page-header {
    padding: 30px 20px 10px;
    text-align: center;
}

.section-page-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
}

.section-nav {
    max-width: 900px;
    margin: 20px auto 0;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.section-nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.section-nav a:hover {
    color: #fff;
    border-color: #0039A6;
    background: rgba(0, 57, 166, 0.2);
}

.section-nav a.active {
    background: #0039A6;
    border-color: #0039A6;
    color: #fff;
}

/* Tabs de nivel (A1 a C1) dentro de una sección */
.level-tabs {
    max-width: 900px;
    margin: 30px auto 0;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.level-tab-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 18px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.level-tab-btn:hover {
    color: #fff;
    border-color: #0039A6;
}

.level-tab-btn.active {
    background: #0039A6;
    border-color: #0039A6;
    color: #fff;
}

.level-panel {
    max-width: 900px;
    margin: 30px auto 0;
    padding: 0 20px;
    display: none;
}

.level-panel.active {
    display: block;
}

/* Tarjeta "placeholder" para contenido aún no cargado */
.placeholder-card {
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
}

/* Lista simple de ítems dentro de una sección (Escucha, Dictados, Gramática, Vocabulario) */
.content-list {
    max-width: 900px;
    margin: 30px auto 0;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.content-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 18px 20px;
}

.content-item-title {
    font-weight: bold;
    margin-bottom: 10px;
}

.content-item audio {
    width: 100%;
}

@media (max-width: 992px) {
    .brand {
        font-size: 4.4rem;
    }

    .carousel-title small {
        font-size: 0.95rem;
    }

    .language-switch {
        gap: 1rem;
    }

    .lang-icon {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 768px) {
    .brand {
        font-size: 3.6rem;
    }

    .carousel-title small {
        font-size: 0.85rem;
        letter-spacing: 0.26em;
    }

    .language-switch {
        gap: 0.8rem;
        padding: 12px 20px;
        bottom: 60px;
        /* Ajustado para pantallas medianas */
    }

    .lang-icon {
        width: 38px;
        height: 38px;
    }

    .infos {
        bottom: 10px;
        right: 10px;
        transform: scale(0.75);
        padding: 12px;
    }

    .socials-fixed {
        padding: 12px;
    }

    .footer {
        font-size: 0.7rem;
        padding: 6px;
    }

    /* encima del pie de página: a este ancho el texto centrado del pie llega hasta el borde */
    .attribution {
        font-size: 0.6rem;
        padding: 4px 6px;
        bottom: 30px;
    }
}

@media (max-width: 576px) {
    .brand {
        font-size: 3rem;
    }

    .carousel-title small {
        font-size: 0.72rem;
        letter-spacing: 0.2em;
    }

    .header {
        min-height: 500px;
    }

    .language-switch {
        bottom: 50px;
        /* Ajustado para pantallas pequeñas */
        gap: 0.6rem;
        padding: 10px 15px;
    }

    .lang-icon {
        width: 34px;
        height: 34px;
        border-width: 2px;
    }

    /* el nombre del idioma (solo visible al pasar el mouse) no debe ensanchar la fila de banderas:
       sin esto, en un celular la fila se salía de la pantalla por los dos lados */
    .lang-item {
        padding: 6px;
    }

    .lang-text {
        font-size: 0.8rem;
        position: absolute;
        top: 100%;
        white-space: nowrap;
        pointer-events: none;
    }

    /* Contacto arriba a la derecha: abajo ya están las banderas, el pie y la atribución */
    .infos {
        top: 10px;
        bottom: auto;
        right: 10px;
        transform: scale(0.75);
        transform-origin: top right;
    }

    .footer {
        font-size: 0.6rem;
        padding: 4px;
    }

    .attribution {
        font-size: 0.5rem;
        padding: 3px 5px;
    }
}