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

html {
    scroll-behavior: smooth;
}

:root {
    /* Colores */
    --crema: #f5f5f1;
    --blanco: #ffffff;
    --celeste: #5bc0cc;
    --celeste-claro: rgba(91, 192, 204, 0.4);
    --azul-oscuro: #1a355c;
    --azul-mult: rgba(26, 53, 92, 0.3);

    /* Escala tipográfica */
    --base: 16px;
    --h1: calc(var(--base) * 3);
    --h2: calc(var(--base) * 2.5);
    --h3: calc(var(--base) * 2);
    --h4: calc(var(--base) * 1.75);
    --h5: calc(var(--base) * 1.4);
    --h6: calc(var(--base) * 1.2);
    --micro: calc(var(--base) * 0.8);

    /* Familias */
    --font-sans: 'Work Sans', system-ui, sans-serif;
    --font-serif: "Source Serif 4", 'Georgia', serif;

    /* Interlineados */
    --line-height-default: 1.3em;
    --line-height-spaced: 1.5em;
    --line-height-tight: 1em;
    --tracking-spaced: 0.05em;

    /* Botones */
    --btn-padding: 10px;
    --btn-radius: 8px;
    --btn-border: solid 1px var(--azul-oscuro);
    --btn-transition: all 0.3s ease;

    /*Tarjetas*/
    /* The widths below subtract the total horizontal gap so that
       3 (or 2) cards + gaps always exactly fill the track width. */
    --card-gap: 24px;
    --card-w-desktop: calc((100% - 2 * var(--card-gap)) / 3); /* 3 cards */
    --card-w-tablet: calc((100% - 1 * var(--card-gap)) / 2);  /* 2 cards */
    --card-w-mobile: 100%;
}

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

body {
    font-family: 'Work Sans', system-ui, sans-serif;
    font-size: var(--base);
    font-weight: 400;
    line-height: 1.3em;
    font-style: normal;
    color: var(--azul-oscuro);
    background-color: var(--crema);
    text-wrap: pretty;
    font-variation-settings: 'opsz' 16;
}
h1 {
    font-family: var(--font-sans);
    font-size: var(--h1);
    font-weight: 300;
    line-height: var(--line-height-default);
}

h2 {
    font-family: var(--font-sans);
    font-size: var(--h2);
    font-weight: 300;
    line-height: var(--line-height-default);
}

h3 {
    font-family: var(--font-sans);
    font-size: var(--h3);
    font-weight: 500;
    line-height: var(--line-height-default);
}

h4 {
    font-family: var(--font-sans);
    font-size: var(--h4);
    font-weight: 500;
    line-height: var(--line-height-default);
}

h5 {
    font-family: var(--font-sans);
    font-size: var(--h5);
    font-weight: 700;
    line-height: var(--line-height-default);
}

h6 {
    font-family: var(--font-sans);
    font-size: var(--h6);
    font-weight: 600;
    line-height: var(--line-height-default);
    font-variant: small-caps;
    letter-spacing: var(--tracking-spaced);
}

.base-source {
    font-family: var(--font-serif);
    font-size: var(--base);
    font-weight: 400;
    line-height: var(--line-height-default);
}

.h1-source {
    font-family: var(--font-serif);
    font-size: var(--h1);
    font-weight: 400;
    line-height: var(--line-height-default);
}

.h2-source {
    font-family: var(--font-serif);
    font-size: var(--h2);
    font-weight: 500;
    line-height: var(--line-height-default);
}

.h4-source {
    font-family: var(--font-serif);
    font-size: var(--h4);
    font-weight: 400;
    line-height: var(--line-height-default);
}

.micro {
    font-family: var(--font-sans);
    font-size: var(--micro);
    font-weight: 400;
    line-height: var(--line-height-tight);
    font-variant: small-caps;
    letter-spacing: var(--tracking-spaced);
}

.btn {
    font-family: var(--font-sans);
    font-size: var(--h6);
    font-weight: 400;
    line-height: var(--h6);
    background-color: transparent;
    color: var(--azul-oscuro);
    border: var(--btn-border);
    padding: var(--btn-padding);
    border-radius: var(--btn-radius);
    cursor: pointer;
    transition: var(--btn-transition);
    align-self: flex-start;

}

.btn:hover {
    background-color: var(--azul-oscuro);
    color: var(--blanco);
    transform: translateX(20px);
}

.btn--filled {
    font-weight: 600;
    background-color: var(--crema);
}

