/* CEA Santa Rita — estilo “interactivo tipo Flash”: separación, color vivo, scroll + hover */

/* ——— Separación generosa entre bloques ——— */
.cea-section {
  padding: clamp(3.8rem, 7.5vw, 6.2rem) 0 !important;
}
.cea-section + .cea-section {
  margin-top: 0.35rem;
}
main .row.g-3 { --bs-gutter-y: 1.35rem; --bs-gutter-x: 1.35rem; }
main .row.g-4 { --bs-gutter-y: 1.85rem; --bs-gutter-x: 1.85rem; }
main .row.g-5 { --bs-gutter-y: 2.4rem; --bs-gutter-x: 2.4rem; }

.cea-news-card,
.cea-gallery-card,
.cea-gallery-quote,
.cea-panel,
.cea-malla-viewer,
.cea-empty,
main .card,
main form.bg-white,
main .bg-white.p-3,
main .bg-white.p-4 {
  margin-bottom: 0.35rem;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.85) inset,
    0 16px 38px rgba(44, 30, 28, 0.1),
    0 4px 12px rgba(232, 160, 23, 0.06) !important;
}

.cea-list-item {
  margin: 0.55rem 0 !important;
  padding: 1.45rem 1.15rem !important;
  border: 1px solid rgba(44, 44, 42, 0.07);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(44, 36, 30, 0.06);
  border-radius: 1rem !important;
}
.cea-list-item + .cea-list-item {
  margin-top: 0.95rem !important;
}

.cea-carousel-shell {
  margin-bottom: 2rem !important;
}

.cea-section-title {
  margin-bottom: 0.55rem !important;
}
.cea-section-sub {
  margin-bottom: 2.4rem !important;
}

/* ——— Secciones con color suave y cambio al hover / scroll ——— */
.cea-section {
  transition:
    background 0.7s ease,
    box-shadow 0.6s ease,
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.5s ease;
  border-radius: 0;
  position: relative;
}
.cea-section::before {
  content: "";
  position: absolute;
  inset: 1.25rem 3%;
  border-radius: 1.5rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.55s ease;
  background: linear-gradient(135deg, rgba(255,255,255,0.55), rgba(255, 244, 230, 0.35));
  box-shadow: 0 24px 60px rgba(44, 30, 28, 0.08);
  z-index: 0;
}
.cea-section > .container {
  position: relative;
  z-index: 1;
}

