/* =============================================================
   PLANTILLA: Corazón de María (Oblatas)
   Paleta: Azul marino #1e3a6e + Azul brillante #2d6cdf
   Fuente headings: Plus Jakarta Sans | Cuerpo: Inter
   overrideColors: true → los colores del backend se ignoran
   ============================================================= */

/* ── Variables locales de la plantilla ──────────────────────── */
.template-corazon_maria {
  --cm-bg: #f0f4f8;          /* Sección alterna */
  --cm-bg-dark: #0d1b3e;     /* Footer y header oscuro */
  --cm-text: #1e3a6e;        /* Headings: el mismo azul marino primario */
  --cm-text-body: #374151;   /* Cuerpo: gris azulado legible, no tan oscuro */
  --cm-text-muted: #64748b;  /* Texto secundario y descripciones */
  --cm-border: #dce5f0;      /* Bordes suaves */
  --cm-white: #ffffff;
  --cm-accent-line: 3px solid var(--color-secondary);
  --cm-font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
  --cm-font-body: 'Inter', system-ui, sans-serif;
}

/* ── Tipografía ─────────────────────────────────────────────── */
.template-corazon_maria body {
  font-family: var(--cm-font-body);
  color: var(--cm-text-body);   /* gris azulado, no negro puro */
  background-color: #fff;
}

/* Headings en azul marino — NO aplica dentro de secciones oscuras */
.template-corazon_maria h1,
.template-corazon_maria h2,
.template-corazon_maria h3,
.template-corazon_maria h4 {
  font-family: var(--cm-font-heading);
  color: var(--cm-text);
  letter-spacing: -0.025em;
  font-weight: 700;
}

/* Headings en contextos oscuros (hero, footer, section--dark) → siempre blancos */
.cm-hero__content h1,
.cm-hero__content h2,
.cm-section--dark h1,
.cm-section--dark h2,
.cm-section--dark h3,
.cm-footer h2,
.cm-footer h3,
.cm-mobile-menu__header h1,
.template-corazon_maria .cm-hero__title {
  color: #ffffff !important;
  font-family: var(--cm-font-heading);
}

/* Page headers con bg-primary también necesitan texto blanco */
.template-corazon_maria .bg-primary h1,
.template-corazon_maria .bg-primary h2,
.template-corazon_maria .bg-primary h3,
.template-corazon_maria .bg-primary p {
  color: #ffffff !important;
}
.template-corazon_maria .bg-primary .text-white\/60,
.template-corazon_maria .bg-primary .text-white\/80 {
  color: rgba(255,255,255,0.72) !important;
}

/* Respetar utilidades text-white de Tailwind cuando el CSS del template sería más específico */
.template-corazon_maria h1.text-white,
.template-corazon_maria h2.text-white,
.template-corazon_maria h3.text-white,
.template-corazon_maria h4.text-white,
.template-corazon_maria p.text-white {
  color: #ffffff !important;
}


/* ══════════════════════════════════════════════════════════════
   HEADER — Tres niveles: topbar + marca + nav
   ══════════════════════════════════════════════════════════════ */

.cm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 16px rgba(14, 27, 62, 0.18);
}

/* ── Nivel 1: barra superior oscura ─── */
.cm-header__top {
  background-color: var(--cm-bg-dark);
  color: rgba(255,255,255,0.82);
  padding: 0.45rem 0;
  font-size: 0.78rem;
}

.cm-header__top a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.2s;
}
.cm-header__top a:hover { color: #fff; }

/* ── Nivel 2: área de marca ─── */
.cm-header__brand {
  background-color: #fff;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--cm-border);
}

.cm-header__brand-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  gap: 1rem;
}

.cm-header__logo-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
}

.cm-header__logo {
  height: 3.25rem;
  width: auto;
  object-fit: contain;
}

.cm-header__logo-placeholder {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--cm-font-heading);
  flex-shrink: 0;
}

.cm-header__institution { display: flex; flex-direction: column; }

.cm-header__institution-name {
  font-family: var(--cm-font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cm-text);
  line-height: 1.2;
}

.cm-header__institution-slogan {
  font-size: 0.68rem;
  color: var(--cm-text-muted);
  font-style: italic;
  margin-top: 0.1rem;
}

.cm-header__contact-btn {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--color-secondary);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.cm-header__contact-btn:hover {
  background-color: color-mix(in srgb, var(--color-secondary) 85%, black);
  transform: translateY(-1px);
}
@media (min-width: 768px) { .cm-header__contact-btn { display: flex; } }