header {
    top: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--azul-oscuro);
    width: 100%;
    overflow: hidden;
    position: absolute;
    z-index: 99;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.logo {
    display: block;
    padding: 20px;
}

.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 48px;
    height: 48px;
    padding: 12px;
    margin-right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--crema);
    transition: color 0.3s ease;
}

.burger:hover {
    color: var(--celeste);
}

.burger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

header.nav-open .burger-line:nth-child(2) {
    opacity: 0;
}

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

.logo img{
    height: auto;
    width: 400px;
}

hr {
    border: 0;
    height: 0.5px;
    background-color: var(--crema);
}

.hr-azul {
    border: 0;
    height: 0.5px;
    background-color: var(--azul-oscuro);
}

nav {
    display: flex;
    width: 100%;
    font-weight: 400;
    justify-content: space-around;
    font-size: var(--base);
    text-transform: uppercase;
    padding: 10px 20%;
    letter-spacing: var(--tracking-spaced);
    align-self: center;
}

nav a {
    color: var(--celeste);
    transition: all 500ms ease;
}

nav a:hover {
    color: var(--crema)
}


/* Tablet */

@media (max-width: 1000px) { 
    nav {
        padding: 10px 12%;
    }
 }

/* Mobile */

@media (max-width: 768px) { 
    .header-top {
        justify-content: space-between;
    }

    .burger {
        display: flex;
    }

    nav {
        display: none;
        flex-direction: column;
        padding: 20px;
        gap: 8px;
        border-top: 1px solid rgba(245, 245, 241, 0.2);
    }

    nav a {
        padding: 12px 0;
        font-size: var(--h6);
    }

    header.nav-open nav {
        display: flex;
    }

    header {
        position: static;
    }
 }

 section {
    padding: 40px;
 }
 

 #hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 100svh;   /* or height: 100vh; */
    background-color: var(--celeste);
    padding-top: 204px;
    top: 0;
 }

#hero-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10svh;
}

 #hero-text {
    width: 50vw;
    font-size: 2.5em;
 }


 #hero-text span {
    font-variant: small-caps;
 }

#hero-btn {
    margin-top: auto;
    align-self: flex-start;
}

 #hero-btn span {
    vertical-align: -2px;
}

#hero-svg img{
    display: block;
    width: 200px;
    height: auto;
}

  /* ─── Carousel Wrapper ───────────────────────────── */
  .carousel-section {
    width: 100%;
    overflow: hidden;
  }

  .carousel-track {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: var(--card-gap);
    cursor: pointer;
  }

  .carousel-track::-webkit-scrollbar {
    display: none;
  }

  /* ─── Cards ──────────────────────────────────────── */
  .card {
    flex: 0 0 var(--card-w-desktop);
    min-width: var(--card-w-desktop);
    scroll-snap-align: start;
    background: var(--celeste-claro);
    border: 1px solid var(--azul-oscuro);
    padding: 3rem 2.5rem 3.5rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: background 0.3s ease;
    position: relative;
    overflow: hidden;
  }


  .card:hover {
    background: var(--celeste);
  }

  .card:hover::before {
    transform: scaleX(1);
  }

  .card-title {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 400;
    line-height: 1.25;
    color: var(--azul-oscuro);
  }

  .card-body {
    font-size: 0.8rem;
    line-height: var(--line-height-spaced);
    color: var(--azul-oscuro);
    flex-grow: 1;
  }
 
.section-title {
    font-variant: small-caps;
    font-weight: 600;
}


  /* ─── Tablet ─────────────────────────────────────── */
  @media (max-width: 1000px) {
    .card {
      flex: 0 0 var(--card-w-tablet);
      min-width: var(--card-w-tablet);
    }
  }

  /* ─── Mobile ─────────────────────────────────────── */
  @media (max-width: 600px) {
    .card {
      flex: 0 0 var(--card-w-mobile);
      min-width: var(--card-w-mobile);
    }

    .carousel-header {
      flex-direction: column;
      gap: 0.5rem;
    }
  }

  .fecha-tarjeta-noticias {
    display: flex;
    flex-direction: row;    
    align-items: center;
    flex: 1;
    gap: 12px;
  }

  .fecha-tarjeta-noticias .line-container {
    flex: 1;
    height: 2;
    background: var(--azul-oscuro);
  }

#lista-eventos {
    display: flex;
    flex-direction: column;
}

.evento-card {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 2rem;
    border-bottom: 1px solid var(--azul-oscuro);
    flex: 1;
    gap: 2rem;
}

.evento-card:last-child {
    border-bottom: none;

}

