/* ─── Variables de Color y Tipografía Originales ─── */
:root {
  --paper: #f4f2ee;
  /* fondo cálido casi blanco */
  --ink: #0e0e0e;
  /* negro tipográfico */
  --mid: #888;
  --light: #d8d5cf;
  --gray-bg: #e8e5e0;

  --ff-display: 'Bebas Neue', sans-serif;
  --ff-serif: 'DM Serif Display', serif;
  --ff-mono: 'DM Mono', monospace;
}

/* ─── Reset Básico ─── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-mono);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ─── Ticker Superior ─── */
.ticker {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 7px 0;
  overflow: hidden;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 105;
  border-bottom: 1px solid var(--ink);
}

.ticker-inner {
  display: inline-block;
  animation: scroll-left 25s linear infinite;
}

.ticker-inner span {
  margin: 0 1.5rem;
}

@keyframes scroll-left {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* ─── Navbar Brutalista (Contenedores Fijos con Outline) ─── */
.navbar {
  width: 100%;
  background: var(--ink);
  border-bottom: 1px solid var(--ink);
  position: sticky;
  top: 29px;
  z-index: 100;
}

nav.nav-primary {
  display: flex;
  width: 100%;
}

/* Estilos de Celda Base */
.nav-block {
  flex: 1;
  min-height: 45px;
  display: flex;
  align-items: center;
  background: var(--paper);
  border-right: 1px solid var(--ink);
  padding: 10px 15px;
  position: relative;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-block:last-child {
  border-right: none;
}

/* Desencadenadores de Texto */
.nav-trigger,
.nav-label {
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: bold;
  color: var(--ink);
  text-transform: lowercase;
  cursor: pointer;
  margin-right: auto;
  transition: color 0.2s ease;
}

/* Efecto Hover para celdas DESPLEGABLES: Fondo negro, texto blanco */
.nav-block-dropdown:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-block-dropdown:hover .nav-trigger {
  color: var(--paper);
}

/* Efecto especial para que el puntito baje/aparezca mecánicamente al hacer hover */
.nav-block-dropdown:hover::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--paper);
  border-radius: 50%;
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  animation: dot-drop 0.25s forwards;
}

@keyframes dot-drop {
  0% {
    transform: translateY(-120%);
    opacity: 0;
  }

  100% {
    transform: translateY(-50%);
    opacity: 1;
  }
}

/* ─── Bloques Planos (No Desplegables) ─── */
a.nav-block-flat {
  text-decoration: none;
  font-family: var(--ff-mono);
  font-size: 1rem;
  font-weight: lighter;
  color: var(--ink);
  text-transform: lowercase;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: background 0.2s ease, color 0.2s ease;
}

/* Hover en Bloques Planos: Fondo negro, letras blancas */
a.nav-block-flat:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Efecto Click Activo / Página seleccionada permanente */
a.nav-block-flat:active,
a.nav-block-flat.active {
  background: var(--ink) !important;
  color: var(--paper) !important;
}

/* ─── Menú Desplegable Box (Conserva legibilidad interna) ─── */
.nav-links-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: -1px;
  width: calc(100% + 2px);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-top: none;
  z-index: 1000;
}

.nav-block-dropdown:hover .nav-links-menu {
  display: block;
}

.nav-links-menu a {
  font-family: var(--ff-mono);
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  padding: 12px 15px;
  border-bottom: 1px solid var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links-menu a:last-child {
  border-bottom: none;
}

.nav-links-menu a:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-links-menu a.active {
  font-weight: bold;
}

.nav-links-menu a span {
  font-size: 0.75rem;
}

/* ─── Estructura Principal con Contornos Negros Estilo FADU ─── */
.main-container {
  display: flex;
  flex: 1;
  background: var(--ink);
}

/* Columna 1: Sidebar Izquierdo */
.sidebar-left {
  width: 80px;
  border-right: 1px solid var(--ink);
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--paper);
}

.vertical-text {
  white-space: nowrap;
  transform: rotate(180deg);
  writing-mode: vertical-rl;
  font-family: var(--ff-display);
  font-size: 35px;
  letter-spacing: 2px;
  color: var(--ink);
  text-transform: lowercase;
}

/* Columna 2: Centro (Título) */
.content-middle {
  flex: 1.1;
  border-right: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  background: #edeae4;
  min-width: 635px;
}

@media screen and (max-width: 1300px) {
  .content-middle {
    padding: 2%;
  }
}

/* SOLUCIÓN AL CORTE: Forzamos a este contenedor a expandirse verticalmente */
.middle-top-wrapper {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: stretch;
  padding: 5%;
}

.middle-top {
  padding: 60px 40px;
  flex: 1;
}

.middle-top h1 {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 4.5vw, 4.5rem);
  line-height: 0.9;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.serif-italic {
  font-family: var(--ff-serif);
  font-style: italic;
  font-size: 1.8rem;
  text-transform: none;
  font-weight: normal;
  margin-top: -18px;
  margin-bottom: 25px;
}

