/* ==========================================================================
   HMA Artist Profile v2.1 — Editorial Layout
   Brand: The Hair Mastery Agency
   Fonts: Canela (serif display), Plus Jakarta Sans (UI sans-serif)
   ========================================================================== */

/* --- CSS Variables (mirrors brand guide) --- */
:root {
    --hma-black: #0A0A0A;
    --hma-red: #C8102E;
    --hma-red-600: #A50D26;
    --hma-red-50: #FEF1F2;
    --hma-white: #FFFFFF;
    --hma-white-warm: #FAFAF8;
    --hma-white-soft: #F5F4F2;
    --hma-white-muted: #EEEDEB;
    --hma-white-cloud: #E8E6E3;
    --hma-white-stone: #D9D7D4;
    --hma-gray-100: #F7F7F6;
    --hma-gray-400: #B0AFAC;
    --hma-gray-500: #8A8986;
    --hma-gray-600: #6B6A67;
    --hma-gray-700: #4A4946;
    --hma-gray-800: #2D2C2A;
    --hma-gray-900: #1A1918;
    --hma-font-serif: 'Canela', Georgia, 'Times New Roman', serif;
    --hma-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --hma-radius: 8px;
    --hma-radius-lg: 12px;
    --hma-radius-xl: 16px;
}

/* ==========================================================================
   PROFILE WRAPPER
   ========================================================================== */
.hma-profile {
    font-family: var(--hma-font-sans);
    background: var(--hma-white-warm);
    color: var(--hma-gray-800);
    max-width: 100%;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   STICKY HEADER BAR — Name left, Nav center, Back far right
   ========================================================================== */
.hma-artist-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--hma-white);
    border-bottom: 1px solid var(--hma-white-cloud);
    padding: 0 48px;
}

.hma-artist-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    max-width: 100%;
}

/* --- Left: Name + Profession --- */
.hma-artist-identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
}

.hma-artist-name {
    font-family: var(--hma-font-serif);
    font-weight: 100;
    font-size: 24px;
    letter-spacing: -0.01em;
    color: var(--hma-black);
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.hma-artist-profession {
    font-family: var(--hma-font-sans);
    font-weight: 400;
    font-size: 13px;
    color: var(--hma-gray-500);
    letter-spacing: 0.01em;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* --- Center: Tab Navigation --- */
.hma-tab-nav {
    display: flex;
    gap: 36px;
    align-items: center;
    height: 100%;
}

.hma-tab-btn {
    font-family: var(--hma-font-sans);
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.01em;
    color: var(--hma-gray-400);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 21px 0;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease;
    white-space: nowrap;
    outline: none;
}

.hma-tab-btn:hover {
    color: var(--hma-gray-600);
}

.hma-tab-btn.is-active {
    color: var(--hma-black);
    border-bottom-color: var(--hma-red);
}

/* URL tab — external link icon styling */
.hma-tab-btn.is-url-tab .hma-external-icon {
    opacity: 0.5;
    transition: opacity 0.2s;
}
.hma-tab-btn.is-url-tab:hover .hma-external-icon {
    opacity: 0.8;
}

/* --- Right: Back link --- */
.hma-back-link {
    font-family: var(--hma-font-sans);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--hma-red);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.hma-back-link:hover {
    color: var(--hma-red-600);
}

/* ==========================================================================
   TAB CONTENT AREA
   ========================================================================== */
.hma-tab-content {
    min-height: calc(100vh - 73px);
    position: relative;
}

/* ==========================================================================
   TAB LOADING STATE — Inline spinner (shown during AJAX tab switch)
   ========================================================================== */
.hma-tab-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 320px;
    padding: 60px 20px;
    animation: hma-fade-in-loading 0.3s ease;
}

.hma-tab-loading-state span {
    font-family: var(--hma-font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--hma-gray-500);
    letter-spacing: 0.03em;
}

@keyframes hma-fade-in-loading {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Shared spinner ring — used by tab-loading and infinite scroll */
.hma-spinner {
    width: 32px;
    height: 32px;
    border: 2.5px solid var(--hma-white-cloud);
    border-top-color: var(--hma-red);
    border-radius: 50%;
    animation: hma-spin 0.7s linear infinite;
}

@keyframes hma-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   FADE-IN — For AJAX-loaded tab content
   ========================================================================== */
.hma-fade-in {
    animation: hma-content-fade 0.4s ease;
}

@keyframes hma-content-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   BIO TAB — Two column: Text left, Image right
   ========================================================================== */
.hma-bio-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - 73px);
}

