/* ==========================================================================
   Herrumbre Vivo Arte — Main Stylesheet
   Pixel-accurate replica of Carrd.co site
   ========================================================================== */

/* ---------- Go to Top Button ---------- */
.go-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, opacity 0.3s, visibility 0.3s;
    cursor: pointer;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
}

.go-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.go-to-top:hover {
    transform: scale(1.1);
    color: #fff;
}

.go-to-top svg {
    width: 16px;
    height: 16px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

:focus-visible {
    outline: 2px solid #35B88F;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 300;
    line-height: 1.6;
    color: #ffffff;
    background-color: #1e404a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    --background-height: 100vh;
}

/* Atmospheric background: misty gradient + noise texture */
body::before {
    content: "";
    display: block;
    background-attachment: scroll;
    height: var(--background-height);
    left: 0;
    pointer-events: none;
    position: fixed;
    top: 0;
    transform: scale(1);
    width: 100vw;
    z-index: 0;
    background-image:
        url("data:image/svg+xml;charset=utf8,%3Csvg%20viewBox%3D%220%200%20512%20512%22%20width%3D%22512%22%20height%3D%22512%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%20%3Cfilter%20id%3D%22noise%22%3E%20%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%220.875%22%20result%3D%22noise%22%20%2F%3E%20%3CfeColorMatrix%20type%3D%22matrix%22%20values%3D%220.0390625%200%200%200%200%200%200.03515625%200%200%200%200%200%200.03515625%200%200%200%200%200%200.56640625%200%22%20%2F%3E%20%3C%2Ffilter%3E%20%3Crect%20filter%3D%22url%28%23noise%29%22%20x%3D%220%22%20y%3D%220%22%20width%3D%22512%22%20height%3D%22512%22%20fill%3D%22transparent%22%20opacity%3D%221%22%20%2F%3E%3C%2Fsvg%3E"),
        url("/static/svg/bg.svg");
    background-size: 512px, cover;
    background-position: center center, center top;
    background-repeat: repeat, repeat;
}

/* Intro fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Layout ---------- */
.site-main {
    width: 100%;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    animation: fadeInUp 1.5s ease-out;
}

.inner {
    max-width: 54rem;
    margin: 0 auto;
    padding: 0 3rem;
}

/* ---------- Dividers ---------- */

/* Style 1: Tall vertical line (5rem) — main section connector */
.divider-1 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1rem;
    padding: 13px 0;
}

.divider-1::before {
    content: '';
    display: block;
    width: 1px;
    height: 5rem;
    background-color: rgb(255, 255, 255);
}

/* On light backgrounds */
.contact-card .divider-1::before,
.service-card .divider-1::before {
    background-color: rgba(0, 0, 0, 0.15);
}

/* Style 2: Short vertical line (4rem) — tighter spacing */
.divider-2 {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 1rem;
    padding: 0;
}

.divider-2::before {
    content: '';
    display: block;
    width: 1px;
    height: 4rem;
    background-color: rgb(255, 255, 255);
}

/* ---------- Pill Buttons ---------- */
.pill-btn {
    display: inline-block;
    height: 2.375rem;
    line-height: 2.375rem;
    padding: 0 1.2rem;
    background: #35B88F;
    color: #FFFFFF;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 1.2em;
    font-weight: 400;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 2rem;
    border: none;
    cursor: pointer;
    transition: color 0.25s ease, background-color 0.25s ease;
    text-align: center;
    flex: 0 1 auto;
}

.pill-btn:hover {
    background: rgb(43, 164, 123);
    transform: translateY(-3px);
}

.pill-btn--small {
    padding: 10px 28px;
    font-size: 0.75rem;
    height: auto;
    line-height: normal;
    border-radius: 30px;
}

.pill-btn--submit {
    padding: 12px 40px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: 1.73px;
    height: auto;
    line-height: normal;
    flex: none;
    max-width: none;
    width: auto;
}

/* Section pills — the markers between sections ("Quién Soy", "Mis Servicios", etc.)
   Different from nav .pill-btn: larger, lighter weight, wider tracking */
.section-pill {
    display: block;
    width: fit-content;
    margin: 0 auto;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 1.73px;
    padding: 0 30px;
    height: 67px;
    line-height: 67px;
    text-transform: none;
    border-radius: 34.67px;
    flex: none;
    max-width: none;
    cursor: default;
}

