/* =========================================================
   Fotos de León — David Jiménez Llanes
   Diseño masonry oscuro cinematográfico
   ========================================================= */

:root {
    --bg: #0a0a0a;
    --bg-soft: #131313;
    --bg-card: #181818;
    --fg: #f3f0ea;
    --fg-soft: rgba(243, 240, 234, 0.65);
    --fg-dim: rgba(243, 240, 234, 0.35);
    --accent: #d4a574;
    --accent-soft: rgba(212, 165, 116, 0.15);
    --line: rgba(243, 240, 234, 0.08);

    --serif: 'Cormorant Garamond', Georgia, serif;
    --sans:  'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    --col-gap: 1rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}

/* =========================================================
   CURSOR PERSONALIZADO (escritorio)
   ========================================================= */
.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s, transform 0.18s var(--ease-out);
    opacity: 0;
}

.cursor-dot {
    width: 6px; height: 6px;
    background: var(--accent);
}

.cursor-ring {
    width: 36px; height: 36px;
    border: 1px solid rgba(212, 165, 116, 0.5);
    transition: transform 0.4s var(--ease-out), width 0.3s, height 0.3s, opacity 0.3s;
}

@media (hover: hover) and (pointer: fine) {
    body.cursor-ready .cursor-dot,
    body.cursor-ready .cursor-ring { opacity: 1; }
    body.cursor-ready { cursor: none; }
    body.cursor-ready a, body.cursor-ready button { cursor: none; }

    .cursor-ring.is-hover {
        width: 64px; height: 64px;
        background: var(--accent-soft);
        border-color: transparent;
    }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.hero__bg {
    position: absolute;
    inset: -10% -5% -10% -5%;
    background-size: cover;
    background-position: center;
    z-index: -2;
    will-change: transform;
    transform: scale(1.05);
    filter: brightness(0.55) contrast(1.05) saturate(1.05);
    animation: heroZoom 18s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    from { transform: scale(1.05) translate3d(0, 0, 0); }
    to   { transform: scale(1.18) translate3d(0, -2%, 0); }
}

.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 50% 30%, transparent 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.85) 100%),
        linear-gradient(180deg, rgba(10,10,10,0.4) 0%, rgba(10,10,10,0.1) 35%, rgba(10,10,10,0.85) 100%);
}

.hero__noise {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__content {
    position: relative;
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 90vw;
    z-index: 1;
}

.hero__eyebrow {
    display: inline-block;
    font-family: var(--sans);
    font-size: clamp(0.65rem, 2.5vw, 0.75rem);
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--accent);
    margin-bottom: 1.5rem;
    padding-left: 0.35em;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s var(--ease-out) 0.2s forwards;
}

@media (max-width: 480px) {
    .hero__eyebrow {
        letter-spacing: 0.25em;
        padding-left: 0.25em;
    }
}

.hero__title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(3.5rem, 14vw, 11rem);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
}

.hero__title-line {
    display: block;
    overflow: hidden;
}

.hero__title-line > * { display: block; }

/* Reveal por línea: el JS añade .is-revealed */
.hero__title-line {
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.05s, transform 1.1s var(--ease-out);
}

.hero__title-line.is-revealed {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.hero__title-line--accent {
    font-style: italic;
    color: var(--accent);
    transition-delay: 0.3s;
}

.hero__title-line--accent.is-revealed { transition-delay: 0.55s; }

.hero__subtitle {
    font-family: var(--sans);
    font-weight: 300;
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--fg-soft);
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.9s var(--ease-out);
}

.hero__subtitle.is-revealed {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s;
}

.hero__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 2.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--fg-dim);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.9s var(--ease-out);
}

.hero__meta.is-revealed {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.1s;
}

.hero__meta-sep { color: var(--accent); }

.hero__scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--fg-soft);
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 1s var(--ease-out) 1.5s forwards;
    transition: color 0.3s;
}

.hero__scroll:hover { color: var(--accent); }

.hero__scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(180deg, transparent, var(--fg-soft) 50%, transparent);
    animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(0.3); transform-origin: top; }
    50%      { transform: scaleY(1);   transform-origin: top; }
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px) translateX(-50%); }
    to   { opacity: 1; transform: translateY(0)    translateX(-50%); }
}

.hero--empty {
    background: var(--bg);
}

.hero--empty .hero__title-line { opacity: 1; transform: none; }

.hero__empty-note {
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--fg-dim);
}

.hero__empty-note code {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    background: var(--accent-soft);
    padding: 0.15em 0.5em;
    border-radius: 3px;
}

/* =========================================================
   GALERÍA - INTRO
   ========================================================= */
