:root{
    --azul:#003366;
    --azul-oscuro:#001022;
    --dorado:#d4af37;
    --indigo:#4f46e5;
    --cian:#06b6d4;
    --gris-texto:#555555;
    --gris-borde:#e3e3e3;
    --fuente-titulo:'Playfair Display',serif;
    --fuente-texto:'Inter','Segoe UI',sans-serif;
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    width:100%;
    height:100%;
    overflow:hidden;
    font-family:var(--fuente-texto);
    background:#1b1b1b;
}

#flipbook{
    width:100vw;
    height:100vh;
}

/*contraportada*/

.page {
    background: #ffffff;
    padding: 50px; 
    overflow-y: auto;
    

    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: space-between; 
    
    position: relative;
    height: 100vh; 
    box-sizing: border-box;
    

    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}


.page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #4f46e5, #06b6d4); 
}

/* ==========================
   SECCIONES
========================== */

.encabezado{

    width:100%;
}

.centro{

    width:100%;

    flex:1;

    display:flex;

    justify-content:center;

    align-items:center;
}

.pie{

    width:100%;
}

/* ==========================
   PORTADA
========================== */

.portada{

    background:
    linear-gradient(
        rgba(0,20,50,.80),
        rgba(0,51,102,.90)
    ),
    url("img/etica_img.png");

    background-size:cover;
    background-position:center;

    color:white;

    display:flex;
    flex-direction:column;

    justify-content:space-between;

    align-items:center;

    text-align:center;

    padding:25px;

    border:8px solid #d4af37;

    height:100%;

    overflow:hidden;

    position:relative;
}

/* Líneas decorativas */

.portada::before{

    content:"";

    position:absolute;

    top:15px;
    left:25px;
    right:25px;

    height:3px;

    background:#d4af37;
}

.portada::after{

    content:"";

    position:absolute;

    bottom:15px;
    left:25px;
    right:25px;

    height:3px;

    background:#d4af37;
}

/* ==========================
   LOGO
========================== */

.logo{

    width:min(120px,20vw);

    height:auto;

    margin:0 auto 10px auto;
}


/* ==========================
   IMAGEN CENTRAL
========================== */

.imagen{

    width:70%;

    max-width:320px;

    max-height:220px;

    object-fit:contain;

    border-radius:15px;

    box-shadow:
    0 0 25px rgba(0,0,0,.5);

    display:block;
}

/* ==========================
   TITULOS
========================== */

.portada h1{

    font-family:var(--fuente-titulo);

    font-size:clamp(1.4rem,2vw,2.2rem);

    font-weight:700;

    text-transform:uppercase;

    margin-bottom:10px;
}

.portada h2{

    font-size:clamp(.9rem,1.3vw,1.2rem);

    font-weight:400;

    margin-bottom:6px;
}

.portada h3{

    font-family:var(--fuente-titulo);

    font-size:clamp(1.2rem,2vw,1.8rem);

    color:#ffd700;

    margin-top:10px;

    margin-bottom:10px;
}

.portada h4{

    font-size:clamp(.9rem,1.4vw,1.3rem);

    letter-spacing:2px;

    margin-bottom:10px;
}


/* ==========================
   TEXTO
========================== */

.portada p{

    margin-bottom:10px;

    font-size:1rem;
}

.portada blockquote{

    max-width:600px;

    margin:0 auto;

    padding-left:15px;

    border-left:4px solid #ffd700;

    font-family:var(--fuente-titulo);

    font-style:italic;

    font-size:clamp(.8rem,1vw,1rem);
}
/* PAGINAS INTERNAS */

.page h1{

    font-family:var(--fuente-titulo);

    color:#003366;

    margin-bottom:25px;

    text-align:center;
}

.page p{

    line-height:1.8;

    margin-bottom:10px;
}

.page ul{

    margin-left:30px;
}

.page li{

    margin-bottom:8px;
}

/* NUMERO PAGINA */

.numero{

    position:absolute;

    bottom:10px;

    right:20px;

    color:#777;

    font-weight:bold;
}

.numero-pdf{

    color:#fff;

    background:rgba(0,0,0,.55);

    padding:2px 10px;

    border-radius:20px;

    bottom:14px;

    right:14px;
}

/* MOVIL */

@media(max-width:768px){

    .page{
        padding:20px;
    }

    .portada{
        padding:25px;
    }

}
/* ==========================
   IMAGENES RESPONSIVE
========================== */

img{

    max-width:100%;

    height:auto;

    display:block;
}

/* ==========================================================
   ÍNDICE — lista con líneas separadoras y guía punteada
========================================================== */