/* Es una etiqueta de sección, no un botón: sin salto ni cambio de color. */
.section-pill:hover {
    transform: none;
    background: #35B88F;
}

/* ---------- Logo ---------- */
.section-logo {
    padding-top: 83px;
    text-align: center;
    padding-bottom: 10px;
}

.site-logo {
    max-width: 10.125rem;
    margin: 0 auto;
}

/* ---------- Navigation ---------- */
.nav-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16.5px;
    padding: 28px 2px;
}

/* ---------- Hero Section ---------- */
.section-hero {
    text-align: center;
}

.hero-title {
    font-size: 34.67px;
    font-weight: 600;
    letter-spacing: 6.93px;
    text-transform: uppercase;
    color: rgb(255, 255, 255);
    margin-top: 20px;
    margin-bottom: 13px;
    line-height: 1.3;
}

.hero-separator {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    width: 16rem;
    height: 3px;
    margin: 13px auto;
    background: transparent;
}

.hero-image-wrap {
    margin: 13px auto;
    max-width: 22.875rem;
    overflow: hidden;
    border-radius: 0;
}

.hero-image {
    width: 100%;
    height: auto;
}

.hero-intro {
    color: #FFFFFF;
    font-family: 'Source Sans Pro', sans-serif;
    letter-spacing: 0.05rem;
    width: calc(100% + 0.05rem);
    font-size: 1em;
    line-height: 1.75;
    font-weight: 300;
    text-align: center;
    margin: 13px 0;
    margin: 13px 0;
}

.hero-subtitle {
    font-size: 17.33px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.84);
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 3.9px;
    max-width: 600px;
    margin: 13px auto;
    line-height: 1.8;
}

/* ---------- About Section ---------- */
.section-about {
    text-align: center;
}

.about-row-image {
    margin: 0 auto;
    max-width: 22.875rem;
    border-radius: 4px;
    overflow: hidden;
}

.about-row-img {
    width: 100%;
    height: auto;
}

.bio-text {
    color: #FFFFFF;
    font-family: 'Source Sans Pro', sans-serif;
    letter-spacing: 0.05rem;
    font-size: 1em;
    line-height: 1.75;
    font-weight: 300;
    text-align: center;
    max-width: 650px;
    margin: 13px auto;
}

.bio-text a {
    color: #35B88F;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bio-text a:hover {
    color: #2da37d;
}

.about-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.about-col-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ---------- Services Section ---------- */
.section-services {
    text-align: center;
}

.service-card {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    margin: 0 auto;
    max-width: 100%;
    padding: 0;
}

.service-card--left {
    flex-direction: row;
}

.service-card--right {
    flex-direction: row-reverse;
}

.service-card__image {
    flex: 0 0 50%;
    min-height: 220px;
    overflow: hidden;
}

.service-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.service-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 69px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.service-card__title {
    font-size: 24px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 7px;
    color: #3A3939;
    margin-bottom: 12px;
}

.service-card__desc {
    font-size: 17px;
    font-weight: 300;
    color: rgba(153, 153, 153, 0.94);
    line-height: 30px;
    letter-spacing: 0.87px;
}

/* ---------- Teal Full-Width Sections ---------- */
.teal-section {
    background-color: #35B88F;
    background-image: url(/static/svg/geometric-pattern.svg);
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    /* Break out of .inner container */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 80px 24px;
    text-align: center;
}

.teal-section__inner {
    max-width: 700px;
    margin: 0 auto;
}

.teal-section__title {
    font-size: 33px;
    font-weight: 400;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 7px;
    line-height: 49px;
    margin-bottom: 28px;
}

.teal-section__text {
    color: #FFFFFF;
    font-family: 'Source Sans Pro', sans-serif;
    letter-spacing: 0.05rem;
    font-size: 1.15em;
    line-height: 1.75;
    font-weight: 300;
    text-align: justify;
}

.teal-section__text p {
    margin-bottom: 16px;
}

.teal-section__quote {
    font-size: 1.1rem;
    font-weight: 400;
    font-style: italic;
    color: #ffffff;
    line-height: 1.8;
    border: none;
    padding: 0;
    margin: 0;
    text-align: justify;
}

/* Los párrafos de la cita llevan el mismo aire que los de la filosofía. */
.teal-section__quote p {
    margin: 0 0 16px;
}

