/* CSS-only replacement for the headline animation previously driven by Elementor. */
.hero-title .museum-headline-dynamic-wrapper {
    display: block;
    position: relative;
    width: 9ch !important;
    height: 1em;
    overflow: visible;
}

.hero-title .museum-headline-dynamic-text {
    position: absolute !important;
    inset: 0 auto auto 0;
    display: inline-block;
    visibility: hidden;
    white-space: nowrap;
    opacity: 0;
    color: #ffffff;
    transform: none;
    will-change: opacity;
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}

.hero-title .museum-headline-dynamic-text::after {
    display: inline-block;
    width: 0.035em;
    height: 0.86em;
    margin-left: 0.13em;
    content: "";
    background: currentColor;
    vertical-align: -0.04em;
}

.hero-title .museum-type-letter {
    display: inline;
    font-size: 0;
    opacity: 0;
    will-change: font-size;
    animation-duration: 5s;
    animation-iteration-count: infinite;
    animation-timing-function: steps(1, end);
}

.hero-title .museum-headline-dynamic-text:first-child {
    animation-name: museum-word-virtual;
}

.hero-title .museum-headline-dynamic-text:first-child::after {
    animation: museum-caret-virtual 5s linear infinite;
}

.hero-title .museum-headline-dynamic-text:first-child .museum-type-letter {
    animation-name: museum-letter-virtual;
}

.hero-title .museum-headline-dynamic-text:first-child .museum-type-letter:nth-child(2) {
    animation-delay: 0.18s;
}

.hero-title .museum-headline-dynamic-text:first-child .museum-type-letter:nth-child(3) {
    animation-delay: 0.36s;
}

.hero-title .museum-headline-dynamic-text:first-child .museum-type-letter:nth-child(4) {
    animation-delay: 0.54s;
}

.hero-title .museum-headline-dynamic-text:first-child .museum-type-letter:nth-child(5) {
    animation-delay: 0.72s;
}

.hero-title .museum-headline-dynamic-text:first-child .museum-type-letter:nth-child(6) {
    animation-delay: 0.9s;
}

.hero-title .museum-headline-dynamic-text:first-child .museum-type-letter:nth-child(7) {
    animation-delay: 1.08s;
}

.hero-title .museum-headline-dynamic-text:nth-child(2) {
    animation-name: museum-word-urjc;
}

.hero-title .museum-headline-dynamic-text:nth-child(2)::after {
    animation: museum-caret-urjc 5s linear infinite;
}

.hero-title .museum-headline-dynamic-text:nth-child(2) .museum-type-letter {
    animation-name: museum-letter-urjc;
}

.hero-title .museum-headline-dynamic-text:nth-child(2) .museum-type-letter:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-title .museum-headline-dynamic-text:nth-child(2) .museum-type-letter:nth-child(3) {
    animation-delay: 0.4s;
}

.hero-title .museum-headline-dynamic-text:nth-child(2) .museum-type-letter:nth-child(4) {
    animation-delay: 0.6s;
}

@keyframes museum-word-virtual {
    0% {
        visibility: visible;
        opacity: 0;
    }

    3%, 42% {
        visibility: visible;
        opacity: 1;
    }

    50% {
        visibility: visible;
        opacity: 0;
    }

    50.1%, 100% {
        visibility: hidden;
        opacity: 0;
    }
}

@keyframes museum-word-urjc {
    0%, 49.9% {
        visibility: hidden;
        opacity: 0;
    }

    50% {
        visibility: visible;
        opacity: 0;
    }

    53%, 92% {
        visibility: visible;
        opacity: 1;
    }

    100% {
        visibility: visible;
        opacity: 0;
    }
}

@keyframes museum-letter-virtual {
    0%, 3% {
        font-size: 0;
        opacity: 0;
    }

    3.1%, 50% {
        font-size: 1em;
        opacity: 1;
    }

    50.1%, 100% {
        font-size: 0;
        opacity: 0;
    }
}

@keyframes museum-letter-urjc {
    0%, 53% {
        font-size: 0;
        opacity: 0;
    }

    53.1%, 100% {
        font-size: 1em;
        opacity: 1;
    }
}

@keyframes museum-caret-virtual {
    0%, 2.9% {
        opacity: 0;
    }

    3%, 28% {
        opacity: 1;
    }

    31%, 37%, 42%, 100% {
        opacity: 0;
    }

    34%, 40% {
        opacity: 1;
    }
}

@keyframes museum-caret-urjc {
    0%, 52.9% {
        opacity: 0;
    }

    53%, 73% {
        opacity: 1;
    }

    77%, 85%, 92%, 100% {
        opacity: 0;
    }

    81%, 89% {
        opacity: 1;
    }
}

