/* As tipografías cárganse desde includes/head.php cun <link> e preconnect.
   Un @import aquí non se descobre ata que baixa esta folla de estilos, o que
   encadea dúas peticións en serie e atrasa o primeiro renderizado. */

:root {
    --color-bg: #faf9f6;
    --color-bg-alt: #f3f1ec;
    --color-bg-dark: #1a1a2e;
    --color-surface: #ffffff;
    --color-text: #2d2d2d;
    --color-text-light: #6b7280;
    --color-text-muted: #9ca3af;
    --color-primary: #b8860b;
    --color-primary-dark: #8b6914;
    --color-primary-light: #daa520;
    --color-primary-glow: rgba(184, 134, 11, 0.12);
    --color-accent: #2d5016;
    --color-border: rgba(0, 0, 0, 0.08);
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --transition: 150ms ease;
}

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

html {
    scroll-behavior: smooth;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    max-width: 100vw;
    overflow-x: hidden;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---- NAVBAR ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
    border-bottom: none;
    transition: all 0.3s;
}

.navbar.scrolled {
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
    mix-blend-mode: difference;
}

.navbar.transparent-nav {
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    backdrop-filter: none;
    border-bottom: none;
}
.navbar.transparent-nav.scrolled {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    mix-blend-mode: difference;
}

.navbar.transparent-nav .nav-link {
    color: #fff;
}
.navbar.transparent-nav .logo-text {
    color: #fff;
}
.navbar.transparent-nav .nav-toggle span {
    background: #fff;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
}

.nav-cta {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white !important;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    mix-blend-mode: normal;
}

.nav-cta:hover {
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
    transform: translateY(-1px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: #fff;
    transition: all 0.3s;
    border-radius: 2px;
    mix-blend-mode: difference;
}

/* ---- HERO ---- */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--color-bg-dark);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05);
    animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}

/* ---- FLOATING 3D HERO IMAGES ---- */
.hero-floating-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1; /* Below overlay */
    pointer-events: none;
    perspective: 1500px;
}

.hero-float-img {
    position: absolute;
    opacity: 0;
    transform-style: preserve-3d;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    overflow: hidden;
    filter: brightness(0.8);
    border: 1px solid rgba(255,255,255,0.05); /* Softer borders */
    will-change: transform, opacity;
}

@media (max-width: 768px) {
    .hero-float-img {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
        border-radius: 12px;
    }
}

.hero-float-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Elegantly ease up from well below the container view bounds */
@keyframes floatUp3D {
    0% {
        opacity: 0;
        transform: translateY(120vh) translateZ(-150px) rotateX(25deg) rotateY(-20deg) rotateZ(-10deg);
    }
    15% {
        opacity: 0.90; /* Highly visible */
    }
    85% {
        opacity: 0.90;
    }
    100% {
        opacity: 0;
        transform: translateY(-80vh) translateZ(50px) rotateX(-5deg) rotateY(10deg) rotateZ(5deg);
    }
}

@keyframes floatUp3DAlt {
    0% {
        opacity: 0;
        transform: translateY(120vh) translateZ(-50px) rotateX(-20deg) rotateY(25deg) rotateZ(10deg);
    }
    15% {
        opacity: 0.85; 
    }
    85% {
        opacity: 0.85;
    }
    100% {
        opacity: 0;
        transform: translateY(-80vh) translateZ(-200px) rotateX(10deg) rotateY(-15deg) rotateZ(-5deg);
    }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(26, 26, 46, 0.4) 0%,
            rgba(26, 26, 46, 0.75) 60%,
            rgba(26, 26, 46, 0.95) 100%);
    z-index: 2; /* Above elements to ensure text remains readable */
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 6rem 1.5rem 4rem;
    max-width: 700px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.15rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-desc {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(184, 134, 11, 0.35);
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
}