.teal-section__quote p:last-child,
.teal-section__text p:last-child {
    margin-bottom: 0;
}

/* ---------- Philosophy Section ---------- */
.section-philosophy {
    text-align: center;
}

/* ---------- Gallery Preview Section ---------- */
.section-gallery {
    text-align: center;
}

.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gallery-card {
    display: block;
    position: relative;
    overflow: hidden;
    height: 11.75rem;
    border-radius: 0;
}

.gallery-card__thumb {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-card:hover .gallery-card__thumb img {
    transform: scale(1.03);
}

/* Dark overlay on gallery preview cards */
.gallery-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.4s ease;
}

.gallery-card:hover .gallery-card__overlay {
    background: rgba(0, 0, 0, 0.15);
}

.gallery-card__title {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #ffffff;
    text-align: center;
    transition: font-weight 0.3s ease;
}

.gallery-card:hover .gallery-card__title {
    font-weight: 600;
}

/* ---------- Contact Section ---------- */
.section-contact {
    text-align: center;
}

.contact-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px 36px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    margin: 0 auto;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.form-group label {
    font-size: 15px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 5.6px;
    color: #3A3939;
    margin-bottom: 6px;
    text-align: center;
}

.form-group input,
.form-group textarea {
    font-family: inherit;
    font-size: 17px;
    font-weight: 300;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    background: #F1F1F1;
    color: #1a1a1a;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #35B88F;
    box-shadow: 0 0 0 3px rgba(53, 184, 143, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-actions {
    text-align: center;
    margin-top: 8px;
}

/* Contact success */
.contact-success {
    text-align: center;
    padding: 48px 24px;
}

.contact-success__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #35B88F;
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.contact-success__title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.contact-success__text {
    font-size: 0.9rem;
    color: #555;
}

/* ---------- Social Section ---------- */
.section-social {
    text-align: center;
    padding: 20px 0;
}

.social-capsule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 18px 48px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease, transform 0.2s ease;
}

.social-link:hover {
    color: #35B88F;
    transform: translateY(-2px);
}

.social-icon {
    width: 28px;
    height: 28px;
}

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 40px 0 20px;
}

.footer-branding {
    margin-bottom: 8px;
    text-align: center;
}

.footer-brand-title {
    display: block;
    font-size: 34.67px;
    font-weight: 600;
    letter-spacing: 6.93px;
    line-height: 1;
    text-transform: uppercase;
    color: #FFFFFF;
}

.footer-brand-line {
    width: 16rem;
    max-width: 60%;
    border: none;
    border-top: solid 1px rgba(255, 255, 255, 0.302);
    border-bottom: solid 1px rgba(255, 255, 255, 0.302);
    height: 3px;
    margin: 12px auto;
}

.footer-brand-subtitle {
    display: block;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 3.9px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.839);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}


.footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 300;
    text-align: center;
}

.footer-copyright p {
    margin-top: 16px;
    margin-bottom: 0;
}

.footer-logo {
    display: block;
    width: 10.125rem;
    max-width: 175px;
    margin: 0 auto;
}

/* ---------- HTMX Loading Indicator ---------- */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request .pill-btn--submit {
    opacity: 0.7;
    pointer-events: none;
}

