/* ==========================================================
   Modal de áreas del grupo (Universidad, Deportes, etc.)
   Cárgalo DESPUÉS de areas.css. Usa Manrope (ya cargada) y,
   para el título, Playfair Display (agrégala en el <head>).
   ========================================================== */
.amodal {
  --am-green: #00564e;
  --am-teal: #00989a;
  --am-soft: #d9efee;
  --am-mist: #eff5f3;
  --am-ink: #0c1c26;
  --am-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  width: min(94vw, 980px);
  max-height: 92svh;
  padding: 0;
  border: 0;
  border-radius: clamp(22px, 4vw, 32px);
  background: #fff;
  color: var(--am-ink);
  font-family: var(--font, "Manrope", system-ui, sans-serif);
  box-shadow: 0 40px 80px -30px rgba(0, 30, 28, 0.6);
  overflow: hidden;
}
.amodal::backdrop {
  background: rgba(8, 30, 28, 0.62);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.amodal[open] { animation: amIn 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.amodal[open]::backdrop { animation: amFade 0.4s ease; }
@keyframes amIn { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes amFade { from { opacity: 0; } to { opacity: 1; } }
html.modal-open { overflow: hidden; }

/* 1) Cerrar */
.amodal__x {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--am-green);
  cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(0, 30, 28, 0.5);
  transition: transform 0.25s, background 0.25s;
}
.amodal__x:hover { transform: rotate(90deg); background: #fff; }
.amodal__x svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.amodal__x:focus-visible, .amodal__cta:focus-visible, .amodal__soc a:focus-visible { outline: 3px solid var(--am-teal); outline-offset: 3px; }

.amodal__box { display: grid; max-height: 92svh; overflow-y: auto; overscroll-behavior: contain; }

/* 3) Fotografía */
.amodal__fig { position: relative; margin: 0; min-height: 220px; aspect-ratio: 16 / 10; background: var(--am-soft); }
.amodal__fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.amodal__fig::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 40, 38, 0.35), transparent 45%); pointer-events: none; }

.amodal__body { display: flex; flex-direction: column; gap: 1.1rem; padding: clamp(1.4rem, 4vw, 2.6rem); }

/* 2) Título */
.amodal__label { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; padding: 0.4rem 0.9rem; border-radius: 99px; background: var(--am-mist); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #3f5560; }
.amodal__label i { width: 7px; height: 7px; border-radius: 50%; background: var(--am-green); }
.amodal__title { margin: 0; font-family: var(--am-serif); font-weight: 400; font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.08; letter-spacing: -0.015em; color: var(--am-ink); text-wrap: balance; }

/* 4) Texto */
.amodal__txt p { margin: 0 0 0.85rem; font-size: 1rem; line-height: 1.65; color: #4a5a63; }
.amodal__txt p:last-child { margin-bottom: 0; }

/* 5) Características destacadas (mismas que en los modales del hospital) */
.amodal__facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.amodal__facts li { padding: 0.55rem 1.05rem; border-radius: 99px; background: var(--am-soft); border: 1px solid rgba(0, 86, 78, 0.12); font-size: 0.9rem; font-weight: 600; color: var(--am-green); }

/* 6) Redes + 7) Contacto */
.amodal__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.4rem; padding-top: 1.2rem; border-top: 1px solid rgba(0, 86, 78, 0.12); }
.amodal__soc { display: flex; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.amodal__soc a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(0, 86, 78, 0.28); color: var(--am-green); transition: background 0.25s, color 0.25s, transform 0.25s; }
.amodal__soc a:hover { background: var(--am-green); color: #fff; transform: translateY(-2px); }
.amodal__soc svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.amodal__cta { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.85rem 0.6rem 0.85rem 1.6rem; border-radius: 99px; background: var(--am-green); color: #fff; font-weight: 700; font-size: 0.95rem; text-decoration: none; transition: transform 0.25s, box-shadow 0.25s; }
.amodal__cta:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -14px rgba(0, 86, 78, 0.9); }
.amodal__cta i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; }
.amodal__cta svg { width: 16px; fill: none; stroke: var(--am-green); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

[hidden].amodal__logo, .amodal__label[hidden], .amodal__team[hidden], .amodal__gallery[hidden], .amodal__videos[hidden], .amodal__sub[hidden], .amodal__slogan[hidden], .amodal__hint[hidden], .amodal__dots[hidden], .amodal__services[hidden], .amodal__note[hidden] { display: none !important; }

/* Logotipo del área (reemplaza la etiqueta "Grupo Grinker") */
.amodal__logo { align-self: flex-start; width: auto; height: clamp(38px, 6vw, 48px); max-width: 100%; margin-top: 0.9rem; }
@media (min-width: 800px) { .amodal__logo { margin-top: 0; } }

/* Equipo médico */
.amodal__team { margin-top: 0.4rem; padding-top: 1.4rem; border-top: 1px solid rgba(0, 86, 78, 0.12); }
.amodal__team h3 { margin: 0 0 1rem; font-family: var(--am-serif); font-weight: 400; font-size: clamp(1.4rem, 3.4vw, 1.8rem); letter-spacing: -0.01em; }
.amodal__team ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem 0.9rem; margin: 0; padding: 0; list-style: none; }
.amodal__team li { display: flex; flex-direction: column; gap: 0.2rem; }
.amodal__team img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 16px; background: var(--am-soft); margin-bottom: 0.45rem; }
.amodal__team b { font-size: 0.92rem; font-weight: 700; line-height: 1.3; color: var(--am-ink); }
.amodal__team span { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--am-green); }
@media (min-width: 1000px) { .amodal__team ul { grid-template-columns: repeat(4, 1fr); } }