/* ── Nivel 3: barra de navegación ─── */
.cm-header__nav { background-color: var(--color-primary); }

.cm-header__nav-inner {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 2.85rem;
}

.cm-header__nav-links {
  display: none;
  align-items: center;
  gap: 0.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 1024px) { .cm-header__nav-links { display: flex; } }

.cm-header__nav-links li {
  display: flex;
  align-items: center;
}

/* Enlaces normales: tipografía ligera, sin forma de botón */
.cm-header__nav-links li:not(.cm-nav-cta) a {
  display: inline-flex;
  align-items: center;
  min-height: 2.85rem;
  padding: 0 0.85rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cm-header__nav-links li:not(.cm-nav-cta) a:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.35);
}

.cm-header__nav-links li:not(.cm-nav-cta) a.active {
  color: #ffffff;
  font-weight: 600;
  border-bottom-color: var(--color-secondary);
}

/* Ítem resaltado: único botón sólido de la barra */
.cm-header__nav-links .cm-nav-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.45rem 1rem;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  background-color: var(--color-secondary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: none;
  transition: background-color 0.2s ease;
}

.cm-header__nav-links .cm-nav-cta a:hover,
.cm-header__nav-links .cm-nav-cta a.active {
  background-color: color-mix(in srgb, var(--color-secondary) 88%, black);
  color: #fff;
}

.cm-header__hamburger {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: white;
  padding: 0.7rem 0;
  margin-left: auto;
}
@media (min-width: 1024px) { .cm-header__hamburger { display: none; } }

/* ── Menú móvil ─── */
.cm-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0,0,0,0.55);
}
.cm-mobile-menu.open { display: block; }

.cm-mobile-menu__panel {
  position: absolute;
  top: 0; right: 0;
  width: min(18rem, 86vw);
  height: 100%;
  background-color: #fff;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.cm-mobile-menu__header {
  background-color: var(--color-primary);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}

.cm-mobile-menu__title {
  font-family: var(--cm-font-heading);
  font-size: 0.95rem;
  font-weight: 700;
}

.cm-mobile-menu__close {
  background: none; border: none; color: white;
  cursor: pointer; padding: 0.25rem;
  border-radius: 0.25rem; transition: background-color 0.2s;
}
.cm-mobile-menu__close:hover { background-color: rgba(255,255,255,0.15); }

.cm-mobile-menu__links {
  list-style: none; padding: 0.5rem 0; margin: 0; flex: 1;
}
.cm-mobile-menu__links a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: var(--cm-text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid #edf2f7;
  transition: background-color 0.15s, color 0.15s;
}

.cm-mobile-menu__links a:hover {
  background-color: var(--cm-bg);
  color: var(--color-primary);
}

.cm-mobile-menu__links a.cm-mobile-menu__link--highlighted {
  background-color: var(--color-secondary);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 0.25rem;
  margin: 0.2rem 0.75rem;
  border-bottom-color: transparent;
}

.cm-mobile-menu__links a.cm-mobile-menu__link--highlighted:hover {
  background-color: color-mix(in srgb, var(--color-secondary) 88%, black);
  color: #fff;
}

.cm-mobile-menu__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #edf2f7;
}
.cm-mobile-menu__cta {
  display: block;
  text-align: center;
  background-color: var(--color-secondary);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 0.25rem;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════
   HERO — Imagen de fondo + overlay + texto centrado
   ══════════════════════════════════════════════════════════════ */

.cm-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}
@media (min-width: 768px) { .cm-hero { min-height: 640px; } }

.cm-hero__bg { position: absolute; inset: 0; z-index: 0; }
.cm-hero__bg img,
.cm-hero__video,
.cm-hero__fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cm-hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(14, 27, 62, 0.62) 0%,
    rgba(14, 27, 62, 0.52) 50%,
    rgba(14, 27, 62, 0.72) 100%
  );
}

.cm-hero__gradient {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0d1b3e 0%, #1e3a6e 100%);
}

.cm-hero__content {
  position: relative;
  z-index: 10;
  max-width: 860px;
  padding: 5rem 1.5rem;
}

.cm-hero__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 0.35rem 1.1rem;
  border-radius: 2rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.07);
}

