/**
 * PV Gallery — Frontend Styles (unique prefix pv9g-)
 * Phương Võ Hair Salon
 * Prefix: pv9g- to avoid conflict with Elementor global
 */

:root {
    --pv9g-gold: #b8860b;
    --pv9g-gold-l: #96700a;
    --pv9g-gold-glow: rgba(184, 134, 11, 0.08);
    --pv9g-dk: #ffffff;
    --pv9g-dk2: #f8f7f4;
    --pv9g-dk3: #f0efe9;
    --pv9g-txt: #2c2c2c;
    --pv9g-muted: #777777;
    --pv9g-bdr: rgba(0, 0, 0, 0.08);
    --pv9g-cardbg: #ffffff;
    --pv9g-r: 16px;
    --pv9g-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════
   ELEMENTOR OVERRIDES — phải thắng global styles
   ═══════════════════════════════════════ */

#pv9g-gallery-page,
#pv9g-single-page {
    background: var(--pv9g-dk) !important;
    color: var(--pv9g-txt) !important;
    min-height: 100vh;
    font-family: var(--pvt-body, 'Be Vietnam Pro'), -apple-system, BlinkMacSystemFont, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

/* Reset tất cả typography trong gallery pages — thắng Elementor */
#pv9g-gallery-page h1,
#pv9g-gallery-page h2,
#pv9g-gallery-page h3,
#pv9g-gallery-page h4,
#pv9g-gallery-page p,
#pv9g-gallery-page span,
#pv9g-gallery-page a,
#pv9g-gallery-page button,
#pv9g-single-page h1,
#pv9g-single-page h2,
#pv9g-single-page h3,
#pv9g-single-page h4,
#pv9g-single-page p,
#pv9g-single-page span,
#pv9g-single-page a,
#pv9g-single-page button {
    font-family: var(--pvt-body, 'Be Vietnam Pro'), -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: var(--pv9g-txt);
    line-height: 1.4;
}

/* ═══════════════════════════════════════
   GALLERY PAGE (page-gallery.php)
   ═══════════════════════════════════════ */

/* ─── Hero ─── */
.pv9g-hero {
    position: relative;
    padding: 80px 24px 60px;
    text-align: center;
    background: linear-gradient(180deg, var(--pv9g-dk2) 0%, var(--pv9g-dk) 100%) !important;
    overflow: hidden;
}

.pv9g-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--pv9g-gold-glow) 0%, transparent 70%);
    pointer-events: none;
}

.pv9g-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.pv9g-hero-label {
    display: inline-block;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--pv9g-gold) !important;
    margin-bottom: 16px;
}

#pv9g-gallery-page h1.pv9g-hero-title,
#pv9g-single-page h1.pv9g-shero-title {
    font-size: clamp(32px, 5vw, 42px) !important;
    font-weight: 500 !important;
    font-family: var(--pvt-heading, 'Cormorant Garamond'), Georgia, serif !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    letter-spacing: -0.5px !important;
    line-height: 1.2 !important;
    color: var(--pv9g-txt) !important;
    -webkit-text-fill-color: var(--pv9g-txt) !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.pv9g-hero-desc {
    font-size: 16px !important;
    color: var(--pv9g-muted) !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

/* ─── Container ─── */
.pv9g-wrap,
.pv9g-swrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.pv9g-content,
.pv9g-scontent {
    padding: 48px 0 80px;
}

/* ─── Filters ─── */
.pv9g-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 40px;
}

.pv9g-fbtn {
    padding: 10px 22px;
    border: 1.5px solid var(--pv9g-bdr);
    background: transparent;
    color: var(--pv9g-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s var(--pv9g-ease);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pv9g-fbtn:hover {
    border-color: var(--pv9g-gold);
    color: var(--pv9g-gold);
    background: rgba(184, 134, 11, 0.06);
}

.pv9g-fbtn.active {
    background: var(--pv9g-gold);
    border-color: var(--pv9g-gold);
    color: #fff;
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.3);
}

.pv9g-ficon {
    font-size: 10px;
}

.pv9g-fcnt {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}

.pv9g-fbtn.active .pv9g-fcnt {
    background: rgba(255, 255, 255, 0.25);
}

/* ─── Album Grid ─── */
.pv9g-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.pv9g-item {
    transition: opacity 0.4s var(--pv9g-ease), transform 0.4s var(--pv9g-ease);
}

.pv9g-item.pv9g-hidden {
    display: none;
}

.pv9g-card {
    background: var(--pv9g-cardbg);
    border: 1px solid var(--pv9g-bdr);
    border-radius: var(--pv9g-r);
    overflow: hidden;
    transition: all 0.35s var(--pv9g-ease);
}

.pv9g-card:hover {
    border-color: rgba(184, 134, 11, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(184, 134, 11, 0.1);
    transform: translateY(-4px);
}

/* ─── Album Media ─── */
.pv9g-media {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
}

.pv9g-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--pv9g-ease);
}

.pv9g-card:hover .pv9g-media img {
    transform: scale(1.06);
}

.pv9g-nothumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--pv9g-dk3);
    color: var(--pv9g-muted);
}

.pv9g-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pv9g-badge svg {
    opacity: 0.7;
}

/* ─── Album Body ─── */
.pv9g-body {
    padding: 16px 20px 8px;
}

#pv9g-gallery-page .pv9g-name {
    font-size: 17px !important;
    font-weight: 500 !important;
    font-family: var(--pvt-heading, 'Cormorant Garamond'), Georgia, serif !important;
    margin: 0 0 6px !important;
    color: var(--pv9g-txt) !important;
    line-height: 1.3 !important;
}