.gallery-section {
    padding: 6rem 2rem 4rem;
    max-width: 2200px;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .gallery-section { padding: 4rem 1rem 3rem; }
}

.gallery-intro {
    text-align: center;
    margin-bottom: 5rem;
    padding: 0 1rem;
}

.gallery-intro__title {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.01em;
    color: var(--fg);
    margin-bottom: 1rem;
}

.gallery-intro__text {
    color: var(--fg-soft);
    font-size: 0.95rem;
    max-width: 32em;
    margin: 0 auto;
    letter-spacing: 0.02em;
}

/* =========================================================
   MASONRY (CSS columns)
   ========================================================= */
.masonry {
    column-count: 1;
    column-gap: var(--col-gap);
}

@media (min-width: 600px)  { .masonry { column-count: 2; --col-gap: 1.2rem; } }
@media (min-width: 1100px) { .masonry { column-count: 2; --col-gap: 1.8rem; } }
@media (min-width: 1500px) { .masonry { column-count: 3; --col-gap: 2rem; } }
@media (min-width: 2000px) { .masonry { column-count: 4; --col-gap: 2rem; } }

.card {
    break-inside: avoid;
    margin-bottom: var(--col-gap);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.card.is-revealed {
    opacity: 1;
    transform: translateY(0);
}

.card__btn {
    display: block;
    width: 100%;
    padding: 0;
    background: transparent;
    border-radius: 4px;
    position: relative;
}

.card__picture {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: var(--aspect, 1.5);
    background: linear-gradient(135deg, #1a1a1a 0%, #0e0e0e 100%);
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
    transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out);
}

.card__picture::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    border-radius: inherit;
    pointer-events: none;
    z-index: 3;
}

.card__btn:hover .card__picture {
    transform: translateY(-4px);
    box-shadow:
        0 30px 60px -25px rgba(0, 0, 0, 0.9),
        0 12px 30px -15px rgba(212, 165, 116, 0.18);
}

.card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 0.8s var(--ease-out), transform 1.6s var(--ease-out), filter 0.6s var(--ease-out);
    filter: blur(20px);
}

.card__img.is-loaded {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.card__btn:hover .card__img {
    transform: scale(1.06);
}

/* ===== TEXTO DEBAJO DE LA FOTO (siempre) ===== */
.card__text {
    padding: 1.6rem 0.4rem 0.4rem;
    text-align: left;
}

.card__title {
    font-family: var(--serif);
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
    line-height: 1.25;
    letter-spacing: -0.005em;
    color: var(--fg);
    margin: 0 0 0.9rem;
    display: inline-block;
    transition: color 0.4s var(--ease-out);
}

/* Línea dorada decorativa debajo del título, crece en hover */
.card__title::after {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
    background: var(--accent);
    margin-top: 0.9rem;
    transform-origin: left center;
    transition: width 0.6s var(--ease-out), background 0.4s;
}

.card__btn:hover .card__title { color: var(--accent); }
.card__btn:hover .card__title::after { width: 72px; }

.card__description {
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--fg-soft);
    letter-spacing: 0.005em;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.4s var(--ease-out);
}

.card__btn:hover .card__description { color: var(--fg); }

/* Cards con texto: más espacio inferior para que respiren entre filas */
.card--has-text {
    margin-bottom: calc(var(--col-gap) + 1.6rem);
}

@media (max-width: 600px) {
    .card__text { padding: 1.3rem 0.2rem 0.3rem; }
    .card__description {
        font-size: 0.88rem;
        -webkit-line-clamp: 4;
    }
}

/* Reveal genérico para [data-reveal] no-card */
[data-reveal]:not(.card):not(.hero__title-line):not(.hero__subtitle):not(.hero__meta) {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

[data-reveal].is-revealed:not(.card):not(.hero__title-line):not(.hero__subtitle):not(.hero__meta) {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 8, 8, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 5rem 3.5rem;
    gap: 2.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out), visibility 0.4s;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox__stage {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    border-radius: 4px;
}

.lightbox__img.is-shown {
    opacity: 1;
    transform: scale(1);
}

.lightbox__close,
.lightbox__nav {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--fg);
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.lightbox__close svg,
.lightbox__nav svg {
    width: 22px;
    height: 22px;
}

.lightbox__close:hover,
.lightbox__nav:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    transform: scale(1.05);
}

.lightbox__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__nav--prev { left: 0; }
.lightbox__nav--next { right: 0; }
.lightbox__nav--prev:hover { transform: translateY(-50%) scale(1.05); }
.lightbox__nav--next:hover { transform: translateY(-50%) scale(1.05); }

