:root {
    /* Paleta Institucional */
    --marino: #054575;
    --azul: #1f67ad;
    --cielo: #0e91c6;
    --dorado: #e5ab41;
    --bronce: #c28743;
    --amarillo: #fec902;
    --crema: #fff9ed;
    --papel: #ffffff;
    --linea: #eadfc9;

    /* Bordes y Sombras */
    --r: 22px;
    --r-sm: 12px;
    --sombra: 0 10px 40px rgba(5, 69, 117, 0.08);
    --sombra-hover: 0 16px 40px rgba(5, 69, 117, 0.15);
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==========================================================
   TIPOS DE LETRA (AzoSans)
   ========================================================== */
@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-MediumItalic.ttf') format('truetype');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'AzoSans';
    src: url('../fonts/linea-grafica/AzoSans-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================
   ESTILOS GENERALES
   ========================================================== */
html {
    scroll-behavior: smooth;
}

html.lenis, html.lenis body {
    height: auto;
}

body {
    font-family: 'AzoSans', system-ui, -apple-system, sans-serif;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--marino);
    background-color: var(--crema);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--azul);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--cielo);
}

/* Encabezados Tipográficos */
h1, h2, h3, h4, h5, h6 {
    font-family: 'AzoSans', sans-serif;
    line-height: 1.15;
    color: var(--marino);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 500; /* AzoSans-Black */
}

h2 {
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    font-weight: 500; /* AzoSans-Bold */
}

h3 {
    font-size: 1.35rem;
    font-weight: 500;
}

h4 {
    font-size: 1.15rem;
    font-weight: 500;
}

/* ==========================================================
   CONTENEDORES Y SECCIONES
   ========================================================== */
.wrap {
    width: min(1180px, 92vw);
    margin-inline: auto;
}


section {
    padding: clamp(45px, 6vw, 80px) 0;
}

/* SECTION BANNER */

.banner{
    padding: clamp(5px, 4vw, 50px) 0;
}

.eyebrow {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--azul);
    margin-bottom: 0.75rem;
}

.lead {
    font-size: 1.2rem;
    font-weight: 300; /* AzoSans-Light */
    max-width: 55ch;
    opacity: 0.95;
    line-height: 1.65;
}

/* Accesibilidad y Foco */
.skip {
    position: absolute;
    left: -999px;
}

.skip:focus {
    left: 12px;
    top: 12px;
    z-index: 200;
    background: var(--papel);
    padding: 8px 16px;
    border-radius: var(--r-sm);
    box-shadow: var(--sombra);
}

:focus-visible {
    outline: 3px solid var(--cielo);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ==========================================================
   SISTEMA DE GRID Y TARJETAS
   ========================================================== */
.grid {
    display: grid;
    gap: 24px;
}

.flex-education {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: stretch;
}

.educacion {
    width: 320px;
    display: flex;
    flex-direction: column;
}

/* --- Control de Imágenes --- */
.educacion .card-img-container {
    margin-bottom: 12px;
}

.educacion .card-img-container img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
}

.educacion .card-tags {
    margin-bottom: 8px;
}

/* --- Limitación de Título (Máximo 2 líneas) --- */
.educacion .card-title {
    margin-top: 8px;
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Número máximo de líneas para el título */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Limitación de Descripción (Máximo 3 líneas) --- */
.educacion .card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Número máximo de líneas para la descripción */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
    font-size: 14px;
    height: 50px;
}

.educacion .card-instructions {
    font-size: 0.8rem;
    color: var(--azul);
    display: block;
    margin-top: 4px;
}

.infoDescarga{
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

/* --- Empujar el botón siempre hacia el fondo de la tarjeta --- */
.educacion .card-action {
    margin-top: auto; 
    padding-top: 16px;
}

.educacion .card-action .btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    text-decoration: none;
    box-sizing: border-box;
}

.investigacion{
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
}

.contenedor-investigacion{
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 70%;
}

.cont-imagen{
    width: 30%;
    padding: 10px;
    display: flex;
    justify-content: center;
}

.cont-imagen img{
    object-fit: contain;
    max-height: 250px;
}

.botones{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.botones > a{
    overflow: hidden;
    width: 350px;
    border: 1px solid orange;
    display: flex;
    padding: 10px 0;
    justify-content: center;
    border-radius: 10px;
}

.botones > a:hover{
    background-color: #e5ab41;
    color: #054575;
}

/* GUIA DE PRACTICA CLINICA DE EDUCACION EN DIABETES */
.intro-section{
    margin: 20px 0;
}

.intro-section > img{
    width: 350px;
    margin: 0 auto;
}

.intro-text{
    margin: 30px 0;
}

.seccion{
    margin: 50px 0;
}

.contenido-flex{
    display: flex;
    flex-direction: row;
}

.texto{
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.imagen-seccion{
    width: 300px;
}

.contenido-flex{
    padding: 10px 0;
}

/* Responsive */
@media (max-width: 780px) {
    .cont-imagen{
        width: 100%;
    }
    .investigacion{
        flex-direction: column;
    }

    .contenedor-investigacion{
        width: 100%;
    }

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

    .intro-section > img{
        width: 70%;
        margin: 0 auto;
    }

    .imagen-seccion{
        width: 100%;
    }
}


.g4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }

/* Tarjetas Base */
.card {
    background: var(--papel);
    border-radius: var(--r);
    padding: 28px;
    box-shadow: var(--sombra);
    border: 1px solid var(--linea);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sombra-hover);
}

/* Etiquetas y Marcadores */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background: #eef6fc;
    color: var(--azul);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Marcadores de posición / Avatares */
.ph.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--linea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--marino);
    font-size: 0.8rem;
    margin: 0 auto 16px;
}

/* Variantes de Fondo de Sección */
.alt {
    background: var(--papel);
}

/* COLOR AZUL */
.dark, .banner {
    background: var(--marino);
    color: var(--papel);
}

.dark h1, .dark h2, .dark h3, .dark h4 {
    color: var(--papel);
}

.dark a {
    color: var(--amarillo);
}

.dark .eyebrow {
    color: var(--amarillo);
}

/* ==========================================================
   ANIMACIONES Y MOVIMIENTO REDUCIDO
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}