@media (max-width: 767px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    .museum-page,
    .hero-title,
    .hero-title .museum-headline {
        min-width: 0;
        max-width: 100%;
    }

    .museum-page .universe-tagline {
        overflow: hidden;
    }

    .museum-page .layout-item.works-panel > .layout-item--populated {
        margin-left: 0;
        --museum-column-margin-left: 0;
    }

    .hero-title .museum-headline-dynamic-wrapper {
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-title .museum-headline-dynamic-text {
        display: none;
        visibility: hidden;
        animation: none;
    }

    .hero-title .museum-headline-dynamic-text.museum-headline-text-active {
        display: inline-block;
        visibility: visible;
        opacity: 1;
    }

    .hero-title .museum-headline-dynamic-text.museum-headline-text-active::after {
        display: none;
    }

    .hero-title .museum-headline-dynamic-text.museum-headline-text-active .museum-type-letter {
        font-size: 1em;
        opacity: 1;
        animation: none;
    }
}

/* Footer discreto: créditos de diseño/desarrollo, sin "Develop By".
   Mismo patrón visual y ritmo de espaciado que template-parts/footer.php
   (icons -> copyright -> créditos), para que ambos footers sean iguales. */
.museum-page .layout-item.footer-social {
    margin-bottom: 20px;
}

.museum-page .layout-item.footer-copyright .museum-heading-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 300;
    color: #aaa;
}

.museum-page .layout-item.footer-navigation.museum-widget-text-editor {
    font-size: 12px;
    font-weight: 400;
    color: #777;
}

.museum-page .layout-item.footer-navigation.museum-widget-text-editor p {
    margin: 0;
}

.museum-page .layout-item.footer-navigation.museum-widget-text-editor a {
    color: #999;
    text-decoration: none;
    transition: color .3s;
}

.museum-page .layout-item.footer-navigation.museum-widget-text-editor a:hover,
.museum-page .layout-item.footer-navigation.museum-widget-text-editor a:focus {
    color: #fff;
}

.museum-page .layout-item.site-footer {
    padding: 35px 0;
}

.museum-page .layout-item.site-footer .museum-container,
.museum-page .layout-item.footer-content,
.museum-page .layout-item.footer-content .museum-widget-wrap {
    text-align: center;
}

.museum-page .layout-item.footer-social .museum-social-icons-wrapper {
    justify-content: center;
}

/* Footer de la home a sangre completa */
.museum-page .layout-item.site-footer.museum-section-boxed > .museum-container {
    max-width: 100%;
}

/* Padding lateral del sticky header igual al page-shell */
.sticky-header__inner {
    width: min(calc(100% - 40px), 1200px);
    margin-inline: auto;
}

/* Footer de la home a sangre completa: override del max-width 1140px del tema hello */
.site-footer:not(.dynamic-footer),
.site-footer .footer-inner {
    max-width: 100% !important;
}

.museum-page .layout-item.site-footer.museum-section-boxed > .museum-container {
    max-width: 100% !important;
}

/* Contraste newsletter: blanco sobre #FC3B29 = 3.9:1, subimos a negro */
.museum-page .layout-item.newsletter-copy {
    color: #1a1a1a !important;
}

.museum-page .layout-item.newsletter-title .museum-heading-title {
    color: #000000 !important;
}

/* Contraste utility bar: corregido directamente en main.css */

/* Contraste about-text: blanco sobre rojo multiply = bajo contraste, oscurecemos el contenedor */
.museum-page .layout-item.about-content > .layout-item--populated {
    background: rgba(0, 0, 0, 0.45);
}