/* Variante de color: Deportes (rojo del toro) */
.amodal[data-theme="deportes"] { --am-green: #b31217; --am-teal: #e02027; --am-soft: #fde6e6; --am-mist: #fbf1f1; }
.amodal[data-theme="deportes"] .amodal__foot, .amodal[data-theme="deportes"] .amodal__team { border-top-color: rgba(179, 18, 23, 0.16); }
.amodal[data-theme="deportes"] .amodal__facts li { border-color: rgba(179, 18, 23, 0.16); }
.amodal[data-theme="deportes"] .amodal__soc a { border-color: rgba(179, 18, 23, 0.32); }
.amodal[data-theme="deportes"] .amodal__videos, .amodal[data-theme="deportes"] .amodal__gallery { border-top-color: rgba(179, 18, 23, 0.16); }

/* Variante de color: Centro de Fertilidad (morado del logotipo) */
.amodal[data-theme="fertilidad"] { --am-green: #7a4596; --am-teal: #8e55ac; --am-soft: #f1e5f6; --am-mist: #f7f0fa; }
.amodal[data-theme="fertilidad"] .amodal__fig { background: var(--am-soft); }
.amodal[data-theme="fertilidad"] .amodal__fig::after { background: linear-gradient(0deg, rgba(60, 20, 80, 0.3), transparent 45%); }
.amodal[data-theme="fertilidad"] .amodal__foot, .amodal[data-theme="fertilidad"] .amodal__team { border-top-color: rgba(122, 69, 150, 0.16); }
.amodal[data-theme="fertilidad"] .amodal__facts li { border-color: rgba(122, 69, 150, 0.16); }
.amodal[data-theme="fertilidad"] .amodal__soc a { border-color: rgba(122, 69, 150, 0.32); }

/* Subtítulo y lema */
.amodal__sub { margin: -0.5rem 0 0; font-family: var(--am-serif); font-style: italic; font-size: clamp(1.1rem, 2.6vw, 1.35rem); line-height: 1.3; color: var(--am-green); }
.amodal__slogan { display: flex; align-items: center; gap: 0.8rem; margin: 0; font-size: 0.95rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--am-green); }
.amodal__slogan::before { content: ""; width: 2.2rem; height: 3px; border-radius: 2px; background: currentColor; }

/* Videos verticales: tira con desplazamiento lateral */
.amodal__videos { margin-top: 0.4rem; padding-top: 1.4rem; border-top: 1px solid rgba(0, 86, 78, 0.12); }
.amodal__videos h3 { margin: 0 0 1rem; font-family: var(--am-serif); font-weight: 400; font-size: clamp(1.4rem, 3.4vw, 1.8rem); letter-spacing: -0.01em; }
.amodal__videos ul { display: flex; gap: 0.8rem; margin: 0; padding: 0 0 0.7rem; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: rgba(0, 86, 78, 0.3) transparent; }
.amodal__videos ul > li { flex: 0 0 calc((100% - 0.8rem) / 2); scroll-snap-align: start; }   /* siempre 2 completos, sin asomar un tercero */
.amodal__videos ul.is-wide li { flex-basis: 100%; }
.amodal__videos ul.is-wide video { aspect-ratio: 16 / 9; }
.amodal__videos video { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 16px; background: var(--am-ink); }

/* Galería de fotos bajo el texto */
.amodal__gallery { margin-top: 0.4rem; padding-top: 1.4rem; border-top: 1px solid rgba(0, 86, 78, 0.12); }
.amodal__gallery h3 { margin: 0 0 1rem; font-family: var(--am-serif); font-weight: 400; font-size: clamp(1.4rem, 3.4vw, 1.8rem); letter-spacing: -0.01em; }
.amodal__gallery ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.amodal__gallery li:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.amodal__gallery li:first-child:nth-last-child(odd) img { aspect-ratio: 16 / 9; }
.amodal__gallery img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; background: var(--am-soft); }

