/* Homepage gallery section — Option C (Featured + strip). Scoped to #portfolio-gallery-section */

#portfolio-gallery-section.home-gallery-featured {
    --hgf-bg-thumb: #111d30;
    --hgf-cyan: var(--accent, #00c4ff);
    --hgf-cyan-dim: rgba(0, 196, 255, 0.12);
    --hgf-cyan-glow: rgba(0, 196, 255, 0.22);
    --hgf-border: rgba(255, 255, 255, 0.08);
    --hgf-text-2: var(--subtext, #7a96b5);
    --hgf-text-3: #3a5470;
}

#portfolio-gallery-section .home-gallery-featured-inner {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
}

#portfolio-gallery-section .hgf-section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    margin-bottom: 28px;
}

#portfolio-gallery-section .hgf-header-left {
    width: 100%;
    text-align: center;
}

#portfolio-gallery-section .hgf-section-header .hgf-header-right {
    margin: 12px auto 0;
    text-align: center;
    align-self: center;
}

#portfolio-gallery-section .hgf-header-left h2 {
    font-family: 'Bebas Neue', sans-serif;
    /* !important needed: global device-specific `h2 { font-size: ... !important }`
       rules in styles.css/tailwind.css would otherwise hijack this at some breakpoints. */
    font-size: clamp(30px, 6vw, 52px) !important;
    letter-spacing: 0.04em;
    color: var(--text);
    line-height: 1;
    margin: 0;
    text-align: center;
}

#portfolio-gallery-section .hgf-header-left p {
    font-size: clamp(13px, 2.5vw, 16px);
    color: var(--hgf-text-2);
    margin: 4px 0 0;
    font-weight: 300;
    font-family: 'Barlow', sans-serif;
    text-align: center;
}

#portfolio-gallery-section .hgf-style-tag {
    background: var(--hgf-cyan);
    color: #002a33;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    flex-shrink: 0;
    margin: 0;
    font-family: 'Barlow', sans-serif;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
}

#portfolio-gallery-section .hgf-style-tag:empty,
#portfolio-gallery-section .hgf-style-tag.hgf-hidden {
    display: none;
}

#portfolio-gallery-section .hgf-featured-row {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 28px;
}

#portfolio-gallery-section .hgf-featured-image-wrap {
    flex: 2;
    min-height: 340px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--hgf-cyan-glow);
    box-shadow: 0 0 40px rgba(0, 196, 255, 0.08);
    background: var(--hgf-bg-thumb);
}

#portfolio-gallery-section .hgf-featured-image-wrap img {
    width: 100%;
    height: 100%;
    min-height: 340px;
    object-fit: cover;
    display: block;
}

#portfolio-gallery-section .hgf-featured-image-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(transparent, rgba(8, 14, 28, 0.6));
    pointer-events: none;
}

#portfolio-gallery-section .hgf-img-placeholder .hgf-placeholder-sub {
    font-size: 0.85rem;
    color: var(--hgf-text-3, #9ca3af);
    margin-top: 4px;
    font-family: 'Barlow', sans-serif;
    font-weight: 400;
    text-align: center;
    max-width: 280px;
}

#portfolio-gallery-section .hgf-img-placeholder {
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--hgf-text-3);
    font-size: 12px;
    font-family: 'Barlow', sans-serif;
}

#portfolio-gallery-section .hgf-featured-info {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 4px 0;
    min-width: 0;
    position: relative;
    text-align: left;
}

#portfolio-gallery-section .hgf-work-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(22px, 3vw, 34px);
    letter-spacing: 0.04em;
    color: var(--text);
    line-height: 1.05;
    margin: 0;
    text-align: left;
    padding-right: 110px;
}

#portfolio-gallery-section .hgf-artist-line {
    font-size: 13px;
    color: var(--hgf-text-2);
    font-family: 'Barlow', sans-serif;
    margin: 0;
    text-align: left;
}

