
/* =====================================================
   DIGESTO 009 — IDENTIDAD VISUAL UNIFICADA
   ===================================================== */

:root {
  --d009-bg: #061c2b;
  --d009-surface: #102f42;
  --d009-cyan: #59dfff;
  --d009-text: #eaf6fc;
}

/* Fondo continuo de la portada */
html {
  background: var(--d009-bg);
}

body,
body.dark {
  background: var(--d009-bg) !important;
}

/* Secciones institucionales */
body .civi-info-only,
body.dark .civi-info-only,
body .noticias-digesto-section,
body.dark .noticias-digesto-section,
body #facebook-compacto,
body.dark #facebook-compacto {
  background: var(--d009-bg) !important;
  color: var(--d009-text) !important;
}

/* Separación suave entre secciones */
.civi-info-only,
.noticias-digesto-section,
#facebook-compacto {
  border: 0 !important;
}

/* Noticias */
.noticias-digesto-section {
  padding-top: 54px;
  padding-bottom: 54px;
}

.noticias-digesto-section h2,
#facebook-compacto h2 {
  color: #fff;
}

/* Facebook integrado */
#facebook-compacto {
  padding-top: 35px !important;
  padding-bottom: 65px !important;
}

#facebook-compacto > div {
  border-top: 1px solid rgba(100,210,240,.14);
  padding-top: 38px;
}

#facebook-compacto a {
  color: #80e7ff;
}

/* Pie de página institucional */
body footer,
body.dark footer {
  background: var(--d009-bg) !important;
  border-color: rgba(100,210,240,.16) !important;
}

body footer p,
body.dark footer p {
  color: #b9d3e0 !important;
}

/* =====================================================
   LOGOS INSTITUCIONALES
   ===================================================== */

/* Escudo: ampliar sin modificar el HTML */
.institutional-slide img.institutional-floating-logo {
  width: min(88%, 336px) !important;
  height: 290px !important;
  max-width: 100%;
  object-fit: contain;
}

/* CIVI: ampliar */
.institutional-slide .civi-logo-mark {
  width: 253px;
  height: 253px;
  max-width: 90%;
}

.institutional-slide .civi-logo-mark strong {
  font-size: 4.5rem;
}

/* Entrada + flotación continua */
@keyframes d009EntranceFloat {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(.90);
  }
  15% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-9px) scale(1);
  }
  60% {
    transform: translateY(0) scale(1);
  }
  80% {
    transform: translateY(-7px) scale(1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.institutional-slide.is-active .institutional-floating-logo {
  animation: d009EntranceFloat 5s ease-in-out infinite;
}

/* Profundidad visual sutil */
.institutional-slide.is-active img.institutional-floating-logo {
  filter: drop-shadow(0 16px 24px rgba(36,155,205,.16));
}

.institutional-slide.is-active .civi-logo-mark {
  box-shadow:
    0 18px 55px rgba(0,160,220,.17),
    inset 0 0 30px rgba(73,213,255,.15);
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .institutional-slide.is-active .institutional-floating-logo {
    animation: none !important;
  }
}

/* Adaptación móvil */
@media (max-width: 600px) {
  .institutional-slide img.institutional-floating-logo {
    width: min(82%, 260px) !important;
    height: 240px !important;
  }

  .institutional-slide .civi-logo-mark {
    width: 205px;
    height: 205px;
  }

  .institutional-slide .civi-logo-mark strong {
    font-size: 3.5rem;
  }

  .noticias-digesto-section {
    padding-top: 36px;
    padding-bottom: 36px;
  }
}



/* DIGESTO 009.1 — TRAMA CONTINUA Y ANIMACIONES */

/* Trama institucional compartida */
body,
body.dark {
    background-color: #061c2b !important;
    background-image:
        linear-gradient(
            rgba(6, 28, 43, .91),
            rgba(6, 28, 43, .91)
        ),
        url('../img/back2.png') !important;
    background-position: center top !important;
    background-size: auto, 100% auto !important;
    background-repeat: no-repeat, repeat-y !important;
}

/* Las secciones dejan ver el fondo compartido */
body .civi-info-only,
body.dark .civi-info-only,
body .noticias-digesto-section,
body.dark .noticias-digesto-section,
body #facebook-compacto,
body.dark #facebook-compacto,
body footer,
body.dark footer {
    background: transparent !important;
}

/* Evitar que el contenido principal tape la trama */
body main {
    background: transparent !important;
}

/* Mantener la legibilidad de las tarjetas */
.p009-slide {
    background: #102f42;
}

.p009-body {
    color: #eaf6fc;
}

/* Entrada única seguida de flotación */
@keyframes d009FloatContinuous {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes d009EnterOnce {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* El elemento exterior hace la entrada.
   El logo interior conserva su flotación. */
.institutional-slide.is-active {
    animation: d009EnterOnce .85s ease-out both;
}

.institutional-slide.is-active .institutional-floating-logo {
    animation: d009FloatContinuous 4.5s ease-in-out infinite !important;
}

/* Evitar animaciones innecesarias */
@media (prefers-reduced-motion: reduce) {
    .institutional-slide.is-active,
    .institutional-slide.is-active .institutional-floating-logo {
        animation: none !important;
    }
}

/* En celulares, conservar la trama sin sobrecargar */
@media (max-width: 600px) {
    body,
    body.dark {
        background-size: auto, auto 100vh !important;
    }
}



/* DIGESTO 009.2 — MODO CLARO UNIFICADO */

/* Fondo crema continuo */
body:not(.dark) {
    background-color: #f1e7d8 !important;
    background-image:
        linear-gradient(
            rgba(241,231,216,.86),
            rgba(241,231,216,.86)
        ),
        url('../img/back2.png') !important;
    background-position: center top !important;
    background-size: auto, 100% auto !important;
    background-repeat: no-repeat, repeat-y !important;
}

/* Secciones transparentes */
body:not(.dark) .civi-info-only,
body:not(.dark) .noticias-digesto-section,
body:not(.dark) #facebook-compacto,
body:not(.dark) footer {
    background: transparent !important;
    color: #17384a !important;
}

/* Títulos y textos */
body:not(.dark) .noticias-digesto-section h2,
body:not(.dark) #facebook-compacto h2 {
    color: #17384a !important;
}

body:not(.dark) .noticias-digesto-section > div > p,
body:not(.dark) #facebook-compacto > div > p {
    color: #405b6a;
}

/* Mantener CIVI con su estética tecnológica */
body:not(.dark) .civi-info-only .civi094-carousel {
    background: linear-gradient(110deg,#073653,#04192f);
    color: #fff;
}

/* Noticias: tarjetas oscuras en ambos modos */
body:not(.dark) .p009-slide {
    background: #102f42;
    color: #eaf6fc;
}

body:not(.dark) .p009-body h3,
body:not(.dark) .p009-body p,
body:not(.dark) .p009-body small {
    color: #eaf6fc;
}

/* Facebook */
body:not(.dark) #facebook-compacto a {
    color: #0b6081;
}

/* Pie de página */
body:not(.dark) footer {
    border-color: rgba(23,56,74,.18) !important;
}

body:not(.dark) footer p {
    color: #405b6a !important;
}
