/* Rediseño estructural v2 — Colegio San Alberto Hurtado */
:root {
  --navy: #071b2e;
  --navy-2: #0d2942;
  --orange: #ef641d;
  --orange-deep: #bd4510;
  --blue: #185b88;
  --paper: #f4f7fa;
  --paper-2: #e9eff5;
  --ink: #152334;
  --muted: #59697a;
  --line: rgba(7, 27, 46, .12);
  --white: #fff;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 18px 50px rgba(7, 27, 46, .13);
  --shadow-soft: 0 8px 24px rgba(7, 27, 46, .08);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 96px; }
body { background: var(--paper); color: var(--ink); line-height: 1.5; }
body.menu-abierto { overflow: hidden; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid #ffb27e; outline-offset: 3px; }

/* Cabecera */
.topbar { min-height: 34px; padding: 5px max(24px, calc((100vw - 1240px) / 2)); background: #041321; }
header.main {
  min-height: 84px;
  padding: 10px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 0;
  box-shadow: 0 4px 22px rgba(0,0,0,.18);
}
.brand { gap: 12px; }
.brand img { width: 58px !important; height: 64px !important; }
.brand .name .big { font-size: clamp(1rem, 1.5vw, 1.35rem); }
.brand .name .small { font-size: .7rem; letter-spacing: .08em; }
nav.primary { gap: 2px; }
nav.primary a { padding: 10px 12px; border-radius: 10px; font-size: .88rem; }
nav.primary a.cta { border-radius: 12px; padding-inline: 18px; }
.nav-dropdown { border-radius: 0 0 14px 14px; overflow: hidden; }

/* Hero realmente nuevo: panel editorial + fotografía */
.hero {
  width: calc(100% - clamp(24px, 3.2vw, 64px));
  min-height: 610px;
  margin: 34px auto 0;
  border-radius: var(--radius-lg);
  align-items: center;
  background: var(--navy);
  box-shadow: var(--shadow);
}
.hero-bg-img, .hero-bg-video {
  left: auto;
  right: 0;
  width: 58%;
  height: 100%;
  object-position: center;
}
.hero-overlay {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 39%, rgba(7,27,46,.9) 48%, rgba(7,27,46,.18) 76%, rgba(7,27,46,.05) 100%) !important;
}
.hero-content {
  width: 52%;
  max-width: 680px;
  padding: clamp(46px, 5vw, 76px);
  margin: 0;
}
.hero-content .eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(239,100,29,.16);
  border: 1px solid rgba(239,100,29,.45);
  color: #ff9b62;
  font-size: .79rem;
}
.hero-content h1 {
  max-width: 620px;
  margin-top: 18px;
  font-size: clamp(2.35rem, 4.2vw, 4.15rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.hero-content p { max-width: 560px; font-size: 1.05rem; color: #d7e0e8; }
.hero-actions { flex-wrap: wrap; }
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 21px;
  border-radius: 12px;
}
.btn-primary { box-shadow: 0 8px 22px rgba(239,100,29,.23); }
.btn:hover { transform: translateY(-2px); }

/* Accesos rápidos, nueva sección */
.accesos-rapidos {
  position: relative;
  z-index: 5;
  width: min(1120px, calc(100% - 72px));
  margin: -42px auto 72px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #fff;
  border-radius: 20px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.accesos-rapidos > a {
  min-width: 0;
  min-height: 86px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  border-right: 1px solid var(--line);
  transition: background .2s, transform .2s;
}
.accesos-rapidos > a:last-child { border-right: 0; }
.accesos-rapidos > a:hover { background: #eef4f8; transform: translateY(-2px); }
.accesos-rapidos .acceso-destacado { background: var(--orange); color: #fff; }
.accesos-rapidos .acceso-destacado:hover { background: var(--orange-deep); }
.acceso-icono {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e8f0f6;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 800;
}
.acceso-destacado .acceso-icono { background: rgba(255,255,255,.18); color: #fff; }
.accesos-rapidos strong, .accesos-rapidos small { display: block; }
.accesos-rapidos strong { font-size: .9rem; }
.accesos-rapidos small { margin-top: 2px; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.acceso-destacado small { color: rgba(255,255,255,.8); }

/* Destacados */
.bloque-destacados { width: min(500px, calc(100% - 48px)); margin: 0 auto 80px; }
.bloque-destacados { width: calc(100% - clamp(24px, 3.2vw, 64px)); }
.bloque-etiqueta {
  margin-bottom: 16px;
  color: var(--orange-deep);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.carousel-banners {
  width: 100%;
  max-width: none;
  height: 390px;
  margin: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.carousel-slide .cs-content { max-width: 650px; padding: 0 clamp(32px, 6vw, 78px); }
.carousel-slide h3 { font-size: clamp(1.8rem, 3vw, 2.7rem); text-wrap: balance; }
.carousel-slide p { font-size: 1rem; }
.carousel-arrows button { width: 46px; height: 46px; }
.carousel-dots button { min-width: 13px; min-height: 13px; }

/* Secciones */
section { padding: clamp(62px, 7vw, 100px) clamp(16px, 3.2vw, 60px); }
.section-head { max-width: 760px; margin-bottom: 42px; }
.section-head h2 { font-size: clamp(2rem, 3.7vw, 3rem); letter-spacing: -.025em; }
.section-head p { font-size: 1rem; color: var(--muted); }

/* Agenda visible, separada de Noticias */
.agenda-section { background: var(--navy); color: #fff; }
.agenda-section-head {
  width: min(1180px, 100%);
  margin: 0 auto 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}
.agenda-section-head h2 { margin: 5px 0 0; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); }
.agenda-section-head p { max-width: 430px; margin: 0; color: #b9c7d4; }
.agenda-kicker { color: #ff9b62; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.agenda-section .agenda-widget {
  width: min(1180px, 100%);
  margin: 0 auto;
  position: static;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: none;
}
.agenda-section .agenda-widget > h3 { display: none; }
.agenda-section .agenda-item {
  min-width: 0;
  margin: 0;
  padding: 18px;
  gap: 14px;
  align-items: center;
  border: 0;
  border-radius: 14px;
  background: #fff;
}
.agenda-section .agenda-fecha { background: var(--orange); }
.agenda-section .agenda-fecha .mes { color: #fff; }
.agenda-section .agenda-texto p { color: var(--ink); font-size: .9rem; }
.agenda-section .agenda-vertodos {
  grid-column: 1 / -1;
  width: max-content;
  min-width: 150px;
  margin: 4px auto 0;
  padding: 0 18px;
  color: #fff;
  background: rgba(255,255,255,.1);
}

/* Noticias con jerarquía editorial */
.noticias-layout { display: block; }
.noticias-principal { width: 100%; }
.noticias-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 24px); }
.noticia-card {
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  background: #fff;
}
.noticia-card:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr); }
.noticia-card:first-child .img { min-height: 330px; aspect-ratio: auto; }
.noticia-card:first-child .noticia-body { display: flex; flex-direction: column; justify-content: center; padding: 34px; }
.noticia-card:first-child h3 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.noticia-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.noticia-card .img { aspect-ratio: 16/9; }
.noticia-body { padding: 20px; }
.noticia-card h3 { font-size: 1.14rem; }
.noticia-card p { font-size: .9rem; color: var(--muted); }
.agenda-widget { top: 104px; border: 0; border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-soft); }
.agenda-widget h3 { font-size: 1.25rem; }
.agenda-item { padding: 14px 0; }
.agenda-fecha { min-width: 58px; padding: 9px; border-radius: 12px; }
.agenda-texto p { font-size: .88rem; }
.agenda-vertodos { min-height: 46px; display: grid; place-items: center; border-radius: 10px; background: #fff3eb; }

/* Comunidad y equipos */
.comunidad-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); }
.comunidad-grid a {
  position: relative;
  min-height: 168px;
  padding: 26px;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(145deg, #153b5c, #0c253c);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 14px 32px rgba(0,0,0,.18);
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  text-align: left;
}
.comunidad-grid a::before {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  top: -30px;
  right: -24px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.comunidad-grid a::after { content: '↗'; position: absolute; right: 22px; bottom: 20px; color: #ff9b62; font: 700 1.15rem var(--sans); }
.comunidad-grid a:nth-child(3n+2) { background: linear-gradient(145deg, #174f72, #0d304c); }
.comunidad-grid a:nth-child(3n) { background: linear-gradient(145deg, #5f2d1b, #321d1a); }
.comunidad-grid a:hover { background: var(--orange); border-color: var(--orange); transform: translateY(-5px); }
.dept-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); }
.dept-card {
  padding: 12px 12px 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform .2s, box-shadow .2s;
}
.dept-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.dept-hex {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  margin: 0 0 18px;
  clip-path: none;
  border: 0;
  border-radius: 15px;
  background-color: var(--navy);
  font-size: 1.45rem;
}
.dept-card h4 { padding-inline: 8px; font-size: 1rem; }
.dept-card p { padding-inline: 8px; }
.gallery-strip { gap: 14px; }
.gallery-strip .g { border-radius: var(--radius-md); box-shadow: var(--shadow-soft); transition: transform .2s; }
.gallery-strip .g:hover { transform: translateY(-5px); }

/* Catálogo CRA integrado */
.cra-section { background: linear-gradient(180deg, #eef4f8 0%, #fff 100%); }
.cra-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}
.cra-kicker { color: var(--orange-deep); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cra-head h2 { margin: 7px 0 10px; font-family: var(--serif); font-size: clamp(2.1rem, 4vw, 3.4rem); color: var(--navy); }
.cra-head p { margin: 0; color: var(--muted); font-size: 1rem; }
.cra-open {
  min-height: 48px;
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
}
.cra-browser { height: min(820px, 78vh); min-height: 620px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.cra-browser iframe { width: 100%; height: 100%; border: 0; background: #fff; }

/* Modales */
.texto-overlay .contenido-modal { max-height: calc(100svh - 80px); overflow: auto; border-radius: 22px; padding: clamp(28px, 5vw, 50px); background: var(--navy-2); }
.aviso-caja { border-radius: 20px; }

@media (max-width: 1080px) {
  .accesos-rapidos { grid-template-columns: repeat(3, 1fr); }
  .accesos-rapidos > a { border-right: 0; }
  .dept-grid { grid-template-columns: repeat(3, 1fr); }
  .noticias-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .topbar .quote { display: none; }
  header.main { min-height: 72px; padding: 8px 72px 8px 16px; }
  .brand img { width: 46px !important; height: 50px !important; }
  .brand .name .big { font-size: .91rem; }
  .brand .name .small { font-size: .58rem; }
  .menu-toggle { position: absolute; top: 13px; right: 14px; width: 46px; height: 46px; }
  nav.primary { width: min(88vw, 390px); padding: 76px 20px 30px; }
  nav.primary a { min-height: 48px; }

  .hero { width: calc(100% - 28px); min-height: 650px; margin-top: 18px; align-items: flex-end; }
  .hero-bg-img, .hero-bg-video { width: 100%; height: 100%; }
  .hero-overlay { background: linear-gradient(0deg, rgba(7,27,46,.98) 0%, rgba(7,27,46,.85) 45%, rgba(7,27,46,.12) 100%) !important; }
  .hero-content { width: 100%; max-width: 720px; padding: 42px 30px; }
  .hero-content h1 { font-size: clamp(2.3rem, 8vw, 3.7rem); }

  .accesos-rapidos { width: calc(100% - 48px); margin-top: -26px; grid-template-columns: repeat(2, 1fr); }
  .bloque-destacados { width: calc(100% - 32px); }
  .agenda-section .agenda-widget { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dept-grid { grid-template-columns: repeat(2, 1fr); }
  .noticias-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .noticia-card:first-child { grid-template-columns: 1.15fr .85fr; }
}

@media (max-width: 640px) {
  .topbar { justify-content: flex-end; }
  .topbar > span { display: none; }
  .hero { min-height: 610px; width: calc(100% - 20px); border-radius: 22px; }
  .hero-content { padding: 34px 22px; }
  .hero-content h1 { font-size: clamp(2rem, 10vw, 2.75rem); }
  .hero-content p { font-size: .96rem; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }

  .accesos-rapidos { width: calc(100% - 28px); margin: -18px auto 54px; grid-template-columns: 1fr; }
  .accesos-rapidos > a { min-height: 70px; }
  .bloque-destacados { margin-bottom: 48px; }
  .carousel-banners { height: 430px; }
  .carousel-slide { align-items: flex-end; }
  .carousel-slide::after { background: linear-gradient(0deg, rgba(7,27,46,.98), rgba(7,27,46,.12)); }
  .carousel-slide .cs-content { padding: 28px 22px 62px; }
  .carousel-arrows { display: none; }
  .carousel-dots { left: 22px; bottom: 22px; }

  section { padding: 56px 18px; }
  .agenda-section-head { display: block; }
  .agenda-section-head p { margin-top: 10px; }
  .agenda-section .agenda-widget { grid-template-columns: 1fr; padding: 10px; }
  .agenda-section .agenda-item { min-height: 92px; }
  .noticias-grid { grid-template-columns: 1fr; }
  .noticia-card:first-child { grid-column: auto; display: block; }
  .noticia-card:first-child .img { min-height: 0; aspect-ratio: 16/9; }
  .noticia-card:first-child .noticia-body { display: block; padding: 22px; }
  .noticia-card:first-child h3 { font-size: 1.35rem; }
  .comunidad-grid, .gallery-strip { grid-template-columns: 1fr; }
  .dept-grid { gap: 10px; }
  .dept-card { padding: 16px 7px; }
  .dept-hex { width: 80px; height: 92px; }
  .dept-hex { width: 100%; height: auto; }
  .comunidad-grid a { min-height: 132px; }
  .cra-head { display: block; }
  .cra-open { width: 100%; margin-top: 20px; }
  .cra-browser { min-height: 680px; height: 78vh; border-radius: 18px; }
  .noticias-paginacion a, .noticias-paginacion span { min-width: 44px; height: 44px; }
  .footer-bottom { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Revisión v4: escala más equilibrada, ancho completo y buscador CRA propio */
body { overflow-x: hidden; }
.topbar { padding-inline: clamp(28px, 4vw, 76px); }
header.main {
  min-height: 102px;
  padding: 12px clamp(28px, 4vw, 76px);
}
.brand { gap: 16px; }
.brand img { width: 70px !important; height: 76px !important; }
.brand .name .big { max-width: 360px; font-size: clamp(1.25rem, 1.55vw, 1.65rem); line-height: 1.05; }
.brand .name .small { margin-top: 5px; font-size: .74rem; }
nav.primary a { font-size: .93rem; padding: 11px 13px; }

.hero {
  width: 100%;
  min-height: 500px;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}
.hero-content { padding: clamp(38px, 4vw, 60px) clamp(34px, 5vw, 78px); }
.hero-content h1 { font-size: clamp(2.25rem, 3.55vw, 3.65rem); line-height: 1.04; }
.hero-content p { font-size: 1rem; }

.bloque-destacados { width: 100%; margin-bottom: 52px; }
.bloque-etiqueta { padding-inline: clamp(24px, 4vw, 64px); }
.carousel-banners { height: 440px; border-radius: 0; box-shadow: none; }

section { padding: clamp(48px, 5.5vw, 76px) clamp(24px, 4vw, 64px); }
.section-head { margin-bottom: 28px; }
.section-head h2, .agenda-section-head h2 { font-size: clamp(1.9rem, 3vw, 2.65rem); }
.agenda-section .agenda-widget { padding: 12px; gap: 10px; }
.agenda-section .agenda-item { min-height: 104px; padding: 12px; }

.comunidad-grid { gap: 14px; }
.comunidad-grid a {
  min-height: 110px;
  padding: 20px 22px;
  border-radius: 16px;
  font-size: 1.08rem;
}
.comunidad-grid a::before { width: 82px; height: 82px; }
.comunidad-grid a::after { right: 18px; bottom: 16px; }
.dept-grid { gap: 16px; }
.dept-card { border-radius: 16px; padding: 9px 9px 17px; }
.dept-hex { margin-bottom: 13px; border-radius: 11px; aspect-ratio: 16/8.5; }
.dept-card h4 { font-size: .95rem; }

.cra-section { background: #eef3f7; }
.cra-head { align-items: center; margin-bottom: 22px; }
.cra-head h2 { font-size: clamp(1.9rem, 3vw, 2.65rem); }
.cra-search-wrap {
  max-width: 1120px;
  padding: clamp(20px, 3vw, 34px);
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.cra-search {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 2px solid #ccd7e0;
  border-radius: 14px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.cra-search:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px rgba(239,100,29,.12); }
.cra-search svg { width: 23px; flex: 0 0 23px; fill: none; stroke: var(--navy); stroke-width: 1.8; }
.cra-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 600 1rem var(--sans); }
.cra-search input::placeholder { color: #7b8794; font-weight: 400; }
.cra-status { margin: 12px 3px 0; color: var(--muted); font-size: .88rem; }
.cra-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.cra-result {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #f8fafc;
  text-decoration: none;
}
.cra-result:hover { border-color: rgba(239,100,29,.5); background: #fff7f2; }
.cra-result-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--navy); color: #fff; font-size: .67rem; font-weight: 800; }
.cra-result strong, .cra-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cra-result strong { font-size: .92rem; }
.cra-result small { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.cra-result b { color: var(--orange-deep); font-size: .78rem; }
.cra-empty { grid-column: 1/-1; padding: 24px; border-radius: 12px; text-align: center; color: var(--muted); background: #f7f9fb; }
.cra-data-frame { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; border: 0 !important; }

@media (max-width: 980px) {
  header.main { min-height: 82px; }
  .hero { min-height: 540px; width: 100%; margin-top: 0; border-radius: 0; }
  .hero-content { padding: 36px 28px; }
  .hero-content h1 { font-size: clamp(2.05rem, 7vw, 3.15rem); }
  .bloque-destacados { width: 100%; }
  .carousel-banners { border-radius: 0; }
}

@media (max-width: 640px) {
  header.main { min-height: 76px; padding-block: 8px; }
  .brand img { width: 50px !important; height: 54px !important; }
  .hero { min-height: 540px; width: 100%; border-radius: 0; }
  .hero-content h1 { font-size: clamp(2rem, 9vw, 2.65rem); }
  .carousel-banners { height: 390px; }
  .comunidad-grid a { min-height: 86px; }
  .cra-results { grid-template-columns: 1fr; }
  .cra-head { display: block; }
}

/* Revisión v5: proporciones contenidas y capas flotantes */
.hero-bg-img, .hero-bg-video {
  left: 0;
  right: auto;
  width: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  background: linear-gradient(90deg, rgba(7,27,46,.98) 0%, rgba(7,27,46,.94) 27%, rgba(7,27,46,.68) 46%, rgba(7,27,46,.18) 72%, rgba(7,27,46,.03) 100%) !important;
}
.hero-content { width: 49%; max-width: 720px; }

.bloque-destacados { position: relative; }
.bloque-etiqueta {
  position: absolute;
  z-index: 6;
  top: 22px;
  left: clamp(24px, 4vw, 64px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(7,27,46,.82);
  color: #fff;
  backdrop-filter: blur(8px);
}

#noticias > .noticias-layout,
#comunidad > .section-head,
#comunidad > .comunidad-grid,
.dept-section > .section-head,
.dept-section > .dept-grid,
section:has(> .gallery-strip) > .section-head,
section:has(> .gallery-strip) > .gallery-strip,
section:has(> .gallery-strip) > .pastoral-action,
.cra-section > .cra-head,
.cra-section > .cra-search-wrap {
  width: min(1240px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.noticia-card:first-child {
  width: min(1080px, 100%);
  justify-self: center;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr);
}
.noticia-card:first-child .img {
  min-height: 300px;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: var(--navy);
}
.noticia-card:first-child .noticia-body { padding: 28px; }

.comunidad-grid { width: min(1080px, 100%) !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.comunidad-grid a { min-height: 88px; padding: 17px 19px; font-size: 1rem; }
.comunidad-grid a::before { width: 62px; height: 62px; }

.dept-grid { width: min(1160px, 100%) !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dept-hex { aspect-ratio: 16/7.5; }

section:has(> .gallery-strip) { padding-top: 52px !important; }
.gallery-strip { width: min(1080px, 100%) !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery-strip .g { aspect-ratio: 16/10; }
.pastoral-action { margin-top: 18px; text-align: right; }
.pastoral-action a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--navy);
  background: #fff;
  font-size: .88rem;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}
.pastoral-action span { color: var(--orange); }

.cra-section { position: relative; z-index: 3; }
.cra-search-wrap { position: relative; z-index: 12; max-width: 980px; }
.cra-results {
  position: absolute;
  z-index: 30;
  top: calc(100% - 10px);
  left: clamp(20px, 3vw, 34px);
  right: clamp(20px, 3vw, 34px);
  max-height: 350px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(7,27,46,.22);
}
.cra-results:empty { display: none; }
.cra-results::-webkit-scrollbar { width: 9px; }
.cra-results::-webkit-scrollbar-thumb { border: 2px solid #fff; border-radius: 999px; background: #b8c3cd; }

@media (max-width: 1080px) {
  .comunidad-grid, .dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .hero-content { width: 100%; max-width: 650px; }
  .hero-overlay { background: linear-gradient(0deg, rgba(7,27,46,.97) 0%, rgba(7,27,46,.8) 48%, rgba(7,27,46,.12) 100%) !important; }
  .noticia-card:first-child { grid-template-columns: 1fr; }
  .noticia-card:first-child .img { min-height: 0; aspect-ratio: 16/8; }
  .comunidad-grid, .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .bloque-etiqueta { top: 16px; left: 18px; }
  .noticia-card:first-child .img { aspect-ratio: 16/10; }
  .comunidad-grid { grid-template-columns: 1fr; }
  .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pastoral-action { text-align: left; }
  .cra-results { grid-template-columns: 1fr; max-height: 310px; }
}

/* Revisión v6: transición, cinco noticias, equipos descriptivos y footer seguro */
.bloque-destacados::before {
  content: '';
  position: absolute;
  z-index: 5;
  top: -24px;
  left: 0;
  width: 100%;
  height: 48px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.92) 48%, rgba(255,255,255,.28) 78%, rgba(255,255,255,0) 100%);
  filter: blur(5px);
}

#noticias { padding-inline: clamp(24px, 3vw, 54px); }
#noticias > .noticias-layout { width: min(1500px, 100%); }
.noticias-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.noticia-card:first-child { width: min(1280px, 100%); }
.noticia-card:not(:first-child) .noticia-body { padding: 16px; }
.noticia-card:not(:first-child) h3 { font-size: 1rem; line-height: 1.25; }
.noticia-card:not(:first-child) p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }

.dept-section { padding-inline: clamp(24px, 3vw, 54px); }
.dept-section > .section-head,
.dept-section > .dept-grid { width: min(1500px, 100%); }
.dept-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dept-card {
  min-height: 118px;
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 13px;
  padding: 18px;
  border-radius: 18px;
  text-align: left;
}
.dept-hex {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 54px;
  height: 54px;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--navy), #174b70);
  color: var(--orange);
  font-size: .92rem;
}
.dept-card h4 { grid-column: 2; margin: 0 0 4px; padding: 0; font-size: .94rem; line-height: 1.2; }
.dept-card p { grid-column: 2; margin: 0; padding: 0; color: var(--muted); font-size: .78rem; line-height: 1.35; }

section:has(> .gallery-strip) { padding-inline: clamp(24px, 3vw, 54px); }
section:has(> .gallery-strip) > .section-head,
section:has(> .gallery-strip) > .gallery-strip,
section:has(> .gallery-strip) > .pastoral-action { width: min(1500px, 100%) !important; }
.gallery-strip { gap: 16px; }
.gallery-strip .g { aspect-ratio: 16/9; min-height: 190px; }
.pastoral-action { margin-top: 20px; }

.footer-logo-fallback {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  color: var(--navy);
  text-align: center;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.15;
}

@media (max-width: 1260px) {
  .noticias-grid, .dept-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .noticias-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dept-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .noticia-card:first-child { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .noticias-grid, .dept-grid { grid-template-columns: 1fr; }
  .gallery-strip .g { min-height: 0; }
}

/* Cuadrículas y ficha CRA */
@media (min-width: 1261px) {
  .noticias-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.cra-results {
  grid-template-columns: 1fr;
  max-height: 306px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cra-result {
  width: 100%;
  min-height: 62px;
  border: 1px solid #d9e0e6;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cra-result:hover { border-color: var(--orange); background: #fff8f3; }
.cra-modal[hidden] { display: none; }
.cra-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 18, 31, .78);
  backdrop-filter: blur(7px);
}
.cra-modal-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(620px, calc(100vh - 44px));
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 30px;
  align-items: center;
  padding: 30px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
}
.cra-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #edf2f5;
  color: var(--navy);
  font-size: 25px;
  cursor: pointer;
}
.cra-modal-cover-wrap {
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--navy), #174b70);
  color: #fff;
  font-weight: 800;
  letter-spacing: .16em;
}
.cra-modal-cover-wrap img { width: 100%; height: 100%; max-height: 380px; object-fit: contain; background: #f3f5f6; }
.cra-modal-copy h3 { margin: 10px 0 8px; font-family: var(--serif); font-size: clamp(1.65rem, 4vw, 2.45rem); line-height: 1.1; color: var(--navy); }
.cra-modal-copy > p { color: var(--muted); }
.cra-modal-note { margin: 22px 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: .88rem; }
body.cra-modal-open { overflow: hidden; }

@media (max-width: 1260px) {
  .dept-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cra-modal-card { grid-template-columns: 1fr; gap: 18px; padding: 24px; }
  .cra-modal-cover-wrap { min-height: 210px; max-height: 270px; }
}

/* Separadores definitivos del carrusel */
.bloque-destacados {
  position: relative;
  padding-top: 22px;
  padding-bottom: 22px;
  margin-bottom: 0;
  background:
    linear-gradient(90deg, var(--navy) 0%, #dfe8ee 18%, #f5f7f8 50%, #dfe8ee 82%, var(--navy) 100%);
}
.bloque-destacados::before,
.bloque-destacados::after {
  content: '';
  display: block;
  position: absolute;
  z-index: 6;
  left: 50%;
  width: min(720px, 68vw);
  height: 2px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(241,96,24,.75), transparent);
}
.bloque-destacados::before { top: 9px; filter: none; }
.bloque-destacados::after { bottom: 9px; }
.bloque-etiqueta { top: 44px; }

@media (max-width: 640px) {
  .bloque-destacados { padding-top: 16px; padding-bottom: 16px; }
  .bloque-destacados::before { top: 6px; }
  .bloque-destacados::after { bottom: 6px; }
  .bloque-etiqueta { top: 34px; }
}

/* Todas las noticias con el mismo tamaño */
.noticias-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.noticia-card:first-child {
  grid-column: auto;
  display: block;
  width: auto;
}

.noticia-card:first-child .img {
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.noticia-card:first-child .noticia-body {
  display: block;
  padding: 16px;
}

.noticia-card:first-child h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.noticia-card:first-child p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Adaptación para otras pantallas */
@media (max-width: 1260px) {
  .noticias-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .noticias-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .noticias-grid {
    grid-template-columns: 1fr;
  }
}

/* Fondo azul para la sección Pastoral */
.pastoral-section {
  padding: 70px clamp(24px, 3vw, 54px) !important;
  background:
    radial-gradient(circle at 85% 15%, rgba(30, 101, 145, 0.45), transparent 35%),
    linear-gradient(135deg, #071b2e 0%, #0b3553 55%, #124f73 100%);
  color: #ffffff;
}

.pastoral-section .section-head h2 {
  color: #ffffff;
}

.pastoral-section .section-head p {
  color: #c8dbe8;
}

.pastoral-section .gallery-strip .g {
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pastoral-section .gallery-strip .g:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.38);
}

.pastoral-section .pastoral-action a {
  background: #f16018;
  border-color: #f16018;
  color: #ffffff;
}

.pastoral-section .pastoral-action a:hover {
  background: #ffffff;
  border-color: #ffffff;
  color: #071b2e;
}

@media (max-width: 640px) {
  .pastoral-section {
    padding: 48px 18px !important;
  }
}

/* Mismo fondo azul para Pastoral, Comunidad y Próximas actividades */
.pastoral-section,
#comunidad,
.agenda-section {
  background:
    radial-gradient(
      circle at 85% 15%,
      rgba(30, 101, 145, 0.45),
      transparent 35%
    ),
    linear-gradient(
      135deg,
      #071b2e 0%,
      #0b3553 55%,
      #124f73 100%
    ) !important;

  color: #ffffff;
}

/* Títulos y descripciones */
.pastoral-section .section-head h2,
#comunidad .section-head h2,
.agenda-section h2 {
  color: #ffffff !important;
}

.pastoral-section .section-head p,
#comunidad .section-head p,
.agenda-section-head p {
  color: #c8dbe8 !important;
}

/* Etiqueta de Próximas actividades */
.agenda-section .agenda-kicker {
  color: #ff7a32;
}

/* Tarjetas de Comunidad */
#comunidad .comunidad-grid a {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

#comunidad .comunidad-grid a:hover {
  background: #f16018;
  border-color: #f16018;
  transform: translateY(-4px);
}

/* Calendario sobre el fondo azul */
.agenda-section .agenda-widget {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}
/* Encabezado y pie con el mismo azul institucional */
.topbar {
  background: #071b2e !important;
}

header.main {
  background:
    radial-gradient(
      circle at 20% 0%,
      rgba(30, 101, 145, 0.35),
      transparent 32%
    ),
    linear-gradient(
      90deg,
      #071b2e 0%,
      #0b3553 55%,
      #124f73 100%
    ) !important;

  border-bottom: 2px solid rgba(241, 96, 24, 0.75);
}

footer {
  background:
    radial-gradient(
      circle at 85% 15%,
      rgba(30, 101, 145, 0.45),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      #071b2e 0%,
      #0b3553 55%,
      #124f73 100%
    ) !important;
}

/* Textos secundarios del encabezado y footer */
.topbar,
header.main .brand .small,
footer p,
footer a {
  color: #c8dbe8;
}

/* Líneas divisorias del footer */
footer hr,
footer > div {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Mantener el botón Intranet destacado */
header.main .cta {
  background: #f16018 !important;
  color: #ffffff !important;
}

header.main .cta:hover {
  background: #ffffff !important;
  color: #071b2e !important;
}

/* Carátulas completas, sin cápsula alrededor */
.pastoral-section .gallery-strip .g {
  aspect-ratio: 3 / 2 !important;
  min-height: 0 !important;

  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;

  border: none !important;
  border-radius: 14px !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28) !important;
  overflow: hidden;
}

.pastoral-section .gallery-strip .g:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.38) !important;
}

/* Centrar los cinco departamentos restantes */
.dept-section .dept-grid {
  width: min(1400px, 100%) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  justify-content: center;
}

/* Tablets */
@media (max-width: 1100px) {
  .dept-section .dept-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .dept-section .dept-card:nth-child(4) {
    grid-column: 1 / 2;
  }
}

/* Móviles */
@media (max-width: 700px) {
  .dept-section .dept-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dept-section .dept-card:nth-child(4) {
    grid-column: auto;
  }

  .dept-section .dept-card:last-child {
    grid-column: 1 / -1;
    width: min(100%, 320px);
    justify-self: center;
  }
}

@media (max-width: 440px) {
  .dept-section .dept-grid {
    grid-template-columns: 1fr !important;
  }

  .dept-section .dept-card:last-child {
    grid-column: auto;
    width: 100%;
  }
}

/* Portada principal ligeramente más amplia */
.hero {
  min-height: 76vh !important;
  height: 76vh !important;
}

/* Bordes blancos iguales arriba y abajo del carrusel */
.bloque-destacados {
  padding-top: 28px !important;
  padding-bottom: 28px !important;
  background: #f5f7f8 !important;
}

/* Ocultar las líneas decorativas anteriores */
.bloque-destacados::before,
.bloque-destacados::after {
  display: none !important;
}

/* Reubicar el título dentro del carrusel */
.bloque-etiqueta {
  top: 48px !important;
}

/* Ajustes para tablet */
@media (max-width: 980px) {
  .hero {
    min-height: 620px !important;
    height: auto !important;
  }

  .bloque-destacados {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
  }

  .bloque-etiqueta {
    top: 42px !important;
  }
}

/* Ajustes para teléfonos */
@media (max-width: 640px) {
  .hero {
    min-height: 570px !important;
  }

  .bloque-destacados {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
  }

  .bloque-etiqueta {
    top: 36px !important;
  }
}
/* Carrusel ancho, pero con menor altura */
.carousel-banners {
  width: calc(100% - 48px) !important;
  max-width: none !important;
  height: 320px !important;
  margin-inline: 24px !important;
  border-radius: 24px !important;
}

.carousel-slide {
  height: 320px !important;
  min-height: 320px !important;
}

/* Carrusel ancho completo y de menor altura */
.bloque-destacados {
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.carousel-banners {
  width: 100% !important;
  max-width: none !important;
  height: 320px !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

.carousel-slide {
  width: 100% !important;
  height: 320px !important;
  min-height: 320px !important;
}

@media (max-width: 640px) {
  .carousel-banners,
  .carousel-slide {
    width: 100% !important;
    height: 300px !important;
    min-height: 300px !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}