.cm-hero__title {
  font-family: var(--cm-font-heading);
  font-size: clamp(1.75rem, 4.5vw, 3rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 16px rgba(0,0,0,0.35);
}

.cm-hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255,255,255,0.88);
  margin-bottom: 2rem;
  line-height: 1.6;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.cm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.cm-hero__btn-primary {
  background-color: var(--color-secondary);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 0.2rem;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s;
}
.cm-hero__btn-primary:hover {
  background-color: color-mix(in srgb, var(--color-secondary) 84%, black);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
}

.cm-hero__btn-secondary {
  background-color: transparent;
  color: #fff;
  padding: 0.7rem 1.6rem;
  border: 2px solid rgba(255,255,255,0.65);
  border-radius: 0.2rem;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s;
}
.cm-hero__btn-secondary:hover {
  background-color: rgba(255,255,255,0.12);
  border-color: #fff;
  transform: translateY(-2px);
}

.cm-hero__wave {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
}

/* ══════════════════════════════════════════════════════════════
   SECCIONES GENERALES
   ══════════════════════════════════════════════════════════════ */

.template-corazon_maria .section {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

/* ── Encabezado compacto de páginas internas ─── */
.cm-page-header {
  background-color: var(--cm-bg);
  border-bottom: 1px solid var(--cm-border);
  padding: 1.75rem 0 2rem;
}

.cm-page-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.cm-page-header__breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--cm-text-muted);
  margin-bottom: 0.75rem;
}

.cm-page-header__breadcrumb a {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 500;
}

.cm-page-header__breadcrumb a:hover {
  text-decoration: underline;
}

.cm-page-header__current {
  color: var(--cm-text-muted);
  max-width: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-page-header__title {
  font-family: var(--cm-font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--cm-text);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0;
}

.cm-page-header__desc {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: var(--cm-text-muted);
  max-width: 640px;
  line-height: 1.6;
}

/* ── Home SPA: scroll vertical con secciones alternadas ─── */
.cm-home {
  scroll-behavior: smooth;
}

.cm-section__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.cm-text-welcome {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.cm-text-welcome__body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--cm-text-body);
}

.cm-text-centered {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.cm-text-centered__body {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--cm-text-muted);
  text-align: justify;
}

/* Sección con fondo suave explícita */
.cm-section { padding: 4.5rem 0; }
.cm-section--warm { background-color: var(--cm-bg); }
.cm-section--dark {
  background-color: var(--color-primary);
  color: #fff;
}
.cm-section--dark h2,
.cm-section--dark h3 { color: #fff; }
.cm-section--dark p { color: rgba(255,255,255,0.82); }

/* ── Título de sección ─── */
.template-corazon_maria .section-title h2,
.section-title-cm h2 {
  font-family: var(--cm-font-heading);
  color: var(--cm-text);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 0;
  display: inline-block;
}

.template-corazon_maria .section-title h2::after,
.section-title-cm h2::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background-color: var(--color-secondary);
  margin: 0.55rem auto 0;
  border-radius: 2px;
}

.template-corazon_maria .section-title,
.section-title-cm {
  text-align: center;
  margin-bottom: 2.75rem;
}

.template-corazon_maria .section-title p,
.section-title-cm p {
  color: var(--cm-text-muted);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0.6rem auto 0;
  line-height: 1.65;
}

.template-corazon_maria .section-title-line { display: none; }

/* ══════════════════════════════════════════════════════════════
   CARDS DE NOTICIAS / ARTÍCULOS
   ══════════════════════════════════════════════════════════════ */