/* ---------- Lightbox ---------- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 85vw;
    max-height: 80vh;
}

.lightbox-overlay img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 10001;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 3rem;
    width: 50px;
    height: 80px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
    background: rgba(255,255,255,0.2);
}

.lightbox-bottom {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    z-index: 10001;
}

.lightbox-counter {
    margin-right: 16px;
    font-weight: 500;
}

.lightbox-caption {
    font-weight: 300;
    font-style: italic;
}

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 60px;
        font-size: 2rem;
    }
    .lightbox-prev { left: 4px; }
    .lightbox-next { right: 4px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .inner {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 1.6rem;
        letter-spacing: 0.2em;
    }

    .service-card {
        flex-direction: column !important;
    }

    .service-card__image {
        flex: none;
        min-height: 180px;
    }

    .service-card__content {
        padding: 24px 20px;
        text-align: center;
    }

    .gallery-grid {
        gap: 0;
    }

    .gallery-card {
        height: 11.75rem;
    }

    .about-two-col {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .nav-container {
        gap: 8px;
    }

    /* Sin ancho fijo: con 110px "Mis Servicios" y "Por qué lo hago" salían
       con puntos suspensivos. El nav es flex-wrap, así que caben en 2 filas. */
    .pill-btn {
        font-size: 14px;
        padding: 0 14px;
        height: 36px;
        line-height: 36px;
    }

    /* La etiqueta de sección comparte la clase .pill-btn y heredaba los
       tamaños pequeños de la navegación en móvil; aquí recupera su tamaño
       grande, como en la web vieja. */
    .section-pill {
        width: fit-content;
        font-size: 18px;
        height: 52px;
        line-height: 52px;
        padding: 0 24px;
    }

    /* El botón Enviar tampoco encoge: en la web vieja ocupa todo el ancho
       del formulario en móvil. */
    .pill-btn--submit {
        width: 100%;
        height: auto;
        line-height: normal;
        font-size: 17px;
        padding: 14px 24px;
    }

    .nav-container {
        gap: 12px;
        padding: 16px 20px;
    }

    .teal-section {
        padding: 60px 16px;
    }

    .contact-card {
        padding: 32px 20px;
    }

    .social-links {
        gap: 16px;
    }

    .footer-nav {
        gap: 8px;
        justify-content: center;
    }

    .footer-nav .pill-btn {
        flex: 0 1 auto;
    }

    .divider-1::before {
        height: 3rem;
    }

    .divider-2::before {
        height: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.3rem;
    }

    .gallery-card {
        height: 11.75rem;
    }

    .pill-btn {
        font-size: 12px;
        width: auto;
        min-width: 70px;
        height: 32px;
        line-height: 32px;
    }

    .section-pill {
        width: fit-content;
        min-width: 0;
        font-size: 17px;
        height: 48px;
        line-height: 48px;
        padding: 0 22px;
    }

    .pill-btn--submit {
        width: 100%;
        min-width: 0;
        height: auto;
        line-height: normal;
        font-size: 16px;
        padding: 14px 24px;
    }

    .nav-container {
        gap: 8px;
        padding: 12px 16px;
    }
}

@media (min-width: 769px) {
    .hero-title {
        font-size: 2rem;
        margin-top: 20px;
    }
}

/* ==========================================================================
   Gallery Sub-Pages (obras, servicios, exposiciones)
   ========================================================================== */

/* ---------- Page Container ---------- */
.gallery-page {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
}

/* ---------- Gallery Header ---------- */
.gallery-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    padding: 32px 0 8px;
}

.gallery-title {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #ffffff;
}

/* Enlace de vuelta bajo el título de cada galería: un pill pequeño y legible,
   mismo tamaño que los del pie. Antes era texto de 11 px medio transparente
   sobre el verde y, con la fuente de reserva, salía recortado con puntos. */
.gallery-back-link {
    padding: 10px 24px;
    font-size: 0.85rem;
    height: auto;
    line-height: normal;
    border-radius: 30px;
    text-decoration: none;
}


/* ---------- Gallery Nav (Prev / Next) ---------- */
.gallery-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.gallery-nav__link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
    padding: 8px 0;
}

.gallery-nav__link:hover {
    color: #35B88F;
}

.gallery-nav__arrow {
    font-size: 1.2rem;
    line-height: 1;
}

/* ---------- Gallery Image Grid ---------- */
.gallery-page-grid {
    columns: 3;
    column-gap: 0;
}

/* ---------- Gallery Item (masonry card) ---------- */
.gallery-item {
    display: block;
    break-inside: avoid;
    margin-bottom: 0;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
}

.gallery-item:hover .gallery-item__thumb img {
    filter: brightness(0.7);
    transition: filter 0.3s;
}

.gallery-item__thumb {
    width: 100%;
    overflow: hidden;
}

.gallery-item__thumb img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gallery-item__thumb img.loaded {
    opacity: 1;
}

.gallery-item__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 10px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-item__caption {
    opacity: 1;
}

