/* ============================================================
   BAOBAO.css — Estilos de la aplicación BaoBao 幼儿汉语
   ============================================================ */

* { box-sizing: border-box; }

/* ==========================================
   BASE Y FONDO
========================================== */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: transparent;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: #faf7f0;
    background-image: url('FONDO.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* ==========================================
   HEADER SUPERIOR
========================================== */
#top-header {
    display: flex;
    align-items: center;
    background: #c0392b;
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    gap: 16px;
}

#header-logo-left,
#header-logo-right {
    flex-shrink: 0;
    background: #faf8f8;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    align-self: stretch;
}
#header-logo-left img,
#header-logo-right img {
    height: 90px;
    width: auto;
    display: block;
    border-radius: 6px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
    transition: transform 0.15s;
}
#header-logo-left img:hover,
#header-logo-right img:hover { transform: scale(1.05); }

#header-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

#header-titulo {
    font-size: 16px;
    font-weight: 700;
    color: #f7f4f4;
    letter-spacing: 0.5px;
    line-height: 1.4;
    margin-bottom: 10px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

#header-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
#header-nav a {
    color: rgba(243, 238, 238, 0.85);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 7px 20px;
    border-radius: 20px;
    border: 1px solid rgba(253, 249, 9, 0.986);
    transition: all 0.15s;
    white-space: nowrap;
}
#header-nav a:hover {
    background: rgba(255,255,255,0.2);
    color: #f7f0f0;
    border-color: rgba(255,255,255,0.6);
}
#header-nav a.activo {
    background: #fff;
    color: #c0392b;
    border-color: #fff;
    font-weight: 800;
}

/* --- DROPDOWN --- */
.dropdown {
    position: relative;
}
.dropdown > a {
    cursor: pointer;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1008;
    border: 1px solid rgba(192,57,43,0.4);
    border-radius: 10px;
    min-width: 190px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    overflow: hidden;
    z-index: 300;
}
.dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 23px;
    color: rgba(245, 208, 217, 0.85) !important;
    border: none !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(192,57,43,0.2) !important;
    background: transparent !important;
    text-align: left;
    white-space: nowrap;
}
.dropdown-menu a:last-child {
    border-bottom: none !important;
}
.dropdown-menu a:hover {
    background: rgba(192,57,43,0.25) !important;
    color: #fff !important;
    padding-left: 22px;
}



#header-titulo {
    font-size: 22px;
    font-weight: 700;
    color: #fdf6f6;
    letter-spacing: 0.5px;
    line-height: 1.4;
    margin-bottom: 7px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

#header-nav {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}
#header-nav > a, .dropdown > a {
    color: rgba(253, 247, 247, 0.85);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(248, 244, 7, 0.959);
    transition: all 0.15s;
    white-space: nowrap;
    display: inline-block;
}
#header-nav > a:hover, .dropdown > a:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
}
#header-nav > a.activo {
    background: #fff;
    color: #c0392b;
    border-color: #fff;
    font-weight: 800;
}

/* --- DROPDOWN --- */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-top: 10px; /* puente invisible entre botón y menú */
    z-index: 600;
    pointer-events: auto;
}
.dropdown:hover .dropdown-menu {
    display: block;
}
.dropdown-menu-inner {
    background: #1a1008;
    border: 1px solid rgba(192,57,43,0.4);
    border-radius: 10px;
    min-width: 190px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    overflow: hidden;
}
.dropdown-menu a {
    display: block !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    color: rgba(157, 216, 62, 0.85) !important;
    border: none !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(192,57,43,0.2) !important;
    background: transparent !important;
    text-align: left !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}
.dropdown-menu a:last-child {
    border-bottom: none !important;
}
.dropdown-menu a:hover {
    background: rgba(192,57,43,0.35) !important;
    color: #fff !important;
    padding-left: 22px !important;
}

/* ==========================================
   LAYOUT: MENÚ + CONTENIDO
========================================== */
#layout {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
    gap: 32px;
    background: transparent;
}

/* ==========================================
   MENÚ LATERAL
========================================== */
#sidebar {
    width: 340px;
    min-width: 280px;
    max-width: 360px;
    flex-shrink: 0;
    background-color: #1a1008;
    background-image: none;
    min-height: 100vh;
    position: sticky;
    top: 116px;
    height: calc(100vh - 116px);
    overflow-y: auto;
    z-index: 100;
    scrollbar-width: thin;
    scrollbar-color: #c0392b #1a1008;
}

/* Botón hamburguesa móvil — baja para no tapar el header */
#btn-menu { top: 92px; }
#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-track { background: #1a1008; }
#sidebar::-webkit-scrollbar-thumb { background: #c0392b; border-radius: 3px; }

#sidebar-header {
    padding: 20px 16px 14px;
    border-bottom: 1px solid rgba(192,57,43,0.25);
    text-align: center;
}
#sidebar-header .logo-titulo {
    font-size: 20px;
    font-weight: 800;
    color: #ff1d04;
    text-transform: uppercase;
    letter-spacing: 2px;
    line-height: 1.4;
}
#sidebar-header .logo-cn {
    font-size: 28px;
    color: #f5ead0;
    margin-top: 4px;
    font-family: serif;
}
#sidebar-header a {
    display: inline-block;
    margin-top: 10px;
    font-size: 20px;
    color: rgba(247, 28, 4, 0.5);
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
}
#sidebar-header a:hover { color: #c0392b; }

#menu-lecciones {
    list-style: none;
    margin: 0;
    padding: 10px 0 20px;
}
#menu-lecciones li a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: rgba(245,234,208,0.7);
    font-size: 14px;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}