.template-corazon_maria .card-hover {
  background-color: #fff;
  border: 1px solid var(--cm-border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.2s;
}
.template-corazon_maria .card-hover:hover {
  box-shadow: 0 8px 32px rgba(14,27,62,0.12);
  transform: translateY(-3px);
}
.template-corazon_maria .card-hover h3 {
  font-family: var(--cm-font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cm-text);
}

.template-corazon_maria .badge-primary {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.2rem 0.65rem;
  background-color: color-mix(in srgb, var(--color-primary) 10%, white);
  color: var(--color-primary);
  border-radius: 2rem;
}

.template-corazon_maria .link-primary { color: var(--color-secondary); font-weight: 600; }
.template-corazon_maria .link-primary:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   MISIÓN / VISIÓN / VALORES
   ══════════════════════════════════════════════════════════════ */

.cm-mvv {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 768px) { .cm-mvv { grid-template-columns: repeat(3, 1fr); } }

.cm-mvv__item {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 2rem 1.75rem;
  border: 1px solid var(--cm-border);
  transition: box-shadow 0.25s;
}
.cm-mvv__item:hover { box-shadow: 0 6px 24px rgba(14,27,62,0.1); }

.cm-mvv__icon {
  width: 3.5rem;
  height: 3.5rem;
  background-color: color-mix(in srgb, var(--color-primary) 8%, white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.cm-mvv__title {
  font-family: var(--cm-font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cm-text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-secondary);
  display: inline-block;
}

.cm-mvv__text {
  font-size: 0.855rem;
  color: var(--cm-text-muted);
  line-height: 1.7;
  text-align: justify;
}

.cm-mvv__list {
  list-style: none; padding: 0; margin: 0;
}
.cm-mvv__list li {
  font-size: 0.855rem;
  color: var(--cm-text-muted);
  padding: 0.3rem 0 0.3rem 1.5rem;
  position: relative;
  line-height: 1.5;
}
.cm-mvv__list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 0.8rem;
}

/* ══════════════════════════════════════════════════════════════
   TIMELINE — Reseña histórica
   ══════════════════════════════════════════════════════════════ */

.cm-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

/* Línea central vertical */
.cm-timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
  transform: translateX(-50%);
}

@media (max-width: 767px) {
  .cm-timeline::before { left: 1rem; }
}

.cm-timeline__item {
  position: relative;
  width: 50%;
  padding-bottom: 3rem;
}

.cm-timeline__item:nth-child(odd) {
  padding-right: 3rem;
  align-self: flex-start;
}

.cm-timeline__item:nth-child(even) {
  padding-left: 3rem;
  margin-left: 50%;
}

@media (max-width: 767px) {
  .cm-timeline__item { width: 100%; margin-left: 0 !important; padding-left: 3rem !important; padding-right: 0 !important; }
}

.cm-timeline__dot {
  position: absolute;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  background-color: var(--color-secondary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--color-primary);
  top: 0.25rem;
}

.cm-timeline__item:nth-child(odd) .cm-timeline__dot { right: -0.5rem; }
.cm-timeline__item:nth-child(even) .cm-timeline__dot { left: -0.5rem; }

@media (max-width: 767px) {
  .cm-timeline__item .cm-timeline__dot { left: 0.625rem !important; right: auto !important; }
}

.cm-timeline__year {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background-color: var(--color-primary);
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  margin-bottom: 0.5rem;
}

.cm-timeline__card {
  background: #fff;
  border: 1px solid var(--cm-border);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 12px rgba(14,27,62,0.07);
}

.cm-timeline__title {
  font-family: var(--cm-font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cm-text);
  margin-bottom: 0.5rem;
}

.cm-timeline__desc {
  font-size: 0.82rem;
  color: var(--cm-text-muted);
  line-height: 1.65;
}

/* Estadísticas sobre el timeline */
.cm-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}
@media (min-width: 640px) { .cm-stats { grid-template-columns: repeat(4, 1fr); } }

