/* ==================================================
   WIA ARTISTS BOARD SKIN
   White Cube Gallery Inspired — Artist Portfolio
   ================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;1,400&family=Noto+Sans+KR:wght@300;400;500&display=swap');

:root {
    --artist-font-sans: 'Inter', 'Noto Sans KR', sans-serif;
    --artist-font-serif: 'Playfair Display', serif;
    --artist-color-fg: #111;
    --artist-color-bg: #fff;
    --artist-color-muted: #888;
    --artist-color-light: #f5f5f5;
    --artist-color-border: rgba(0,0,0,0.08);
    --artist-ease: cubic-bezier(0.19, 1, 0.22, 1);
}

.artists-page {
    font-family: var(--artist-font-sans);
    color: var(--artist-color-fg);
    -webkit-font-smoothing: antialiased;
}

/* ==================================================
   LIST PAGE — Header (Title + Index inline, Search below)
   ================================================== */
.artist-list-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 5% 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.artist-list-header__top {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
}

.artist-list-header__title {
    font-family: var(--artist-font-serif);
    font-size: clamp(2.2rem, 3.5vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    margin: 0;
    flex-shrink: 0;
    line-height: 1;
}

.artist-list-header__search {
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--artist-color-border);
    padding-bottom: 6px;
    flex-shrink: 0;
    margin-left: auto;
}

.artist-list-header__search-icon {
    width: 16px;
    height: 16px;
    color: var(--artist-color-muted);
    flex-shrink: 0;
}

.artist-list-header__search-input {
    border: none;
    outline: none;
    font-family: var(--artist-font-sans);
    font-size: 0.85rem;
    color: var(--artist-color-fg);
    background: transparent;
    width: 180px;
    transition: width 0.4s var(--artist-ease);
}

.artist-list-header__search-input:focus {
    width: 260px;
}

.artist-list-header__search-input::placeholder {
    color: var(--artist-color-muted);
    font-weight: 300;
}

/* ==================================================
   INDEX BAR — Inline with title
   ================================================== */
.artist-index {
    flex: 1;
    min-width: 0;
    padding: 0;
}

.artist-index__bar {
    border-bottom: none;
    padding-bottom: 0;
}

.artist-index__row {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.artist-index__row:last-child {
    margin-bottom: 0;
}

.artist-index__row--alpha {
    flex-wrap: nowrap;
}

.artist-index__row--alpha .artist-index__btn {
    min-width: 24px;
    padding: 0 2px;
}

.artist-index__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 5px;
    border: none;
    background: none;
    font-family: var(--artist-font-sans);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--artist-color-muted);
    cursor: pointer;
    transition: all 0.25s;
    letter-spacing: 0.02em;
    border-radius: 2px;
}

.artist-index__btn:hover {
    color: var(--artist-color-fg);
}

.artist-index__btn.is-active {
    color: var(--artist-color-bg);
    background: var(--artist-color-fg);
    font-weight: 500;
}

.artist-index__sep {
    width: 1px;
    height: 16px;
    background: var(--artist-color-border);
    margin: 0 6px;
    flex-shrink: 0;
}

/* ==================================================
   HERO SECTION — Featured Artist (max 2560x1440)
   ================================================== */
.artist-hero {
    width: 100%;
    max-width: 2560px;
    margin: 20px auto 0;
    padding: 0 5%;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    min-height: 400px;
    max-height: min(1440px, 56.25vw); /* 16:9 aspect cap = 1440/2560 */
    overflow: hidden;
    border-bottom: 1px solid var(--artist-color-border);
    box-sizing: border-box;
}

.artist-hero__info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 40px 0 0;
    border-right: 1px solid var(--artist-color-border);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    position: static;
    border-radius: 0;
    width: auto;
    max-width: none;
}

.artist-hero__profile-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    filter: grayscale(10%);
    transition: filter 0.5s ease;
}

.artist-hero__profile-img:hover {
    filter: grayscale(0%);
}

.artist-hero__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--artist-color-muted);
    margin-bottom: 10px;
}