.pv9g-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--pv9g-gold);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ─── Toggle ─── */
.pv9g-toggle {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-top: 1px solid var(--pv9g-bdr);
    background: transparent;
    color: var(--pv9g-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s var(--pv9g-ease);
    margin-top: 8px;
}

.pv9g-toggle:hover {
    color: var(--pv9g-gold) !important;
    background: var(--pv9g-gold-glow);
}

.pv9g-arrow {
    transition: transform 0.3s var(--pv9g-ease);
}

.pv9g-toggle.expanded .pv9g-arrow {
    transform: rotate(180deg);
}

/* ─── Expand Grid ─── */
.pv9g-expand {
    border-top: 1px solid var(--pv9g-bdr);
    padding: 16px;
    background: var(--pv9g-dk2) !important;
}

.pv9g-expgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.pv9g-expimg {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
}

.pv9g-expimg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s var(--pv9g-ease), filter 0.4s;
}

.pv9g-expimg:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.pv9g-expimg a {
    display: block;
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════
   SINGLE ALBUM PAGE (single-pv_gallery.php)
   ═══════════════════════════════════════ */

.pv9g-shero {
    position: relative;
    padding: 80px 24px 50px;
    text-align: center;
    background: linear-gradient(180deg, var(--pv9g-dk2) 0%, var(--pv9g-dk) 100%);
    overflow: hidden;
}

.pv9g-shero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--pv9g-gold-glow) 0%, transparent 70%);
    pointer-events: none;
}

.pv9g-shero-inner {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.pv9g-shero-cat {
    display: inline-block;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--pv9g-gold) !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding: 4px 16px;
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 20px;
}

/* .pv9g-shero-title is styled via #pv9g-single-page h1.pv9g-shero-title above */

.pv9g-shero-meta {
    font-size: 14px;
    color: var(--pv9g-muted);
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pv9g-shero-sep {
    opacity: 0.3;
}

.pv9g-backlink {
    display: inline-block;
    font-size: 14px;
    color: var(--pv9g-muted);
    text-decoration: none;
    transition: color 0.3s;
    border: 1px solid var(--pv9g-bdr);
    padding: 8px 20px;
    border-radius: 30px;
}

.pv9g-backlink:hover {
    color: var(--pv9g-gold);
    border-color: var(--pv9g-gold);
}

.pv9g-sdesc {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    font-size: 16px;
    line-height: 1.7;
    color: var(--pv9g-muted);
}

/* ─── Single Image Grid ─── */
.pv9g-sgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.pv9g-simg {
    border-radius: var(--pv9g-r);
    overflow: hidden;
    position: relative;
    background: var(--pv9g-cardbg);
    border: 1px solid var(--pv9g-bdr);
    transition: all 0.35s var(--pv9g-ease);
}

.pv9g-simg:hover {
    border-color: rgba(184, 134, 11, 0.2);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.pv9g-simg a {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.pv9g-simg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--pv9g-ease);
}

.pv9g-simg:hover img {
    transform: scale(1.06);
}

.pv9g-simgover {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s var(--pv9g-ease);
}

.pv9g-simg:hover .pv9g-simgover {
    opacity: 1;
}

.pv9g-simgover svg {
    color: #fff;
}

.pv9g-scap {
    padding: 10px 14px;
    margin: 0;
    font-size: 13px;
    color: var(--pv9g-muted);
    border-top: 1px solid var(--pv9g-bdr);
}

/* ═══════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════ */

.pv9g-lb {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(8px);
}

.pv9g-lb.active {
    opacity: 1;
    visibility: visible;
}

.pv9g-lb-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pv9g-lb-content img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
    animation: pv9gFade 0.35s var(--pv9g-ease);
}

.pv9g-lb-cap {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-top: 14px;
    text-align: center;
}

.pv9g-lb-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1000000;
}

.pv9g-lb-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.pv9g-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1000000;
}

.pv9g-lb-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-50%) scale(1.08);
}

.pv9g-lb-prev {
    left: 24px;
}

.pv9g-lb-next {
    right: 24px;
}

.pv9g-lb-ctr {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 1000000;
}

@keyframes pv9gFade {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ─── Empty ─── */
.pv9g-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--pv9g-muted);
}

.pv9g-empty svg {
    opacity: 0.3;
    margin-bottom: 20px;
}

.pv9g-empty h3 {
    font-size: 22px !important;
    color: var(--pv9g-txt) !important;
    margin: 0 0 8px !important;
}

.pv9g-empty p {
    font-size: 15px !important;
    margin: 0 !important;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 992px) {

    .pv9g-grid,
    .pv9g-sgrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .pv9g-hero,
    .pv9g-shero {
        padding: 60px 20px 40px;
    }
}

@media (max-width: 640px) {
    .pv9g-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .pv9g-sgrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pv9g-expgrid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .pv9g-filters {
        gap: 6px;
    }

    .pv9g-fbtn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .pv9g-hero,
    .pv9g-shero {
        padding: 48px 16px 32px;
    }

    .pv9g-hero-desc,
    .pv9g-sdesc {
        font-size: 14px;
    }

    .pv9g-lb-nav {
        width: 42px;
        height: 42px;
    }

    .pv9g-lb-prev {
        left: 12px;
    }

    .pv9g-lb-next {
        right: 12px;
    }
}