/* ---- SECTIONS ---- */
.section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-primary);
    background: var(--color-primary-glow);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--color-text-light);
    max-width: 500px;
    margin: 0 auto;
}

/* ---- EVENT CARDS ---- */
.events-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.event-card-image {
    height: 180px;
    overflow: hidden;
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.event-card:hover .event-card-image img {
    transform: scale(1.05);
}

.event-card-body {
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    flex: 1;
}

.event-date {
    background: var(--color-primary-glow);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.65rem;
    text-align: center;
    min-width: 52px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.date-day {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.date-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--color-primary-dark);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.event-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.event-lugar {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-bottom: 0.35rem;
}

.event-desc {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.event-card-link {
    display: block;
    padding: 0.75rem 1.25rem;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-primary);
    border-top: 1px solid var(--color-border);
    transition: background var(--transition);
}

.event-card-link:hover {
    background: var(--color-primary-glow);
}

/* ---- SPONSORS ---- */
.section-sponsors {
    padding: 3rem 0;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.sponsors-label {
    text-align: center;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.sponsors-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.sponsor-logo img {
    height: 44px;
    opacity: 0.5;
    filter: grayscale(100%);
    transition: all 0.3s;
}

.sponsor-logo:hover img {
    opacity: 1;
    filter: grayscale(0%);
}

/* ---- FOOTER ---- */
.footer {
    background: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2.5rem;
}

.footer-brand h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--color-primary-light);
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links a {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    padding: 0.25rem 0;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--color-primary-light);
}

.footer-contact p {
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition);
}

.footer-contact a:hover {
    color: var(--color-primary-light);
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: all var(--transition);
}

.footer-social a:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.footer-bottom {
    margin-top: 3rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.4);
    transition: color var(--transition);
}

.footer-legal a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ---- QUIENES SOMOS GRID ---- */
.qs-intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .qs-intro-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .qs-intro-grid div:first-child { order: 1; }
    .qs-intro-grid div:last-child { order: 2; }
}

/* ---- QUEBRA DE PALABRAS LONGAS ----
   As tarxetas levan overflow:hidden, así que un título, un URL ou unha
   referencia sen espazos saíase pola dereita e vía cortada, sobre todo
   en móbil, onde a columna é moito máis estreita. ---- */
.card-title, .card-title a, .card-excerpt, .card-tag, .card-date-pill,
.biblio-title, .biblio-desc, .biblio-meta,
.timeline-card .card-title, .timeline-card .card-excerpt,
.museo-item-title, .museo-item-meta, .museo-item-blur-desc,
.lightbox-caption {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ---- CLICKABLE CARDS (NIEBLA, TIMELINE, BIBLIOTECA) ---- */
.niebla-card, .timeline-card, .biblio-card {
    position: relative; /* Base for pseudo-link */
    cursor: default;
}

.niebla-card .main-link::after, .timeline-card .main-link::after, .biblio-card .main-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1; /* Cover whole card */
}

/* Ensure secondary links (tags, attachments) stay on top */
.card-preview-stack, .card-tags, .card-footer a:not(.main-link), .mc-mini-carousel, .meta-item, .content-icon-pill, .biblio-meta {
    position: relative;
    z-index: 2;
}

/* ---- FLOATING CONTACT ---- */
.floating-contact {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
}

.floating-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.35);
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(184, 134, 11, 0.45);
}

.floating-menu {
    position: absolute;
    bottom: 65px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s;
}

.floating-contact.open .floating-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.float-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: var(--color-surface);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition);
    color: var(--color-text);
}

.float-item:hover {
    background: var(--color-primary);
    color: white;
}

.float-item i {
    width: 18px;
    text-align: center;
}

/* ---- COOKIE BANNER ---- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 2rem;
}

.cookie-inner p {
    font-size: 0.82rem;
    line-height: 1.5;
}

.cookie-inner a {
    color: var(--color-primary-light);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ---- ANIMATIONS ---- */
