@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background: #eeeeee;
    color: #333;
}

/* ── NAVBAR ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 50px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 10px;
}

nav .logo {
    font-size: 20px;
    font-weight: 700;
    color: #5d6fbf;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

nav .logo img {
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-logo-icon {
    font-size: 28px;
    color: #5d6fbf;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
    align-items: center;
    flex-wrap: wrap;
}

nav ul li {
    position: relative;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #3796b6;
}

nav details > summary {
    cursor: pointer;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
    list-style: none;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

nav details > summary::-webkit-details-marker {
    display: none;
}

nav details > summary:hover {
    color: #3796b6;
}

nav details ul {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    min-width: 210px;
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.13);
    z-index: 200;
    list-style: none;
}

nav details ul li a {
    display: block;
    padding: 9px 18px;
    color: #444;
    white-space: nowrap;
    font-size: 14px;
}

nav details ul li a:hover {
    background: #f0f7ff;
    color: #3796b6;
}

/* ── HERO ── */
.hero {
    background: linear-gradient(160deg, rgba(15, 45, 100, 0.78), rgba(40, 110, 175, 0.68)),
        url("logot3.png");
    background-size: cover;
    background-position: center;
    padding: 140px 20px;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: 46px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero p {
    font-size: 20px;
    margin-top: 14px;
    opacity: 0.93;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.hero button {
    margin-top: 30px;
    background: white;
    color: #4d4f9f;
    padding: 14px 36px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 17px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Poppins', sans-serif;
}

.hero button:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

/* ── SECCIONES ── */
section {
    width: 90%;
    max-width: 1100px;
    background: white;
    margin: 60px auto;
    padding: 50px 60px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

h2 {
    text-align: center;
    font-size: 34px;
    color: #5492b3;
    margin-top: 0;
}

.subtitulo {
    text-align: center;
    color: #666;
    margin-top: -10px;
    margin-bottom: 20px;
}

/* ── SERVICES GRID ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: rgba(73, 132, 177, 0.6);
    border-radius: 18px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.06);
    transition: 0.3s;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.service-card h3 {
    color: white;
    font-size: 21px;
    margin-bottom: 10px;
}

.service-card p {
    color: rgba(255, 255, 255, 0.92);
    margin: 0;
}

#avisos {
    padding: clamp(1.25rem, 4vw, 3rem);
    scroll-margin-top: 6rem;
    background: linear-gradient(145deg, #193568, #285f95);
    color: white;
}

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

.avisos-encabezado p {
    margin: 0 0 0.35rem;
    color: #c8e6fa;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.avisos-encabezado h2 {
    margin: 0 0 1.25rem;
    color: inherit;
    text-align: center;
}

.avisos-paneles {
    display: grid;
    gap: 1rem;
}

.avisos-paneles[data-carrusel] > .aviso {
    grid-area: 1 / 1;
}

.aviso {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(1rem, 4vw, 2.5rem);
    padding: clamp(1rem, 4vw, 2.5rem);
    border-radius: 18px;
    background: white;
    color: #25354a;
}

.aviso h3 {
    margin: 0;
    color: #193568;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    line-height: 1.2;
}

.aviso ul {
    padding-inline-start: 1.2rem;
}

.aviso-intro {
    max-width: 42ch;
    margin: 0.8rem 0 1.25rem;
}

.aviso-datos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin: 0;
}

.aviso-datos > div {
    padding: 0.65rem 0.85rem;
    border-left: 3px solid #5492b3;
    border-radius: 0 10px 10px 0;
    background: #edf5fb;
}

.aviso-datos .aviso-sede {
    grid-column: 1 / -1;
}

.aviso-datos dt {
    color: #285f95;
    font-size: 0.8rem;
    font-weight: 600;
}

.aviso-datos dd {
    margin: 0;
    font-weight: 600;
}

.aviso-placa {
    position: relative;
    width: min(100%, 21rem);
    margin: auto;
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 8 / 7;
}

.aviso-placa img {
    position: absolute;
    max-width: none;
}

.aviso-placa--expo img {
    width: 156.52%;
    left: -21.5%;
    top: -72%;
}

.aviso-placa--completa {
    aspect-ratio: auto;
}

.aviso-placa--completa img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
}

.aviso-logo {
    display: grid;
    place-items: center;
    width: min(100%, 21rem);
    aspect-ratio: 8 / 7;
    margin: auto;
    border-radius: 16px;
    background: radial-gradient(circle, #f6fbff, #d7e9f8);
}

.aviso-logo img {
    width: 65%;
    height: auto;
    border-radius: 50%;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .aviso {
        transition: box-shadow 180ms ease;
    }

    .aviso:hover {
        box-shadow: 0 8px 24px rgb(10 29 63 / 28%);
    }

    .aviso img {
        transition: transform 180ms ease;
    }

    .aviso:hover img {
        transform: scale(1.035);
    }
}

.avisos-controles {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.avisos-controles button {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #b2d1e8;
    border-radius: 8px;
    background: white;
    color: #193568;
    font: inherit;
    cursor: pointer;
}

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

.avisos-centro {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.avisos-estado-titulo {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.avisos-paneles[data-carrusel] > .aviso[hidden] {
    display: grid;
    visibility: hidden;
}

.avisos-controles[hidden] {
    display: none;
}

@media (max-width: 700px) {
    .aviso {
        grid-template-columns: 1fr;
    }

}

/* ── GALERÍA ESCOLAR ── */
.galeria-cubiertas {
    position: relative;
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: repeat(2, minmax(13rem, 1fr));
    gap: 0.9rem;
    width: 90%;
    max-width: 1100px;
    margin: clamp(1.5rem, 4vw, 3rem) auto 2.5rem;
}

.galeria-cubierta {
    position: relative;
    display: flex;
    align-items: end;
    isolation: isolate;
    overflow: hidden;
    min-height: 13rem;
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 22px;
    background: #193568;
    color: white;
    text-decoration: none;
    box-shadow: 0 8px 25px rgb(19 43 75 / 18%);
}

.galeria-cubierta:first-child {
    grid-row: span 2;
}

.galeria-cubierta img,
.galeria-cubierta::after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.galeria-cubierta img {
    z-index: -2;
    object-fit: cover;
}

.galeria-cubierta::after {
    z-index: -1;
    background: linear-gradient(0deg, rgb(9 25 49 / 96%), rgb(9 25 49 / 72%) 35%, transparent 82%);
    content: "";
}

.galeria-cubierta-texto h2 {
    margin: 0.25rem 0 0.55rem;
    color: white;
    text-align: left;
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.2;
}

.galeria-cubierta:first-child h2 {
    font-size: clamp(1.5rem, 4vw, 2.75rem);
}

.galeria-cubierta-texto > span {
    color: #d7edfb;
    font-size: 0.85rem;
}

.galeria-cubierta-texto .galeria-abrir {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgb(255 255 255 / 50%);
    border-radius: 999px;
    color: white;
    font-weight: 600;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .galeria-cubierta img,
    .galeria-fotos img {
        transition: transform 220ms ease;
    }

    .galeria-cubierta:hover img,
    .galeria-fotos a:hover img {
        transform: scale(1.04);
    }
}

@media (max-width: 700px) {
    .galeria-cubiertas {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .galeria-cubierta:first-child {
        grid-row: auto;
        min-height: 17rem;
    }
}

.galeria-album {
    padding: clamp(1rem, 4vw, 2.5rem);
    scroll-margin-top: 6rem;
}

.galeria-album header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.galeria-album header h2,
.galeria-album header p {
    margin: 0;
}

.galeria-destacada {
    margin: 0 0 1rem;
    scroll-margin-top: 6rem;
}

.galeria-destacada a {
    display: block;
    overflow: hidden;
    border-radius: 16px;
    background: #132b4b;
}

.galeria-destacada img {
    display: block;
    width: 100%;
    height: clamp(16rem, 56vw, 35rem);
    object-fit: contain;
}

.galeria-destacada figcaption {
    margin-top: 0.45rem;
    color: #435873;
    font-size: 0.9rem;
    text-align: center;
}

.galeria-fotos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    gap: 0.85rem;
}

.galeria-fotos a {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: #edf5fb;
}

.galeria-cubierta:focus-visible,
.galeria-destacada a:focus-visible,
.galeria-fotos a:focus-visible {
    outline: 3px solid #285f95;
    outline-offset: 3px;
}

.galeria-fotos a[aria-current="true"] {
    outline: 3px solid #285f95;
    outline-offset: 2px;
}

.galeria-fotos img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* ── TABLA ÁREAS ── */
.tabla-areas {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.tabla-areas td {
    padding: 11px 14px;
    border-bottom: 1px solid #eee;
}

.tabla-areas td:first-child {
    width: 36px;
    font-weight: 700;
    color: #5492b3;
}

.tabla-areas tr:hover td {
    background: #f5faff;
}

/* ── HISTORIA ── */
.historia {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.historia img {
    width: 100%;
    border-radius: 16px;
    height: 160px;
    object-fit: cover;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* ── TABLA CURRICULAR ── */
.tabla-curricular-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 500px;
    margin: 20px 0;
    border-radius: 12px;
    border: 1px solid #ddd;
}

.tabla-curricular {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 14px;
}

.tabla-curricular thead tr:first-child {
    background: #5492b3;
    color: white;
}

.tabla-curricular thead tr:last-child {
    background: #3d7a9e;
    color: white;
}

.tabla-curricular thead th {
    padding: 12px 10px;
}

.tabla-curricular tbody td {
    padding: 9px 10px;
    border-bottom: 1px solid #eee;
}

.tabla-curricular tbody tr:hover td {
    background: #f5faff;
}

.tabla-curricular .seccion-row td {
    background: #e8f2f9;
    font-weight: 700;
    text-align: left;
    padding: 10px 14px;
    color: #2e5f85;
}

.tabla-curricular tfoot td {
    font-weight: 700;
    background: #f0f4f8;
    padding: 10px;
}

/* ── TABLA MESAS DE EXAMEN ── */
.tabla-mesas {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    font-size: 15px;
}

.tabla-mesas thead tr {
    background: #5492b3;
    color: white;
}

.tabla-mesas thead th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tabla-mesas tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.tabla-mesas tbody tr:hover {
    background: rgba(84, 146, 179, 0.08);
}

.tabla-mesas tbody td {
    padding: 14px 20px;
    color: #333;
}

.tabla-mesas tbody tr:nth-child(even) {
    background: #f4f8fb;
}

.tabla-mesas tbody tr:nth-child(even):hover {
    background: rgba(84, 146, 179, 0.1);
}

.badge-año {
    display: inline-block;
    background: rgba(73, 132, 177, 0.18);
    color: #2e6a99;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 600;
}

.badge-hora {
    display: inline-block;
    background: rgba(87, 180, 149, 0.18);
    color: #2a7a60;
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 13px;
    font-weight: 600;
}

/* ── CARRUSEL ── */
.carrusel {
    max-width: 100%;
    overflow: hidden;
    margin-top: 30px;
}

.carrusel-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.carrusel-item[aria-hidden="true"] {
    display: none;
}

@media (prefers-reduced-motion: no-preference) {
    .carrusel-inner--animado {
        width: var(--ancho-carrusel-equipo, 200%);
        flex-wrap: nowrap;
        justify-content: flex-start;
        animation: desplazar-equipo 20s linear infinite;
    }

    .carrusel-inner--animado:hover {
        animation-play-state: paused;
    }

    .carrusel-inner--animado > .carrusel-item {
        flex: 0 0 12.5%;
        min-width: 0;
    }

    .carrusel-inner--animado > .carrusel-item[aria-hidden="true"] {
        display: block;
    }

    @keyframes desplazar-equipo {
        to { transform: translateX(-50%); }
    }
}

.carrusel-item {
    min-width: 25%;
    text-align: center;
    padding: 16px;
}

.carrusel-item img,
.equipo-iniciales {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
}

.carrusel-item img {
    object-fit: cover;
}

.equipo-iniciales {
    display: inline-grid;
    place-items: center;
    vertical-align: baseline;
    background: #edf5fb;
    color: #193568;
    font-size: 2.5rem;
    font-weight: 600;
}

.carrusel-item h3 {
    color: #5492b3;
    margin: 12px 0 4px;
    font-size: 17px;
}

.carrusel-item p {
    color: #777;
    font-size: 13px;
    margin: 0;
}

/* ── CONTACTO ── */
.contact-box {
    background: #f7fbff;
    padding: 30px;
    border-radius: 18px;
    border-left: 6px solid #5492b3;
}

.contact-box p {
    margin: 8px 0;
    font-size: 16px;
}

.contact-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.contact-links a {
    background: #5492b3;
    color: white;
    padding: 9px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}

.contact-links a:hover {
    background: #3d7a9e;
}

/* ── DESCARGAS ── */
.año-titulo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 40px 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #5492b3;
}

.año-titulo::before {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, #c5dff0);
}

.año-titulo::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #c5dff0, transparent);
}

.descargas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.card-descarga {
    background: white;
    border-radius: 18px;
    border: 2px solid #e0eef7;
    padding: 28px 24px;
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.card-descarga:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(80, 175, 204, 0.2);
    border-color: #50afcc;
}

.card-icono {
    width: 60px;
    height: 60px;
    background: rgba(73, 132, 177, 0.12);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.card-nombre {
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    color: #2e5f85;
}

.card-badge {
    background: rgba(73, 132, 177, 0.15);
    color: #2e6a99;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
}

.btn-dl {
    background: #50afcc;
    color: white;
    border-radius: 30px;
    padding: 8px 22px;
    font-size: 13px;
    font-weight: 600;
}

/* ── PRÁCTICAS ── */
.practicas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    margin-top: 36px;
}

.practica-card {
    background: white;
    border-radius: 18px;
    border: 2px solid #e0eef7;
    padding: 30px 24px;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.practica-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(80, 175, 204, 0.2);
    border-color: #5492b3;
}

.practica-card .icono {
    font-size: 40px;
    margin-bottom: 14px;
}

.practica-card h3 {
    color: #5492b3;
    margin: 0 0 10px;
    font-size: 18px;
}

.practica-card p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.practica-card .anio {
    display: inline-block;
    background: rgba(73, 132, 177, 0.15);
    color: #2e6a99;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

/* ── BOTÓN FLOTANTE ── */
details.flotante {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
}

details.flotante > summary {
    background: #50afcc;
    color: white;
    padding: 14px 22px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: background 0.3s;
}

details.flotante > summary::-webkit-details-marker {
    display: none;
}

details.flotante > summary:hover {
    background: #3d98b3;
}

.flotante-menu {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.flotante-menu a {
    background: #50afcc;
    color: white;
    padding: 11px 18px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    transition: background 0.3s;
}

.flotante-menu a:hover {
    background: #3d98b3;
}

/* ── FOOTER ── */
footer {
    background: rgba(44, 90, 140, 0.92);
    color: white;
    text-align: center;
    padding: 50px 20px;
    margin-top: 80px;
    font-size: 16px;
}

footer p {
    margin: 5px 0;
}

.footer-titulo {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.footer-sub {
    opacity: 0.9;
}

.footer-dir {
    opacity: 0.85;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.footer-social a {
    color: white;
    text-decoration: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.3s, box-shadow 0.3s;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.footer-social a:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.si-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%) !important; }
.si-youtube   { background: #FF0000 !important; }
.si-email     { background: #c0392b !important; }
.si-maps      { background: #34A853 !important; }

.footer-copy {
    margin-top: 22px;
    font-size: 13px;
    opacity: 0.65;
}

/* ── FORMULARIO EN CONTACTO ── */
.contact-box details {
    width: fit-content;
}

.btn-preguntas {
    background: #5492b3;
    color: white;
    padding: 9px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    border: none;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: background 0.3s;
}

.btn-preguntas::-webkit-details-marker {
    display: none;
}

.btn-preguntas:hover {
    background: #3d7a9e;
}

.form-preguntas {
    background: white;
    border-radius: 14px;
    padding: 24px;
    margin-top: 12px;
    min-width: 300px;
    text-align: left;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.form-preguntas label {
    font-weight: 600;
    color: #444;
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.form-preguntas input,
.form-preguntas textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    margin-bottom: 12px;
    color: #333;
}

.form-preguntas textarea {
    height: 80px;
    resize: vertical;
}

.form-preguntas button {
    background: #5492b3;
    color: white;
    border: none;
    padding: 10px 26px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.3s;
    font-size: 14px;
}

.form-preguntas button:hover {
    background: #3d7a9e;
}

/* ── MAPA ── */
.mapa {
    width: 100%;
    height: 380px;
    border: 0;
    border-radius: 16px;
    margin-top: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* ── VIDEO EMBED ── */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    margin-top: 30px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 16px;
}

/* ── HAMBURGUESA ── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: #5d6fbf;
    border-radius: 3px;
    transition: transform 0.3s, opacity 0.3s;
}

nav.nav-open .hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

nav.nav-open .hamburger span:nth-child(2) {
    opacity: 0;
}

nav.nav-open .hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    nav ul {
        gap: 10px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    nav {
        padding: 12px 16px;
        flex-wrap: wrap;
        align-items: center;
    }

    nav .logo {
        font-size: 15px;
        flex: 1;
        min-width: 0;
    }

    .hamburger {
        display: flex;
    }

    nav > ul {
        display: none;
        flex: 0 0 100%;
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
        font-size: 14px;
        padding: 10px 0 4px;
        order: 3;
    }

    nav.nav-open > ul {
        display: flex;
    }

    nav ul li {
        width: 100%;
    }

    nav details > summary {
        padding: 8px 4px;
        width: 100%;
        display: block;
    }

    nav details ul {
        position: static;
        min-width: 0;
        box-shadow: none;
        border-left: 3px solid #e0eef7;
        border-radius: 0;
        padding: 4px 0 4px 14px;
        margin-top: 4px;
        background: #f8fbff;
    }

    nav details ul li a {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    nav ul li a {
        display: block;
        padding: 8px 4px;
    }

    .hero {
        padding: 70px 20px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 15px;
    }

    section {
        width: 95%;
        padding: 28px 18px;
        margin: 24px auto;
        border-radius: 16px;
    }

    h2 {
        font-size: 24px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .practicas-grid {
        grid-template-columns: 1fr;
    }

    .descargas-grid {
        grid-template-columns: 1fr;
    }

    .historia {
        grid-template-columns: 1fr;
    }

    .carrusel-inner {
        --ancho-carrusel-equipo: 400%;
    }

    .carrusel-item {
        min-width: 50%;
    }

    .carrusel-item img,
    .equipo-iniciales {
        width: 130px;
        height: 130px;
    }

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

    .mapa {
        height: 280px;
    }

    footer {
        padding: 36px 16px;
    }

    footer details {
        width: 90%;
    }

    .form-preguntas {
        min-width: unset;
        width: 100%;
    }

    .footer-social {
        gap: 10px;
    }

    .tabla-curricular {
        font-size: 12px;
    }

    .tabla-mesas {
        font-size: 13px;
    }

    .tabla-mesas thead th,
    .tabla-mesas tbody td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    nav .logo img {
        height: 32px;
    }

    nav .logo {
        font-size: 13px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .galeria-fotos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .galeria-destacada img {
        height: clamp(12rem, 64vw, 18rem);
    }

    .carrusel-inner {
        --ancho-carrusel-equipo: 800%;
    }

    .carrusel-item {
        min-width: 100%;
    }

    .footer-social a {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

/* Detalles de interacción de la portada. */
@media (prefers-reduced-motion: no-preference) {
    .portada-animada .historia img,
    .portada-animada .carrusel-item img,
    .portada-animada .equipo-iniciales,
    .portada-animada .avisos-controles button,
    .portada-animada .contact-links > a,
    .portada-animada .btn-preguntas {
        transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
    }

    .portada-animada .avisos-controles button:focus-visible,
    .portada-animada .contact-links > a:focus-visible,
    .portada-animada .btn-preguntas:focus-visible {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(25, 53, 104, 0.18);
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .portada-animada .historia img:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(25, 53, 104, 0.18);
    }

    .portada-animada .carrusel-item:hover img,
    .portada-animada .carrusel-item:hover .equipo-iniciales {
        transform: scale(1.04);
        box-shadow: 0 9px 24px rgba(25, 53, 104, 0.2);
    }

    .portada-animada .avisos-controles button:hover,
    .portada-animada .contact-links > a:hover,
    .portada-animada .btn-preguntas:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(25, 53, 104, 0.18);
    }
}

/* Ilustración tecnológica de la portada. */
.hero--ilustrada {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    align-items: center;
    gap: clamp(24px, 5vw, 80px);
    padding: clamp(48px, 7vw, 100px) max(24px, calc((100vw - 1100px) / 2));
    background: linear-gradient(160deg, rgba(15, 45, 100, 0.78), rgba(40, 110, 175, 0.68)), url("logot3.png");
    background-size: cover;
    background-position: center;
    text-align: left;
    overflow: hidden;
}
.hero--ilustrada h1 { font-size: clamp(30px, 4vw, 52px); line-height: 1.18; }
.hero--ilustrada p { max-width: 35em; line-height: 1.7; }
.hero-tecnologia { width: 100%; max-width: 520px; justify-self: center; }
.hero-tecnologia svg { display: block; width: 100%; height: auto; overflow: visible; }

@media (prefers-reduced-motion: no-preference) {
    .hero-tecnologia svg { animation: tech-ciclo 5s linear infinite; }
    .tech-monitor { transform-origin: 260px 375px; animation: tech-aparecer 5s cubic-bezier(.22,1,.36,1) infinite; }
    .tech-circuitos path { stroke-dasharray: 1; animation: tech-trazar 5s ease infinite; }
    .tech-nodos { animation: tech-encender 5s ease infinite; }
    .tech-codigo path { stroke-dasharray: 1; animation: tech-codigo 5s ease infinite; }
    .tech-chip { transform-origin: 310px 205px; animation: tech-pulso 5s ease infinite; }

    @keyframes tech-ciclo {
        0%, 90% { opacity: 1; }
        100% { opacity: 0; }
    }
    @keyframes tech-aparecer {
        0% { opacity: 0; transform: translateY(24px) scale(.9); }
        18%, 100% { opacity: 1; transform: none; }
    }
    @keyframes tech-trazar {
        0%, 12% { stroke-dashoffset: 1; }
        42%, 100% { stroke-dashoffset: 0; }
    }
    @keyframes tech-encender {
        0%, 30% { opacity: 0; }
        48%, 100% { opacity: 1; }
    }
    @keyframes tech-codigo {
        0%, 26% { stroke-dashoffset: 1; }
        60%, 100% { stroke-dashoffset: 0; }
    }
    @keyframes tech-pulso {
        0%, 48% { opacity: .45; transform: scale(.9); }
        62% { opacity: 1; transform: scale(1.1); }
        80%, 100% { opacity: 1; transform: scale(1); }
    }
}
@media (max-width: 768px) {
    .hero--ilustrada { grid-template-columns: 1fr; text-align: center; padding: 48px 24px 32px; gap: 16px; }
    .hero-tecnologia { max-width: 350px; }
}

/* Plan de estudios abierto, adaptable por año. */
.curricula-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-top: 28px;
    align-items: start;
}
.curricula-ano {
    min-width: 0;
    border: 1px solid #dbe7ef;
    border-radius: 18px;
    background: #fff;
    overflow: clip;
}
.curricula-cabecera {
    padding: 22px 24px;
    background: #193568;
    color: #fff;
}
.curricula-cabecera h3 { margin: 0 0 6px; font-size: 26px; }
.curricula-cabecera p { margin: 0; font-size: 13px; line-height: 1.6; }
.curricula-materias {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}
.curricula-materias th, .curricula-materias td {
    padding: 11px 16px;
    border-bottom: 1px solid #e9eff4;
    overflow-wrap: anywhere;
}
.curricula-materias thead { color: #43617c; background: #f7fafc; font-size: 12px; }
.curricula-materias thead th:last-child { width: 66px; text-align: right; }
.curricula-materias td { text-align: right; color: #193568; font-variant-numeric: tabular-nums; }
.curricula-materias th[scope="row"] { font-weight: 400; }
.curricula-materias .curricula-grupo th {
    padding-top: 14px;
    padding-bottom: 14px;
    background: #e8f2f9;
    color: #285b80;
    font-size: 11px;
    letter-spacing: .025em;
    font-weight: 700;
}
.curricula-materias tbody:last-child tr:last-child > * { border-bottom: 0; }
.curricula-lector {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
@media (max-width: 700px) {
    .curricula-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .curricula-cabecera { padding: 20px 18px; }
    .curricula-materias th, .curricula-materias td { padding-left: 12px; padding-right: 12px; }
}