.artist-hero__name {
    font-family: var(--artist-font-serif);
    font-size: clamp(1.6rem, 2.5vw, 2.4rem);
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.artist-hero__bio {
    font-size: 0.8rem;
    line-height: 1.7;
    color: #555;
    max-height: 100px;
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
}

.artist-hero__bio::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(transparent, var(--artist-color-bg));
}

.artist-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 8px 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: opacity 0.3s;
    text-decoration: none;
    color: var(--artist-color-fg);
}

.artist-hero__cta:hover { opacity: 0.5; }

.artist-hero__cta svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s var(--artist-ease);
}

.artist-hero__cta:hover svg { transform: translateX(4px); }

.artist-hero__artwork {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    max-height: min(1440px, 56.25vw);
    overflow: hidden;
}

.artist-hero__artwork img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transition: transform 6s ease-out;
}

.artist-hero:hover .artist-hero__artwork img {
    transform: scale(1.03);
}

/* ==================================================
   ARTIST NAME LIST — White Cube Style
   ================================================== */
.artist-names {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 5% 60px;
    position: relative;
}

.artist-names__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.artist-names__item {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.3s, transform 0.3s;
}

.artist-names__item.is-hidden {
    display: none;
}

/* Pipe separator between artist names */
.artist-names__separator {
    display: inline-block;
    color: #ccc;
    font-size: 1rem;
    padding: 0 6px;
    user-select: none;
    line-height: 1;
}

.artist-names__link {
    display: inline-block;
    padding: 12px 6px;
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--artist-color-muted);
    text-decoration: none;
    transition: color 0.3s, opacity 0.3s;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.artist-names__link:hover {
    color: var(--artist-color-fg) !important;
    opacity: 1 !important;
}

/* Highlighted names (active filter category) */
.artist-names__item.is-highlighted .artist-names__link {
    color: var(--artist-color-fg);
    font-weight: 500;
    font-size: 1.5rem;
}

/* Hover preview image */
.artist-names__preview {
    position: fixed;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 280px;
}

.artist-names__preview.is-visible {
    opacity: 1;
}

.artist-names__preview img {
    width: 100%;
    display: block;
    border-radius: 2px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.artist-names__empty {
    width: 100%;
    text-align: center;
    padding: 60px 0;
    color: var(--artist-color-muted);
    font-size: 0.95rem;
    font-style: italic;
}

.artist-names__no-results {
    width: 100%;
    text-align: center;
    padding: 60px 0;
    color: var(--artist-color-muted);
    font-size: 0.9rem;
    display: none;
}

.artist-names__chk {
    margin-right: 4px;
}

/* Footer */
.artist-list-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5% 48px;
}

.artist-index__write-btn {
    display: inline-block;
    padding: 10px 28px;
    background: var(--artist-color-fg);
    color: var(--artist-color-bg) !important;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-decoration: none;
    border: 1px solid var(--artist-color-fg);
    transition: all 0.3s ease;
}

.artist-index__write-btn:hover {
    background: transparent;
    color: var(--artist-color-fg) !important;
}

/* Pagination */
.artist-pages {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5% 32px;
    text-align: center;
}

.artist-pages a,
.artist-pages strong {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--artist-color-muted);
    margin: 0 2px;
    transition: all 0.2s;
}

.artist-pages a:hover { color: var(--artist-color-fg); }
.artist-pages strong { color: var(--artist-color-fg); font-weight: 700; border-bottom: 2px solid var(--artist-color-fg); }

/* Admin */
.artist-admin {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 5%;
    display: flex;
    gap: 8px;
}

.artist-admin input[type="submit"] {
    padding: 6px 16px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.artist-admin input[type="submit"]:hover {
    background: var(--artist-color-fg);
    color: var(--artist-color-bg);
    border-color: var(--artist-color-fg);
}

/* ==================================================
   VIEW PAGE — Artist Detail
   ================================================== */
.artist-view {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 5%;
}

/* Hero: sidebar + gallery, fit in one viewport */
.artist-view__hero {
    display: grid;
    grid-template-columns: 33% 1fr;
    gap: 0;
    height: calc(100vh - 160px); /* Fully fits without scrolling */
    min-height: 500px;
    margin-top: 80px;
    margin-bottom: 80px;
    overflow: hidden;
}

.artist-view__sidebar {
    padding: 32px 40px 32px 0;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: calc(100vh - 112px);
}

.artist-view__profile-photo {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 24px;
    filter: grayscale(15%);
}

.artist-view__name {
    font-family: var(--artist-font-serif);
    font-size: clamp(1.8rem, 2.5vw, 2.8rem);
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 20px;
    letter-spacing: -0.02em;
}

.artist-view__bio {
    font-size: 0.82rem;
    line-height: 1.8;
    color: #444;
    flex: 1;
    overflow-y: auto;
}

.artist-view__bio p {
    margin: 0 0 1rem;
}

/* Share & Actions */
.artist-view__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--artist-color-border);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.artist-view__action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    background: var(--artist-color-bg);
    color: #555;
    font-family: var(--artist-font-sans);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border-radius: 2px;
}