#portfolio-gallery-section .hgf-artist-line strong {
    color: var(--hgf-cyan);
    font-weight: 600;
    text-align: left;
}

#portfolio-gallery-section .hgf-spotlight-desc {
    font-size: 13px;
    color: var(--hgf-text-2);
    line-height: 1.7;
    font-weight: 300;
    border-left: 2px solid var(--hgf-cyan-glow);
    padding-left: 12px;
    margin: 0;
    font-family: 'Barlow', sans-serif;
}

#portfolio-gallery-section .hgf-spotlight-desc.hgf-hidden {
    display: none;
}

#portfolio-gallery-section .hgf-info-divider {
    width: 40px;
    height: 1px;
    background: var(--hgf-border);
}

#portfolio-gallery-section .hgf-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#portfolio-gallery-section .hgf-btn-outline {
    border: 1px solid var(--hgf-border);
    color: var(--text);
    background: transparent;
    border-radius: 7px;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 20px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
}

#portfolio-gallery-section .hgf-btn-outline:hover {
    border-color: var(--hgf-cyan);
    color: var(--hgf-cyan);
}

#portfolio-gallery-section .hgf-btn-cyan {
    background: var(--hgf-cyan);
    color: #002a33;
    border: none;
    border-radius: 7px;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 20px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#portfolio-gallery-section .hgf-btn-cyan:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

#portfolio-gallery-section .hgf-btn-cyan #hgfBookBtnArtist {
    color: #ffffff;
}

#portfolio-gallery-section .hgf-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}

#portfolio-gallery-section .hgf-recent-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--hgf-text-2);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0;
    font-family: 'Barlow', sans-serif;
}

#portfolio-gallery-section .hgf-thumb-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
    margin-bottom: 28px;
    -webkit-overflow-scrolling: touch;
}

#portfolio-gallery-section .hgf-thumb-strip::-webkit-scrollbar {
    display: none;
}

#portfolio-gallery-section .hgf-thumb-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--hgf-bg-thumb);
    border: 1px solid var(--hgf-border);
    cursor: default;
    user-select: none;
    pointer-events: none;
}

#portfolio-gallery-section .hgf-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

#portfolio-gallery-section .hgf-thumb-more {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 1px dashed var(--hgf-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    user-select: none;
}

#portfolio-gallery-section .hgf-thumb-more span {
    font-size: 13px;
    font-weight: 600;
    color: var(--hgf-text-3);
    font-family: 'Barlow', sans-serif;
}

#portfolio-gallery-section .hgf-thumb-more.hgf-hidden {
    display: none;
}

#portfolio-gallery-section .hgf-view-gallery-wrap {
    text-align: center;
}

#portfolio-gallery-section .hgf-btn-gallery {
    background: var(--hgf-cyan);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 36px;
    cursor: pointer;
    letter-spacing: 0.04em;
    transition: opacity 0.2s, transform 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#portfolio-gallery-section .hgf-btn-gallery:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* Structured skeleton mirrors the real .hgf-content footprint to avoid layout shift.
   It reuses real layout classes (.hgf-featured-row/-info, .hgf-thumb-strip, etc.) so
   spacing/columns stay in sync; placeholder blocks get the shimmer via .hgf-sk-block. */
#portfolio-gallery-section .hgf-skeleton {
    border-radius: 12px;
}

/* Re-apply shimmer with id-level specificity so reused elements (image-wrap, thumb-item)
   that set their own background don't override the skeleton gradient. */
#portfolio-gallery-section .hgf-skeleton .hgf-sk-block {
    background: linear-gradient(90deg,
        var(--card-bg) 0%,
        rgba(0, 196, 255, 0.12) 50%,
        var(--card-bg) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

#portfolio-gallery-section .hgf-sk-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

#portfolio-gallery-section .hgf-sk-title {
    width: min(60%, 320px);
    height: clamp(30px, 6vw, 52px);
}

#portfolio-gallery-section .hgf-sk-subtitle {
    width: 160px;
    height: 16px;
}

