:root {
    --bg: #f7f4ef;
    --surface: #ffffff;
    --ink: #151515;
    --muted: #68625b;
    --line: rgba(21, 21, 21, 0.1);
    --accent: #0067f4;
    --accent-dark: #004ec2;
    --accent-ink: #ffffff;
    --link: #0057d9;
    --link-hover: #003b9e;
    --green: #2d6f62;
    --shadow: 0 22px 60px rgba(44, 36, 30, 0.14);
    --header-bg: rgba(247, 244, 239, 0.82);
    --header-line: rgba(255, 255, 255, 0.42);
    --nav-bg: rgba(255, 255, 255, 0.56);
    --nav-hover: #ffffff;
    --card-image-bg: #ddd7ce;
    --zoom-bg: #f0ece5;
    --zoom-hover: #e6dfd4;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(0, 103, 244, 0.14), transparent 32%),
        linear-gradient(315deg, rgba(45, 111, 98, 0.12), transparent 34%),
        var(--bg);
}

body:has(#theme-toggle:checked) {
    --bg: #11100f;
    --surface: #1c1a18;
    --ink: #f5f1ea;
    --muted: #b9aea3;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #5ad7ff;
    --accent-dark: #20a8e0;
    --accent-ink: #06131d;
    --link: #79dcff;
    --link-hover: #c1f1ff;
    --green: #57b7a4;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    --header-bg: rgba(17, 16, 15, 0.82);
    --header-line: rgba(255, 255, 255, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.06);
    --nav-hover: rgba(255, 255, 255, 0.1);
    --card-image-bg: #292522;
    --zoom-bg: rgba(255, 255, 255, 0.08);
    --zoom-hover: rgba(255, 255, 255, 0.14);
}

body:has(#creditos:target) {
    overflow: hidden;
}

a {
    color: var(--link);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--link-hover);
}

#fancybox-wrap,
#fancybox-wrap *,
#fancybox-overlay,
#fancybox-loading,
#fancybox-loading * {
    box-sizing: content-box;
}

#fancybox-close,
#fancybox-left,
#fancybox-right {
    text-decoration: none;
}

#fancybox-title .fancybox-reference {
    max-width: 100%;
    padding: 2px 12px 4px;
    overflow-wrap: anywhere;
    color: #333;
    text-align: left;
    white-space: normal;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.theme-toggle-input {
    position: fixed;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--header-line);
    background: var(--header-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1180px, calc(100% - 32px));
    min-height: 88px;
    margin: 0 auto;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 60px;
    object-fit: contain;
    filter: none;
}

.theme-toggle-input:checked + .site-header .brand-mark img {
    filter: brightness(0) invert(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav a {
    min-width: 122px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    background: var(--nav-bg);
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.header-nav a:hover {
    color: var(--ink);
    border-color: rgba(0, 103, 244, 0.36);
    background: var(--nav-hover);
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--ink), #4a4038);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.12);
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.16);
}

.theme-toggle-input:focus-visible + .site-header .theme-toggle {
    outline: 3px solid rgba(0, 103, 244, 0.36);
    outline-offset: 3px;
}

.theme-dark,
.theme-toggle-input:checked + .site-header .theme-light {
    display: none;
}

.theme-toggle-input:checked + .site-header .theme-dark {
    display: inline;
}

.theme-toggle-input:checked + .site-header .theme-toggle {
    color: #151515;
    background: linear-gradient(135deg, #f5f1ea, #c9c0b6);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 64px;
}

.hero {
    margin-bottom: 28px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.hero img {
    display: block;
    width: 100%;
    height: auto;
}

.exhibition-intro {
    max-width: 860px;
    margin: 0 0 34px;
    padding: 6px 0 4px;
}

.exhibition-intro h2 {
    margin: 8px 0 12px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
}

.exhibition-intro p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px;
    scroll-margin-top: 104px;
}

.card {
    position: relative;
    flex: 0 0 274px;
    width: 274px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(34, 29, 24, 0.08);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 103, 244, 0.28);
    box-shadow: 0 24px 54px rgba(34, 29, 24, 0.16);
}

.card > .verfoto {
    display: grid;
    place-items: center;
    position: relative;
    min-height: 418px;
    overflow: hidden;
    padding: 12px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.5), transparent 42%),
        var(--card-image-bg);
}

.card > .verfoto::after {
    content: "Ampliar";
    position: absolute;
    right: 14px;
    bottom: 14px;
    padding: 8px 11px;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.54);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.card:hover > .verfoto::after {
    opacity: 1;
    transform: translateY(0);
}

.card img {
    display: block;
    width: min(250px, 100%);
    max-width: 100%;
    height: auto;
    aspect-ratio: 250 / 394;
    object-fit: contain;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
    transform: scale(1.001);
    transition: transform 300ms ease, filter 300ms ease, box-shadow 300ms ease;
}

.card:hover img {
    filter: saturate(1.08) contrast(1.03);
    transform: scale(1.035);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.32);
}

.card-content {
    padding: 18px;
}

.card-content h3 {
    margin: 0 0 14px;
    font-size: 22px;
    line-height: 1.15;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.btn,
.brand,
.header-nav a,
.verfoto,
.credits-backdrop,
.credits-close,
#fancybox-close,
#fancybox-left,
#fancybox-right {
    color: inherit;
}

.btn:hover,
.brand:hover,
.header-nav a:hover,
.verfoto:hover,
.credits-backdrop:hover,
.credits-close:hover,
#fancybox-close:hover,
#fancybox-left:hover,
#fancybox-right:hover {
    color: inherit;
}

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

.btn-more {
    color: var(--accent-ink);
    background: var(--accent);
    box-shadow: 0 12px 20px rgba(0, 103, 244, 0.22);
}

.btn-more:hover {
    color: var(--accent-ink);
    background: var(--accent-dark);
}

.credits-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.credits-modal:target {
    opacity: 1;
    pointer-events: auto;
}

.credits-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.credits-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: min(80vh, 620px);
    overflow: auto;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateY(10px) scale(0.98);
    transition: transform 180ms ease;
}

.credits-modal:target .credits-dialog {
    transform: translateY(0) scale(1);
}

.credits-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 24px;
    line-height: 1;
    background: var(--nav-bg);
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.credits-close:hover {
    color: var(--ink);
    border-color: rgba(0, 103, 244, 0.36);
    background: var(--nav-hover);
}

.credits-dialog h2 {
    margin: 8px 42px 18px 0;
    font-size: 32px;
    line-height: 1.1;
}

.credits-text {
    display: grid;
    gap: 12px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.credits-text p {
    margin: 0;
}

@media (max-width: 700px) {
    .header-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        min-height: 76px;
        padding: 8px 0;
        gap: 8px 12px;
    }

    .brand {
        grid-column: 1;
        grid-row: 1;
    }

    .brand-mark {
        width: auto;
        height: 60px;
    }

    .header-actions {
        display: contents;
    }

    .header-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        gap: 6px;
    }

    .header-nav a {
        min-width: 0;
        padding: 9px 8px;
        font-size: 13px;
    }

    .theme-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        width: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    main {
        width: min(100% - 24px, 1180px);
        padding-top: 24px;
    }

    .exhibition-intro {
        margin-bottom: 26px;
    }

    .exhibition-intro p:last-child {
        font-size: 16px;
    }

    .gallery-container {
        max-width: 380px;
        margin: 0 auto;
        gap: 18px;
    }

    .card {
        flex-basis: min(100%, 340px);
        width: min(100%, 340px);
    }

    .credits-dialog {
        padding: 24px;
    }

    .credits-dialog h2 {
        font-size: 28px;
    }
}
