/* Generales y Reset Básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow-x: hidden; /* Evita el scroll horizontal */
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    background-color: #ffffff;
    padding-top: 60px; /* Espacio para el header fijo (Default PC) */
    padding-bottom: 40px; /* Espacio para el footer fijo (Default PC) */
    position: relative;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Material Symbols específicos */
.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
    vertical-align: middle;
    display: inline-block;
}

/* -------------------------------------------------------------------------- */
/* HEADER - Posición fija y degradado MEJORADO */
/* -------------------------------------------------------------------------- */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px; /* Altura fija para PC */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
    z-index: 1001; /* Alto para estar siempre visible */
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.main-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Logo a la izquierda por defecto en PC */
    
}

.logo {
    display: block;
    /* No se necesitan propiedades de posicionamiento aquí, el flexbox del padre se encarga */
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

/* -------------------------------------------------------------------------- */
/* NAV - Franja roja a la derecha, debajo del header (PC) */
/* -------------------------------------------------------------------------- */
.main-nav-container {
    position: fixed;
    top: 60px; /* Debajo del header */
    right: 0;
    height: 35px;
    width: 50px; /* Ancho inicial colapsado */
    background-color: #e60000;
    z-index: 1000; /* Menor que el header (1001), mayor que el contenido (1) */
    
    display: flex;
    align-items: center;
    
    border-top-left-radius: 25px;
    border-bottom-left-radius: 25px;
    
    transition: width 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    overflow: hidden;
    box-shadow: -2px 0 5px rgba(0,0,0,0.2);
}

.main-nav-container.expanded {
    width: 450px; /* Ancho expandido */
    height: 35px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.4);
}

.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: white;
    font-size: 0;
    transition: transform 0.3s ease-in-out;
    flex-shrink: 0;
    margin-left: auto;
}

.arrow-icon {
    font-size: 30px;
    font-variation-settings: 'FILL' 1;
}

.main-nav-container.expanded .nav-toggle .arrow-icon {
    transform: rotate(180deg);
}

.nav-links {
    display: flex;
    align-items: center;
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    
    gap: 20px;
    padding-left: 20px;
    flex-grow: 1;
}

.main-nav-container.expanded .nav-links {
    opacity: 1;
    pointer-events: auto;
}

.nav-links li {
    flex-shrink: 0;
}

.nav-links a {
    color: white;
    font-size: 1.1em;
    padding: 7px 10px;
    display: block;
    line-height: 1.1em;
    transition: background-color 0.2s;
    white-space: nowrap;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links a:hover {
    background-color: rgb(182, 8, 8);
}

.main-nav-container.expanded .nav-links a.active-link {
    background-color: rgb(94, 3, 3);
    font-weight: bold;
    border-radius: 0;
}

.nav-play-icon {
    color: #e60000;
    background-color: white;
    border-radius: 50%;
    font-size: 20px;
    padding: 2px;
    font-variation-settings: 'FILL' 1;
    display: none;
    margin-right: 8px;
    flex-shrink: 0;
}

.main-nav-container.expanded .nav-item .nav-play-icon.active-nav-marker {
    display: inline-block;
}

.nav-item {
    display: flex;
    align-items: center;
}

/* -------------------------------------------------------------------------- */
/* MAIN - Área editable */
/* -------------------------------------------------------------------------- */
.editable-content {
    padding: 20px;
    /* Ajustamos el min-height, pero el padding del body ya debería manejar gran parte */
    min-height: calc(100vh - 60px - 40px); 
    background-color: #ffffff; 
    position: relative;
    z-index: 1;
}

/* -------------------------------------------------------------------------- */
/* FOOTER - Posición fija y z-index bajo MEJORADO */
/* -------------------------------------------------------------------------- */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* *** CAMBIO CLAVE PARA FOOTER: Altura automática y padding en el footer mismo *** */
    height: auto; /* Permitimos que la altura se ajuste al contenido y al padding */
    padding: 10px 20px; /* Padding top/bottom/left/right para el footer */
    background-color: #d3d3d3;
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 0.9em;
    border-top: 1px solid #ccc;
    box-sizing: border-box; /* Crucial para que el padding se incluya dentro del tamaño */
}