.gallery-item__caption-visible {
    /* For non-hover caption (patrimonio cards) */
    padding: 8px 10px;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Gallery Empty State ---------- */
.gallery-item__info {
    padding: 8px 0;
}

.gallery-item__location {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

.gallery-item--patrimonio .gallery-item__thumb {
    border: 2px solid rgba(53, 184, 143, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.gallery-header__subtitle {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    font-weight: 300;
    margin-bottom: 16px;
    text-align: center;
}

.gallery-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    font-weight: 300;
    padding: 60px 0;
    letter-spacing: 0.05em;
}

/* ---------- Exhibition Block ---------- */
.exhibition-block {
    margin-bottom: 16px;
}

.exhibition-title {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #35B88F;
    margin-bottom: 12px;
    text-align: center;
}

.exhibition-desc {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    max-width: 600px;
    margin: 0 auto 24px;
}

/* ---------- Exhibition Video ---------- */
/* Vídeos de exposición: dos por fila en escritorio, uno en móvil. El
   reproductor conserva 16:9 con el póster de la web vieja como portada. */
.exhibition-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.exhibition-video {
    margin: 0;
}

.exhibition-video__player {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    object-fit: cover;
}

.exhibition-video__caption {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.05rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

/* ---------- Responsive: Gallery Sub-Pages ---------- */
@media (max-width: 768px) {
    .gallery-page-grid {
        columns: 2;
        column-gap: 0;
    }

    .gallery-title {
        font-size: 1.5rem;
    }

    .gallery-nav {
        padding: 4px 0;
    }
}

@media (max-width: 480px) {
    .gallery-page-grid {
        columns: 1;
        column-gap: 0;
    }

    .gallery-title {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   Obra Detail Page
   ========================================================================== */

.obra-page {
    position: relative;
    z-index: 1;
}

/* Top nav group: home icon + back button */
.obra-topnav {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
}

.obra-topnav__home {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(26, 26, 26, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.obra-topnav__home:hover {
    transform: scale(1.1);
}

/* Logo dentro del círculo de "inicio": tamaño fijo para que no se salga. */
.obra-topnav__home-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.back-to-obras {
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(26, 26, 26, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    font-weight: 400;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s;
    white-space: nowrap;
}

.back-to-obras:hover {
    transform: scale(1.05);
    background: rgba(53, 184, 143, 0.9);
    color: #fff;
}

/* Hero */
.obra-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a2a1a 0%, #0f1f1a 50%, #1a1a2a 100%);
}

.obra-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (min-width: 769px) {
    .obra-hero__img {
        object-fit: contain;
    }
}

.obra-hero__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 40px 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

.obra-hero__title {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 8px;
}

.obra-hero__credit {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
    font-weight: 300;
}

/* Content */
.obra-content {
    padding: 40px 20px 60px;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.lang-switcher__btn {
    padding: 8px 20px;
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
}

.lang-switcher__btn:hover {
    border-color: #35B88F;
    color: #fff;
    background: rgba(53,184,143,0.15);
}

.lang-switcher__btn--active {
    background: #35B88F;
    border-color: #35B88F;
    color: #fff;
    font-weight: 500;
}

/* Fade-in for description on language switch */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.obra-description {
    animation: fadeIn 0.5s ease;
}

.obra-desc__lang {
    display: none;
}

.obra-desc__lang--active {
    display: block;
    opacity: 1;
    transition: opacity 0.25s ease;
}

/* Description */
.obra-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.85);
    margin-bottom: 50px;
    max-width: 800px;
}

/* Map */
.obra-map {
    margin-bottom: 40px;
}

.obra-map__toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.obra-map__style-select {
    padding: 6px 12px;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    cursor: pointer;
}

.obra-map__style-select option {
    background: #1a1a1a;
    color: #fff;
}

.obra-map__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}

.obra-map__subbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,1);
    padding: 6px 0;
}

.obra-map__subbar span {
    cursor: default;
}

#gmap-toggle {
    cursor: pointer;
}

.obra-map__subbar__hint-mobile { display: none; }
.obra-map__hint--mobile { display: none; }

.obra-map__hint {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    padding: 6px 24px;
    text-align: center;
}

@media (max-width: 768px) {
    .obra-map__subbar__hint-desktop { display: none; }
    .obra-map__subbar__hint-mobile { display: inline; }
    .obra-map__hint--desktop { display: none; }
    .obra-map__hint--mobile { display: inline; }
}

.obra-map__container {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.obra-map__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.obra-map__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #35B88F;
    color: #fff;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s;
}

.obra-map__btn:hover {
    background: #2ea37d;
}

.obra-map__btn--secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.8);
}

.obra-map__btn--secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* Map popups */
.obra-popup {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: inherit;
    line-height: 1.4;
}

.obra-popup strong {
    font-size: 0.95rem;
    color: #1a1a1a;
}

.obra-popup__loc,
.obra-popup__cat {
    font-size: 0.8rem;
    color: #666;
}

.obra-popup__meta {
    font-size: 0.75rem;
    color: #999;
    margin-top: 2px;
}

.obra-popup__dist {
    font-size: 0.8rem;
    color: #8899aa;
    font-weight: 400;
}

.obra-popup--row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.obra-popup__img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.obra-popup__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mapboxgl-popup {
    z-index: 20 !important;
    max-width: 90vw !important;
}

.mapboxgl-popup-content {
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #1a1a1a;
    overflow: visible;
}

.mapboxgl-popup-close-button {
    color: #666;
}

/* Nearby Points */
.obra-nearby {
    margin-bottom: 50px;
}

.obra-nearby__title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
}

