/* CEA Santa Rita — interacciones automáticas + hover intensos */

:root {
  --cea-glow-rojo: 0 18px 40px rgba(179, 40, 45, 0.28);
  --cea-glow-ambar: 0 18px 40px rgba(232, 160, 23, 0.3);
  --cea-glow-mix: 0 22px 48px rgba(179, 40, 45, 0.22), 0 8px 20px rgba(232, 160, 23, 0.18);
}

/* ——— Hover global en tarjetas / paneles / cajas ——— */
.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 {
  transition:
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.5s ease,
    border-color 0.4s ease,
    background 0.45s ease,
    filter 0.4s ease,
    color 0.35s ease !important;
}
.cea-news-card:hover,
.cea-gallery-card:hover,
.cea-panel:hover,
.cea-malla-viewer:hover,
main .card:hover,
main form.bg-white:hover,
main .bg-white.p-3:hover,
main .bg-white.p-4:hover {
  transform: translateY(-12px) scale(1.02) !important;
  box-shadow: var(--cea-glow-mix) !important;
  border-color: rgba(232, 160, 23, 0.55) !important;
  background:
    linear-gradient(160deg, #ffffff 0%, #FFF8EE 45%, #FFEFE4 100%) !important;
  filter: saturate(1.05);
}
.cea-gallery-quote:hover {
  transform: translateY(-10px) translateX(6px) scale(1.015) !important;
  box-shadow: var(--cea-glow-rojo) !important;
  background: linear-gradient(160deg, #fff, #FFF4E8) !important;
}
.cea-empty:hover {
  transform: translateY(-8px) scale(1.01) !important;
  box-shadow: var(--cea-glow-ambar) !important;
  color: var(--cea-rojo-oscuro) !important;
  background: linear-gradient(160deg, #fff, #FFF6EA) !important;
}

/* Pulso automático suave cuando ya entraron en viewport */
.cea-reveal.is-in.cea-news-card,
.cea-reveal.is-in.cea-gallery-card,
.cea-reveal.is-in.cea-panel {
  animation: ceaIdleFloat 5.5s ease-in-out infinite;
}
.cea-reveal.is-in.cea-news-card:nth-child(odd),
.cea-reveal.is-in.cea-gallery-card:nth-child(odd) {
  animation-delay: 0.4s;
}
.cea-reveal.is-in.cea-news-card:hover,
.cea-reveal.is-in.cea-gallery-card:hover,
.cea-reveal.is-in.cea-panel:hover {
  animation: none;
}
@keyframes ceaIdleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ——— Lista de ítems ——— */
.cea-list-item {
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.4s ease,
    box-shadow 0.45s ease,
    padding-left 0.4s ease,
    border-color 0.35s !important;
}
.cea-list-item:hover {
  transform: translateX(10px) scale(1.01) !important;
  background:
    linear-gradient(90deg, rgba(179, 40, 45, 0.1), rgba(232, 160, 23, 0.14), rgba(207, 109, 31, 0.08)) !important;
  box-shadow:
    inset 5px 0 0 transparent,
    0 16px 36px rgba(122, 27, 30, 0.12) !important;
  border-radius: 0.85rem;
}
.cea-list-item:hover h3 {
  background: linear-gradient(90deg, #B3282D, #E8A017, #CF6D1F) !important;
  background-size: 200% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  animation: ceaTextFlow 2.2s ease infinite;
  transform: translateX(4px);
  letter-spacing: 0.015em;
}
.cea-list-item:hover .cea-badge {
  transform: scale(1.1) rotate(-2deg);
  box-shadow: 0 8px 18px rgba(232, 160, 23, 0.25);
}
@keyframes ceaTextFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ——— Títulos y textos ——— */
.cea-section-title {
  transition: transform 0.4s ease, filter 0.4s ease, letter-spacing 0.4s !important;
}
.cea-section-title:hover {
  transform: translateX(8px) scale(1.02);
  filter: drop-shadow(0 8px 16px rgba(179, 40, 45, 0.2));
  letter-spacing: 0.01em;
}
.cea-section-sub {
  transition: color 0.4s ease, transform 0.4s ease, opacity 0.4s;
}
.cea-section-sub:hover {
  color: #5A4338;
  transform: translateX(4px);
}

main h2, main h3, main .h5 {
  transition: color 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), text-shadow 0.4s !important;
}
main h2:hover, main h3:hover, main .h5:hover {
  color: var(--cea-rojo) !important;
  transform: translateY(-2px) scale(1.02);
  text-shadow: 0 10px 24px rgba(179, 40, 45, 0.18);
}
main p a:hover,
main a:not(.btn):not(.nav-link):not(.cea-social-btn):not(.cea-list-item):not(.cea-brand):hover {
  color: var(--cea-naranja) !important;
  text-shadow: 0 0 18px rgba(232, 160, 23, 0.35);
}

/* ——— Badges vivientes ——— */
.cea-badge {
  transition: transform 0.35s ease, box-shadow 0.35s, background 0.35s, color 0.35s, filter 0.35s !important;
}
.cea-badge:hover {
  transform: scale(1.12) translateY(-2px);
  filter: saturate(1.2);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}
.cea-badge-ok:hover {
  background: linear-gradient(135deg, rgba(99, 153, 34, 0.28), rgba(232, 160, 23, 0.15));
  color: #3f6e12;
}
.cea-badge-dorado:hover {
  background: linear-gradient(135deg, #E8A017, #CF6D1F);
  color: #fff;
}
.cea-badge-alerta:hover {
  background: linear-gradient(135deg, #EF9F27, #E8A017);
  color: #fff;
}
.cea-badge-critico:hover {
  background: linear-gradient(135deg, #E24B4A, #B3282D);
  color: #fff;
}
.cea-reveal.is-in .cea-badge {
  animation: ceaBadgeGlow 3.2s ease-in-out infinite;
}
@keyframes ceaBadgeGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 160, 23, 0); }
  50% { box-shadow: 0 0 0 6px rgba(232, 160, 23, 0.12); }
}

/* ——— Botones explosivos de hover ——— */
.btn-cea,
.btn-cea-outline,
.btn-cea-ghost {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    background 0.4s ease,
    color 0.35s ease,
    border-color 0.35s,
    filter 0.35s !important;
}
.btn-cea:hover {
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow: var(--cea-glow-mix) !important;
  filter: brightness(1.08) saturate(1.1);
}
.btn-cea-outline:hover {
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow: 0 16px 36px rgba(232, 160, 23, 0.35) !important;
}
.btn-cea-ghost:hover {
  transform: translateY(-4px) scale(1.05) !important;
  box-shadow: var(--cea-glow-rojo) !important;
}
.btn-cea:active,
.btn-cea-outline:active,
.btn-cea-ghost:active {
  transform: translateY(0) scale(0.96) !important;
}

/* ——— Menú: hover más vivo ——— */
.cea-nav .nav-link {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease,
    color 0.35s ease,
    box-shadow 0.35s ease,
    letter-spacing 0.35s !important;
}
.cea-nav .nav-link:hover {
  transform: translateY(-4px) scale(1.06) !important;
  letter-spacing: 0.03em;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28) !important;
}
.cea-nav .nav-link.active {
  animation: ceaActivePulse 2.8s ease-in-out infinite;
}
@keyframes ceaActivePulse {
  0%, 100% { box-shadow: 0 12px 28px rgba(232, 160, 23, 0.28); }
  50% { box-shadow: 0 16px 34px rgba(232, 160, 23, 0.48), 0 0 0 4px rgba(232, 160, 23, 0.12); }
}
.cea-nav .nav-link.active:hover {
  animation: none;
  transform: translateY(-4px) scale(1.07) !important;
}
.cea-brand:hover {
  transform: translateY(-2px) scale(1.02);
}
.cea-brand img {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.45s !important;
  animation: none;
}
.cea-brand:hover img {
  transform: scale(1.14) rotate(-8deg) !important;
  filter: saturate(1.2) brightness(1.05);
  animation: none;
}
@keyframes ceaLogoGlow {
  0%, 100% { box-shadow: 0 0 0 2px rgba(232, 160, 23, 0.35), 0 8px 18px rgba(0, 0, 0,.25); }
  50% { box-shadow: 0 0 0 4px rgba(232, 160, 23, 0.55), 0 12px 26px rgba(179, 40, 45, 0.35); }
}

/* ——— Galería media ——— */
.cea-gallery-media {
  transition: transform 0.5s ease, box-shadow 0.5s;
}
.cea-gallery-card:hover .cea-gallery-media {
  transform: scale(1.02);
}
.cea-gallery-overlay {
  backdrop-filter: blur(2px);
  background: linear-gradient(135deg, rgba(179, 40, 45, 0.55), rgba(232, 160, 23, 0.5)) !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
  transform: scale(1.05);
}
.cea-gallery-card:hover .cea-gallery-overlay {
  opacity: 1 !important;
  transform: scale(1);
}
.cea-gallery-title {
  transition: transform 0.4s ease, letter-spacing 0.4s !important;
}
.cea-gallery-card:hover .cea-gallery-title {
  transform: translateY(-2px);
  letter-spacing: 0.02em;
}

/* ——— Carrusel ——— */
.cea-carousel-shell {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.55s !important;
}
.cea-carousel-shell:hover {
  transform: translateY(-10px) scale(1.01) !important;
  box-shadow: 0 34px 70px rgba(122, 27, 30, 0.28) !important;
}
.cea-carousel-shell:hover .cea-carousel-caption h3 {
  color: #FFE7B8;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transform: translateX(6px);
  transition: transform 0.4s ease, color 0.4s, text-shadow 0.4s;
}
.carousel-control-prev,
.carousel-control-next {
  transition: transform 0.35s ease, opacity 0.35s !important;
  opacity: 0.75;
}
.carousel-control-prev:hover,
.carousel-control-next:hover {
  transform: scale(1.15);
  opacity: 1;
}

/* ——— Footer / redes ——— */
.cea-footer a {
  transition: color 0.3s ease, transform 0.35s ease, text-shadow 0.35s !important;
}
.cea-footer-links a:hover {
  color: #FFD27A !important;
  transform: translateX(8px) scale(1.03);
  text-shadow: 0 0 16px rgba(232, 160, 23, 0.45);
}
.cea-social-btn {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s, background 0.35s, border-color 0.35s !important;
  animation: ceaSocialIdle 4.5s ease-in-out infinite;
}
.cea-social-btn:nth-child(2) { animation-delay: 0.3s; }
.cea-social-btn:nth-child(3) { animation-delay: 0.6s; }
.cea-social-btn:nth-child(4) { animation-delay: 0.9s; }
.cea-social-btn:nth-child(5) { animation-delay: 1.2s; }
.cea-social-btn:nth-child(6) { animation-delay: 1.5s; }
.cea-social-btn:hover {
  animation: none;
  transform: scale(1.28) translateY(-6px) rotate(-6deg) !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.35) !important;
}
@keyframes ceaSocialIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ——— Formularios ——— */
main .form-control,
main .form-select,
main textarea.form-control {
  transition: transform 0.35s ease, box-shadow 0.4s ease, border-color 0.35s, background 0.35s !important;
}
main .form-control:hover,
main .form-select:hover,
main textarea.form-control:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 160, 23, 0.55) !important;
  box-shadow: 0 10px 24px rgba(232, 160, 23, 0.12);
  background: linear-gradient(180deg, #fff, #FFF8EF) !important;
}
main .form-control:focus,
main .form-select:focus,
main textarea.form-control:focus {
  transform: translateY(-3px) scale(1.01);
  border-color: var(--cea-ambar) !important;
  box-shadow:
    0 0 0 0.25rem rgba(232, 160, 23, 0.2),
    0 14px 30px rgba(179, 40, 45, 0.1) !important;
}

