/* ========================================
   1. VARIABLES Y GENERALES
======================================== */

:root {
    --black: #111111;
    --white: #f8f7f3;
    --beige: #ddd4c8;
    --line: rgba(17, 17, 17, 0.16);
    --gray: #706d68;

    --serif: "Italiana", serif;
    --sans: "DM Sans", sans-serif;
    --title-letter-spacing: -0.01em;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    color: var(--black);
    background: var(--white);

    font-family: var(--sans);
    font-weight: 300;
}

body.menu-open {
    overflow: hidden;
}

img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

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

button {
    color: inherit;
    font: inherit;
}

main {
    overflow: hidden;
}

h1,
h2,
h3 {
    letter-spacing: var(--title-letter-spacing);
}

.events-eyebrow {
    margin: 0;

    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}


/* ========================================
   2. HEADER
======================================== */

.header {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    width: 100%;
    height: 78px;
    padding: 0 3.3vw;

    border-bottom: 1px solid rgba(17, 17, 17, 0.12);

    background: rgba(248, 247, 243, 0.9);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    transition: transform 0.4s ease;
}

.header.hidden {
    transform: translateY(-100%);
}

.logo {
    font-family: var(--serif);
    font-size: 20px;
    letter-spacing: 0.06em;
}

.menu {
    display: flex;
    gap: 28px;

    font-size: 12px;
}

.menu a {
    position: relative;
    white-space: nowrap;
}

.menu a::after {
    position: absolute;
    right: 0;
    bottom: -6px;
    left: 0;

    height: 1px;

    background: var(--black);

    content: "";

    transform: scaleX(0);
    transform-origin: right;

    transition: transform 0.35s ease;
}

.menu a:hover::after,
.menu a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header__button {
    justify-self: end;

    padding: 11px 18px;

    border: 1px solid var(--black);

    font-size: 12px;

    transition:
        color 0.3s ease,
        background 0.3s ease;
}

.header__button span {
    margin-left: 15px;
}

.header__button:hover {
    color: var(--white);
    background: var(--black);
}

.menu__button {
    display: none;

    padding: 0;
    border: 0;

    background: transparent;
    cursor: pointer;
}


/* ========================================
   3. PORTADA
======================================== */

.events-hero {
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    min-height: 82vh;
    padding:
        calc(78px + 7vh)
        3.3vw
        5vh;
}

.events-hero__top,
.events-hero__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.events-hero__top > span,
.events-hero__bottom {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.events-hero__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.3fr);
    align-items: end;
    gap: 5vw;

    margin: 7vh 0;
}

.events-hero__content h1 {
    margin: 0;

    font-family: var(--serif);
    font-size: clamp(65px, 9vw, 155px);
    font-weight: 400;
    line-height: 0.88;
    letter-spacing: var(--title-letter-spacing);
}

.events-hero__content h1 em {
    font-style: italic;
}

.events-hero__content > p {
    max-width: 380px;
    margin: 0 0 12px;

    font-size: 15px;
    line-height: 1.7;
}

.events-hero__bottom {
    padding-top: 22px;

    border-top: 1px solid var(--line);
}

.events-hero__bottom a {
    display: inline-flex;
    align-items: center;
    gap: 24px;
}


/* ========================================
   4. PORTAFOLIO
======================================== */

.events-portfolio {
    padding: 12vh 3.3vw 14vh;

    background: #ffffff;
}

.events-portfolio__heading {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: end;
    gap: 4vw;

    margin-bottom: 7vh;
}

.events-portfolio__heading h2 {
    margin: 0;

    font-family: var(--serif);
    font-size: clamp(55px, 7vw, 115px);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: var(--title-letter-spacing);
}

.events-portfolio__heading h2 em {
    font-style: italic;
}


/* ========================================
   5. FILTROS
======================================== */

.events-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin-bottom: 6vh;
    padding-bottom: 25px;

    border-bottom: 1px solid var(--line);
}

.events-filter {
    padding: 10px 17px;

    border: 1px solid var(--line);
    border-radius: 100px;

    background: transparent;

    font-size: 11px;
    cursor: pointer;

    transition:
        color 0.3s ease,
        background 0.3s ease;
}

.events-filter:hover,
.events-filter.active {
    color: #ffffff;
    background: var(--black);
}


/* ========================================
   6. CUADRÍCULA
======================================== */

.events-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8vh 2vw;
}

.event-card.hidden {
    display: none;
}


/* ========================================
   7. GALERÍA DE CADA EVENTO
======================================== */

.event-card__gallery {
    position: relative;

    height: 48vh;
    overflow: hidden;

    background: var(--beige);
}

.event-card__slides {
    position: relative;

    width: 100%;
    height: 100%;
}

.event-card__slide {
    position: absolute;
    inset: 0;

    opacity: 0;
    transform: scale(1.025);

    transition:
        opacity 0.65s ease,
        transform 1s ease;
}