.student-desc {
  margin-top: 90px;
}

.student-desc p {
  font-family: var(--ff-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: 460px;
  margin-bottom: 15px;
}

.student-desc p:last-child {
  margin-bottom: 0;
}

.side-avatar {
  width: 180px;
  border-left: none;
  background: #edeae4;
  /* Cambiado al fondo beige del texto para que el aire superior sea continuo */
  display: flex;
  padding-top: 60px;
}

.side-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08);
  display: block;
  align-self: stretch;
}

.side-avatar:hover img {
  filter: grayscale(0%) contrast(1);
  /* Desactiva el blanco y negro por completo */
  /* [cite: 4] */
}

.date {
  font-size: 0.75rem;
  color: var(--mid);
  letter-spacing: 0.1em;
}

.middle-bottom {
  margin-top: auto;
}

.slide-link {
  text-decoration: none;
  display: inline-block;
}

.slide-link:hover .slide-number {
  color: var(--ink);
}

.slide-number {
  padding: 40px 40px 20px 40px;
  font-family: var(--ff-mono);
  font-size: 1.2rem;
  color: var(--mid);
  transition: color 0.2s ease;
}

.plan-visit {
  background-color: #d8c9b1;
  color: var(--ink);
  padding: 35px 40px;
  font-family: var(--ff-display);
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  border-top: 1px solid var(--ink);
  transition: background-color 0.2s;
}

.plan-visit:hover {
  background-color: #cbbba1;
}

/* Columna 3: Derecha */
.content-right {
  flex: 1.4;
  display: flex;
  flex-direction: column;
  background: #edeae4;
  padding: 0; /* ◄ Cambiado de 5% a 0[cite: 2] */
  min-width: 635px;
}

/* Cuadrícula de Información */
.info-grid {
  background: #edeae4;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;

}

.info-item {
  padding: 20px;
}

.border-right {
  border-right: 1px solid var(--ink);
}

.border-bottom {
  border-bottom: 1px solid var(--ink);
}

.info-item h3 {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: var(--ink);
}

.info-meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--ink);
  line-height: 1.5;
}

.black-circle {
  width: 7px;
  height: 7px;
  background-color: var(--ink);
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

/* Contenedor de la Imagen Inferior */
.image-section {
  flex: 1;
  background: var(--gray-bg);
  overflow: hidden;
  border-top: 1px solid var(--ink);
}

.image-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.08);
}

/* ─── Footer Institucional Obligatorio ─── */
footer {
  background: var(--paper);
  color: var(--ink);
  border-top: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.footer-top {
  display: flex;
  border-bottom: 1px solid var(--ink);
}

.footer-brand {
  font-family: var(--ff-display);
  font-size: 3.5rem;
  line-height: 0.85;
  padding: 40px;
  border-right: 1px solid var(--ink);
  min-width: 220px;
  letter-spacing: 1px;
}

.footer-brand span {
  color: var(--mid);
}

.footer-datos {
  padding: 40px;
  flex: 1;
}

.footer-datos h4 {
  font-family: var(--ff-mono);
  font-size: 1rem;
  text-transform: uppercase;
  margin-bottom: 20px;
  letter-spacing: 1px;
  font-weight: bold;
}

.footer-datos p {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

.footer-legal {
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #eeeae3;
}

.footer-legal p {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: #555;
  max-width: 900px;
}

.footer-copy {
  display: flex;
  justify-content: space-between;
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--ink);
  border-top: 1px solid var(--light);
  padding-top: 15px;
}

.materias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  background: var(--gray);
}


.materia-card {
  /* background: var(--black); */
  padding: 1.5rem;
  transition: background 0.2s;
  position: relative;
  border: 1px solid var(--ink);
}

.materia-card-link {
    position: relative;
    border: 1px solid var(--ink);
    height: auto;
}

/* Equipos */


.equipos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  background: var(--gray);
}


.equipo-card {
  /* background: var(--black); */
  padding: 1.5rem;
  transition: background 0.2s;
  position: relative;
  border: 1px solid var(--ink);
}

.equipo-card-link {
    position: relative;
    border: 1px solid var(--ink);
    height: auto;
}

.materia-card-link .plan-visit {
  padding: 40px
}

/* .materia-card:hover { background: #111; } */

.materia-card .estado {
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 0.5rem;
}

.materia-card .estado.aprobada {
  color: var(--accent);
}

.materia-card .estado.en-curso {
  color: #f5a623;
}

