:root {
    --ink: #061b31;
    --navy: #09243e;
    --blue: #123b60;
    --paper: #f4f5f4;
    --white: #fff;
    --orange: #ff7144;
    --muted: #a9bed0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

.topbar {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 max(24px, calc((100vw - 1220px)/2));
    background: var(--ink);
    color: #fff;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.85rem;
    font-weight: 850;
    letter-spacing: -.08em;
    text-decoration: none;
}

.logo span {
    color: #fff;
}

.logo .logo-accent {
    color: #ff8059;
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.topbar nav a {
    color: #d5e1eb;
    text-decoration: none;
    font-size: .82rem;
}

.nav-button {
    padding: 8px 13px;
    border: 1px solid #64809a;
    border-radius: 999px;
    color: #fff;
    background: transparent;
    cursor: pointer;
    font-size: .8rem;
}

.hero {
    min-height: 470px;
    padding: 52px max(24px, calc((100vw - 1220px)/2));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(90deg, rgba(4, 18, 32, .91) 2%, rgba(4, 18, 32, .55) 58%, rgba(4, 18, 32, .24)), url('https://images.unsplash.com/photo-1506157786151-b8491531f063?auto=format&fit=crop&w=1800&q=85') center/cover;
    color: #fff;
}

.hero-content {
    max-width: 620px;
}

.eyebrow {
    margin: 0 0 9px;
    color: #ff9c7b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(3rem, 6.2vw, 5.8rem);
    line-height: .89;
    letter-spacing: -.085em;
}

.hero-copy {
    max-width: 400px;
    margin: 22px 0 0;
    color: #e6edf3;
    font-size: 1.05rem;
    line-height: 1.5;
}

.search-panel {
    max-width: 800px;
    display: flex;
    gap: 10px;
    padding: 12px;
    background: rgba(8, 34, 57, .88);
    border: 1px solid rgba(198, 222, 240, .19);
    border-radius: 14px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
}

.search-field {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px;
    border-radius: 8px;
    background: #fff;
    color: #5b6775;
}

.search-field input {
    width: 100%;
    min-height: 43px;
    border: 0;
    outline: 0;
    color: var(--ink);
}

.search-panel button,
.btn-primary {
    border: 0;
    border-radius: 8px;
    background: var(--orange);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    padding: 0 19px;
}

.agenda-section {
    max-width: 1220px;
    margin: 0 auto;
    padding: 65px 24px 78px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
}

.section-heading .eyebrow {
    color: #dd5630;
}

h2 {
    margin: 0;
    letter-spacing: -.055em;
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1;
}

.contador {
    margin: 0;
    color: #637589;
    font-size: .9rem;
}

.contenedor-filtros {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    margin: 26px 0;
    padding-bottom: 3px;
}

.btn-filtro {
    flex: 0 0 auto;
    border: 1px solid #d5dce2;
    border-radius: 999px;
    background: #fff;
    color: #4d6174;
    padding: 9px 15px;
    cursor: pointer;
    font-weight: 700;
    font-size: .86rem;
}

.btn-filtro.active {
    color: #fff;
    background: var(--ink);
    border-color: var(--ink);
}

.btn-permanente {
    color: #9f5420;
    border-color: #f3d4be;
    background: #fff9f4;
}

.btn-vigonature {
    color: #1b5e20;
    border-color: #a5d6a7;
    background: #f1f8e9;
}

.btn-vigonature.active {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}


.grid-eventos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.card {
    position: relative;
    min-height: 380px;
    overflow: hidden;
    border-radius: 14px;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(6, 27, 49, .14);
    transition: transform .25s, box-shadow .25s;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 34px rgba(6, 27, 49, .23);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 15%, rgba(5, 17, 29, .23) 38%, rgba(5, 17, 29, .96) 92%);
}

.card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    position: absolute;
    inset: auto 0 0;
    z-index: 1;
    padding: 19px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 5px;
    background: #4a779d;
    color: #fff;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tag.musica {
    background: #c53d57
}

.tag.exposiciones {
    background: #318a6b
}

.tag.familiar {
    background: #d58d26
}

.tag.rutas {
    background: #297e91
}

.tag.escena {
    background: #7a5bae
}