.obra-nearby__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.obra-nearby__item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.obra-nearby__pin {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.obra-nearby__item:hover {
    background: rgba(255,255,255,0.1);
}

.obra-nearby__item--active {
    background: rgba(53,184,143,0.12);
    border-color: #35B88F;
}

.obra-nearby__item--main {
    border-color: rgba(53,184,143,0.3);
    background: rgba(53,184,143,0.08);
}

.obra-nearby__item--linked {
    border-color: rgba(53,184,143,0.25);
    background: rgba(53,184,143,0.06);
    text-decoration: none;
}

.obra-nearby__item--linked:hover {
    border-color: #35B88F;
    background: rgba(53,184,143,0.12);
}

.obra-nearby__link {
    color: #5fd4ad;
    text-decoration: none;
    font-weight: 500;
}

.obra-nearby__link:hover {
    text-decoration: underline;
}

.obra-nearby__thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.obra-nearby__thumb--lightbox {
    cursor: zoom-in;
    transition: transform 0.2s, box-shadow 0.2s;
}

.obra-nearby__thumb--lightbox:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 12px rgba(53,184,143,0.3);
}

.obra-nearby__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.obra-nearby__name {
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
}

.obra-nearby__category {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

.obra-nearby__distance {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
}

/* ==========================================================================
   Ruta (Trail) Page
   ========================================================================== */
.ruta-page {
    position: relative;
    z-index: 1;
}

.ruta-hero {
    height: 35vh;
    min-height: 220px;
}

.ruta-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,20,15,0.6) 0%, rgba(15,20,15,0.85) 100%);
}

.ruta-hero__content {
    position: relative;
    z-index: 1;
}

.ruta-hero__badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(53,184,143,0.7);
    border: 1px solid rgba(53,184,143,0.8);
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.ruta-hero__title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.ruta-hero__area {
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
}

.ruta-hero__desc {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.5);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.ruta-content {
    padding: 30px 24px 40px;
}

.ruta-map-section {
    width: 100%;
}

.ruta-map-section__map {
    width: 100%;
    height: 450px;
    border-radius: 0;
}

.ruta-map-section__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
}

.ruta-map-section__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ruta-map__container {
    height: 450px;
}

/* Patrimonio gallery — ruta sections */
.patrimonio-ruta {
    margin-bottom: 40px;
}

.patrimonio-ruta__header {
    margin-bottom: 20px;
}

.patrimonio-ruta__link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(53,184,143,0.08);
    border: 1px solid rgba(53,184,143,0.2);
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s;
}

.patrimonio-ruta__link:hover {
    border-color: #35B88F;
    background: rgba(53,184,143,0.14);
}

.patrimonio-ruta__icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(53,184,143,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #5fd4ad;
}

.patrimonio-ruta__text {
    flex: 1;
}

.patrimonio-ruta__title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #5fd4ad;
    margin: 0 0 4px;
}

.patrimonio-ruta__meta {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.5);
}

/* Patrimonio grid — 3 columns, equal height thumbs */
.patrimonio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.patrimonio-grid__item {
    text-decoration: none;
    display: block;
    transition: transform 0.2s;
}

.patrimonio-grid__item:hover {
    transform: translateY(-2px);
}

.patrimonio-grid__thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid rgba(53,184,143,0.3);
}