#portfolio-gallery-section .hgf-skeleton .hgf-featured-image-wrap {
    flex: 2;
}

#portfolio-gallery-section .hgf-sk-work-title {
    width: 70%;
    height: clamp(22px, 3vw, 34px);
}

#portfolio-gallery-section .hgf-sk-artist {
    width: 45%;
    height: 14px;
}

#portfolio-gallery-section .hgf-sk-desc {
    width: 100%;
    height: 36px;
}

#portfolio-gallery-section .hgf-sk-btn {
    width: 96px;
    height: 38px;
    border-radius: 7px;
}

#portfolio-gallery-section .hgf-sk-label {
    width: 140px;
    height: 12px;
}

#portfolio-gallery-section .hgf-sk-gallery-btn {
    display: inline-block;
    width: 220px;
    height: 46px;
}

@media (prefers-reduced-motion: reduce) {
    #portfolio-gallery-section .hgf-skeleton .hgf-sk-block {
        animation: none;
        background: var(--card-bg);
    }
}

#portfolio-gallery-section .hgf-skeleton.hgf-hidden,
#portfolio-gallery-section .hgf-content.hgf-hidden,
#portfolio-gallery-section .hgf-empty.hgf-hidden {
    display: none !important;
}

/* Spotlight fullscreen lightbox (View button) */
#hgfSpotlightLightbox.hgf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    padding: 48px 16px 16px;
    box-sizing: border-box;
    overscroll-behavior: contain;
    touch-action: none;
}

#hgfSpotlightLightbox.hgf-lightbox[hidden] {
    display: none !important;
}

/* Scroll lock: keep lightbox viewport-fixed (global html/body use will-change: transform,
   which would otherwise create a containing block and anchor the fixed lightbox to the
   now-fixed tall body instead of the viewport). */
html.hgf-lightbox-open,
body.hgf-lightbox-open {
    will-change: auto !important;
}

/* Fixed "cadre" frame: identical 4:5 portrait for every image, fits all viewports.
   width is the smallest of: 86vw, 70vh (= 87.5vh tall at 4:5), 460px cap. */
#hgfSpotlightLightbox .hgf-lightbox-frame {
    width: min(86vw, 70vh, 460px);
    aspect-ratio: 4 / 5;
    max-height: 88vh;
    position: relative;
}

#hgfSpotlightLightbox .hgf-lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    display: block;
    pointer-events: auto;
}

/* Loading spinner: centered in frame, above image, below close button.
   Reuses the shared @keyframes spin from styles.css. */
#hgfSpotlightLightbox .hgf-lightbox-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--accent, #00C4FF);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    pointer-events: none;
    z-index: 0;
}

#hgfSpotlightLightbox.is-loading .hgf-lightbox-spinner {
    display: block;
}

#hgfSpotlightLightbox .hgf-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow', sans-serif;
}

#hgfSpotlightLightbox .hgf-lightbox-close:hover,
#hgfSpotlightLightbox .hgf-lightbox-close:focus-visible {
    opacity: 0.85;
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    #portfolio-gallery-section .hgf-section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #portfolio-gallery-section .hgf-featured-row {
        flex-direction: column;
        gap: 16px;
    }

    #portfolio-gallery-section .hgf-featured-image-wrap,
    #portfolio-gallery-section .hgf-featured-image-wrap img,
    #portfolio-gallery-section .hgf-img-placeholder {
        min-height: 240px;
    }

    #portfolio-gallery-section .hgf-featured-image-wrap .hgf-style-tag {
        top: 12px;
        right: 12px;
    }

    #portfolio-gallery-section .hgf-featured-info {
        gap: 12px;
        padding: 0;
    }

    #portfolio-gallery-section .hgf-work-title {
        padding-right: 0;
    }

    #portfolio-gallery-section .hgf-thumb-item,
    #portfolio-gallery-section .hgf-thumb-more {
        width: 68px;
        height: 68px;
    }
}