.artist-view__action-btn:hover {
    border-color: var(--artist-color-fg);
    color: var(--artist-color-fg);
}

.artist-view__action-btn svg {
    width: 13px;
    height: 13px;
}

/* Gallery section — fits viewport */
.artist-view__gallery {
    padding: 32px 0 32px 40px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 112px);
}

.artist-view__gallery-title {
    font-family: var(--artist-font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

/* Thumbnail strip */
.artist-view__thumb-strip {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    flex-shrink: 0;
    padding-bottom: 8px;
}

.artist-view__thumb-strip::-webkit-scrollbar {
    height: 3px;
}

.artist-view__thumb-strip::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.artist-view__thumb-item {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s, opacity 0.3s;
    opacity: 0.6;
}

.artist-view__thumb-item:hover,
.artist-view__thumb-item.is-active {
    border-color: var(--artist-color-fg);
    opacity: 1;
}

.artist-view__thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main artwork display */
.artist-view__main-artwork {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--artist-color-light);
    border-radius: 2px;
    cursor: pointer;
    min-height: 0;
}

.artist-view__main-artwork img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.6s var(--artist-ease);
}

.artist-view__main-artwork:hover img {
    transform: scale(1.02);
}

/* Full width artworks grid below (when many images) */
.artist-view__artworks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.artist-view__artwork-item {
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    background: var(--artist-color-light);
    cursor: pointer;
}

.artist-view__artwork-item img {
    width: 100%;
    display: block;
    transition: transform 0.6s var(--artist-ease);
}

.artist-view__artwork-item:hover img {
    transform: scale(1.04);
}

/* Content / Links (Now in sidebar) */
.artist-view__content {
    padding: 24px 0 0;
    border-top: none;
    margin-top: 24px;
    flex-shrink: 0;
}

.artist-view__content-body {
    font-size: 0.9rem;
    line-height: 1.85;
    color: #444;
}

.artist-view__content-body img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 2px;
}

/* Navigation between artists (Now in sidebar) */
.artist-view__nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    border-top: 1px solid var(--artist-color-border);
    padding-top: 16px;
    margin-top: 24px;
    flex-shrink: 0;
}

.artist-view__nav-item {
    flex: 1;
    padding: 8px 0;
    text-decoration: none;
    color: inherit;
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 2px;
}

.artist-view__nav-item:first-child {
    border-right: 1px solid var(--artist-color-border);
    padding-right: 12px;
}

.artist-view__nav-item:last-child {
    text-align: right;
    padding-left: 12px;
}

.artist-view__nav-item:hover { background: var(--artist-color-light); }

.artist-view__nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--artist-color-muted);
}

.artist-view__nav-name {
    font-family: var(--artist-font-serif);
    font-size: 0.95rem;
    font-weight: 400;
}

/* View buttons (Now in sidebar) */
.artist-view__buttons {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 24px 0 0;
    border-top: 1px solid var(--artist-color-border);
    margin-top: 24px;
    gap: 12px;
    flex-shrink: 0;
}

.artist-view__buttons ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Lightbox */
.artist-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.artist-lightbox.is-active { display: flex; }

.artist-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
}

.artist-lightbox__close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Toast */
.artist-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--artist-color-fg);
    color: var(--artist-color-bg);
    padding: 12px 28px;
    font-size: 0.82rem;
    border-radius: 4px;
    z-index: 10000;
    transition: transform 0.4s var(--artist-ease);
    pointer-events: none;
}