/* ——— Tabs ——— */
.cea-gallery-tabs .nav-link {
  transition: transform 0.35s ease, background 0.35s, color 0.35s, box-shadow 0.35s !important;
}
.cea-gallery-tabs .nav-link:hover {
  transform: translateY(-4px) scale(1.05);
  color: var(--cea-rojo) !important;
  background: #fff !important;
  box-shadow: 0 12px 26px rgba(232, 160, 23, 0.2);
}
.cea-gallery-tabs .nav-link.active {
  animation: ceaTabShine 3s ease-in-out infinite;
}
@keyframes ceaTabShine {
  0%, 100% { box-shadow: 0 12px 26px rgba(179, 40, 45, 0.28); }
  50% { box-shadow: 0 16px 34px rgba(207, 109, 31, 0.4); }
}

/* ——— Page header texts hover ——— */
.cea-page-header h1:hover {
  transform: scale(1.02);
  letter-spacing: 0.03em;
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(232, 160, 23, 0.35);
}
.cea-page-header p:hover {
  color: #FFE7B8;
  transform: translateX(4px);
}

/* ——— Imágenes ——— */
main img:not(.cea-brand img):not(.rounded-circle) {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s, box-shadow 0.5s, border-radius 0.5s !important;
}
main img:not(.cea-brand img):not(.rounded-circle):hover {
  transform: scale(1.045) !important;
  filter: saturate(1.12) contrast(1.04) !important;
  box-shadow: var(--cea-glow-mix) !important;
  border-radius: 0.85rem;
}

