/* =============================================================
   FONT: Bricolage Grotesque
   ============================================================= */

/* latin-ext */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../fonts/BricolageGrotesque-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 700;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../fonts/BricolageGrotesque-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

/* =============================================================
   DESIGN TOKENS
   ============================================================= */

:root {
  --color-black: #000000;
  --color-warm-gray: #cacabc;
  --color-white: #ffffff;
  --color-cool-white: #f6f8fb;

  --bg-1: #f9f9f2;
  --bg-1-50: #f9f9f280; /* (50% opacidad) */
  --bg-2: #ffffdb; /* publicaciones */
  --bg-2-50: #ffffdb80; /* publicaciones (50% opacidad) */
  --bg-3: #d8eaf6; /* noticias */
  --bg-3-50: #d8eaf680; /* noticias (50% opacidad) */
  --bg-4: #d8d8d8; /* becas */
  --bg-4-50: #d8d8d880; /* becas (50% opacidad) */
}

/* =============================================================
   TYPOGRAPHY CLASSES  (espejo de estilos de texto de Figma)
   ============================================================= */

.header-1 {
  font-size: 36px;
  font-weight: 600;
  line-height: 85%;
  letter-spacing: -0.04em;
}

.header-2 {
  font-size: 30px;
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.03em;
}

.header-3 {
  font-size: 26px;
  font-weight: 700;
  line-height: 100%;
  letter-spacing: -0.02em;
}

.header-4 {
  font-size: 22px;
  font-weight: 700;
  line-height: 100%;
  letter-spacing: -0.02em;
}

.body-bold {
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
}

.body-medium {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.cuerpo-bold {
  font-size: 12px;
  font-weight: 700;
  line-height: 15px;
}

.cuerpo-medium {
  font-size: 12px;
  font-weight: 500;
  line-height: 14px;
}

.cuerpo-mini {
  font-size: 10px;
  font-weight: 500;
}

/* =============================================================
   TYPOGRAPHY — variantes responsive
   -s → solo móvil  (< 640px)
   -m → solo tablet (640px – 1023px)
   -l → solo desktop (≥ 1024px)
   ============================================================= */

@media (max-width: 639px) {
  .header-1-s { font-size: 36px; font-weight: 600; line-height: 85%; letter-spacing: -0.04em; }
  .header-2-s { font-size: 30px; font-weight: 700; line-height: 110%; letter-spacing: -0.03em; }
  .header-3-s { font-size: 26px; font-weight: 700; line-height: 100%; letter-spacing: -0.02em; }
  .header-4-s { font-size: 22px; font-weight: 700; line-height: 100%; letter-spacing: -0.02em; }
  .body-bold-s     { font-size: 16px; font-weight: 700; line-height: 20px; }
  .body-medium-s   { font-size: 14px; font-weight: 500; line-height: 20px; }
  .cuerpo-bold-s   { font-size: 12px; font-weight: 700; line-height: 15px; }
  .cuerpo-medium-s { font-size: 12px; font-weight: 500; line-height: 14px; }
  .cuerpo-mini-s   { font-size: 10px; font-weight: 500; }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .header-1-m { font-size: 36px; font-weight: 600; line-height: 85%; letter-spacing: -0.04em; }
  .header-2-m { font-size: 30px; font-weight: 700; line-height: 110%; letter-spacing: -0.03em; }
  .header-3-m { font-size: 26px; font-weight: 700; line-height: 100%; letter-spacing: -0.02em; }
  .header-4-m { font-size: 22px; font-weight: 700; line-height: 100%; letter-spacing: -0.02em; }
  .body-bold-m     { font-size: 16px; font-weight: 700; line-height: 20px; }
  .body-medium-m   { font-size: 14px; font-weight: 500; line-height: 20px; }
  .cuerpo-bold-m   { font-size: 12px; font-weight: 700; line-height: 15px; }
  .cuerpo-medium-m { font-size: 12px; font-weight: 500; line-height: 14px; }
  .cuerpo-mini-m   { font-size: 10px; font-weight: 500; }
}

@media (min-width: 1024px) {
  .header-1-l { font-size: 36px; font-weight: 600; line-height: 85%; letter-spacing: -0.04em; }
  .header-2-l { font-size: 30px; font-weight: 700; line-height: 110%; letter-spacing: -0.03em; }
  .header-3-l { font-size: 26px; font-weight: 700; line-height: 100%; letter-spacing: -0.02em; }
  .header-4-l { font-size: 22px; font-weight: 700; line-height: 100%; letter-spacing: -0.02em; }
  .body-bold-l     { font-size: 16px; font-weight: 700; line-height: 20px; }
  .body-medium-l   { font-size: 14px; font-weight: 500; line-height: 20px; }
  .cuerpo-bold-l   { font-size: 12px; font-weight: 700; line-height: 15px; }
  .cuerpo-medium-l { font-size: 12px; font-weight: 500; line-height: 14px; }
  .cuerpo-mini-l   { font-size: 10px; font-weight: 500; }
}

/* =============================================================
   HEADER — mobile first
   ============================================================= */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--header-bg, var(--bg-1-50));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding-top: var(--header-padding-top);
  padding-bottom: var(--header-padding-bottom);
  transition: padding 0.4s ease;

  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

