/* ------------------------------------------------------------------
   L3V3L Photography — Stage 10 category gallery layout
   Applies the approved Stage 2 visual language (charcoal + bronze,
   Poppins / Dancing Script, photographic backdrop, bronze hairline
   panels) to the public category galleries, the Family index, and the
   Family sub-gallery.

   Presentation only. No authentication, session, or delivery logic is
   expressed here.
   ------------------------------------------------------------------ */

:root {
    --l3v3l-bronze: #B39A78;
    --l3v3l-bronze-bright: #d8c3a5;
    --l3v3l-bg: #1f2029;
    --l3v3l-panel: rgba(31, 32, 41, 0.72);
    --l3v3l-line: rgba(179, 154, 120, 0.22);
    --l3v3l-text: #f4f1ea;
    --l3v3l-muted: rgba(244, 241, 234, 0.68);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--l3v3l-text);
    background-color: var(--l3v3l-bg);
    background-image:
        linear-gradient(180deg, rgba(12, 13, 18, 0.82) 0%, rgba(18, 19, 26, 0.92) 42%, rgba(12, 13, 18, 0.98) 100%),
        url('../img/photo.jpg');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(circle at 72% 8%, rgba(179, 154, 120, 0.1), transparent 38%);
}

body a {
    color: var(--l3v3l-bronze);
    text-decoration: none;
}

body a:hover,
body a:focus-visible {
    color: var(--l3v3l-bronze-bright);
}

/* ---------- shell ---------- */

.pg-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 4vw, 3rem) 4rem;
}

/* ---------- brand ---------- */

.pg-brand {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: clamp(1rem, 2.5vw, 1.75rem);
}

.pg-brand__wordmark {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--l3v3l-text);
    line-height: 1;
}

.pg-brand__sub {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: var(--l3v3l-bronze);
}

/* ---------- horizontal nav ---------- */

.pg-nav {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--l3v3l-line);
}

.pg-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pg-nav a {
    display: inline-block;
    padding: 0.35rem 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--l3v3l-muted);
    border-bottom: 1px solid transparent;
    transition: color 300ms ease, border-color 300ms ease;
}

.pg-nav a:hover,
.pg-nav a:focus-visible {
    color: var(--l3v3l-bronze-bright);
    border-bottom-color: var(--l3v3l-bronze);
}

.pg-nav a[aria-current="page"] {
    color: var(--l3v3l-text);
    border-bottom-color: var(--l3v3l-bronze);
}

/* ---------- headings ---------- */

.pg-title {
    margin: 0 0 0.4rem;
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.35rem, 2.6vw, 1.9rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--l3v3l-text);
}

.pg-title::after {
    content: '';
    display: block;
    width: 46px;
    height: 2px;
    margin-top: 0.7rem;
    background: var(--l3v3l-bronze);
}

.pg-sub {
    margin: 0 0 clamp(1.5rem, 3vw, 2.25rem);
    font-size: 0.9rem;
    color: var(--l3v3l-muted);
}

/* ---------- gallery grid ---------- */

.gallery {
    margin: 0;
}

.gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: clamp(0.75rem, 1.6vw, 1.15rem);
}

.gallery-link {
    position: relative;
    display: block;
    overflow: hidden;
    border: 1px solid var(--l3v3l-line);
    border-radius: 2px;
    background: var(--l3v3l-panel);
    transition: border-color 300ms ease, transform 300ms ease;
}

.gallery-link:hover,
.gallery-link:focus-visible {
    border-color: var(--l3v3l-bronze);
    transform: translateY(-2px);
}

.gallery-link:focus-visible {
    outline: 2px solid var(--l3v3l-bronze-bright);
    outline-offset: 3px;
}

.gallery-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 0;
    background: #0D0E11;
    transition: opacity 300ms ease;
}

.gallery-link:hover .gallery-img,
.gallery-link:focus-visible .gallery-img {
    opacity: 0.88;
}

/* Family index label under each thumbnail */
.gallery-link .pg-tile-label {
    display: block;
    padding: 0.6rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--l3v3l-muted);
    text-align: center;
    border-top: 1px solid var(--l3v3l-line);
}

.gallery-link:hover .pg-tile-label {
    color: var(--l3v3l-bronze-bright);
}

/* ---------- empty / error states ---------- */

.pg-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: clamp(2rem, 6vw, 4rem) 1.5rem;
    text-align: center;
    color: var(--l3v3l-muted);
    font-size: 0.92rem;
    border: 1px dashed var(--l3v3l-line);
    border-radius: 2px;
    background: var(--l3v3l-panel);
}

.pg-empty__title {
    display: block;
    margin-bottom: 0.4rem;
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: var(--l3v3l-bronze);
}

/* ---------- footer ---------- */

.pg-footer {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    padding-top: 1.25rem;
    border-top: 1px solid var(--l3v3l-line);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--l3v3l-muted);
}

.pg-footer a {
    color: var(--l3v3l-bronze);
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
    .gallery-images {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.6rem;
    }

    .pg-nav ul {
        gap: 0.3rem 1rem;
    }

    .pg-nav a {
        font-size: 0.72rem;
        letter-spacing: 0.12em;
    }
}

@media (max-width: 420px) {
    .gallery-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    body *,
    .gallery-link,
    .gallery-img,
    .pg-nav a {
        transition: none !important;
        animation: none !important;
    }

    .gallery-link:hover,
    .gallery-link:focus-visible {
        transform: none;
    }
}

/* ---------- back to top ---------- */

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    color: var(--l3v3l-bronze);
    background: rgba(15, 16, 22, 0.86);
    border: 1px solid var(--l3v3l-line);
    border-radius: 50%;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(14px);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 300ms ease, transform 300ms ease, visibility 300ms ease,
                color 300ms ease, border-color 300ms ease, background 300ms ease;
}

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

.back-to-top:hover,
.back-to-top:focus-visible {
    color: #fff;
    border-color: rgba(179, 154, 120, 0.55);
    background: rgba(31, 32, 41, 0.92);
    transform: translateY(-3px);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--l3v3l-bronze);
    outline-offset: 3px;
}

.back-to-top svg {
    display: block;
    transition: transform 300ms ease;
}

.back-to-top:hover svg {
    transform: translateY(-2px);
}

@media (max-width: 720px) {
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
}

/* ---------- load more ---------- */

.gallery-images .is-hidden {
    display: none;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: clamp(1.5rem, 4vw, 2.5rem);
}

.load-more {
    padding: 0.7rem 2rem;
    color: var(--l3v3l-bronze);
    background: rgba(15, 16, 22, 0.86);
    border: 1px solid var(--l3v3l-line);
    border-radius: 999px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 300ms ease, border-color 300ms ease, background 300ms ease;
}

.load-more:hover,
.load-more:focus-visible {
    color: #fff;
    border-color: rgba(179, 154, 120, 0.55);
    background: rgba(31, 32, 41, 0.92);
}

.load-more:focus-visible {
    outline: 2px solid var(--l3v3l-bronze);
    outline-offset: 3px;
}