.main-footer p {
    margin: 0; /* Aseguramos que el párrafo no tenga márgenes propios */
    /* Eliminamos el padding del párrafo, ahora lo maneja el .main-footer */
    white-space: normal;
    text-align: center;
    word-wrap: break-word;
}

/* -------------------------------------------------------------------------- */
/* Títulos de Sección (Aplicados a h1.section-title) */
/* -------------------------------------------------------------------------- */
.section-title {
    font-size: 3em;
    text-align: left;
    margin-bottom: 30px;
    color: #333;
    font-weight: 700;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}


/* -------------------------------------------------------------------------- */
/* MEDIA QUERIES (Móvil) */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {

    body {
        padding-top: 50px;
        padding-bottom: 60px;
        overflow-y: auto;
    }

    .header-container {
        height: 50px; /* Altura más pequeña en móvil */
        padding: 0 10px;
        /* *** CAMBIO CLAVE PARA DEGRADADO: Degradado más visible y sólido al inicio en móvil *** */
        background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
        z-index: 1001;
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
    }

    .main-header {
        width: auto;
        justify-content: center;
    }

    .logo {
        position: static;
        transform: none;
    }
    .logo-img {
        height: 35px;
        margin: 0;
        display: block;
    }

    /* CONTENEDOR PRINCIPAL DEL MENÚ MÓVIL (.main-nav-container) */
    .main-nav-container {
        position: fixed;
        top: 50px;
        right: 0;
        z-index: 1000;
        
        flex-direction: row;
        width: 50px;
        height: 35px;
        background-color: #e60000;
        
        border-top-left-radius: 17.5px;
        border-bottom-left-radius: 17.5px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        
        box-shadow: -2px 2px 5px rgba(0,0,0,0.2);
        overflow: hidden;
        transition: all 0.3s ease-in-out; 

        align-items: center;
        justify-content: flex-start;
        padding-left: 10px;
    }

    .main-nav-container .nav-toggle {
        order: 1;
        flex-shrink: 0;
        width: auto;
        height: auto;
        background-color: transparent;
        padding: 0;
        margin-right: auto;
        margin-left: 0;
        transition: none;
    }

    .main-nav-container.expanded .nav-toggle .arrow-icon {
        transform: rotate(180deg);
    }
    
    .main-nav-container .nav-links {
        order: 2;
        display: flex;
        flex-direction: column;
        width: 100%;
        background-color: transparent;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        gap: 0;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease-in-out;
    }

    .main-nav-container.expanded {
        flex-direction: column;
        width: 150px;
        height: auto;
        max-height: calc(100vh - 50px - 40px);
        overflow-y: auto;
        
        background-color: #e60000;
        
        border-top-left-radius: 17.5px;
        border-bottom-left-radius: 17.5px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        
        box-shadow: -5px 5px 15px rgba(0,0,0,0.4);
        
        align-items: flex-start;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .main-nav-container.expanded .nav-toggle {
        margin-right: 0;
        margin-left: 10px;
        padding-bottom: 10px;
        justify-content: flex-start;
    }

    .main-nav-container.expanded .nav-links {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links li {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 5px;
    }

    .nav-links li:last-child {
        margin-bottom: 0;
    }

    .nav-links a {
        width: 100%;
        height: auto;
        padding: 7px 6px;
        text-align: center;
        display: block;
        box-sizing: border-box;
    }

    .nav-links a:hover {
        background-color: #990000;
        border-radius: 0;
    }

    .nav-links a.active-link {
        background-color: #990000;
        font-weight: bold;
        border-radius: 0;
    }

    .section-title {
        font-size: 2em;
        text-align: center;
        margin-bottom: 20px;
        padding: 0 15px;
    }
}

