/* Xun's Art — fully self-contained stylesheet.
   Deliberately independent of ../../../assets/css/main.css and the
   shared site header/nav/footer/hero patterns — this page defines its
   own reset, tokens, and typography from scratch. */

/* ---------- Theme presets ----------
   Dev-only switch via body[data-theme]. See index.html for how to swap. */

body[data-theme="minimal"] {
    --bg: #ffffff;
    --surface: #f6f6f4;
    --text: #111111;
    --text-muted: #6b6b6b;
    --border: rgba(0, 0, 0, 0.12);
    --accent: #111111;
    --tile-dash: rgba(0, 0, 0, 0.25);
    --tile-shadow: rgba(0, 0, 0, 0.2);
    --backdrop: rgba(10, 10, 10, 0.88);
}

body[data-theme="amber"] {
    --bg: #fff8ef;
    --surface: #fdeed6;
    --text: #2b1a06;
    --text-muted: #8a6a3e;
    --border: rgba(180, 110, 20, 0.25);
    --accent: #c1660b;
    --tile-dash: rgba(193, 102, 11, 0.4);
    --tile-shadow: rgba(120, 72, 12, 0.28);
    --backdrop: rgba(30, 18, 4, 0.88);
}

body[data-theme="dark"] {
    --bg: #0d0d0d;
    --surface: #181818;
    --text: #f2f2f0;
    --text-muted: #9a9a95;
    --border: rgba(255, 255, 255, 0.14);
    --accent: #e8a33d;
    --tile-dash: rgba(255, 255, 255, 0.28);
    --tile-shadow: rgba(0, 0, 0, 0.55);
    --backdrop: rgba(0, 0, 0, 0.92);
}

/* ---------- Reset & base ---------- */

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background 0.2s ease, color 0.2s ease;
}

button {
    font: inherit;
    color: inherit;
}

/* ---------- Layout ---------- */

.art-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 4rem 1.5rem 6rem;
}

.art-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4rem;
}

.art-word {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 1.6rem;
}

.art-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.art-intro {
    margin-bottom: 3.5rem;
}

.art-intro h1 {
    font-family: 'Instrument Serif', Georgia, serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.15;
    max-width: 700px;
    margin-bottom: 1rem;
}

.art-intro p {
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.6;
}

.art-ig-follow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.6;
    transition: color 0.2s ease;
}

.art-ig-follow:hover,
.art-ig-follow:focus-visible {
    color: var(--accent);
}

.art-ig-follow svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ---------- Gallery ----------
   True masonry via CSS multi-column layout: each image keeps its natural
   aspect ratio (no forced crop) and the browser fills column 1 top-to-
   bottom, then column 2, etc. — the column-based, uneven-row look of
   https://www.levijacobs.nl/'s Wix Pro Gallery (masonry mode, fixed
   columns, no smart-crop), not a row-by-row grid. */

.art-gallery {
    column-count: 4;
    column-gap: 1.25rem;
}

.art-tile {
    display: block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 1.25rem;
    border: none;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.art-tile:hover,
.art-tile:focus-visible {
    transform: translateY(-6px) scale(1.015);
}

.art-tile:hover {
    box-shadow: 0 18px 32px -16px var(--tile-shadow);
}

.art-tile:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.art-tile:hover .art-tile-placeholder,
.art-tile:focus-visible .art-tile-placeholder {
    border-color: var(--accent);
    color: var(--accent);
}

.art-tile img {
    width: 100%;
    height: auto;
    display: block;
}

.art-tile-placeholder {
    width: 100%;
    aspect-ratio: 4 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px dashed var(--tile-dash);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---------- Footer ---------- */

.art-bottom {
    margin-top: 5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.art-social {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.1rem;
}

.art-social-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.art-social-link:hover,
.art-social-link:focus-visible {
    color: var(--accent);
}

.art-social-link svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
}

/* ---------- Lightbox ----------
   Built on the native <dialog> element (via showModal()) rather than a
   hand-rolled overlay: the browser handles focus trapping, making the
   rest of the page inert to assistive tech while open, and closing on
   Escape, for free. A small JS-toggled class still drives the "pop up"
   open transition (see index.html's inline script). */

dialog.art-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    margin: auto;
    max-width: min(90vw, 900px);
    max-height: 85vh;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    overflow: visible;
}

dialog.art-lightbox::backdrop {
    background: var(--backdrop);
}

.art-lightbox-content {
    max-width: min(90vw, 900px);
    max-height: 85vh;
    background: var(--surface);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: translateY(16px) scale(0.96);
    transition: transform 0.2s ease;
}

.art-lightbox--open .art-lightbox-content {
    transform: translateY(0) scale(1);
}

.art-lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
}

.art-lightbox-placeholder {
    width: min(70vw, 560px);
    aspect-ratio: 4 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--tile-dash);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.art-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.art-lightbox-close:hover,
.art-lightbox-close:focus-visible {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

body.art-scroll-lock {
    overflow: hidden;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .art-page {
        padding: 3rem 1.25rem 4rem;
    }

    .art-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
        margin-bottom: 3rem;
    }

    .art-gallery {
        column-count: 3;
        column-gap: 0.9rem;
    }

    .art-tile {
        margin-bottom: 0.9rem;
    }
}

@media (max-width: 480px) {
    .art-gallery {
        column-count: 2;
    }

    dialog.art-lightbox {
        max-width: 94vw;
    }

    .art-lightbox-close {
        top: -10px;
        right: -10px;
        width: 2.2rem;
        height: 2.2rem;
    }
}