.evento-card:hover {
    background-color: var(--celeste-claro)
}

.evento-img {
    flex: 2;
    background-color: var(--azul-oscuro);
    aspect-ratio: 16/9;
    border-radius: 8px;
}

.evento-txt {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 3;
}

.tit-evento-card {
    font-family: var(--font-serif);
    font-weight: 400;
}

.btn--micro {
    font-size: var(--micro);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: var(--tracking-spaced);
    padding: 6px;
    color: var(--crema);
    background-color: var(--azul-oscuro);
}

.btn--micro:hover {
    color: var(--azul-oscuro);
    background-color: var(--crema);
    transform: translateX(0);
}

.data-evento-card {
    font-size: var(--h6);
}

.evento-link {
    width: auto;
}

.evento-txt .evento-link a {
    font-size: var(--h6);
    text-transform: uppercase;
    width: auto;
    position: relative;
}



.evento-txt a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: var(--azul-oscuro);
    transition: width 300ms ease-in;
}


.evento-card:hover .evento-txt a::after {
    width: 100%;
}

footer {
    display: flex;
    flex-direction: column;
    background-color: var(--celeste);
    padding: 20px 40px;
    border-top: 1px solid var(--azul-oscuro);
}

.footer-l1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#footer-logo img {
    max-width: 40vw;
}

.footer-l2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
}

.footer-l3 {
    display: flex;
    width: 100%;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 40px 0;
    border-top: 1px solid var(--azul-oscuro);
}

.footer-l3 img {
    max-height: 40px;
}

.footer-l3 img:last-child {
    max-height: 35px;
}


/* ─── Responsive layout tweaks ───────────────────────── */

@media (max-width: 1000px) {
    section {
        padding: 32px 24px;
    }

    #hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 3rem;
        padding-top: 40px;
    }

    #hero-text {
        width: 100%;
        font-size: 2rem;
    }

    #hero-svg img {
        display: none;
    }
    
}

@media (max-width: 768px) {
    section {
        padding: 24px 20px;
    }

    .logo img {
        width: 260px;
    }

    .evento-card {
        flex-direction: column;
        padding: 1.5rem 1rem;
    }

    .evento-img {
        width: 100%;
    }

    .footer-l1 {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .footer-l3 {
        flex-wrap: wrap;
        padding: 24px 0 0 0;
        gap: 16px;
        justify-content: center;
    }

    #footer-logo img {
        max-width: 80vw;
    }

    #hero-svg img {
        display:none;
    }
}

#investigacion {
    padding: 204px 60px 0 60px;
}

.tit-seccion {
    padding-bottom: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--azul-oscuro);
}

#investigacion span {
    font-weight:600;
    text-transform: uppercase;
}



.linea-card {
    display: flex;
    flex-direction: row;
    justify-content: left;
    padding: 2rem;
    border-bottom: 1px solid var(--azul-oscuro);
    gap: 10vw;
}

.linea-img{
    max-width: 150px;
}

.linea-txt {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
}

.linea-card:last-child {
    border-bottom: none;
}

#publicaciones {
    padding: 60px;
}

.pub-card {
    display: flex;
    flex: 1;
    border-bottom: 1px solid var(--azul-oscuro);
    padding-top: 30px;
}

.pub-card:last-child {
    border-bottom: none;
}

.pub-title {
    flex: 2;
    font-size: var(--h4);
    font-weight:500
}

.pub-txt {
    display:flex;
    flex-direction: column;
    gap: 5px;
    flex: 3;
    align-self: baseline;
    transition: all 300ms ease-in-out;
}

.pub-txt a:hover {
    font-weight: 600;
    text-decoration: underline;
}

.pub-txt a {
    padding-bottom: 20px;
}

/* ─── About page responsive tweaks ───────────────────── */

@media (max-width: 1000px) {
    #investigacion {
        padding: 160px 24px 0 24px;
    }

    #publicaciones {
        padding: 40px 24px;
    }

    .linea-card {
        padding: 1.5rem 0;
        gap: 5vw;
    }
}

@media (max-width: 768px) {
    #investigacion {
        padding: 140px 20px 0 20px;
    }

    #publicaciones {
        padding: 32px 20px 60px 20px;
    }

    .linea-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 0;
        gap: 1.5rem;
    }

    .linea-img {
        max-width: 120px;
    }

    .pub-card {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pub-title {
        margin-bottom: 0.5rem;
    }

    .pub-txt a {
        padding-bottom: 12px;
    }
}