/* Contraste del botón about-action: asegurar negro sobre blanco */
.museum-page .layout-item.about-action .museum-button {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Contraste newsletter: blanco sobre #FC3B29 = 3.9:1, subimos a negro */
.museum-page .layout-item.newsletter-copy {
    color: #1a1a1a !important;
}

.museum-page .layout-item.newsletter-title .museum-heading-title {
    color: #000000 !important;
}

/* Contraste about-text: fondo sólido opaco para que Lighthouse pueda computarlo */
.museum-page .layout-item.about-content > .layout-item--populated {
    background: #1a1a1a !important;
}

/* Asegurar que el botón tiene fondo opaco explícito en el span */
.museum-page .layout-item.about-action .museum-button,
.museum-page .layout-item.about-action .museum-button-text {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Texto del about: blanco sobre #1a1a1a = 15.5:1 */
.museum-page .layout-item.about-text,
.museum-page .layout-item.about-text p,
.museum-page .layout-item.about-text em {
    color: #ffffff !important;
}

/* Eyebrow y título del about */
.museum-page .layout-item.about-eyebrow .museum-heading-title,
.museum-page .layout-item.about-title .museum-heading-title {
    color: #ffffff !important;
}

/* Margin-bottom del título "Sobre el Museo Virtual" */
.museum-page .layout-item.about-title {
    margin-bottom: 30px !important;
}


/* Sección "Cultura Interactiva" (sustituye a la antigua "Descripción del
   metaverso"). Bloque autocontenido con su propia gradilla; no depende del
   sistema de columnas Elementor heredado. Colores alineados con los que ya
   usa el resto de la home (#40214A / #FC3B29). */
.cultura-interactiva {
    --ci-purple: #40214A;
    --ci-red: #FC3B29;
    --ci-grey: #7d858c;
    position: relative;
    overflow: hidden;
    padding: 76px 0 72px;
    background: linear-gradient(180deg, #ffffff 0%, #fdfcfd 100%);
}

.cultura-interactiva__inner {
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
}

.cultura-interactiva__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.14fr) minmax(320px, .86fr);
    gap: 92px;
    align-items: center;
}

.cultura-interactiva__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
    color: var(--ci-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cultura-interactiva__eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: currentColor;
}

.cultura-interactiva__title {
    margin: 0;
    color: var(--ci-purple);
    font-size: clamp(32px, 3.2vw, 37px);
    line-height: 1.08;
    font-weight: 300;
    letter-spacing: -0.03em;
}

.cultura-interactiva__line {
    width: 86px;
    height: 2.7px;
    margin: 20px 0 20px;
    background: var(--ci-red);
}

.cultura-interactiva__copy {
    max-width: 670px;
    color: var(--ci-grey);
    font-size: 18px;
    line-height: 1.72;
}

.cultura-interactiva__copy p {
    margin: 0 0 16px;
}

.cultura-interactiva__copy strong {
    color: var(--ci-purple);
    font-weight: 600;
}

.cultura-interactiva__features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 38px;
    margin-top: 28px;
}

.cultura-interactiva__features ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cultura-interactiva__features li {
    position: relative;
    margin: 0 0 14px;
    padding: 0 0 0 31px;
    font-size: 16.5px;
    line-height: 1.55;
    color: #000;
}

.cultura-interactiva__features li::before {
    content: "✓";
    position: absolute;
    left: 4px;
    top: -1px;
    color: var(--ci-red);
    font-size: 20px;
    font-weight: 700;
}

.cultura-interactiva__visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 430px;
}

.cultura-interactiva__image-wrap {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: min(470px, 100%);
}

.cultura-interactiva__image-wrap img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 920px) {
    .cultura-interactiva {
        padding: 56px 0;
    }

    .cultura-interactiva__grid {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .cultura-interactiva__visual {
        min-height: 360px;
    }
}

@media (max-width: 620px) {
    .cultura-interactiva__inner {
        width: min(calc(100% - 28px), 1140px);
    }

    .cultura-interactiva__title {
        font-size: 30px;
    }

    .cultura-interactiva__copy {
        font-size: 16px;
    }

    .cultura-interactiva__features {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .cultura-interactiva__visual {
        min-height: 310px;
    }
}

/* Título "Sobre el Museo Virtual" en la landing: la sección tiene fondo
   negro, pero el heading widget hereda el color morado global (pensado para
   fondos claros) y queda casi invisible. Lo igualamos al blanco que ya usa
   el texto de al lado (introduction-text). */
.museum-page .layout-item.introduction-title .museum-heading-title {
    color: #FFFFFF;
}

/* introduction-text trae padding-left:30px de fábrica (main.css) para
   separarse del borde rojo de la columna del logo; el título y el botón
   que se añadieron junto a él no lo tenían y quedaban pegados al borde. */
.museum-page .layout-item.introduction-title,
.museum-page .layout-item.introduction-action {
    padding-left: 30px;
}

/* Botón "Más información": el widget de botón no trae chrome por defecto
   (a diferencia de about-action, que sí lo define); sin esto se veía como
   texto suelto flotando debajo del párrafo. Mismo tratamiento que
   about-action (blanco con hover invertido), ya que esta sección también
   tiene fondo negro. */
.museum-page .layout-item.introduction-action {
    margin-top: -6px;
}

.museum-page .layout-item.introduction-action .museum-button {
    display: inline-flex;
    background-color: #ffffff;
    font-family: "Inter", Sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #000000;
    padding: 14px 34px;
    transition: background-color .3s, color .3s;
}

.museum-page .layout-item.introduction-action .museum-button:hover,
.museum-page .layout-item.introduction-action .museum-button:focus {
    background-color: #FC3B29;
    color: #ffffff;
}