@media (max-width: 520px) {
  .amodal__foot { flex-direction: column-reverse; align-items: stretch; }
  .amodal__soc { justify-content: center; }
  .amodal__cta { justify-content: space-between; padding-left: 1.6rem; }
}
@media (min-width: 800px) {
  .amodal__box { grid-template-columns: 0.9fr 1.1fr; max-height: none; overflow: visible; }
  .amodal { max-height: 92svh; overflow-y: auto; }
  .amodal__fig { aspect-ratio: auto; min-height: 0; position: sticky; top: 0; align-self: start; height: min(92svh, 760px); }
}
@media (prefers-reduced-motion: reduce) {
  .amodal[open], .amodal[open]::backdrop { animation: none; }
  .amodal__x:hover, .amodal__cta:hover, .amodal__soc a:hover { transform: none; }
}

/* Servicios disponibles: encabezado en banda de color, viñetas que alternan y filas con cebra suave */
.amodal__services { margin-top: 0.6rem; }
.amodal__services h3 { margin: 0 0 0.5rem; padding: 0.85rem 1.1rem; border-radius: 14px; background: linear-gradient(100deg, var(--am-green), var(--am-teal)); font-family: var(--am-serif); font-weight: 400; font-size: clamp(1.3rem, 3.2vw, 1.7rem); letter-spacing: -0.01em; color: #fff; }
.amodal__services ul { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; counter-reset: svc; }
.amodal__services li { position: relative; padding: 0.7rem 0.9rem 0.7rem 2.3rem; border-radius: 10px; font-size: 0.97rem; line-height: 1.5; color: #4a5a63; }
.amodal__services li:nth-child(even) { background: var(--am-mist); }
.amodal__services li::before { content: ""; position: absolute; left: 0.9rem; top: 1.12rem; width: 9px; height: 9px; border-radius: 50%; background: var(--am-green); }
.amodal__services li:nth-child(even)::before { background: var(--am-alt, var(--am-teal)); border-radius: 2px; transform: rotate(45deg); }
.amodal__note { margin: 0.7rem 0 0; padding: 0.85rem 1rem; border-left: 3px solid var(--am-teal); border-radius: 0 10px 10px 0; background: var(--am-mist); font-size: 0.88rem; line-height: 1.55; color: #4a5a63; }
.amodal[data-theme="fertilidad"] { --am-alt: #c2679d; }

/* Carrusel de videos: indicadores de que hay más contenido al deslizar */
.amodal__hint { display: flex; align-items: center; gap: 0.45rem; margin: -0.5rem 0 0.8rem; font-size: 0.85rem; font-weight: 600; color: var(--am-green); transition: opacity 0.4s; }
.amodal__hint i { font-style: normal; font-size: 1.05rem; line-height: 1; animation: am-nudge 1.4s ease-in-out infinite; }
.amodal__hint.is-seen { opacity: 0.45; }
.amodal__dots { display: flex; justify-content: center; gap: 0.45rem; margin: 0.2rem 0 0; padding: 0; list-style: none; }
.amodal__dots li { width: 7px; height: 7px; border-radius: 99px; background: var(--am-soft); border: 1px solid var(--am-teal); transition: width 0.25s, background 0.25s; }
.amodal__dots li.on { width: 20px; background: var(--am-green); border-color: var(--am-green); }
@keyframes am-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .amodal__hint i { animation: none; } }