.materia-card .nombre {
  font-family: var(--ff-mono); /* ◄ ¡Agregamos el punto y coma faltante aquí! */
  font-weight: bold;           /* ◄ Agregamos esto para que deje de ser light */
  font-size: 1.2rem;
  letter-spacing: 0.05em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.materia-card .anio {
  font-size: 0.65rem;
  color: var(--mid);
}

.dot-aprobada {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 6px;
}

.dot-en-curso {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f5a623;
  display: inline-block;
  margin-right: 6px;
}

/* ─── MATERIAS ──────────────────────────────── */
.materias-header {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  margin-bottom: 1rem;
}

.materias-title {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 4.5vw, 4.5rem);
  font-weight: bold; /* ◄ Cambiado de 'lighter' a 'bold' */
  line-height: 0.9;
  color: var(--white);
}

.materias-subtitle {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  font-family: var(--ff-mono);
}

/* 2. Le pasamos el padding al historial[cite: 2] */
.historial-academico-wrapper {
  padding: 5% 5% 0 5%; /* Mantiene el aire arriba y a los costados[cite: 2] */
  border-bottom: 1px solid var(--ink); /* ◄ Esta línea SÍ va a chocar de borde a borde[cite: 2] */
  padding-bottom: 3rem; /* Espacio antes de la línea */

}
.linea-divisoria {
  border: none;
  border-top: 1px solid var(--ink); /* Tu línea negra sólida */
  
  /* Esto obliga a la línea a medir el 100% del espacio disponible ignorando paddings */
  width: calc(100% + 10%); 
  margin-left: -5%;
  
  /* Espaciado vertical para separar las secciones */
  margin-top: 3rem;
  margin-bottom: 3rem;
}
/* ─── EQUIPO ──────────────────────────────── */
.equipo-header {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  margin-bottom: 1rem;
}

.equipo-title {
  font-family: var(--ff-display);
  font-size: clamp(3rem, 4.5vw, 4.5rem);
  font-weight: bold; /* ◄ Cambiado de 'lighter' a 'bold' */
  line-height: 0.9;
  color: var(--white);
}

.equipo-subtitle {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mid);
  font-family: var(--ff-mono);
}

/* Alinea el nombre a la izquierda y la flecha a la derecha en la misma altura */
.equipo-nombre-wrapper {
  display: flex;
  justify-content: space-between; /* Empuja el texto a la izquierda y la flecha a la derecha */
  align-items: center;           /* Los centra verticalmente en la misma altura */
  width: 100%;
}

.equipo-nombre-wrapper .nombre {
  font-family: var(--ff-mono);
  font-weight: bold;           /* ◄ Agregamos esto para unificar con las materias */
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  line-height: 1;
}

.equipo-nombre-wrapper span {
  font-family: var(--ff-mono);
  font-size: 1.4rem; /* Mismo tamaño que el nombre para que conserve la proporción */
  color: var(--ink);
  line-height: 1;
}

.equipo-wrapper {
  padding: 5%; /* Le da el mismo aire arriba, abajo y a los costados que el historial */
  padding-bottom: 5rem; /* Espacio extra al final antes del footer */
}

/* ─── DISEÑO RESPONSIVE ─── */
@media (max-width: 900px) {
  html {
    scroll-padding-top: 0;
  }

  .navbar {
    position: static;
  }

  nav.nav-primary {
    flex-direction: column;
  }

  .nav-block {
    border-right: none;
    border-bottom: 1px solid var(--ink);
    width: 100%;
  }

  .nav-links-menu {
    width: 100%;
    left: 0;
  }

  .main-container {
    display: grid;
    /* CAMBIADO: Ajustamos las proporciones elásticas (fr) del centro 
     para que las líneas calcen simétricas con los bloques de arriba */
    grid-template-columns: 80px 80px 1.05fr 180px 1.35fr;
    background: var(--ink);
    flex: 1;
  }

  .sidebar-left {
    width: 100%;
    height: 65px;
    border-right: none;
    border-bottom: 1px solid var(--ink);
    padding: 10px 0;
    align-items: center;
    padding-bottom: 0;
  }

  .vertical-text {
    transform: rotate(0);
    font-size: 2.2rem;
  }

  .middle-top-wrapper {
    flex-direction: column;
  }

  .side-avatar {
    width: 100%;
    height: 200px;
    border-left: none;
    border-bottom: 1px solid var(--ink);
  }

  .content-middle {
    border-right: none;
    border-bottom: 1px solid var(--ink);
  }

  .middle-top {
    padding: 40px 20px;
  }

  .slide-number {
    padding: 0 20px 15px 20px;
  }

  .plan-visit {
    padding: 25px 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .info-item.border-right {
    border-right: none;
  }

  .info-item:not(:last-child) {
    border-bottom: 1px solid var(--ink);
  }

  .image-section {
    height: 380px;
  }

  /* Responsive Footer */
  .footer-top {
    flex-direction: column;
  }

  .footer-brand {
    border-right: none;
    border-bottom: 1px solid var(--ink);
    padding: 20px;
  }

  .footer-datos {
    padding: 20px;
  }

  .footer-legal {
    padding: 20px;
  }

  .footer-copy {
    flex-direction: column;
    gap: 5px;
  }
}