.tag.formacion {
    background: #4875b2
}

.titulo-evento {
    margin: 12px 0 10px;
    font-size: 1.36rem;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 5px 0;
    color: #d7e2ea;
    font-size: .8rem;
    line-height: 1.35;
}

.info svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.descripcion {
    display: -webkit-box;
    overflow: hidden;
    margin: 11px 0 0;
    color: #d2dde5;
    font-size: .8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.empty {
    grid-column: 1/-1;
    padding: 50px 20px;
    text-align: center;
    color: #607286;
}

.modal-overlay {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 16, 29, .82);
    backdrop-filter: blur(7px);
}

.modal-overlay[hidden] {
    display: none;
}

.modal-content {
    position: relative;
    width: min(790px, 100%);
    max-height: 92vh;
    overflow: auto;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .4);
}

.btn-cerrar {
    position: absolute;
    z-index: 2;
    top: 13px;
    right: 13px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 1.7rem;
    cursor: pointer;
    box-shadow: 0 2px 8px #0005;
}

.modal-header-img {
    width: 100%;
    height: min(330px, 36vh);
    object-fit: cover;
}

.modal-body {
    padding: 30px clamp(23px, 5vw, 50px) 42px;
}

.modal-body h2 {
    margin: 12px 0 22px;
    font-size: clamp(2rem, 4.4vw, 3rem);
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    padding: 14px 0;
    border-block: 1px solid #e1e6e9;
    color: #4c6174;
    font-size: .92rem;
}

.modal-meta p {
    margin: 0;
}

.modal-descripcion {
    margin: 27px 0;
    color: #2d4051;
    font-size: 1rem;
    line-height: 1.78;
}

.modal-descripcion p {
    margin: 0 0 1.1em;
}

.modal-descripcion p:last-child {
    margin-bottom: 0;
}

#contenedor-mapa h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}

#mapa {
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.modal-actions a {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    text-decoration: none;
}

.btn-secondary {
    border: 1px solid #b9c9d6;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 750;
}

.site-footer {
    display: grid;
    grid-template-columns: 1.2fr 1fr auto;
    gap: 40px;
    padding: 47px max(24px, calc((100vw - 1220px)/2));
    background: var(--ink);
    color: #d5e1eb;
}

.site-footer p {
    max-width: 260px;
    margin: 14px 0 0;
    line-height: 1.5;
    font-size: .9rem;
}

.footer-links,
.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 11px 19px;
    align-content: start;
}

.footer-links a,
.footer-legal a {
    color: #d5e1eb;
    text-decoration: none;
    font-size: .84rem;
}

.footer-legal {
    flex-direction: column;
}

.cookie-banner {
    position: fixed;
    z-index: 30;
    right: 18px;
    bottom: 18px;
    width: min(400px, calc(100vw - 36px));
    padding: 17px;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 12px 36px #0004;
}

.cookie-banner[hidden] {
    display: none
}

.cookie-banner p {
    margin: 0 0 12px;
    font-size: .86rem;
    line-height: 1.45
}

.cookie-banner a {
    color: #a84020
}

.cookie-banner button {
    border: 0;
    border-radius: 6px;
    padding: 8px 13px;
    background: var(--ink);
    color: #fff;
    font-weight: 700;
    cursor: pointer
}

@media(max-width:680px) {
    .topbar {
        padding-block: 13px
    }

    .logo img {
        width: 90px !important;
    }

    .topbar nav a {
        display: none
    }

    .hero {
        min-height: 520px;
        padding-block: 44px
    }

    .search-panel {
        flex-direction: column
    }

    .search-panel button {
        min-height: 43px
    }

    .agenda-section {
        padding-inline: 18px
    }

    .site-footer {
        grid-template-columns: 1fr;
        gap: 27px
    }

    .footer-legal {
        flex-direction: row
    }

    .grid-eventos {
        grid-template-columns: 1fr 1fr
    }

    .card {
        min-height: 325px
    }

    .card-body {
        padding: 14px
    }

    .titulo-evento {
        font-size: 1.1rem
    }

    .descripcion {
        display: none
    }
}

@media(max-width:430px) {
    .grid-eventos {
        grid-template-columns: 1fr
    }

    .card {
        min-height: 370px
    }
}