.patrimonio-grid__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.patrimonio-grid__info {
    padding: 8px 4px;
}

.patrimonio-grid__caption {
    font-size: 0.85rem;
    font-weight: 500;
    color: #fff;
}

.patrimonio-grid__location {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .patrimonio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .patrimonio-grid {
        grid-template-columns: 1fr;
    }
}

.ruta-parada__item {
    text-decoration: none;
    border-color: rgba(53,184,143,0.2);
}

.ruta-parada__item:hover {
    border-color: #35B88F;
    background: rgba(53,184,143,0.1);
}

/* Popup link */
.obra-popup__link {
    display: inline;
    font-size: inherit;
    font-weight: 400;
    color: #35B88F;
    text-decoration: none;
}

.obra-popup__link:hover {
    text-decoration: underline;
}

/* Back link */
.obra-back {
    text-align: center;
    padding: 20px 0;
}

.obra-back .pill-btn {
    max-width: none;
    width: auto;
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0 20px;
}

/* Prev/Next Side Navigation — unified card on hover */
.obra-sidenav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    text-decoration: none;
    background: rgba(26, 26, 26, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.7);
    opacity: 0.5;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.obra-sidenav--prev {
    left: 0;
    flex-direction: row;
    border-left: none;
    border-radius: 0 10px 10px 0;
}

.obra-sidenav--next {
    right: 0;
    flex-direction: row-reverse;
    border-right: none;
    border-radius: 10px 0 0 10px;
}

.obra-sidenav:hover {
    opacity: 1;
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(53, 184, 143, 0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.obra-sidenav__pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    transition: all 0.3s ease;
}

.obra-sidenav:hover .obra-sidenav__pill svg {
    color: #35B88F;
}

.obra-sidenav__icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.obra-sidenav__detail {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 14px 8px 0;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.obra-sidenav--next .obra-sidenav__detail {
    padding: 8px 0 8px 14px;
    text-align: right;
}

.obra-sidenav:hover .obra-sidenav__detail {
    max-width: 200px;
    opacity: 1;
}

.obra-sidenav__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #5fd4ad;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.obra-sidenav__loc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* On mobile: top bar next to back button */
@media (max-width: 768px) {
    .obra-sidenav {
        position: fixed;
        top: 8px;
        transform: none;
    }

    .obra-sidenav--prev {
        left: 0;
    }

    .obra-sidenav--next {
        right: 0;
        left: auto;
    }

    .obra-sidenav__pill {
        padding: 6px 6px;
    }

    .obra-sidenav__icon {
        width: 24px;
        height: 24px;
        border-radius: 50%;
    }

    .obra-sidenav:hover .obra-sidenav__detail {
        max-width: 140px;
    }

    .obra-sidenav__name {
        font-size: 0.8rem;
    }

    .obra-sidenav__loc {
        display: none;
    }

    /* Center the topnav group between the two sidenav pills */
    .obra-topnav {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .obra-hero {
        height: 50vh;
    }
    .obra-hero__img {
        object-position: center 0%;
    }
    .obra-hero__title {
        font-size: 2rem;
    }
    .obra-hero__overlay {
        padding: 40px 20px 24px;
    }
    .obra-map__container {
        height: 250px;
    }
}

/* ==========================================================================
   Revelado al hacer scroll — portado de turismo-fuencaliente (initReveal).
   `.js-anim` la pone el script inline del <head>; sin ella el contenido
   queda VISIBLE. Si el JS no carga, la página no se queda en blanco.
   ========================================================================== */
.js-anim [data-animate] { opacity: 0; }
.js-anim [data-animate].is-revealed {
    opacity: 1;
    animation: hv-fade-in-up 500ms both;
}
@keyframes hv-fade-in-up {
    from { opacity: 0; transform: translate3d(0, 40px, 0); }
    to   { opacity: 1; transform: none; }
}
/* En móvil solo fundido: el translate provoca reflow y tirones al scrollear. */
@media (max-width: 768px) {
    .js-anim [data-animate].is-revealed { animation-name: hv-fade-in; }
}
@keyframes hv-fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Movimiento reducido: se revela, pero sin desplazamiento ni fundido. */
@media (prefers-reduced-motion: reduce) {
    .js-anim [data-animate] { opacity: 1; }
    .js-anim [data-animate].is-revealed { animation: none; }
}
