/* 갤러리 전용 페이지 — 다크 테마 풀페이지, 핀터레스트식 메이슨리 */

.gallery-page {
    background: #16252A;
    color: #fff;
    min-height: 100vh;
    padding: 0 40px 120px;
}

/* 히어로 — 배경 이미지 없이 좌측 상단에 제목만 */
.gallery-page-hero {
    padding: 140px 0 60px;
}

.gallery-page-title {
    font-size: 72px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    margin: 0;
}

/* 제목이 목록으로 돌아가는 통로를 겸한다 */
.gallery-page-title a {
    position: relative;
    display: inline-block;
    color: inherit;
    text-decoration: none;
}

/* 물 채우기가 걸리지 않는 환경(캔버스 미지원 등)을 위한 기본 동작 */
.gallery-page-title a:hover {
    color: var(--point-mint);
}

/* 캔버스가 붙으면 글자 안쪽을 물이 채우므로 색은 그대로 둔다 */
.gallery-page-title a.has-wave:hover {
    color: inherit;
}

.gallery-page-title .wave-fill {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.gallery-more-title {
    margin: 0 0 24px;
    font-size: 22px;
    font-weight: 800;
}

.gallery-page-subtitle {
    margin: 18px 0 0;
    font-size: 18px;
    color: #8b9aa3;
    font-weight: 400;
}

/* 분류 탭 */
.gallery-page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.gallery-page-tabs .tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-page-tabs .tab-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.gallery-page-tabs .tab-btn.active {
    background: var(--point-mint);
    border-color: var(--point-mint);
    color: #06282b;
}

/* 메이슨리 — CSS 다단으로 높이가 제각각인 작품을 자연스럽게 쌓는다 */
.gallery-masonry {
    column-count: 5;
    column-gap: 24px;
}

.gallery-pin {
    display: block;
    break-inside: avoid;
    margin-bottom: 24px;
    border-radius: 16px;
    overflow: hidden;
    background: #1d3037;
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-pin:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.gallery-pin-image img {
    display: block;
    width: 100%;
    height: auto;
}

.gallery-pin-body {
    padding: 16px 18px 20px;
}

.gallery-pin-type {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--point-mint);
    margin-bottom: 8px;
}

.gallery-pin-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.gallery-pin-artist {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #cfdae0;
}

.gallery-pin-meta {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #7d8f99;
}

.gallery-empty,
.gallery-empty-filter {
    padding: 80px 0;
    text-align: center;
    color: #7d8f99;
    font-size: 16px;
}

/* 작가 필터 헤더 */
.gallery-artist-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px;
    margin-bottom: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.gallery-artist-header .btn-gallery-all {
    margin-left: auto;
    flex: 0 0 auto;
}

.gallery-artist-photo {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: #24383f;
}

.gallery-artist-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 사진이 없으면 로고를 연하게 깔아 빈 원을 피한다 */
.gallery-artist-photo .no-photo {
    width: 100%;
    height: 100%;
    background-image: var(--logo);
    background-size: 60%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.35;
}

.gallery-artist-position {
    font-size: 14px;
    color: var(--point-mint);
    font-weight: 700;
}

.gallery-artist-name {
    margin: 4px 0 0;
    font-size: 26px;
    font-weight: 800;
}

.gallery-artist-intro {
    margin: 8px 0 0;
    font-size: 15px;
    color: #8b9aa3;
    line-height: 1.6;
}

/* 작품 상세 */
.gallery-detail {
    margin-bottom: 80px;
}

.gallery-detail-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.gallery-detail-image {
    border-radius: 20px;
    overflow: hidden;
    background: #1d3037;
}

.gallery-detail-image img {
    display: block;
    width: 100%;
    height: auto;
}

.gallery-detail-type {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: var(--point-mint);
    margin-bottom: 10px;
}

.gallery-detail-title {
    margin: 0;
    font-size: 34px;
    font-weight: 800;
    line-height: 1.3;
}

.gallery-detail-meta {
    margin: 10px 0 0;
    color: #7d8f99;
    font-size: 15px;
}

.gallery-detail-desc {
    margin: 20px 0 0;
    color: #b6c4cb;
    font-size: 16px;
    line-height: 1.8;
}

/* 상세 안의 제작자 프로필 */
.gallery-detail .gallery-artist {
    display: flex;
    gap: 20px;
    margin-top: 36px;
    padding: 24px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.btn-artist-more,
.btn-gallery-all,
.btn-gallery-back {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    background: var(--point-mint);
    color: #06282b;
    transition: background 0.25s ease;
}

.btn-gallery-back {
    background: rgba(255, 255, 255, 0.08);
    color: #cfdae0;
    margin-top: 28px;
}

.btn-artist-more:hover,
.btn-gallery-all:hover {
    background: var(--point-mint-light);
}

.btn-gallery-back:hover {
    background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 1600px) {
    .gallery-masonry { column-count: 4; }
}

@media (max-width: 1200px) {
    .gallery-masonry { column-count: 3; }
    .gallery-detail-inner { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 900px) {
    .gallery-page { padding: 0 20px 80px; }
    .gallery-page-hero { padding: 110px 0 40px; }
    .gallery-page-title { font-size: 48px; }
    .gallery-masonry { column-count: 2; column-gap: 16px; }
    .gallery-pin { margin-bottom: 16px; }
    .gallery-artist-header { flex-wrap: wrap; }
    .gallery-artist-header .btn-gallery-all { margin-left: 0; }
}

@media (max-width: 560px) {
    .gallery-page-title { font-size: 38px; }
    .gallery-page-subtitle { font-size: 15px; }
    .gallery-detail-title { font-size: 26px; }
}

/* 더보기 — 30개씩 끊어 보여 준다 */
.gallery-more-wrap {
    display: flex;
    justify-content: center;
    padding: 20px 0 40px;
}

.btn-gallery-more {
    padding: 14px 40px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    color: #cfdae0;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn-gallery-more:hover {
    background: var(--point-mint);
    border-color: var(--point-mint);
    color: #06282b;
}

/* 남은 개수 */
.btn-gallery-more span:not(:empty)::before { content: '('; }
.btn-gallery-more span:not(:empty)::after { content: ')'; }

/* 더보기로 새로 드러나는 카드 — 아래에서 스르르 올라온다.
   지연 시간은 JS 가 카드마다 다르게 넣어 차례로 나타나게 한다 */
@keyframes galleryPinIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gallery-pin.is-appearing {
    animation: galleryPinIn 0.45s cubic-bezier(0.16, 0.84, 0.44, 1) both;
}

/* 등장 중에는 hover 이동이 겹쳐 흔들리므로 끝난 뒤에만 반응한다 */
.gallery-pin.is-appearing:hover {
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .gallery-pin.is-appearing { animation: none; }
}

/* 강사 프로필 통로 — 작품 보기와 나란히 두되, 주가 되지 않게 테두리형으로 */
.gallery-artist-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-artist-profile {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 22px;
    border: 1px solid rgba(0, 204, 198, .5);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--point-mint);
    transition: background .25s ease;
}

.btn-artist-profile:hover { background: rgba(0, 204, 198, .16); }