/* Tonos suaves por orden (auto) */
main .cea-section:nth-of-type(4n + 1) {
  background: linear-gradient(180deg, rgba(255, 248, 242, 0.9), rgba(255, 255, 255, 0.4));
}
main .cea-section:nth-of-type(4n + 2),
main .cea-section.cea-section-alt {
  background:
    radial-gradient(700px 240px at 100% 0%, rgba(232, 160, 23, 0.14), transparent 58%),
    radial-gradient(520px 200px at 0% 100%, rgba(179, 40, 45, 0.08), transparent 60%),
    linear-gradient(180deg, #F3EBE2, #EFE6DB) !important;
}
main .cea-section:nth-of-type(4n + 3) {
  background:
    radial-gradient(650px 220px at 0% 0%, rgba(179, 40, 45, 0.08), transparent 55%),
    linear-gradient(180deg, #F7F2F0, #F2EDEA);
}
main .cea-section:nth-of-type(4n + 4) {
  background:
    radial-gradient(600px 220px at 90% 10%, rgba(207, 109, 31, 0.1), transparent 55%),
    linear-gradient(180deg, #F6F0E8, #F3EBDF);
}

.cea-section:hover {
  filter: saturate(1.06);
}
.cea-section:hover::before {
  opacity: 1;
  transform: scale(1.01);
}
.cea-section.is-near {
  box-shadow: inset 0 0 0 1px rgba(232, 160, 23, 0.18);
}
.cea-section.is-near::before {
  opacity: 0.85;
}
.cea-section.is-hot {
  background:
    radial-gradient(720px 280px at 50% 0%, rgba(232, 160, 23, 0.2), transparent 55%),
    radial-gradient(520px 240px at 10% 100%, rgba(179, 40, 45, 0.12), transparent 60%),
    linear-gradient(180deg, #FFEFD9, #F8E6D4) !important;
  transform: scale(1.008);
  box-shadow:
    inset 0 0 0 1px rgba(232, 160, 23, 0.28),
    0 20px 50px rgba(179, 40, 45, 0.08);
}

/* ——— Escenarios tipo Flash: tarjetas reaccionan al scroll ——— */
.cea-stage {
  transform: translate3d(0, var(--cea-y, 0px), 0) scale(var(--cea-scale, 1));
  opacity: var(--cea-opacity, 1);
  filter: saturate(var(--cea-sat, 1));
  transition:
    box-shadow 0.45s ease,
    border-color 0.4s ease,
    background 0.45s ease;
  will-change: transform, opacity, filter;
}
/* Evitar conflicto: el scroll controla transform de .cea-stage */
.cea-stage.cea-reveal.is-in.cea-news-card,
.cea-stage.cea-reveal.is-in.cea-gallery-card,
.cea-stage.cea-reveal.is-in.cea-panel,
.cea-stage.cea-reveal.is-in.cea-malla-viewer,
.cea-stage.cea-reveal.is-in.cea-carousel-shell {
  animation: none !important;
}
.cea-stage.is-focus {
  --cea-scale: 1.03;
  --cea-sat: 1.08;
  z-index: 2;
  box-shadow:
    0 26px 55px rgba(122, 27, 30, 0.16),
    0 10px 24px rgba(232, 160, 23, 0.14) !important;
  border-color: rgba(232, 160, 23, 0.45) !important;
}

/* ——— Hover “Flash”: multi-paso de color / tamaño / sombra ——— */
.cea-news-card,
.cea-gallery-card,
.cea-panel,
.cea-malla-viewer,
main .card {
  isolation: isolate;
}
.cea-news-card:hover,
.cea-gallery-card:hover,
.cea-panel:hover,
.cea-malla-viewer:hover,
main .card:hover {
  transform: translateY(-14px) scale(1.035) rotate(-0.35deg) !important;
  background:
    linear-gradient(145deg, #ffffff 0%, #FFF4E4 42%, #FFE3C8 100%) !important;
  box-shadow:
    0 28px 60px rgba(179, 40, 45, 0.2),
    0 12px 28px rgba(232, 160, 23, 0.22),
    0 0 0 1px rgba(232, 160, 23, 0.35) !important;
  border-color: transparent !important;
}
.cea-news-card:hover::before {
  transform: scaleX(1) !important;
  height: 4px;
  background: linear-gradient(90deg, #B3282D, #E8A017, #CF6D1F, #B3282D);
  background-size: 200% 100%;
  animation: ceaFlashBar 1.6s linear infinite;
}
@keyframes ceaFlashBar {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.cea-list-item:hover {
  transform: translateX(14px) scale(1.02) !important;
  background:
    linear-gradient(105deg, rgba(179, 40, 45, 0.12), rgba(232, 160, 23, 0.16), rgba(255, 255, 255, 0.9)) !important;
  box-shadow:
    0 20px 44px rgba(122, 27, 30, 0.14),
    inset 5px 0 0 #E8A017 !important;
  border-color: rgba(232, 160, 23, 0.35) !important;
}

/* Botones “magnéticos” */
.btn-cea:hover,
.btn-cea-ghost:hover,
.btn-cea-outline:hover {
  transform: translateY(-6px) scale(1.07) !important;
  letter-spacing: 0.03em;
}
.btn-cea:hover {
  box-shadow:
    0 20px 40px rgba(179, 40, 45, 0.35),
    0 0 0 5px rgba(232, 160, 23, 0.18) !important;
}

/* Galería: marco vivo */
.cea-gallery-card {
  outline: 0 solid rgba(232, 160, 23, 0);
  transition: outline-width 0.35s ease, outline-color 0.35s, transform 0.5s, box-shadow 0.5s !important;
}
.cea-gallery-card:hover {
  outline: 3px solid rgba(232, 160, 23, 0.45);
  outline-offset: 3px;
}

/* Tabs con rebote visual */
.cea-gallery-tabs {
  gap: 0.55rem !important;
  padding: 0.5rem !important;
}
.cea-gallery-tabs .nav-link:hover {
  transform: translateY(-5px) scale(1.07) !important;
}
.cea-gallery-tabs .nav-link.active:hover {
  transform: translateY(-3px) scale(1.05) !important;
}

/* Menú más “juguetón” al hover */
.cea-nav {
  gap: 0.2rem;
}
.cea-nav .nav-link:hover {
  transform: translateY(-5px) scale(1.08) !important;
  background: linear-gradient(135deg, rgba(232, 160, 23, 0.22), rgba(179, 40, 45, 0.2)) !important;
}

/* Page header reactivo */
.cea-page-header {
  transition: filter 0.45s ease, box-shadow 0.45s;
}
.cea-page-header.is-hot {
  filter: saturate(1.15) brightness(1.05);
  box-shadow: 0 18px 40px rgba(122, 27, 30, 0.25);
}
.cea-page-header h1,
.cea-page-header p {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), text-shadow 0.45s, color 0.35s, letter-spacing 0.4s;
}
.cea-page-header:hover h1 {
  transform: scale(1.035);
  letter-spacing: 0.025em;
  text-shadow: 0 14px 36px rgba(0, 0, 0, 0.35), 0 0 28px rgba(232, 160, 23, 0.4);
}
.cea-page-header:hover p {
  transform: translateX(8px);
  color: #FFE7B8;
}

/* Indicador de “escenario activo” al scroll */
.cea-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 2000;
  background: linear-gradient(90deg, #7A1B1E, #B3282D, #E8A017, #CF6D1F);
  background-size: 200% 100%;
  animation: ceaFlashBar 2.5s linear infinite;
  box-shadow: 0 0 12px rgba(232, 160, 23, 0.55);
  pointer-events: none;
  transition: width 0.1s linear;
}

/* Sparkles flotantes suaves (decorativo) */
.cea-spark {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background: radial-gradient(circle, #E8A017, transparent 70%);
  animation: ceaSparkDrift 14s linear infinite;
  mix-blend-mode: multiply;
}
.cea-spark:nth-child(2) {
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, #B3282D, transparent 70%);
  animation-duration: 18s;
}
@keyframes ceaSparkDrift {
  0% { transform: translateY(110vh) translateX(0) scale(0.6); opacity: 0; }
  15% { opacity: 0.4; }
  85% { opacity: 0.25; }
  100% { transform: translateY(-10vh) translateX(40px) scale(1.2); opacity: 0; }
}

/* Footer separación / hover drama */
.cea-footer {
  margin-top: 1rem;
}
.cea-footer h5:hover {
  transform: translateX(6px) scale(1.03);
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  .cea-stage,
  .cea-section,
  .cea-section.is-hot,
  .cea-scroll-progress,
  .cea-spark {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
  .cea-news-card:hover,
  .cea-gallery-card:hover,
  .cea-list-item:hover,
  .btn-cea:hover {
    transform: none !important;
  }
}
