/* ===================================================================
   12-paginas.css — PÁGINAS INTERNAS
   1. Bloques de página (Pastoral y otras)
   2. Nivel académico (selector lateral + carrusel)
   3. Contacto (formulario + mapa)
   =================================================================== */

/* ---------- 1. BLOQUES DE PÁGINA ---------- */
.bloque { position: relative; padding-block: clamp(56px, 7vw, 96px); }
.bloque.fondo-crema { margin-block: 90px; background: var(--cream); }
.bloque.fondo-cafe { margin-block: 90px; background: var(--brown); color: rgb(255 248 238 / 0.92); --sec-title: #fff; --sec-text: rgb(255 248 238 / 0.92); --sec-muted: rgb(255 248 238 / 0.75); }
.bloque + .bloque:not([class*="fondo-crema"]):not([class*="fondo-cafe"]) { padding-top: 0; }
.bloque-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.bloque-split.sin-imagen { grid-template-columns: minmax(0, 1fr); max-width: 820px; margin-inline: auto; }
.img-izquierda .bloque-split > .bloque-media { order: -1; }
.bloque-media { border-radius: 24px; box-shadow: var(--shadow); }
.bloque-texto .text-body { text-align: justify; hyphens: auto; }
/* Frase destacada dentro del texto */
.bloque-destacado {
  margin: 28px 0 0;
  padding-left: 20px;
  border-left: 3px solid var(--gold-soft);
  color: var(--brown);
  font: italic 600 clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem)/1.35 var(--font-serif);
}
/* Tarjeta café con lista */
.tarjeta-cafe { padding: clamp(28px, 4vw, 48px); border-radius: 28px; background: var(--brown); color: rgb(255 248 238 / 0.9); box-shadow: var(--shadow); }
.tarjeta-cafe h2 { color: #fff; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); text-align: center; }
.tarjeta-cafe .text-body { color: inherit; }
.tarjeta-cafe ul { padding-left: 0; list-style: none; }
.tarjeta-cafe li { position: relative; padding-left: 22px; }
.tarjeta-cafe li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-light); }
/* Columnas y grupos */
.bloque-titulo-centro { margin-bottom: 14px; text-align: center; }
.bloque-intro { max-width: 70ch; margin: 0 auto 40px; color: var(--sec-muted, var(--muted)); text-align: center; }
.columnas, .grupos, .fila-fotos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.columna { text-align: center; }
.columna h3 { color: var(--brown); font-size: 1.5rem; }
.columna .media { margin-bottom: 18px; }
.columna .card-text { text-align: justify; }
.fila-fotos figure { margin: 0; border-radius: 20px; }
.fila-fotos figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 14px 10px; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); color: #fff; font-size: var(--fs-xs); }
.grupo { padding: 28px 24px; border: 1px solid var(--line); border-radius: 22px; background: #fff; text-align: center; transition: transform 350ms var(--ease-out), box-shadow 350ms var(--ease-out); }
.grupo-sigla { margin-bottom: 10px; color: var(--gold); font: 700 0.95rem/1 var(--font-sans); letter-spacing: 0.14em; }
.grupo h3 { color: var(--brown-dark); font-size: 1.25rem; }
.grupo-horario { display: grid; justify-items: center; gap: 4px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--brown-dark); }
.grupo-horario .icono { width: 28px; height: 28px; color: var(--brown); }
@media (hover: hover) and (pointer: fine) { .grupo:hover { transform: translateY(-6px); box-shadow: var(--shadow); } }
/* Si la página termina con un bloque café, se une al pie (también café) sin ondas intermedias */
main > .bloque.fondo-cafe:last-child { margin-bottom: 0; padding-bottom: 40px; }
main > .bloque.fondo-cafe:last-child > .onda-abajo { display: none; }
main:has(> .bloque.fondo-cafe:last-child) + .site-footer { margin-top: 0; }
main:has(> .bloque.fondo-cafe:last-child) + .site-footer > .onda { display: none; }
/* Frase en bloque café */
.bloque-frase { max-width: 860px; margin: 0 auto; text-align: center; font: italic 500 clamp(1.3rem, 1.05rem + 1vw, 1.9rem)/1.45 var(--font-serif); }
.bloque-frase p:last-child { margin-bottom: 0; }