/* ——— Fade automático en comunicados del home ——— */
.cea-news-card .h5,
.cea-news-card h3 {
  transition: color 0.35s, transform 0.4s, background-position 0.5s !important;
}
.cea-news-card:hover .h5,
.cea-news-card:hover h3 {
  background: linear-gradient(90deg, #B3282D, #E8A017, #CF6D1F);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: ceaTextFlow 2s linear infinite;
  transform: translateY(-2px);
}

/* Orbes de color decorativos animados en secciones */
.cea-section-alt {
  overflow: hidden;
}
.cea-section-alt::before {
  animation: ceaSectionWash 12s ease-in-out infinite alternate;
}
@keyframes ceaSectionWash {
  0% { opacity: 0.7; transform: translateX(0); }
  100% { opacity: 1; transform: translateX(-2%); }
}

/* Sombras de color que respiran en contenedores visibles */
.cea-reveal.is-in.cea-malla-viewer,
.cea-reveal.is-in.cea-carousel-shell {
  animation: ceaBreatheShadow 4.5s ease-in-out infinite;
}
@keyframes ceaBreatheShadow {
  0%, 100% { box-shadow: 0 16px 40px rgba(44, 36, 30, 0.1); }
  50% { box-shadow: 0 22px 50px rgba(179, 40, 45, 0.18), 0 8px 22px rgba(232, 160, 23, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .cea-reveal.is-in.cea-news-card,
  .cea-reveal.is-in.cea-gallery-card,
  .cea-reveal.is-in.cea-panel,
  .cea-nav .nav-link.active,
  .cea-brand img,
  .cea-social-btn,
  .cea-reveal.is-in .cea-badge,
  .cea-gallery-tabs .nav-link.active,
  .cea-reveal.is-in.cea-malla-viewer,
  .cea-reveal.is-in.cea-carousel-shell,
  .btn-cea {
    animation: none !important;
  }
  .cea-news-card:hover,
  .cea-gallery-card:hover,
  .cea-panel:hover,
  .cea-list-item:hover,
  .btn-cea:hover,
  .cea-nav .nav-link:hover {
    transform: none !important;
  }
}
