@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root{
  --bg: #bdecb6;              /* fondo general (cambialo a #ffffff si lo querés blanco) */
  --surface: #ffffff;         /* cards / tablas */
  --text: #1a1a1a;
  --muted: #555;
  --border: #d7d2c4;
  --link: #0b3d91;
  --link-hover: #072c68;

  --header-bg: #B1B882;       /* header */
  --header-border: #cfc7b5;
  --footer-bg: var(--header-bg);

  --radius: 12px;
  --maxw: 75ch;
}

*{ box-sizing: border-box; }

html{
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body{
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  overflow-y: scroll;
}

.wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* ===== Header ===== */
.site-header{
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
}

.header-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand{
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: .4px;
}

/* ===== Navegación principal ===== */
.site-nav{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a{
  text-decoration: none;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
}

.site-nav a:hover{ background: rgba(0,0,0,.06); }
.site-nav a.active{ background: rgba(0,0,0,.10); }

/* ===== Subnav UBA (Horarios / Materiales / Cronograma / Novedades) =====
   Importante: NO cambia font-weight al activar, para que no “salte” el layout.
*/
.site-header .subnav{
  max-width: none;
  width: 100%;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 0;
  padding-bottom: 10px;
  padding-left: 16px;
  padding-right: 16px;
  justify-content: center;
}

.site-header .subnav a{
  text-decoration: none;
  color: var(--link);

  /* ~15% más chico */
  font-size: 0.85rem;
  padding: 5px 8px;

  border-radius: 10px;

  /* borde fijo (evita saltos) */
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(255,255,255,.65);

  /* evita “botones gigantes” en desktop */
  flex: 0 1 180px;
  max-width: 220px;

  text-align: center;
  font-weight: 600; /* mismo peso siempre */
  white-space: normal;
  min-width: 0;
}

.site-header .subnav a.active{
  background: rgba(0,0,0,.08);
  border-color: rgba(0,0,0,.18);
}

/* ===== Links ===== */
a{ color: var(--link); }
a:hover{ color: var(--link-hover); }

/* ===== Texto ===== */
.prose{ max-width: var(--maxw); }
.wide{ max-width: none; }
.uba-wide{ max-width: none; }
.muted{ color: var(--muted); }

h1,h2,h3{
  line-height: 1.25;
  margin: 0 0 10px 0;
}
h1{ font-size: 1.55rem; }
h2{ font-size: 1.25rem; }
p{ margin: 0 0 12px 0; }

/* ===== Cards ===== */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

/* ===== Grid ===== */
.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 900px){
  .grid{ grid-template-columns: 2fr 1fr; }
}

/* ===== Tablas ===== */
table{
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td{
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;

  /* ayuda a que textos largos no empujen el layout */
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
th{
  background: #ffffff;
  font-weight: 600;
}
tr:last-child td{ border-bottom: 0; }

/* ===== Responsive tables ===== */
.table-wrap{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Footer ===== */
.site-footer{
  margin-top: 24px;
  border-top: 1px solid var(--header-border);
  background: var(--footer-bg);
}

/* ===== Mobile ===== */
@media (max-width: 520px){
  html{ font-size: 16px; }
  .wrap{ padding: 12px; }
  .site-nav a{ padding: 6px 8px; }

  /* Menú principal: scroll horizontal */
  .site-nav{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .site-nav a{ white-space: nowrap; }

  /* Subnav UBA: 2 columnas, sin scroll */
  .site-header .subnav{
    padding-left: 12px;
    padding-right: 12px;
  }
  .site-header .subnav a{
    flex: 1 1 calc(50% - 10px);
    max-width: none;
  }

  h1{ font-size: 1.35rem; }
  h2{ font-size: 1.15rem; }
}

@media (max-width: 380px){
  .site-header .subnav a{ flex: 1 1 100%; }
}

/* ===== Ajuste final tablas UBA (alineación consistente en mobile) ===== */
.card{
  max-width: 100%;
  overflow-x: hidden;
}

.table-wrap{
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Fuerza la misma distribución de columnas en Teóricos / Seminarios / Prácticos */
.tabla-horarios{
  table-layout: fixed;
}

.tabla-horarios th,
.tabla-horarios td{
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* ===== Fuente responsive para tablas ===== */
.tabla-horarios th,
.tabla-horarios td{
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  line-height: 1.3;
}