.animate-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.15s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.45s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- PAGE CONTENT (for inner pages) ---- */
/* ---- PREMIUM ARTICLE HEADER (NIEBLA Style) ---- */
.article-header-hero {
    position: relative;
    padding: 10rem 0 5rem;
    min-height: 50vh;
    display: flex;
    align-items: center;
    background: var(--color-bg-dark);
    overflow: hidden;
}

.hero-blur-bg {
    position: absolute;
    inset: -20px;
    background-position: center;
    background-size: cover;
    filter: blur(40px) brightness(0.5);
    opacity: 0.6;
    transform: scale(1.1);
}

.hero-inner {
    position: relative;
    z-index: 5;
}

.hero-card {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
    align-items: center;
}

@media (max-width: 991px) {
    .hero-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-featured-img {
        margin: 0 auto;
        width: 280px;
        height: 280px;
    }
}

.hero-featured-img {
    width: 350px;
    height: 350px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(-2deg);
    transition: transform 0.4s ease;
}

.hero-featured-img:hover {
    transform: rotate(0) scale(1.02);
}

.hero-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.hero-featured-placeholder {
    width: 350px;
    height: 350px;
    background: var(--color-primary-glow);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--color-primary);
}

.article-type-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--color-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 999px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

.article-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.article-meta-modern {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 991px) {
    .article-meta-modern {
        justify-content: center;
    }
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 1rem;
}

.meta-item i {
    color: var(--color-primary-light);
    font-size: 1.1rem;
}

.page-header {
    padding: 8rem 0 3rem;
    background: var(--color-bg-dark);
    color: white;
    text-align: center;
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

.page-content {
    padding: 3rem 0;
    max-width: 900px;
    margin: 0 auto;
}

/* ---- ARTICLE BLOCKS (NIEBLA render) ---- */
.article-block {
    margin-bottom: 2rem;
}

.article-block .block-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.article-block .block-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text);
}

.article-block .block-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 1rem 0;
}

.article-block .block-image img {
    width: 100%;
    display: block;
}

.article-block .block-gallery-wrapper {
    position: relative;
    margin: 1rem 0;
}

/* ---- MASONRY GRID (No empty spaces) ---- */
.block-gallery.layout-grid {
    display: block;
    column-count: 3;
    column-gap: 1rem;
}

.block-gallery.layout-grid img {
    display: inline-block;
    width: 100%;
    margin-bottom: 1rem;
    break-inside: avoid;
    border-radius: var(--radius-md);
}

@media (max-width: 991px) {
    .block-gallery.layout-grid {
        column-count: 2;
    }
}

@media (max-width: 576px) {
    .block-gallery.layout-grid {
        column-count: 2;
        column-gap: 0.75rem;
    }
    .block-gallery.layout-grid img {
        margin-bottom: 0.75rem;
    }
}

/* ---- REFINED CAROUSEL ---- */
.article-block .block-gallery.layout-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 1rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}

.article-block .block-gallery.layout-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.article-block .block-gallery.layout-carousel img {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: clamp(300px, 45vw, 600px);
    height: 400px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.article-block .block-gallery img {
    width: 100%;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s;
}

.article-block .block-gallery img:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Carousel Nav Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    left: -20px;
    right: -20px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s, left 0.3s, right 0.3s;
}

.block-gallery-wrapper:hover .carousel-nav {
    opacity: 1;
    left: 10px;
    right: 10px;
}

@media (max-width: 991px) {
    .carousel-nav {
        display: none;
    }

    /* Use touch on mobile */
}

.carousel-nav button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
    box-shadow: var(--shadow-md);
}

.carousel-nav button:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: scale(1.1);
}

/* ---- LIGHTBOX (NIEBLA Style) ---- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    /* Toggle via JS */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-content {
    max-width: 90%;
    height: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    flex: 1;
    min-height: 0;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-caption {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-text);
    font-size: 0.9rem;
    text-align: left;
    font-family: var(--font-body);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 350px;
    width: 90%;
    line-height: 1.5;
    z-index: 10;
}