.indice-list{

    list-style:none;

    width:100%;

    max-width:520px;

    margin:0 auto;
}

.indice-item{

    display:flex;

    align-items:center;

    gap:8px;

    width:100%;

    padding:16px 4px;

    margin-bottom:0;

    border-bottom:1px solid var(--gris-borde);

    font-size:clamp(.95rem,1.2vw,1.1rem);

    color:#222;
}

.indice-item:first-child{

    border-top:1px solid var(--gris-borde);
}

.indice-item .titulo{

    font-weight:600;

    white-space:nowrap;
}

.indice-item .leader{

    flex:1 1 auto;

    height:0;

    margin:0 8px;

    border-bottom:2px dotted #c9c9c9;

    transform:translateY(-3px);
}

.indice-item .num{

    font-weight:700;

    color:var(--azul);

    min-width:28px;

    text-align:right;
}

/* ==========================================================
   CARÁTULAS DE SECCIÓN (Misión y Visión, Datos Informativos,
   Apuntes Diarios, Trabajos Individuales, Unidades I-IV)
========================================================== */

.caratula{

    background:linear-gradient(135deg,var(--azul-oscuro) 0%,var(--azul) 100%);

    color:#fff;

    border:8px solid var(--dorado);

    display:flex;

    flex-direction:column;

    justify-content:center;

    align-items:center;

    text-align:center;

    overflow:hidden;

    height:100%;

    position:relative;
}

.caratula::before{

    content:"";

    position:absolute;

    top:18px;
    left:30px;
    right:30px;

    height:2px;

    background:var(--dorado);
}

.caratula::after{

    content:"";

    position:absolute;

    bottom:18px;
    left:30px;
    right:30px;

    height:2px;

    background:var(--dorado);
}

.num-fondo{

    position:absolute;

    top:50%;
    left:50%;

    transform:translate(-50%,-50%);

    font-family:var(--fuente-titulo);

    font-weight:800;

    font-size:min(46vw,280px);

    line-height:1;

    color:rgba(212,175,55,.10);

    pointer-events:none;

    user-select:none;

    z-index:0;
}

.num-chip{

    position:relative;

    z-index:1;

    font-size:.85rem;

    letter-spacing:4px;

    color:var(--dorado);

    margin-bottom:16px;

    text-transform:uppercase;
}

.titulo-caratula{

    position:relative;

    z-index:1;

    font-family:var(--fuente-titulo);

    font-size:clamp(1.6rem,3.2vw,2.6rem);

    text-transform:uppercase;

    letter-spacing:2px;

    margin-bottom:16px;

    font-weight:700;
}

.linea-dorada{

    position:relative;

    z-index:1;

    width:90px;

    height:3px;

    background:var(--dorado);

    margin:0 auto 18px auto;
}

.epigrafe{

    position:relative;

    z-index:1;

    font-family:var(--fuente-titulo);

    font-style:italic;

    max-width:480px;

    font-size:clamp(.95rem,1.3vw,1.15rem);

    color:#e8e8e8;
}

/* ==========================================================
   APUNTES DIARIOS — 1 imagen por hoja (FULL PAGE CLEAN)
========================================================== */

/* Página base */
.page.apunte{
    width: 210mm;
    height: 297mm;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    padding: 15mm;

    page-break-after: always;
    break-after: page;
}