/* ===== Caption editorial debajo de la foto ===== */
.lightbox__caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 38rem;
    text-align: center;
    pointer-events: none;
    flex-shrink: 0;
    padding: 0 1rem;
}

.lightbox__counter {
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--accent);
    padding-left: 0.5em;
    margin-bottom: 1.1rem;
}

.lightbox__title {
    font-family: var(--serif);
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    line-height: 1.2;
    letter-spacing: -0.005em;
    color: var(--fg);
    margin: 0;
    max-width: 24ch;
}

.lightbox__title:empty { display: none; }

.lightbox__title:not(:empty)::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--accent);
    margin: 1.3rem auto 0;
    opacity: 0.75;
}

.lightbox__description {
    font-family: var(--sans);
    font-size: clamp(0.88rem, 1.1vw, 1rem);
    font-weight: 300;
    line-height: 1.75;
    color: var(--fg-soft);
    letter-spacing: 0.005em;
    max-width: 38rem;
    margin: 0;
}

.lightbox__title:not(:empty) ~ .lightbox__description:not(:empty) {
    margin-top: 1.3rem;
}

.lightbox__description:empty { display: none; }

/* Si no hay counter (no debería pasar, pero por si acaso), no espacio extra */
.lightbox__counter:empty { display: none; }

@media (max-width: 768px) {
    .lightbox {
        padding: 3rem 1rem 2rem;
        gap: 1.5rem;
    }
    .lightbox__close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }
    .lightbox__nav {
        width: 44px;
        height: 44px;
    }
    .lightbox__nav--prev { left: 0; }
    .lightbox__nav--next { right: 0; }
    .lightbox__counter {
        font-size: 0.65rem;
        letter-spacing: 0.4em;
        margin-bottom: 0.8rem;
    }
    .lightbox__title {
        font-size: 1.35rem;
    }
    .lightbox__title:not(:empty)::after {
        margin-top: 1rem;
        width: 32px;
    }
    .lightbox__title:not(:empty) ~ .lightbox__description:not(:empty) {
        margin-top: 1rem;
    }
    .lightbox__description {
        font-size: 0.88rem;
        line-height: 1.65;
    }
}

/* =========================================================
   BOTÓN VOLVER ARRIBA
   ========================================================= */
.top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), background 0.3s;
    z-index: 100;
}

.top-btn svg { width: 20px; height: 20px; }

.top-btn.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.top-btn:hover {
    background: var(--fg);
    transform: translateY(-3px);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
    text-align: center;
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--fg-dim);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.site-footer__nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1.2rem;
}

.site-footer__nav a {
    color: var(--fg-dim);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    transition: color 0.3s;
}

.site-footer__nav a:hover { color: var(--accent); }

/* =========================================================
   PÁGINAS LEGALES (Aviso, Privacidad, Cookies)
   ========================================================= */
.legal-page {
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--line);
    gap: 1rem;
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fg-soft);
    text-decoration: none;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: color 0.3s;
}

.legal-back svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s var(--ease-out);
}

.legal-back:hover {
    color: var(--accent);
}

.legal-back:hover svg {
    transform: translateX(-3px);
}

.legal-brand {
    text-decoration: none;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: var(--fg);
}

.legal-brand__title {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--accent);
}

.legal-brand__sub {
    font-size: 0.68rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--fg-dim);
}

.legal-main {
    flex: 1;
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 5rem 1.5rem 5rem;
}

.legal-h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    line-height: 1.05;
    color: var(--fg);
    margin: 0 0 0.8rem;
    letter-spacing: -0.015em;
}

.legal-h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--accent);
    margin-top: 2rem;
}

.legal-content {
    margin-top: 3.5rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--fg-soft);
}

.legal-content h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.5rem;
    color: var(--fg);
    margin: 3rem 0 1rem;
    letter-spacing: -0.005em;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content p {
    margin: 0 0 1.2rem;
}

.legal-content ul {
    margin: 0 0 1.5rem 1.5rem;
    padding: 0;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content strong {
    color: var(--fg);
    font-weight: 500;
}

.legal-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 165, 116, 0.3);
    transition: border-color 0.3s;
}

.legal-content a:hover {
    border-bottom-color: var(--accent);
}

@media (max-width: 600px) {
    .legal-header {
        padding: 1.2rem 1rem;
    }
    .legal-brand__title { font-size: 1.05rem; }
    .legal-brand__sub { font-size: 0.6rem; }
    .legal-main { padding: 3rem 1.2rem 3rem; }
    .legal-content { font-size: 0.95rem; }
    .legal-content h2 { font-size: 1.25rem; margin-top: 2.4rem; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .hero__bg { animation: none; }
}
