/* CEA Santa Rita — motion / degradados / efectos modernos */

/* ——— Fondo vivo con blobs en movimiento ——— */
body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(1000px 420px at 100% -8%, rgba(232, 160, 23, 0.1), transparent 55%),
    radial-gradient(820px 360px at -5% 18%, rgba(179, 40, 45, 0.07), transparent 52%),
    linear-gradient(180deg, #F7F5F2 0%, var(--cea-fondo) 40%, #F3F0EB 100%);
}
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: multiply;
}
body::before {
  width: min(48vw, 520px);
  height: min(48vw, 520px);
  top: 12%;
  left: -8%;
  background: radial-gradient(circle, rgba(232, 160, 23, 0.35), rgba(207, 109, 31, 0.08) 55%, transparent 70%);
  animation: ceaBlobA 18s ease-in-out infinite alternate;
}
body::after {
  width: min(42vw, 460px);
  height: min(42vw, 460px);
  right: -6%;
  bottom: 18%;
  background: radial-gradient(circle, rgba(179, 40, 45, 0.28), rgba(122, 27, 30, 0.08) 50%, transparent 70%);
  animation: ceaBlobB 22s ease-in-out infinite alternate;
}
@keyframes ceaBlobA {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8%, 12%) scale(1.12); }
  100% { transform: translate(4%, -6%) scale(0.95); }
}
@keyframes ceaBlobB {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10%, -8%) scale(1.08); }
  100% { transform: translate(-4%, 10%) scale(1.15); }
}

/* ——— Variantes de revelado ——— */
.cea-reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.985);
  filter: blur(2px);
  transition:
    opacity 0.85s var(--ease-out),
    transform 0.85s var(--ease-out),
    filter 0.85s var(--ease-out),
    box-shadow 0.4s,
    border-color 0.35s,
    background 0.35s,
    color 0.3s !important;
  transition-delay: var(--cea-delay, 0s);
  will-change: opacity, transform, filter;
}
.cea-reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}
.cea-reveal[data-anim="left"] {
  transform: translateX(-40px) scale(0.98);
}
.cea-reveal[data-anim="right"] {
  transform: translateX(40px) scale(0.98);
}
.cea-reveal[data-anim="scale"] {
  transform: scale(0.9);
  filter: blur(3px);
}
.cea-reveal[data-anim="fade"] {
  transform: none;
  filter: blur(4px);
}
.cea-reveal[data-anim="left"].is-in,
.cea-reveal[data-anim="right"].is-in,
.cea-reveal[data-anim="scale"].is-in,
.cea-reveal[data-anim="fade"].is-in {
  transform: none;
  filter: none;
}

/* Textos con entrada elegante */
.cea-reveal.is-in .cea-section-title,
.cea-anim-text.is-in {
  animation: ceaTextRise 0.8s var(--ease-out) both;
}
@keyframes ceaTextRise {
  from { letter-spacing: 0.04em; opacity: 0.4; }
  to { letter-spacing: -0.015em; opacity: 1; }
}

.cea-reveal.is-in .cea-section-title::after {
  animation: ceaUnderlineGrow 0.7s var(--ease-out) both;
}
@keyframes ceaUnderlineGrow {
  from { width: 0; opacity: 0; }
  to { width: 3.25rem; opacity: 1; }
}

/* Gradient text animado */
.cea-text-gradient,
.cea-section-title {
  background-size: 200% 100% !important;
  animation: ceaGradShift 8s ease-in-out infinite;
}
@keyframes ceaGradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ——— Page header con degradado vivo ——— */
.cea-page-header {
  position: relative;
  overflow: hidden;
}
.cea-page-header::after {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(255, 214, 140, 0.18) 45%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: ceaSheenSweep 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ceaSheenSweep {
  0% { transform: translateX(-30%) rotate(8deg); opacity: 0.35; }
  50% { transform: translateX(20%) rotate(8deg); opacity: 0.7; }
  100% { transform: translateX(55%) rotate(8deg); opacity: 0.35; }
}
.cea-page-header h1,
.cea-page-header p {
  position: relative;
  z-index: 1;
}
.cea-page-header h1 {
  animation: ceaFadeUp 0.85s var(--ease-out) both;
}
.cea-page-header p {
  animation: ceaFadeUp 0.9s var(--ease-out) 0.12s both;
}

/* ——— Contenedores con borde degradado animado ——— */
.cea-panel,
.cea-news-card,
.cea-gallery-card,
.cea-malla-viewer,
main form.bg-white,
main .bg-white.p-3,
main .bg-white.p-4,
main .card {
  position: relative;
}
.cea-news-card::after,
.cea-gallery-card::after,
.cea-malla-viewer::after,
main form.bg-white::after,
main .card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    120deg,
    rgba(179, 40, 45, 0.55),
    rgba(232, 160, 23, 0.65),
    rgba(207, 109, 31, 0.5),
    rgba(179, 40, 45, 0.4),
    rgba(232, 160, 23, 0.55)
  );
  background-size: 300% 300%;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s;
  animation: ceaBorderFlow 6s linear infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.cea-news-card:hover::after,