/* Nombre de la imagen */
.nombre-imagen{
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

/* Contenedor de imagen */
.apunte-grid{
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Eliminamos estilo tipo "tarjeta" */
.img-slot{
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;
    border: none;
    padding: 0;
    min-height: auto;
}

/* Imagen ocupa casi toda la hoja */
.img-slot img{
    width: 100%;
    height: 100%;

    max-height: 240mm;
    object-fit: contain;

    box-shadow: none;
    border-radius: 0;
}

/* Número de página */
.numero{
    text-align: right;
    font-size: 14px;
    margin-top: 10px;
    color: var(--gris-texto);
}

/* Eliminamos estilos antiguos que ya no se usan */
.apunte-fecha,
.img-slot .caption,
.apunte .encabezado{
    display: none;
}

/* Responsive (pantalla) */
@media(max-width:768px){

    .nombre-imagen{
        font-size: 16px;
    }

    .img-slot img{
        max-height: 60vh;
    }
}

/* Impresión */
@media print{
    .page.apunte{
        page-break-after: always;
    }
}
.page.apunte{
    margin: 15px auto;

    background: #f5f0e6; /* beige elegante */

    padding: 15mm;

    box-sizing: border-box;

    border-radius: 6px;

    box-shadow: 0 6px 18px rgba(0,0,0,0.12);

    border: 1px solid rgba(180,160,120,0.35);
}
.apunte-grid{
    padding: 20px;
}

.img-slot{
    padding: 25px;

    border: 10px solid #c9b37e; /* borde tipo dorado suave */

    background: #ffffff;

    border-radius: 12px;

    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* ==========================================================
   PÁGINAS DE PDF (Datos Informativos · Google Drive)
========================================================== */

.page.pdf-page{

    padding:0;

    display:block;
}

.pdf-page iframe{

    width:100%;

    height:100%;

    border:none;

    display:block;
}

/* ==========================================================
   TRABAJOS INDIVIDUALES — ficha + visor de Drive
========================================================== */

.trabajo-page{
    padding:5px;
    display:flex;
    flex-direction:column;
    height:100%;
    gap:2px;
}

.trabajo-page .encabezado{
    min-height:35px;
    margin:0;
    padding:0;
}

.trabajo-page h1{
    font-size:0.9rem;
    margin:0;
}

.trabajo-unidad{
    font-size:.55rem;
    padding:2px 8px;
}

.trabajo-visor{
    flex:1;
    width:100%;
    height:calc(100vh - 60px);
    border:none;
    box-shadow:none;
    border-radius:0;
}

.trabajo-visor iframe{
    width:100%;
    height:100%;
    border:none;
}

/* ==========================================================
   PÁGINAS VACÍAS / ESPACIOS RESERVADOS PARA FUTUROS TRABAJOS
========================================================== */

.vacio-titulo{

    color:#aab2bc !important;
}

.trabajo-visor.vacio-visor{

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:center;

    gap:14px;

    background:#f8f9fb;

    border:2px dashed #c7d2e0;

    box-shadow:none;
}

.vacio-visor .vacio-icono{

    font-size:2.6rem;

    color:var(--azul);

    font-weight:300;

    line-height:1;

    opacity:.6;
}

.vacio-visor .vacio-texto{

    color:var(--gris-texto);

    font-style:italic;

    font-size:.9rem;

    text-align:center;

    max-width:75%;

    margin:0;
}

/* ==========================================================
   CONTRAPORTADA
========================================================== */

.contraportada{

    background:
    linear-gradient(
        rgba(0,10,25,.92),
        rgba(0,38,77,.95)
    ),
    url("img/etica_img.png");

    background-size:cover;

    background-position:center;

    color:#fff;

    border:8px solid var(--dorado);

    display:flex;

    flex-direction:column;

    justify-content:center;

    align-items:center;

    text-align:center;

    height:100%;

    position:relative;
}

.contraportada::before{

    content:"";

    position:absolute;

    top:18px;
    left:30px;
    right:30px;

    height:2px;

    background:var(--dorado);
}

.contraportada::after{

    content:"";

    position:absolute;

    bottom:18px;
    left:30px;
    right:30px;

    height:2px;

    background:var(--dorado);
}

.contraportada h1{

    color:#fff;

    font-family:var(--fuente-titulo);

    letter-spacing:3px;

    margin-bottom:16px;
}

.contraportada .firma{

    margin-top:18px;

    font-style:italic;

    color:var(--dorado);
}
.indice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}


.indice-item,
.indice-subitem,
.indice-subsubitem {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
}

/* Nivel principal (Trabajos Individuales, Filosofía Institucional, etc.) */
.indice-item .titulo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.05em;
    color: #1a1a1a;
    white-space: nowrap;
}

/* Nivel de unidad (Unidad 1, Unidad 2...) */
.indice-subitem {
    margin-top: 8px;
}
.indice-subitem .titulo {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95em;
    color: #2c2c2c;
    padding-left: 22px;
    white-space: nowrap;
}

/* Nivel de trabajo individual (dentro de cada unidad) */
.indice-subsubitem {
    margin-bottom: 6px;
}
.indice-subsubitem .titulo {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.88em;
    color: #555;
    padding-left: 44px;
    white-space: nowrap;
}

/* Línea punteada que conecta el título con el número */
.leader {
    flex: 1;
    border-bottom: 1.5px dotted #b8952f;
    margin: 0 8px;
    height: 1px;
    align-self: end;
    margin-bottom: 4px;
}

/* Número de página */
.num {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9em;
    color: #b8952f;
    white-space: nowrap;
    min-width: 20px;
    text-align: right;
}
/* SUBINDICES */
.indice-subitem .titulo {
    padding-left: 20px;
    font-weight: 600;
}
.indice-subsubitem .titulo {
    padding-left: 40px;
    font-size: 0.9em;
    font-weight: 400;
    opacity: 0.85;
}