.lightbox-caption .lightbox-meta {
    display: block;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    font-size: 0.8rem;
    color: #64748b;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
}

.lightbox-caption strong {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--color-primary-dark);
}

@media (max-width: 768px) {
    .lightbox-content {
        justify-content: space-between;
    }

    .lightbox-caption {
        position: relative;
        top: auto;
        left: auto;
        margin-top: 1rem;
        width: 100%;
        max-width: none;
        max-height: 150px;
        overflow-y: auto;
    }
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--color-primary);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
    }
}

.article-block .block-image.full-width {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    border-radius: 0;
}

.article-block .block-image.full-width img {
    border-radius: 0;
}

.article-block .block-video {
    position: relative;
    padding-bottom: 56.25%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.article-block .block-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- JUNTA DIRECTIVA GRID ---- */
.junta-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.junta-member {
    text-align: center;
}

.junta-member img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.75rem;
    border: 3px solid var(--color-primary-glow);
}

.junta-member h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

.junta-member p {
    font-size: 0.8rem;
    color: var(--color-primary);
    font-weight: 500;
}

/* ---- FORM STYLES ---- */
.form-public {
    max-width: 600px;
    margin: 0 auto;
}

.form-group-pub {
    margin-bottom: 1.25rem;
}

.form-group-pub label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-text);
}

.form-group-pub input,
.form-group-pub textarea,
.form-group-pub select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color var(--transition);
    background: var(--color-surface);
}

.form-group-pub input:focus,
.form-group-pub textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

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

/* Nav Menu on mobile for transparent state */
.transparent-nav .nav-menu.open {
    background: #0a0a14 !important; /* Dark background matching Museo/Hero */
}

.transparent-nav .nav-menu.open .nav-links a {
    color: #fff !important;
}

/* --- FOOTER MOBILE GRID --- */
@media (max-width: 768px) {
    .footer-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        text-align: left;
    }
    .footer-brand {
        grid-column: span 2;
        text-align: center;
        margin-bottom: 1rem;
    }
    .footer-links {
        padding: 0 1rem;
    }
    .footer-contact {
        grid-column: span 2;
        text-align: center;
        margin-top: 1rem;
    }
    .footer-social {
        justify-content: center;
    }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: 3rem 1.5rem; /* Increased vertical padding */
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        transform: translateY(-120%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        gap: 1.25rem; /* Increased gap */
    }

    .nav-menu.open {
        transform: translateY(0);
    }

    .nav-link {
        padding: 1rem;
        width: 100%;
        text-align: center;
        font-size: 1.25rem; /* Larger font */
        font-weight: 600;
        border-radius: var(--radius-md);
        letter-spacing: 0.02em;
    }
    
    .nav-link:active {
        background: var(--color-primary-glow);
    }

    .hero {
        min-height: 70vh;
    }

    .hero-content {
        padding: 6rem 2rem 4rem; /* More padding */
        text-align: center;
    }

    .events-carousel {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .footer-bottom .powered-by a {
        justify-content: center !important;
    }

    .cookie-inner {
        flex-direction: column;
        text-align: center;
    }

    .sponsors-strip {
        gap: 1.5rem;
    }

    .sponsor-logo img {
        height: 32px;
    }
}

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

    .hero-buttons {
        flex-direction: row; /* Side by side */
        justify-content: center;
        gap: 0.75rem;
    }

    .hero-buttons .btn {
        width: auto;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        flex: 1;
        max-width: 180px;
    }
}

/* ---- VIDEO COVERS & REORDER ARROWS ---- */
.hero-video-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bloque-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bloque-reorder button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    padding: 2px;
    cursor: pointer;
    font-size: 0.65rem;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bloque-reorder button:hover {
    color: var(--color-primary);
}