/* ── Logo ────────────────────────────────────────────────────── */
.header__logo {
  display: block;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
}

.header__logo-mobile {
  height: var(--logo-height);
  width: auto;
}

.header__logo-svg {
  display: none;
}

/* ── Right side (nav + lang) ─────────────────────────────────── */
.header__right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.site-nav__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Language selector ───────────────────────────────────────── */
.header__lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  background-color: var(--color-black);
  color: var(--color-cool-white);
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

.header__lang-btn:hover {
  background-color: var(--color-warm-gray);
}

/* =============================================================
   SCROLLED STATE
   ============================================================= */

.site-header.is-scrolled {
  --header-padding-top: 10px;
  --header-padding-bottom: 10px;
}

/* =============================================================
   TABLET  ≥ 640px
   ============================================================= */
@media (min-width: 640px) {
  .site-header {
    padding-top: var(--header-padding-top);
    padding-bottom: var(--header-padding-bottom);
  }

  .header__logo-mobile {
    display: none;
  }

  .header__logo-svg {
    display: block;
    height: var(--logo-height);
    width: var(--logo-width);
    transition: width 0.4s ease;
  }

  .logo-part--right {
    transition: transform 0.4s ease;
    transform: translateX(0px);
  }

  .logo-part--rect {
    transition: width 0.4s ease;
    width: 157.7px;
  }

  .header__right {
    gap: 14px;
  }

  .site-nav__list {
    gap: 10px;
  }

  .header__lang-btn {
    padding: 6px;
  }

  /* =============================================================
   SCROLLED STATE
   ============================================================= */

  .site-header.is-scrolled .header__logo-svg {
    width: var(--logo-height);
  }

  .site-header.is-scrolled .logo-part--right {
    transform: translateX(-106px);
  }

  .site-header.is-scrolled .logo-part--rect {
    width: 51px;
  }
}

/* =============================================================
   SIDE MENU — menú lateral fijo en la esquina inferior izquierda
   ============================================================= */

.side-menu {
  position: fixed;
  bottom: 16px;
  left: 10px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* ── Nav list wrapper (scrollable) ─────────────────────────── */
.side-menu__list-wrapper {
  overflow-y: auto;
  max-height: calc(100dvh - var(--header-height) - 60px);
  scrollbar-width: thin;
  scrollbar-color: var(--color-black) transparent;
}

.side-menu__list-wrapper::-webkit-scrollbar {
  width: 3px;
}

.side-menu__list-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--color-black);
}

.side-menu__list-wrapper::-webkit-scrollbar-track {
  background-color: transparent;
}

/* ── Main list ──────────────────────────────────────────────── */
.side-menu__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Parent items ───────────────────────────────────────────── */
.side-menu__item {
  display: flex;
}

/* Items con hijos: los hijos aparecen debajo del enlace padre.
   El anclaje bottom: fijo hace que el padre suba al expandirse. */