/* ---------- 2. NIVEL ACADÉMICO ---------- */
.nivel-layout { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.nivel-menu { position: sticky; top: calc(var(--header-alto, 96px) + 40px); display: grid; gap: 18px; }
.nivel-opcion {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  border-radius: 18px;
  background: #fdeed8;
  color: var(--brown-dark);
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color 250ms ease, color 250ms ease, transform 300ms var(--ease-out);
}
.nivel-raya { flex: 0 0 30px; height: 2px; background: currentColor; transform-origin: 0 50%; transition: transform 300ms var(--ease-out); }
.nivel-opcion[aria-current="page"] { background: var(--brown); color: #fff; box-shadow: var(--shadow); }
.nivel-opcion:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .nivel-opcion:not([aria-current]):hover { transform: translateX(6px); background: #fbe3c2; }
  .nivel-opcion:hover .nivel-raya { transform: scaleX(1.35); }
}
/* Las opciones entran desde la izquierda, una tras otra */
.con-animaciones .nivel-opcion { animation: nivel-entra 700ms var(--ease-out) both; animation-delay: calc(200ms + var(--n, 0) * 90ms); }
@keyframes nivel-entra { from { opacity: 0; transform: translateX(-24px); } }
.nivel-cabecera h2 { margin-bottom: 8px; color: var(--brown); }
.nivel-subtitulo { margin-bottom: 2px; color: var(--brown-dark); font-weight: 650; }
.nivel-edad { color: var(--muted); }
.nivel-contenido .text-body { max-width: none; text-align: justify; hyphens: auto; }
.nivel-fotos { position: relative; aspect-ratio: 16 / 9; margin-top: 32px; border-radius: 22px; overflow: hidden; background: var(--cream); outline: none; }
.nivel-foto { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 900ms var(--ease-in-out); }
.nivel-foto.is-active { opacity: 1; }
.nivel-foto .media-img { width: 100%; height: 100%; object-fit: cover; }
.nivel-foto figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 32px 20px 40px; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); color: #fff; font-size: var(--fs-sm); }
.nivel-flecha { position: absolute; top: 50%; translate: 0 -50%; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.85); color: var(--brown-dark); font-size: 1.6rem; line-height: 1; transition: transform var(--dur-press) var(--ease-out); }
.nivel-flecha:active { transform: scale(0.94); }
.nivel-prev { left: 14px; }
.nivel-next { right: 14px; }
.nivel-puntos { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 6px; }
.nivel-puntos button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / 0.55); transition: width 300ms var(--ease-out), background-color 200ms ease; }
.nivel-puntos button[aria-current="true"] { width: 22px; border-radius: 4px; background: #fff; }
.nivel-foto-unica { margin-top: 32px; border-radius: 22px; }

/* ---------- 3. CONTACTO ---------- */
.contacto-cabecera { margin-bottom: 36px; text-align: center; }
.contacto-cabecera h2 { margin-bottom: 8px; color: var(--brown); }
.contacto-horario { display: inline-flex; align-items: center; gap: 8px; color: var(--brown-dark); font-weight: 600; }
.contacto-horario .icono { color: var(--gold); }
.contacto-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.contacto-form { padding: clamp(24px, 3vw, 36px); border-radius: 24px; background: var(--paper); border: 1px solid var(--line); }
.contacto-form h3 { color: var(--brown); font-size: 1.6rem; }
.campo { display: grid; gap: 6px; margin-bottom: 16px; }
.campo > label { color: var(--brown-dark); font-size: var(--fs-sm); font-weight: 650; }
.requerido { color: #b3261e; }
.campo input:not([type=checkbox]), .campo select, .campo textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d9cec1;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  transition: border-color var(--dur-ui) ease, box-shadow var(--dur-ui) ease;
}
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--brown); outline: none; box-shadow: 0 0 0 3px rgb(201 162 107 / 0.35); }
.campo textarea { min-height: 140px; resize: vertical; }
.con-error input, .con-error select, .con-error textarea { border-color: #b3261e; }
.campo-error { margin: 0; color: #b3261e; font-size: var(--fs-xs); font-weight: 600; }
.campo-check label { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; }
.campo-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brown); }
.campo-check a { color: var(--brown); }
.campo-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contacto-lateral { display: grid; gap: 20px; }
.contacto-datos { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.contacto-datos li { display: flex; align-items: flex-start; gap: 12px; }
.contacto-datos .icono { flex-shrink: 0; width: 22px; height: 22px; color: var(--gold); }
.contacto-datos a { color: var(--brown); font-weight: 600; }
.avisos { max-width: 760px; margin: 0 auto 28px; }
.aviso { margin: 0 0 8px; padding: 14px 18px; border-radius: 14px; font-weight: 600; animation: aviso-entra 400ms var(--ease-out) both; }
.aviso-success { background: #e8f4ec; color: #1d4d31; }
.aviso-error { background: #fdf1f0; color: #7d1d17; }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Adaptación a pantallas pequeñas ---------- */
@media (max-width: 900px) {
  .bloque-texto .text-body, .nivel-contenido .text-body, .columna .card-text { text-align: left; hyphens: manual; }
  .bloque-split, .contacto-grid, .nivel-layout { grid-template-columns: minmax(0, 1fr); }
  .img-izquierda .bloque-split > .bloque-media { order: 0; }
  .columnas, .grupos, .fila-fotos { grid-template-columns: minmax(0, 1fr); }
  .nivel-menu { position: static; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
  .nivel-opcion { padding: 16px 18px; gap: 12px; }
  .nivel-raya { flex-basis: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .grupo:hover, .nivel-opcion:hover { transform: none; }
}

/* ---------- Formato del texto escrito en el panel ----------
   **Título** solo en su párrafo → título; ==texto== → resaltado en color (ver formato_texto). */
.text-body .titulo-parrafo { margin: 2.2em 0 0.6em; color: var(--brown-dark); font-family: var(--font-serif); font-size: 1.28rem; line-height: 1.3; }
.text-body .titulo-parrafo:first-child { margin-top: 0; }
.text-body .titulo-parrafo strong { font-weight: 600; }
.text-body mark.resaltado { padding: 0.05em 0.25em; border-radius: 4px; background: #fbecc8; color: #6b3f12; font-weight: 600; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.politica h2 { margin-top: 1.8em; }