.artist-toast.is-visible {
    transform: translateX(-50%) translateY(0);
}

/* Button styles (from board) */
.btn_b01, .btn_b02, .btn_admin {
    display: inline-block !important;
    padding: 8px 20px !important;
    font-size: 0.82rem !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-radius: 2px !important;
    letter-spacing: 0.02em !important;
    vertical-align: middle !important;
    margin: 2px !important;
    font-weight: 400 !important;
}

.btn_b01 { background: #fff !important; color: #555 !important; border: 1px solid #ddd !important; }
.btn_b01:hover { border-color: #111 !important; color: #111 !important; }
.btn_b02 { background: #111 !important; color: #fff !important; border: 1px solid #111 !important; }
.btn_b02:hover { background: transparent !important; color: #111 !important; }
.btn_admin { background: #fff !important; color: #900 !important; border: 1px solid #ecc !important; }
.btn_admin:hover { background: #900 !important; color: #fff !important; border-color: #900 !important; }

/* ==================================================
   RESPONSIVE — Tablet
   ================================================== */
@media (max-width: 1024px) {
    .artist-list-header__top {
        flex-direction: column;
        gap: 12px;
    }

    .artist-hero__info { width: 360px; padding: 24px; }

    .artist-view__hero {
        grid-template-columns: 35% 1fr;
    }

    .artist-view__sidebar { padding: 24px 28px 24px 0; }
    .artist-view__gallery { padding: 24px 0 24px 28px; }
}

/* ==================================================
   RESPONSIVE — Mobile
   ================================================== */
@media (max-width: 768px) {
    .artist-list-header {
        padding: 80px 5% 0;
        flex-direction: column;
        gap: 12px;
    }

    .artist-list-header__top {
        flex-direction: column;
        gap: 12px;
    }

    .artist-list-header__title { font-size: 2rem; }

    .artist-list-header__search-input {
        width: 120px;
    }
    .artist-list-header__search-input:focus { width: 140px; }

    .artist-index { padding: 20px 5% 0; }

    .artist-index__btn {
        min-width: 26px;
        height: 26px;
        font-size: 0.65rem;
    }

    /* Hero mobile */
    .artist-hero__info {
        width: 90%;
        left: 5%;
        bottom: 5%;
        padding: 20px;
    }

    .artist-hero__artwork {
        height: 320px;
        min-height: 320px;
    }

    .artist-hero__name {
        font-size: 1.4rem;
    }

    .artist-names {
        padding: 20px 5% 40px;
    }

    .artist-names__link {
        font-size: 0.82rem;
        padding: 8px 4px;
    }

    .artist-names__separator {
        font-size: 0.8rem;
        padding: 0 3px;
    }

    .artist-names__item.is-highlighted .artist-names__link {
        font-size: 0.9rem;
    }

    /* View page */
    .artist-view {
        padding: 0 5%;
    }

    .artist-view__hero {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        margin-top: 60px;
        margin-bottom: 40px;
    }

    .artist-view__sidebar {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 24px 0;
        max-height: none;
        overflow-y: visible;
    }

    .artist-view__profile-photo { max-width: 160px; }

    .artist-view__name { font-size: 1.6rem; }

    .artist-view__gallery {
        padding: 24px 0;
        max-height: none;
    }

    .artist-view__thumb-item {
        width: 56px;
        height: 56px;
    }

    .artist-view__artworks {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .artist-view__nav-item { padding: 16px 0; }
    .artist-view__nav-item:first-child { padding-right: 12px; }
    .artist-view__nav-item:last-child { padding-left: 12px; }
    .artist-view__nav-name { font-size: 0.95rem; }

    .artist-pages { padding: 0 5% 32px; }
    .artist-admin { padding: 12px 5%; }
}

@media (max-width: 480px) {
    .artist-names__link {
        font-size: 0.78rem;
    }
}

/* Print styles */
@media print {
    .artist-index,
    .artist-list-header__search,
    .artist-view__actions,
    .artist-view__buttons,
    .artist-view__nav,
    .artist-names__preview {
        display: none !important;
    }

    .artist-view__hero {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .artist-view__sidebar {
        border: none;
        padding: 0;
        max-height: none;
    }
}