.cm-stat {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #fff;
  border: 1px solid var(--cm-border);
  border-radius: 0.5rem;
}
.cm-stat__value {
  font-family: var(--cm-font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.375rem;
}
.cm-stat__label {
  font-size: 0.75rem;
  color: var(--cm-text-muted);
  font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   TEXTO CON IMAGEN — Secciones Catequesis / Pastoral
   ══════════════════════════════════════════════════════════════ */

.cm-text-image {
  display: grid;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 768px) { .cm-text-image { grid-template-columns: 1fr 1fr; } }
@media (min-width: 768px) { .cm-text-image--reverse .cm-text-image__img { order: 2; } }

.cm-text-image__img {
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(14,27,62,0.12);
}
.cm-text-image__img img {
  width: 100%;
  height: 22rem;
  object-fit: cover;
  display: block;
}

.cm-text-image__title {
  font-family: var(--cm-font-heading);
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 700;
  color: var(--cm-text);
  margin-bottom: 0.5rem;
}
.cm-text-image__title::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 3px;
  background-color: var(--color-secondary);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.cm-text-image__subtitle {
  font-size: 0.9rem;
  color: var(--cm-text-muted);
  font-style: italic;
  margin-bottom: 1rem;
}

.cm-text-image__body {
  font-size: 0.9rem;
  color: var(--cm-text-muted);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.cm-text-image__list {
  list-style: none;
  padding: 0; margin: 0 0 1.5rem;
}
.cm-text-image__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: var(--cm-text-muted);
  padding: 0.35rem 0;
}
.cm-text-image__list li::before {
  content: '✓';
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.cm-text-image__btn {
  display: inline-block;
  background-color: var(--color-primary);
  color: #fff;
  padding: 0.65rem 1.5rem;
  border-radius: 0.2rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.2s;
}
.cm-text-image__btn:hover {
  background-color: color-mix(in srgb, var(--color-primary) 84%, black);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   GALERÍA — Tabs + grid
   ══════════════════════════════════════════════════════════════ */

.cm-gallery-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

.cm-gallery-tab {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--cm-border);
  cursor: pointer;
  background-color: #fff;
  color: var(--cm-text);
  transition: all 0.2s;
}
.cm-gallery-tab:hover,
.cm-gallery-tab.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.cm-gallery-tab__label {
  line-height: 1.2;
}

.cm-gallery-tab__count {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(30, 58, 110, 0.08);
  color: var(--cm-text-muted);
}

.cm-gallery-tab:hover .cm-gallery-tab__count,
.cm-gallery-tab.active .cm-gallery-tab__count {
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

/* Iconos SVG institucionales */
.cm-icon {
  display: block;
  flex-shrink: 0;
}

.cm-icon--zoom {
  width: 1.75rem;
  height: 1.75rem;
  color: #fff;
}

.cm-icon--control {
  width: 1.25rem;
  height: 1.25rem;
  color: #fff;
}

.cm-icon--mvv,
.cm-icon--resource {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-primary);
}

.cm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
}
@media (min-width: 640px) { .cm-gallery-grid { grid-template-columns: repeat(3, 1fr); } }

.cm-gallery-item {
  border: none;
  padding: 0;
  background: none;
  border-radius: 0.375rem;
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
  cursor: pointer;
  display: block;
  width: 100%;
}
.cm-gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.cm-gallery-item:hover img { transform: scale(1.06); }
.cm-gallery-item__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  opacity: 0;
}
.cm-gallery-item:hover .cm-gallery-item__overlay {
  background: rgba(14,27,62,0.45);
  opacity: 1;
}

/* ── Lightbox / visor modal ─── */
.cm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 15, 35, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.cm-lightbox[hidden] {
  display: none !important;
}

.cm-lightbox__content {
  max-width: min(1100px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.cm-lightbox__img {
  max-width: 100%;
  max-height: calc(90vh - 5rem);
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.cm-lightbox__caption {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  text-align: center;
  margin: 0;
  max-width: 640px;
}

.cm-lightbox__counter {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  margin: 0;
}

.cm-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cm-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cm-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cm-lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cm-lightbox__nav--prev { left: 1rem; }
.cm-lightbox__nav--next { right: 1rem; }

@media (max-width: 640px) {
  .cm-lightbox__nav { width: 2.25rem; height: 2.25rem; font-size: 1.5rem; }
  .cm-lightbox__nav--prev { left: 0.5rem; }
  .cm-lightbox__nav--next { right: 0.5rem; }
}

.cm-gallery-empty {
  text-align: center;
  color: var(--cm-text-muted);
  padding: 2rem 0;
}

/* ── Noticias: filtros y artículo ─── */
.cm-news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.cm-news-filters .cm-gallery-tab {
  cursor: default;
}

.cm-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--cm-text-muted);
}

.cm-article__image {
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 1.75rem;
  box-shadow: 0 4px 20px rgba(14, 27, 62, 0.1);
}

.cm-article__image img {
  width: 100%;
  max-height: 28rem;
  object-fit: cover;
  display: block;
}

.cm-article__content {
  color: var(--cm-text-body);
  line-height: 1.8;
}

.cm-article__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cm-border);
}

/* ══════════════════════════════════════════════════════════════
   RECURSOS INSTITUCIONALES — Cards centradas con icono
   ══════════════════════════════════════════════════════════════ */

.cm-resources-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 640px) { .cm-resources-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cm-resources-grid { grid-template-columns: repeat(3, 1fr); } }

.cm-resource-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.75rem;
  background-color: #fff;
  border: 1px solid var(--cm-border);
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.2s;
}
.cm-resource-card:hover {
  box-shadow: 0 8px 28px rgba(14,27,62,0.12);
  transform: translateY(-3px);
}
.cm-resource-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-primary) 8%, white);
}
.cm-resource-card__title {
  font-family: var(--cm-font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--cm-text);
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-secondary);
  display: inline-block;
}
.cm-resource-card__desc {
  font-size: 0.825rem;
  color: var(--cm-text-muted);
  line-height: 1.6;
  text-align: justify;
}