.cea-gallery-card:hover::after,
.cea-malla-viewer:hover::after,
main form.bg-white:hover::after,
main .card:hover::after {
  opacity: 1;
}
@keyframes ceaBorderFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Brillo al pasar el mouse */
.cea-shine {
  position: relative;
  overflow: hidden;
}
.cea-shine::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -60%;
  width: 45%;
  height: 180%;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 48%,
    transparent 62%
  );
  transform: translateX(-120%) rotate(12deg);
  transition: transform 0.85s var(--ease-out);
  pointer-events: none;
  z-index: 2;
}
.cea-shine:hover::before {
  transform: translateX(320%) rotate(12deg);
}

/* Listas: entrada + acento animado */
.cea-list-item {
  position: relative;
  overflow: hidden;
}
.cea-list-item::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(180deg, var(--cea-rojo), var(--cea-ambar), var(--cea-naranja));
  transition: width 0.45s var(--ease-out);
  opacity: 0.95;
}
.cea-list-item:hover::after { width: 4px; }
.cea-list-item img {
  transition: transform 0.7s var(--ease-out), filter 0.45s;
}
.cea-list-item:hover img {
  transform: scale(1.05);
  filter: saturate(1.08);
}

/* Imágenes generales en main */
main img:not(.cea-brand img):not(.rounded-circle) {
  transition: transform 0.7s var(--ease-out), filter 0.45s, box-shadow 0.45s;
}
main img:not(.cea-brand img):not(.rounded-circle):hover {
  transform: scale(1.025);
  filter: saturate(1.06) contrast(1.02);
  box-shadow: 0 18px 40px rgba(122, 27, 30, 0.14);
}

/* Bloques de texto institucionales */
main h2:not(.cea-section-title),
main h3:not(.cea-gallery-title) {
  transition: color 0.35s, transform 0.35s var(--ease-out), letter-spacing 0.35s;
}
main h2:not(.cea-section-title):hover,
main h3:not(.cea-gallery-title):hover {
  color: var(--cea-rojo);
  letter-spacing: 0.01em;
  transform: translateX(3px);
}
main p {
  transition: color 0.3s, opacity 0.3s;
}

/* Badges con pulso suave al entrar */
.cea-reveal.is-in .cea-badge {
  animation: ceaBadgePop 0.55s var(--ease-out) both;
}
@keyframes ceaBadgePop {
  0% { transform: scale(0.85); opacity: 0; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

/* Botones: degradado vivo */
.btn-cea {
  background-size: 180% 180%;
  background-image: linear-gradient(135deg, var(--cea-rojo), var(--cea-naranja), var(--cea-rojo-oscuro), var(--cea-rojo)) !important;
  animation: ceaBtnGrad 7s ease infinite;
}
.btn-cea:hover {
  animation-duration: 2.5s;
}
@keyframes ceaBtnGrad {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Secciones con barra inferior animada */
.cea-section {
  position: relative;
}
.cea-section-alt::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cea-rojo), var(--cea-ambar), var(--cea-naranja), transparent);
  background-size: 200% 100%;
  animation: ceaLineFlow 10s linear infinite;
  opacity: 0.55;
}
@keyframes ceaLineFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Footer columnas animadas */
.cea-footer .col-lg-4,
.cea-footer .col-lg-3,
.cea-footer .col-lg-5 {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.cea-footer.is-in .col-lg-4 { transition-delay: 0.05s; }
.cea-footer.is-in .col-lg-3 { transition-delay: 0.15s; }
.cea-footer.is-in .col-lg-5 { transition-delay: 0.25s; }
.cea-footer.is-in .col-lg-4,
.cea-footer.is-in .col-lg-3,
.cea-footer.is-in .col-lg-5 {
  opacity: 1;
  transform: none;
}
.cea-footer.is-in .cea-social-btn {
  animation: ceaBadgePop 0.5s var(--ease-out) both;
}
.cea-footer.is-in .cea-social-btn:nth-child(2) { animation-delay: 0.06s; }
.cea-footer.is-in .cea-social-btn:nth-child(3) { animation-delay: 0.12s; }
.cea-footer.is-in .cea-social-btn:nth-child(4) { animation-delay: 0.18s; }
.cea-footer.is-in .cea-social-btn:nth-child(5) { animation-delay: 0.24s; }
.cea-footer.is-in .cea-social-btn:nth-child(6) { animation-delay: 0.3s; }

/* Nav: shimmer sutil continuo en la franja */
.cea-navbar::before {
  animation: ceaNavGlow 7s ease-in-out infinite !important;
}

/* Panel genérico utilizable */
.cea-panel {
  background: linear-gradient(180deg, #fff, #FFF9F2);
  border: 1px solid rgba(44, 44, 42, 0.08);
  border-radius: 1rem;
  padding: 1.35rem 1.4rem;
  box-shadow: 0 14px 34px rgba(44, 36, 30, 0.07);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s;
}
.cea-panel:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(122, 27, 30, 0.12);
}
.cea-panel h3 {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--cea-rojo) !important;
  animation: none !important;
}

/* Hover lift genérico */
.cea-lift {
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.cea-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(122, 27, 30, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .cea-page-header::after,
  .cea-section-alt::after,
  .btn-cea,
  .cea-text-gradient,
  .cea-section-title,
  .cea-navbar::before,
  .cea-news-card::after,
  .cea-gallery-card::after {
    animation: none !important;
  }
  .cea-reveal,
  .cea-reveal[data-anim] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .cea-footer .col-lg-4,
  .cea-footer .col-lg-3,
  .cea-footer .col-lg-5 {
    opacity: 1 !important;
    transform: none !important;
  }
}
