/* ======================================================================
   QUEBRADA EL AMOLADERO — MODAL EDITORIAL AVES, AISLADO
   100% de las reglas están bajo #fauna-flora-modal.fauna-flora-modal--aves.
   Flora no recibe nuevas reglas visuales. Cargar después del CSS base.
   ====================================================================== */

#fauna-flora-modal.fauna-flora-modal--aves {
    --aves-deep: #00594f;
    --aves-white: #f7faf7;
    --aves-soft: #dce5df;
    --aves-credit: #62b881;
    --aves-watermark: url('../images/fauna-flora-buho-watermark.svg');
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__backdrop {
    background: rgba(0, 48, 40, .94);
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__dialog,
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__content,
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__gallery,
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__information {
    background-color: var(--aves-deep);
}

/* CENEFA ORIGINAL DE FAUNA Y FLORA — AVES.
   El SVG original es una pieza completa de 1920 x 134, NO es un mosaico
   repetible. Desde este CSS en assets/css/ la ruta ../images/ apunta a
   assets/images/. El filtro vuelve blancos sus trazos sin tocar Flora.
*/
#fauna-flora-modal.fauna-flora-modal--aves {
    --ff-footer-height: clamp(68px, 6.98vw, 110px);
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__content::after {
    content: "";
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    width: 100%;
    height: var(--ff-footer-height);
    pointer-events: none;
    background-color: transparent;
    background-image: url("../images/decorativos/fauna-flora-patron.svg?v=20261018-6");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% auto;
    filter: brightness(0) invert(1);
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__content {
    grid-template-columns: minmax(300px, 42%) minmax(0, 58%);
}

/* Fotografía y créditos */
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__gallery {
    justify-content: flex-start;
    padding: clamp(35px, 4vw, 54px) 24px calc(var(--ff-footer-height) + 22px) 30px;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__media {
    width: min(100%, 385px);
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    flex: 0 1 auto;
    background: rgba(255,255,255,.08);
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__image {
    object-fit: cover;
    object-position: center;
    border-radius: 20px;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__caption,
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__credit {
    width: min(100%, 385px);
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__caption {
    color: var(--aves-soft);
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__credit {
    margin-top: 13px;
    padding: 7px 12px;
    border-radius: 8px;
    background: var(--aves-credit);
    color: #ffffff;
    font-family: var(--ff-heavy);
    font-size: clamp(.74rem, 1vw, 1rem);
    font-weight: 700;
    line-height: 1.25;
}

/* Panel de información con marca de agua, sin editar el SVG de Flora. */
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__information {
    padding: clamp(34px, 3vw, 48px) clamp(34px, 4vw, 60px)
        calc(var(--ff-footer-height) + 20px) 26px;
    color: var(--aves-white);
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__information::before {
    z-index: 0;
    top: 20px;
    right: 0;
    width: min(68%, 430px);
    height: calc(100% - var(--ff-footer-height) - 28px);
    background-image: var(--aves-watermark);
    background-size: contain;
    background-position: right center;
    background-repeat: no-repeat;
    opacity: .18;
}

/* Encabezado editorial: reemplazamos visualmente FAUNA Y FLORA.
   El JS compartido ya rellena title y scientific desde el endpoint. */
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__header {
    margin: 0 0 21px;
    padding: 0 56px 0 0;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__eyebrow {
    display: none !important;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__title {
    display: block !important;
    margin: 0 0 5px;
    color: var(--aves-white);
    font-family: var(--ff-display);
    font-weight: 400;
    font-size: clamp(2rem, 3vw, 3.25rem);
    line-height: .97;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__scientific:not([hidden]) {
    display: block !important;
    margin: 0;
    color: var(--aves-soft);
    font-family: var(--ff-body);
    font-style: italic;
    font-size: clamp(1.2rem, 1.7vw, 1.7rem);
    line-height: 1.12;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__scroll {
    color: var(--aves-white);
    padding-right: 12px;
    scrollbar-color: rgba(220,229,223,.5) transparent;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__scroll::-webkit-scrollbar-thumb {
    background: rgba(220,229,223,.5);
}

/* Filas de datos: etiquetas y valores en blanco; soporte de textos largos. */
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__summary-row {
    display: block;
    margin: 0 0 7px;
    color: var(--aves-white);
    font-family: var(--ff-body);
    font-size: clamp(.78rem, .9vw, .92rem);
    line-height: 1.34;
    overflow-wrap: anywhere;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__summary-row strong {
    display: inline;
    color: #ffffff;
    font-family: var(--ff-heavy);
    font-weight: 800;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__summary-row span,
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__section[data-section="general"] .fauna-flora-modal__summary-row span {
    color: var(--aves-soft);
    font-family: var(--ff-body);
    font-weight: 400;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__section[data-section="general"] {
    margin-bottom: 14px;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__text-block {
    margin: 0 0 13px;
    color: var(--aves-white);
    overflow-wrap: anywhere;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__text-block h3 {
    display: inline;
    margin: 0 4px 0 0;
    color: #ffffff;
    font-family: var(--ff-heavy);
    font-weight: 800;
    font-size: clamp(.78rem, .9vw, .92rem);
    line-height: 1.35;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__text-block h3::after {
    content: ':';
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__text-block p {
    display: inline;
    margin: 0;
    color: var(--aves-soft);
    font-family: var(--ff-body);
    font-weight: 400;
    font-size: clamp(.78rem, .9vw, .92rem);
    line-height: 1.4;
    white-space: pre-line;
}

/* Datos curiosos: en aves NO lleva el recuadro verde de Flora. */
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__section--aves
.fauna-flora-modal__text-block:has([data-field="datos_curiosos"]) {
    margin: 18px 0 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__section--aves
.fauna-flora-modal__text-block:has([data-field="datos_curiosos"]) h3,
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__section--aves
.fauna-flora-modal__text-block:has([data-field="datos_curiosos"]) p {
    display: inline;
    color: var(--aves-white);
    font-size: clamp(.78rem, .9vw, .92rem);
    line-height: 1.4;
}

/* Ocultar solo bloques vacíos que haya marcado el módulo JS. */
#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__text-block[hidden] {
    display: none !important;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__close {
    background: #27895a;
    color: #ffffff;
}

#fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__close:hover {
    background: #3cae74;
}

@media (max-width: 1024px) {
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__content {
        grid-template-columns: minmax(260px, 41%) minmax(0, 59%);
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__gallery {
        padding: 32px 16px calc(var(--ff-footer-height) + 18px);
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__information {
        padding: 34px 28px calc(var(--ff-footer-height) + 18px) 14px;
    }
}

/* Móvil: reutiliza el scroll único ya probado en Flora. */
@media (max-width: 767px) {
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__backdrop,
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__dialog,
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__content,
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__gallery,
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__information {
        background-color: var(--aves-deep);
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__gallery {
        padding: 72px 20px 16px;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__media {
        width: min(100%, 340px);
        aspect-ratio: 1 / 1;
        border-radius: 16px;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__image {
        border-radius: 16px;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__credit,
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__caption {
        width: min(100%, 340px);
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__information {
        padding: 14px 22px 30px;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__information::before {
        width: 56%;
        height: 360px;
        right: -28px;
        top: 36px;
        opacity: .11;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__header {
        padding: 0 14px 0 0;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__title {
        font-size: clamp(1.9rem, 8vw, 3rem);
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__scientific:not([hidden]) {
        font-size: clamp(1.15rem, 5vw, 1.5rem);
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__summary-row,
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__text-block h3,
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__text-block p {
        font-size: .9rem;
        line-height: 1.42;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__scroll {
        overflow: visible !important;
        padding: 0;
    }
    /* Mantener el SVG entero sin repetir ni deformar en pantallas pequeñas. */
    #fauna-flora-modal.fauna-flora-modal--aves {
        --ff-footer-height: 56px;
    }
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__content::after {
        position: relative;
        inset: auto;
        height: var(--ff-footer-height);
        background-color: transparent;
        background-repeat: no-repeat;
        background-position: center bottom;
        background-size: auto 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    #fauna-flora-modal.fauna-flora-modal--aves .fauna-flora-modal__close { transition: none; }
}