#menu-lecciones li a:hover {
    background: rgba(192,57,43,0.1);
    color: #f5ead0;
    border-left-color: rgba(192,57,43,0.4);
}
#menu-lecciones li a.activa {
    background: rgba(192,57,43,0.15);
    color: #f5230c;
    border-left-color: #c0392b;
    font-weight: 700;
}
#menu-lecciones li a .num {
    font-size: 21px;
    font-weight: 800;
    color: #c0392b;
    background: rgba(192,57,43,0.15);
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 28px;
    text-align: center;
    margin-top: 1px;
    flex-shrink: 0;
}
#menu-lecciones li a.activa .num { background: #ad2f21; color: #1a1008; }
#menu-lecciones li a .texto-menu { flex: 1; }
#menu-lecciones li a .texto-menu .cn {
    display: block;
    font-family: serif;
    font-size: 20px;
    color: #ffffff;
}
#menu-lecciones li a.activa .texto-menu .cn { color: #c0392b; }
#menu-lecciones li a .texto-menu .es {
    display: block;
    font-size: 15px;
    color: rgba(209, 245, 7, 0.5);
    margin-top: 1px;
}

.menu-extra {
    margin: 6px 12px 0;
    padding: 8px 10px;
    background: rgba(192,57,43,0.08);
    border-radius: 6px;
    border: 1px solid rgba(192,57,43,0.2);
}
.menu-extra a {
    color: rgba(252, 250, 249, 0.7);
    text-decoration: none;
    font-size: 20px;
    display: block;
    line-height: 1.4;
}
.menu-extra a:hover { color: #c0392b; }

/* Botón hamburguesa móvil */
#btn-menu {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: #1a1008;
    color: #c0392b;
    border: 1px solid #c0392b;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
}
#overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

/* ==========================================
   CONTENIDO PRINCIPAL
   — background transparente para ver FONDO.jpg
========================================== */
#main {
    flex: 1;
    min-width: 0;
    padding: 30px 45px;
    background: transparent;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
    padding: 30px;
}

.cargando {
    text-align: center;
    color: #c0392b;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 50px;
}

/* ==========================================
   TÍTULO DE LECCIÓN
========================================== */
#leccion-titulo-top {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 40px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: 25px;
    border-bottom: 3px solid #c0392b;
    padding-bottom: 14px;
    text-align: center;
    text-shadow: 0 1px 3px rgba(255,255,255,0.8);
}

/* ==========================================
   NAVEGACIÓN DE SECCIONES (botones de página)
========================================== */
#nav-secciones {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    padding: 14px 10px;
    /*background: rgba(255, 255, 255, 0.55);*/
    border-radius: 30px;
}
.btn-seccion {
    font-family: inherit;
    font-size: 20.5px;
    padding: 7px 18px;
    border-radius: 20px;
    border: 1px solid #c0392b;
    background: rgba(255, 255, 255, 0.85);
    color: #fc1206;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-seccion:hover { background: #c0392b; color: #fff; }
.btn-seccion.activa { background: #c0392b; color: #fff; font-weight: 700; }

/* ==========================================
   SEPARADOR ROMBO DORADO (estilo D) — usado por <!-- nextpage -->
========================================== */
.sep-rombo {
    display: flex;
    align-items: center;
    width: 60%;
    margin: 50px auto;
}
.sep-rombo-line { flex: 1; height: 3px; background: #c0392b; }
.sep-rombo-diamond {
    width: 12px;
    height: 12px;
    background: #c0392b;
    transform: rotate(45deg);
    margin: 0 10px;
    flex-shrink: 0;
}

/* ==========================================
   LÍNEAS <hr> DE WORDPRESS (vienen de FRAGMENTOS.json)
   Afecta a TODOS los <hr class="wp-block-separator">
========================================== */
hr.wp-block-separator {
    border: none;
    border-top: 8px solid #c0392b;
    width: 60%;
    margin: 40px auto;
    opacity: 1;
}
hr.wp-block-separator.is-style-wide {
    width: 85%;
}

/* ==========================================
   MOTOR VISUAL DE COLUMNAS (WordPress)
========================================== */
.wp-block-columns {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5em;
    margin-bottom: 1.5em;
}
.wp-block-columns.are-vertically-aligned-center { align-items: center; }
.wp-block-column {
    flex-grow: 1;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ==========================================
   ÍNDICE FF1 — 6 imágenes clicables
========================================== */
.indice-secciones {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    padding: 24px 16px;
    margin: 10px 0;
    /*background: rgba(255, 255, 255, 0.55);*/
    border-radius: 16px;
}
.indice-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    max-width: 150px;
    text-align: center;
}
.indice-item:hover { transform: translateY(-3px); }
.indice-item img {
    width: 130px;
    height: 95px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0d8c8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.indice-item:hover img {
    border-color: #c0392b;
    box-shadow: 0 4px 14px rgba(192,57,43,0.35);
}
.indice-item .indice-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fa0303;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    flex-shrink: 0;
}
.indice-item .indice-label {
    font-size: 15px;
    color: #030303;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   RESPONSIVE — MÓVIL
========================================== */
@media (max-width: 820px) {
    #btn-menu { display: block; }
    #sidebar {
        position: fixed;
        left: -340px;
        top: 0;
        height: 100vh;
        transition: left 0.25s ease;
    }
    #sidebar.abierto { left: 0; }
    #overlay.visible { display: block; }
    #main { padding: 20px 15px; }
    #app { padding: 20px 15px; }
    .wp-block-columns { flex-wrap: wrap; }
    .wp-block-column { flex-basis: 100% !important; margin-bottom: 1em; }
    .indice-item img { width: 100px; height: 74px; }
}