/* ══════════════════════════════════════════════════════════════
   QUICK LINKS — Sección con fondo oscuro
   ══════════════════════════════════════════════════════════════ */

.cm-quick-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px) { .cm-quick-links { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .cm-quick-links { grid-template-columns: repeat(5, 1fr); } }

.cm-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 1.5rem 0.75rem;
  background-color: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 0.5rem;
  color: white;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.2s;
  backdrop-filter: blur(4px);
}
.cm-quick-link:hover { background-color: rgba(255,255,255,0.18); }
.cm-quick-link__icon { font-size: 1.75rem; }

/* ══════════════════════════════════════════════════════════════
   FOOTER — Dark navy, 3 columnas
   ══════════════════════════════════════════════════════════════ */

.cm-footer {
  background-color: var(--cm-bg-dark);
  color: rgba(255,255,255,0.75);
  padding: 3.5rem 0 0;
}

.cm-footer__grid {
  display: grid;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (min-width: 768px) { .cm-footer__grid { grid-template-columns: 2fr 1fr 1fr; gap: 3rem; } }

.cm-footer__logo {
  height: 3rem;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.92);
  margin-bottom: 0.75rem;
  display: block;
}

.cm-footer__name {
  font-family: var(--cm-font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.2rem;
}

.cm-footer__slogan {
  font-size: 0.75rem;
  font-style: italic;
  color: rgba(255,255,255,0.45);
  margin-bottom: 1.25rem;
}

.cm-footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.55rem;
  font-size: 0.815rem;
  color: rgba(255,255,255,0.65);
}
.cm-footer__contact-item svg {
  width: 0.9rem; height: 0.9rem;
  color: var(--color-secondary);
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.cm-footer__contact-item a { color: rgba(255,255,255,0.65); text-decoration: none; }
.cm-footer__contact-item a:hover { color: white; }

.cm-footer__section-title {
  font-family: var(--cm-font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cm-footer__links {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.cm-footer__links a {
  font-size: 0.815rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.cm-footer__links a::before {
  content: '›';
  color: var(--color-secondary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}
.cm-footer__links a:hover { color: white; }

.cm-footer__social {
  display: flex; gap: 0.5rem; margin-top: 1rem;
}
.cm-footer__social a {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.65);
  transition: all 0.2s;
}
.cm-footer__social a:hover {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
}

.cm-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 1.25rem 1.5rem;
  margin-top: 3rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
}
@media (min-width: 768px) {
  .cm-footer__bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}
.cm-footer__bottom a { color: rgba(255,255,255,0.45); text-decoration: none; }
.cm-footer__bottom a:hover { color: rgba(255,255,255,0.75); }

/* ══════════════════════════════════════════════════════════════
   BOTONES GLOBALES — sobrescriben la plantilla default
   ══════════════════════════════════════════════════════════════ */

.template-corazon_maria .btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  border-radius: 0.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}
.template-corazon_maria .btn-primary:hover {
  background-color: color-mix(in srgb, var(--color-primary) 84%, black);
  transform: translateY(-1px);
}

.template-corazon_maria .btn-secondary {
  background-color: var(--color-secondary);
  color: #fff;
  border-radius: 0.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}
.template-corazon_maria .btn-secondary:hover {
  background-color: color-mix(in srgb, var(--color-secondary) 84%, black);
  transform: translateY(-1px);
}

.template-corazon_maria .btn-outline {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 0.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}
.template-corazon_maria .btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

/* Pages header strip */
.template-corazon_maria .bg-primary { background-color: var(--color-primary) !important; }

/* Breadcrumbs */
.template-corazon_maria .text-primary { color: var(--color-primary) !important; }

/* ── Formulario de contacto ─── */
.template-corazon_maria input,
.template-corazon_maria textarea,
.template-corazon_maria select {
  border-color: var(--cm-border);
  border-radius: 0.25rem;
  font-family: var(--cm-font-body);
}
.template-corazon_maria input:focus,
.template-corazon_maria textarea:focus,
.template-corazon_maria select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 15%, transparent);
  outline: none;
}

/* ── Scrollbar ─── */
.template-corazon_maria ::-webkit-scrollbar { width: 5px; }
.template-corazon_maria ::-webkit-scrollbar-track { background: var(--cm-bg); }
.template-corazon_maria ::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--color-primary) 35%, white);
  border-radius: 3px;
}

/* ── Animación scroll indicator ─── */
@keyframes cm-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}
