*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --azul: #1a2d6b;
  --azul-hover: #142258;
  --amarillo: #f5c200;
  --rojo: #c0202a;
  --gris-claro: #f5f5f5;
  --gris-borde: #e0e0e0;
  --texto: #333;
  --blanco: #ffffff;
  --nav-h: 52px;
}

body {
  font-family: 'Lato', sans-serif;
  color: var(--texto);
  background: linear-gradient(135deg, rgba(205,226,250,0.98), rgba(237,246,255,0.98) 44%, rgba(198,220,248,0.96));
  font-size: 15px;
  line-height: 1.7;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-borde);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
  overflow: visible;
}

.nav-wrapper {
  background: var(--blanco);
  border-radius: 0 0 18px 18px;
}

.nav-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  height: var(--nav-h);
  padding: 0 18px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 18px;
  padding: 5px 0;
}

.logo-image {
  width: auto;
  height: 42px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(17%) sepia(40%) saturate(2261%) hue-rotate(210deg) brightness(86%) contrast(94%);
}

.logo-icon { width: 38px; height: 46px; flex-shrink: 0; }

.logo-text-block { display: flex; flex-direction: column; line-height: 1.25; }
.logo-text-block .line1 { font-size: 11px; font-weight: 700; color: var(--azul); }
.logo-text-block .line2 { font-size: 11px; font-weight: 400; color: var(--azul); }
.logo-text-block .line3 { font-size: 11px; font-weight: 700; color: var(--azul); }

nav { display: flex; align-items: stretch; height: 100%; margin-left: auto; }

.nav-item { position: relative; display: flex; align-items: stretch; }

.nav-item > a.icon-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 14px;
  color: var(--azul);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  min-width: 68px;
}

.nav-icon svg { width: 17px; height: 17px; }
.nav-label { font-size: 12px; line-height: 1.1; }

.nav-item > a.icon-link:hover { background: #e8edf7; color: var(--azul); }
.nav-item.active > a.icon-link { background: var(--azul); color: var(--blanco); }

.nav-icon { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; }
.nav-label { font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.2; }

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--blanco);
  border: 1px solid var(--gris-borde);
  border-top: 3px solid var(--azul);
  min-width: 230px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.13);
  z-index: 300;
}

.nav-item:hover .dropdown { display: block; }

.dropdown li a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--texto);
  border-bottom: 1px solid #f0f0f0;
  font-weight: 400;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}

.dropdown li a:hover {
  background: var(--gris-claro);
  color: var(--azul);
  padding-left: 24px;
}

main {
  max-width: 1180px;
  margin: 34px auto 72px;
  padding: 48px 42px 62px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(235,244,255,0.9)),
    var(--blanco);
  border: 1px solid rgba(26,45,107,0.08);
  box-shadow: 0 20px 55px rgba(26,45,107,0.13);
  position: relative;
  overflow: hidden;
}

main::before {
  content: "";
  position: absolute;
  top: 28px;
  right: 32px;
  width: min(32%, 340px);
  height: 180px;
  border-radius: 24px;
  background:
    linear-gradient(0deg, rgba(26,45,107,0.08), rgba(26,45,107,0.08)),
    url("../images/colegio-portada.jpg") center/cover;
  box-shadow: 0 14px 34px rgba(26,45,107,0.16);
}

main > * {
  position: relative;
  z-index: 1;
}

.page-title {
  font-family: 'Merriweather', serif;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700;
  color: var(--azul);
  text-align: left;
  margin-bottom: 10px;
  max-width: 62%;
}

.page-title-line {
  width: 48px;
  height: 3px;
  background: var(--azul);
  margin: 0 0 40px;
  border-radius: 2px;
}

.tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--gris-borde);
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 4px;
}

.tab-btn {
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--azul);
  background: var(--gris-claro);
  border: 1px solid var(--gris-borde);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: 'Lato', sans-serif;
}