.hma-bio-text {
    padding: 56px 64px 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hma-bio-text p {
    font-family: var(--hma-font-sans);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: var(--hma-gray-700);
    text-align: justify;
    margin-bottom: 20px;
    letter-spacing: 0.005em;
}

.hma-bio-text p:last-child {
    margin-bottom: 0;
}

.hma-bio-text a {
    color: var(--hma-red);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.hma-bio-text a:hover {
    color: var(--hma-red-600);
}

.hma-bio-image {
    position: relative;
    overflow: hidden;
    background: var(--hma-white-soft);
}

.hma-bio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   PHOTO GALLERY — Masonry columns, original image ratios
   ========================================================================== */
.hma-gallery-grid {
    columns: 4;
    column-gap: 3px;
}

.hma-gallery-item {
    position: relative;
    overflow: hidden;
    background: var(--hma-white-soft);
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: 3px;
}

.hma-gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.hma-gallery-item:hover img {
    transform: scale(1.04);
    opacity: 0.92;
}

/* ==========================================================================
   INFINITE SCROLL — Sentinel, spinner, end message
   ========================================================================== */
.hma-scroll-sentinel {
    width: 100%;
    min-height: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: padding 0.3s ease;
}

.hma-scroll-sentinel.is-loading {
    padding: 40px 0 60px;
}

.hma-scroll-sentinel.is-done {
    padding: 24px 0 40px;
}

/* Spinner inside scroll sentinel */
.hma-scroll-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.hma-scroll-spinner span {
    font-family: var(--hma-font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--hma-gray-500);
    letter-spacing: 0.03em;
}

/* Slightly smaller spinner for infinite scroll vs full-tab loading */
.hma-scroll-spinner .hma-spinner {
    width: 26px;
    height: 26px;
    border-width: 2px;
}

/* End-of-gallery message */
.hma-end-message {
    font-family: var(--hma-font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--hma-gray-400);
    text-align: center;
    padding: 0;
    margin: 0;
}

/* ==========================================================================
   VIDEO GALLERY — 2-column grid with thumbnail + play overlay
   ========================================================================== */
.hma-video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
}

.hma-video-item {
    background: var(--hma-black);
    overflow: hidden;
    cursor: pointer;
}

.hma-video-ratio {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.hma-video-ratio iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.hma-video-title {
    font-family: var(--hma-font-sans);
    font-weight: 500;
    font-size: 13px;
    color: var(--hma-white);
    padding: 16px 20px;
    letter-spacing: 0.03em;
    background: var(--hma-black);
    margin: 0;
}

/* Video play overlay */
.hma-video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.3);
    transition: background 0.25s ease;
    z-index: 2;
}

.hma-video-item:hover .hma-video-play-overlay {
    background: rgba(10, 10, 10, 0.15);
}

.hma-video-play-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

.hma-video-item:hover .hma-video-play-icon {
    transform: scale(1.1);
}

.hma-video-play-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--hma-black);
    margin-left: 3px;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.hma-empty-state {
    font-family: var(--hma-font-sans);
    font-weight: 400;
    font-size: 15px;
    color: var(--hma-gray-400);
    text-align: center;
    padding: 80px 20px;
}

/* ==========================================================================
   LIGHTBOX OVERLAY — Image & Video Preview
   ========================================================================== */
.hma-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 10, 10, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.hma-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

/* Close button */
.hma-lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.hma-lightbox-close:hover {
    transform: scale(1.15);
}

.hma-lightbox-close svg {
    width: 24px;
    height: 24px;
    stroke: var(--hma-white);
    stroke-width: 2;
}

/* Nav arrows */
.hma-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
    z-index: 10;
}

.hma-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.hma-lightbox-nav svg {
    width: 20px;
    height: 20px;
    stroke: var(--hma-white);
    stroke-width: 2;
    fill: none;
}

.hma-lightbox-prev { left: 24px; }
.hma-lightbox-next { right: 24px; }

/* Image container */
.hma-lightbox-image {
    max-width: 85vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 2px;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hma-lightbox.is-open .hma-lightbox-image {
    opacity: 1;
    transform: scale(1);
}

/* Counter */
.hma-lightbox-counter {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--hma-font-sans);
    font-weight: 500;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.06em;
}

/* Video modal */
.hma-lightbox-video-wrap {
    width: 80vw;
    max-width: 1100px;
    aspect-ratio: 16 / 9;
    background: var(--hma-black);
    border-radius: 4px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hma-lightbox.is-open .hma-lightbox-video-wrap {
    opacity: 1;
    transform: scale(1);
}

.hma-lightbox-video-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .hma-gallery-grid {
        columns: 3;
    }
}

@media (max-width: 768px) {
    .hma-artist-header {
        padding: 0 24px;
    }

    .hma-artist-header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 16px 0;
        gap: 12px;
    }

    .hma-artist-identity {
        width: 100%;
        order: 1;
    }

    .hma-tab-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 24px;
        padding-bottom: 0;
    }

    .hma-tab-nav::-webkit-scrollbar { display: none; }

    .hma-back-link {
        order: 2;
        position: absolute;
        right: 24px;
        top: 20px;
    }

    .hma-tab-btn {
        padding: 12px 0;
        font-size: 13px;
    }

    .hma-bio-layout {
        grid-template-columns: 1fr;
    }

    .hma-bio-text {
        padding: 32px 24px;
        order: 2;
    }

    .hma-bio-image {
        order: 1;
        aspect-ratio: 4 / 3;
    }

    .hma-gallery-grid {
        columns: 2;
    }

    .hma-video-grid {
        grid-template-columns: 1fr;
    }

    .hma-artist-name {
        font-size: 18px;
    }

    /* Tab loading state — less padding on mobile */
    .hma-tab-loading-state {
        min-height: 240px;
        padding: 40px 16px;
    }

    /* Lightbox mobile */
    .hma-lightbox-close {
        top: 16px;
        right: 16px;
    }

    .hma-lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .hma-lightbox-prev { left: 12px; }
    .hma-lightbox-next { right: 12px; }

    .hma-lightbox-image {
        max-width: 95vw;
        max-height: 80vh;
    }

    .hma-lightbox-video-wrap {
        width: 95vw;
    }
}