.event-card__slide.active {
    z-index: 1;

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


/* ---------- CONTROLES ---------- */

.event-card__controls {
    position: absolute;
    z-index: 5;
    right: 18px;
    bottom: 18px;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 9px 12px;

    color: #ffffff;
    background: rgba(17, 17, 17, 0.72);

    backdrop-filter: blur(10px);
}

.event-card__arrow {
    padding: 0;
    border: 0;

    background: transparent;

    font-size: 15px;
    cursor: pointer;
}

.event-card__counter {
    min-width: 47px;

    font-size: 9px;
    letter-spacing: 0.12em;
    text-align: center;
}


/* ========================================
   8. INFORMACIÓN DEL EVENTO
======================================== */

.event-card__information {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    min-height: 145px;
    padding: 22px 0;

    border-bottom: 1px solid var(--line);
}

.event-card__number {
    display: block;

    margin-bottom: 12px;

    font-size: 9px;
    letter-spacing: 0.12em;
}

.event-card__information h3 {
    margin: 0 0 10px;

    font-family: var(--serif);
    font-size: clamp(27px, 2.3vw, 40px);
    font-weight: 400;
    line-height: 1;
}

.event-card__information p {
    margin: 0;

    color: var(--gray);

    font-size: 10px;
    line-height: 1.5;
}

.event-card__link {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    flex: 0 0 auto;

    padding-bottom: 7px;

    border-bottom: 1px solid rgba(17, 17, 17, 0.35);

    font-size: 10px;
    white-space: nowrap;
}


/* ========================================
   9. CONTACTO
======================================== */

.events-contact {
    padding: 13vh 3.3vw;

    color: var(--white);
    background: var(--black);
}

.events-contact h2 {
    margin: 6vh 0;

    font-family: var(--serif);
    font-size: clamp(70px, 10vw, 165px);
    font-weight: 400;
    line-height: 0.88;
    letter-spacing: var(--title-letter-spacing);
}

.events-contact h2 em {
    font-style: italic;
}

.events-contact__button {
    display: inline-flex;
    align-items: center;
    gap: 60px;

    padding: 19px 23px;

    border: 1px solid rgba(255, 255, 255, 0.65);

    font-size: 11px;
}


/* ========================================
   10. FOOTER
======================================== */

.events-footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;

    padding: 28px 3.3vw;

    color: rgba(248, 247, 243, 0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.2);

    background: var(--black);

    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.events-footer span:nth-child(2) {
    text-align: center;
}

.events-footer span:last-child {
    text-align: right;
}


/* ========================================
   11. BOTONES FLOTANTES
======================================== */

.whatsapp-float {
    position: fixed;
    z-index: 120;
    right: 24px;
    bottom: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;

    color: #ffffff;
    border-radius: 50%;

    background: var(--black);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.whatsapp-float svg {
    width: 22px;
    height: 22px;
}

.events-back-top {
    position: fixed;
    z-index: 110;
    bottom: 24px;
    left: 24px;

    width: 48px;
    height: 48px;

    border: 1px solid var(--line);
    border-radius: 50%;

    background: rgba(248, 247, 243, 0.94);

    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease;
}

.events-back-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/* ========================================
   12. ANIMACIONES
======================================== */

.events-reveal {
    opacity: 0;
    transform: translateY(35px);

    transition:
        opacity 0.9s ease,
        transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.events-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* ========================================
   13. TABLET
======================================== */

@media (max-width: 1100px) {

    .menu {
        gap: 16px;
        font-size: 10px;
    }

    .events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* ========================================
   14. MÓVIL
======================================== */

@media (max-width: 900px) {

    .header {
        grid-template-columns: 1fr auto;

        height: 70px;
        padding: 0 6vw;
    }

    .logo {
        font-size: 17px;
    }

    .menu {
        position: fixed;
        top: 70px;
        right: 0;

        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 24px;

        width: 100%;
        height: calc(100svh - 70px);
        padding: 40px 6vw;

        background: var(--white);

        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);

        transition:
            opacity 0.4s ease,
            visibility 0.4s ease,
            transform 0.4s ease;
    }

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

    .menu a {
        white-space: normal;

        font-family: var(--serif);
        font-size: clamp(27px, 8vw, 42px);
        line-height: 1.08;
    }

    .header__button {
        display: none;
    }

    .menu__button {
        display: block;
    }

    .events-hero {
        min-height: 90svh;
        padding:
            calc(70px + 7vh)
            6vw
            5vh;
    }

    .events-hero__content {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .events-hero__content h1 {
        font-size: clamp(56px, 14vw, 105px);
    }

    .events-portfolio {
        padding: 11vh 6vw;
    }

    .events-portfolio__heading {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .events-filters {
        flex-wrap: nowrap;
        overflow-x: auto;

        scrollbar-width: none;
    }

    .events-filters::-webkit-scrollbar {
        display: none;
    }

    .events-filter {
        flex: 0 0 auto;
    }

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

    .event-card__gallery {
        height: 58vh;
    }

    .events-contact {
        padding: 12vh 6vw;
    }

    .events-footer {
        grid-template-columns: 1fr;
        gap: 12px;

        padding: 25px 6vw;
    }

    .events-footer span:nth-child(2),
    .events-footer span:last-child {
        text-align: left;
    }

}

@media (max-width: 560px) {

    .events-hero__top > span {
        display: none;
    }

    .event-card__information {
        align-items: flex-start;
        flex-direction: column;
    }

}


/* ========================================
   AJUSTE FINAL — TÍTULOS EDITORIALES
   Mantiene el mismo espaciado que Proyectos
======================================== */

.events-hero__content h1,
.events-portfolio__heading h2,
.events-contact h2 {
    letter-spacing: -0.01em;
}