.tab-btn:hover { background: #dde4f5; }
.tab-btn.active { background: var(--azul); color: var(--blanco); border-color: var(--azul); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.info-block { margin-bottom: 28px; }
.info-block p { margin-bottom: 12px; font-size: 14px; color: #444; text-align: left; }

.info-block .niveles { font-size: 14px; font-weight: 700; color: var(--texto); margin-bottom: 16px; text-align: left; }

.info-block a,
.sae-block a {
  color: var(--azul);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.info-block a:hover,
.sae-block a:hover { color: var(--rojo); }

.link-list { list-style: disc; padding-left: 20px; margin-bottom: 20px; }
.link-list li { margin-bottom: 6px; font-size: 14px; }

.fechas-wrapper { margin: 48px -24px; position: relative; }

.fechas-card {
  background: #ffffff;
  position: relative;
  overflow: hidden;
  padding: 40px 48px 48px;
  border-radius: 0;
}

.fechas-card::before {
  content: '';
  position: absolute;
  top: -60px; left: -60px;
  width: 180px; height: 180px;
  background: #a8d8ea;
  border-radius: 50%;
  opacity: 0.55;
}

.fechas-card::after {
  content: '';
  position: absolute;
  bottom: -50px; right: -50px;
  width: 160px; height: 160px;
  background: var(--azul);
  border-radius: 50%;
  opacity: 0.55;
}

.deco-dot-tr {
  position: absolute;
  top: 28px; right: 40px;
  width: 36px; height: 36px;
  background: var(--azul);
  border-radius: 50%;
  z-index: 1;
}

.deco-blob-bl {
  position: absolute;
  bottom: -30px; left: 60px;
  width: 90px; height: 90px;
  background: #a8d8ea;
  border-radius: 50%;
  opacity: 0.45;
  z-index: 1;
}

.fechas-titulo {
  font-family: 'Merriweather', serif;
  font-size: 30px;
  font-weight: 900;
  color: var(--azul);
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  z-index: 2;
}

.fechas-table-wrap {
  position: relative;
  z-index: 2;
  overflow-x: auto;
}

table.fechas {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border: 1px solid #bbb;
}

table.fechas thead th {
  background: #dde5f4;
  color: var(--azul);
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #bbb;
}

table.fechas tbody tr { background: #fff; }

table.fechas tbody tr:hover { background: #f0f4fb; }

table.fechas tbody td {
  padding: 9px 16px;
  border: 1px solid #ccc;
  vertical-align: middle;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
}

table.fechas tbody td:first-child {
  font-weight: 400;
  color: #333;
  text-align: center;
  width: 190px;
  white-space: nowrap;
}

.sae-block {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--gris-borde);
}

.sae-block h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--azul);
  margin-bottom: 12px;
}

.sae-block p {
  font-size: 14px;
  color: #555;
  margin-bottom: 4px;
}

footer {
  background: #111;
  padding: 16px 24px;
  color: #fff;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-inner p { font-size: 12px; color: rgba(255,255,255,0.8); }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

.footer-links a { font-size: 12px; color: rgba(255,255,255,0.86); }

.footer-links a:hover { color: #fff; }

.footer-practicas {
  color: #111;
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-weight: 700;
  font-size: 12px;
}

.fechas-image {
  width: 100%;
  max-width: 700px;
  margin: 40px auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .tabs-nav { gap: 2px; }
  .tab-btn { padding: 8px 14px; font-size: 12px; }
  main {
    margin: 24px 14px 52px;
    padding: 32px 18px 50px;
    border-radius: 22px;
  }

  main::before {
    position: relative;
    display: block;
    inset: auto;
    width: 100%;
    height: 180px;
    margin-bottom: 24px;
  }

  .page-title {
    max-width: none;
  }
}

/* Header unificado con el resto de la web */
:root {
  --nav-h: 64px;
}

.nav-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--nav-h);
  padding: 0 18px;
  gap: 26px;
}

.logo {
  justify-content: center;
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0;
}

.logo-image {
  height: 50px;
}

.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  color: var(--azul);
  font-size: 28px;
  cursor: pointer;
  padding: 10px;
}

.nav-menu {
  display: contents;
}

.nav-group {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 14px;
  margin-left: 0;
}

.nav-left {
  grid-column: 1;
  justify-content: flex-end;
}

.nav-right {
  grid-column: 3;
  justify-content: flex-start;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-item > a.icon-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  min-width: 0;
  gap: 2px;
  padding: 0 16px;
  color: var(--azul);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border-radius: 12px;
}

.nav-item > a.icon-link:hover,
.nav-item.active > a.icon-link {
  background: var(--azul);
  color: var(--blanco);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.dropdown-arrow {
  font-size: 12px;
  line-height: 1;
}

.nav-right .dropdown {
  left: auto;
  right: 0;
}

.dropdown {
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}

.nav-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-toggle {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--azul);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-toggle svg {
  width: 20px;
  height: 20px;
}

.search-form {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--blanco);
  padding: 10px;
  border: 1px solid var(--gris-borde);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.14);
  z-index: 310;
}

.nav-search.open .search-form {
  display: block;
}

.search-form input {
  width: 260px;
  padding: 10px 12px;
  border: 1px solid var(--gris-borde);
  border-radius: 10px;
  font: inherit;
}

@media (max-width: 900px) {
  header {
    position: static;
  }

  .nav-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    height: auto;
    padding: 0 16px;
  }

  .logo {
    grid-column: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .nav-menu {
    display: none;
    width: 100%;
    background: var(--blanco);
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--gris-borde);
  }

  .nav-menu.open {
    display: block;
  }

  .nav-group {
    flex-direction: column;
    gap: 10px;
    height: auto;
    width: 100%;
  }

  .nav-left,
  .nav-right {
    justify-content: flex-start;
  }

  .nav-item {
    width: 100%;
    display: block;
  }

  .nav-item > a.icon-link {
    width: 100%;
    padding: 12px 18px;
    border-radius: 6px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 8px;
    height: auto;
  }

  .dropdown {
    display: none;
    position: static;
    width: 100%;
    min-width: auto;
    margin: 6px 0 8px;
    padding: 6px 0;
    box-shadow: none;
    border-top: none;
    border-left: 4px solid var(--azul);
    background: #f7f8fb;
  }

  .nav-item:hover .dropdown {
    display: none;
  }

  .nav-item.open .dropdown {
    display: block;
  }

  .dropdown li a {
    padding: 10px 18px 10px 46px;
    color: var(--azul);
    font-size: 13px;
    font-weight: 700;
  }

  .nav-search {
    width: 100%;
    justify-content: flex-start;
  }

  .search-form {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .search-form input {
    width: 100%;
  }
}