.side-menu__item.has-children {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

/* ── Sub-menu ───────────────────────────────────────────────── */
.side-menu__sub {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-menu__sub-item {
  display: flex;
}

/* Hijos en gris, hover invierte a negro */
.side-menu__sub-item .btn-dark {
  background-color: var(--color-warm-gray);
  color: var(--color-black);
}

.side-menu__sub-item .btn-dark:hover,
.side-menu__sub-item .btn-dark.current-menu-item {
  background-color: var(--color-black);
  color: var(--color-cool-white);
}

/* ── Social links ───────────────────────────────────────────── */
.side-menu__social {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ── Label truncation (accesibilidad: aria-label en el enlace) ─ */
.label-short {
  display: none;
}

/* =============================================================
   TABLET  ≥ 640px
   ============================================================= */
@media (min-width: 640px) {
  .side-menu {
    bottom: 20px;
    left: 20px;
  }

  /* Mostrar sub-menú al hacer hover (solo tablet/desktop) */
  .side-menu__item.has-children:hover > .side-menu__sub {
    display: flex;
  }
}

/* =============================================================
   SCROLLED STATE — mostrar solo primeras letras
   ============================================================= */
.side-menu.is-scrolled .label-full {
  display: none;
}

.side-menu.is-scrolled .label-short {
  display: inline;
}

/* =============================================================
   FOOTER — mobile first
   ============================================================= */

.site-footer {
  background-color: var(--color-black);
  color: var(--color-white);
  padding-block: 48px;
}

/* ── Inner wrapper ───────────────────────────────────────────── */
.footer__inner {
  display: grid;
  gap: 48px;
}

/* ── Nav: stacked single column on mobile ────────────────────── */
.footer__nav {
  display: grid;
  gap: 40px;
}

/* ── Column ──────────────────────────────────────────────────── */
.footer-col-contact {
  grid-row: 4;
}

.footer-col-social {
  display: none;
}

.footer-col__title {
  display: block;
  text-transform: uppercase;
  color: var(--color-white);
  text-decoration: none;
  margin-bottom: 8px;
}

.footer-col__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.footer-col__item a,
.footer-col__item span {
  color: var(--color-white);
  text-decoration: none;
}

.footer-col__item a:hover {
  text-decoration: underline;
}

/* Address and phone shown below the sub-list */
.footer-col__address {
  font-style: normal;
  color: var(--color-white);
  margin-top: 20px;
}

.footer-col__phone {
  color: var(--color-white);
  margin-bottom: 0;
}

.footer-col__phone a {
  text-decoration: none;
}

/* ── Logos ───────────────────────────────────────────────────── */
.footer__logos {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer__logos img {
  height: 77px;
  width: auto;
  flex-shrink: 1;
  min-width: 0;
}

.footer__logos img:first-child {
  border-right: 1px solid var(--color-white);
  padding-right: 16px;
}

/* =============================================================
   TABLET  ≥ 640px
   ============================================================= */
@media (min-width: 640px) {
  .site-footer {
    padding-top: 64px;
    padding-bottom: 56px;
  }

  .footer__inner {
    gap: 56px;
  }

  .footer__nav {
    grid-template-columns: repeat(4, 1fr);
    column-gap: 24px;
    row-gap: 32px;
  }

  .footer-col {
    min-width: 0;
  }

  .footer-col-contact {
    grid-row: 1;
    grid-column: 4;
  }

  .footer__logos {
    max-width: 60%;
    gap: 32px;
    margin-left: auto;
  }

  .footer__logos img:first-child {
    padding-right: 32px;
  }
}

/* =============================================================
   DESKTOP  ≥ 1024px
   ============================================================= */
@media (min-width: 1024px) {
  .site-footer {
    padding-top: 100px;
    padding-bottom: 96px;
  }

  .footer__inner {
    gap: 80px;
  }

  .footer__nav {
    grid-template-columns: repeat(5, 1fr);
    column-gap: 40px;
  }

  .footer-col-contact {
    grid-column: 1;
  }

  .footer-col-contact .footer-col__list {
    display: none;
  }

  .footer-col__address {
    margin-top: 0;
  }

  .footer-col-social {
    display: block;
  }
}

