/**
 * 갤러리 페이지 스타일 (전후사진, 자필후기)
 * Source: momoprs.com 원본 스타일
 */

/* ==========================================
   CSS 변수 정의
   ========================================== */
:root {
    --man-color-02: #1C3BA2;
    --man-color-06: #D2E0F4;
}

/* ==========================================
   상단 비주얼 (.sub_visual) - 원본 동일
   ========================================== */
.sub_visual {
    padding: 130px 0;
    text-align: center;
    position: relative;
}

.sub_visual::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, 0);
    width: 80%;
    height: 2px;
    background: #000;
}

.sub_visual h1 {
    font-size: 44px;
    line-height: 1em;
    letter-spacing: -1px;
    margin: 0;
}

@media screen and (max-width: 1024px) {
    .sub_visual {
        padding: 60px 0;
    }
    .sub_visual h1 {
        font-size: 36px;
    }
    .sub_visual::after {
        width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .sub_visual {
        display: none;
    }
}

/* ==========================================
   필터 영역 (.tab_area) - 원본 동일
   ========================================== */
.tab_area .inner {
    padding: 0 16.66%;
    margin-top: 60px;
}

.tab_area .inner .tab_con .con {
    padding: 60px 5% 60px 10%;
    box-sizing: border-box;
    border-radius: 20px;
    background: #FAFAFA;
}

.tab_area .inner .tab_con .con ul {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tab_area .inner .tab_con .con ul li input[type="radio"] {
    display: none;
}

.tab_area .inner .tab_con .con ul li label {
    display: block;
    border-radius: 190px;
    padding: 0 30px;
    line-height: 40px;
    box-sizing: border-box;
    cursor: pointer;
    background: var(--man-color-06);
    color: #456BEC;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -1px;
    white-space: nowrap;
}

.tab_area .inner .tab_con .con ul li input[type="radio"]:checked + label {
    background: #3359D7;
    color: #fff;
}

/* 필터 버튼 (a 링크용) - 원본 스타일 */
.tab_area .inner .tab_con .con ul li a.filter-label {
    display: block;
    border-radius: 190px;
    padding: 0 30px;
    line-height: 40px;
    box-sizing: border-box;
    cursor: pointer;
    background: var(--man-color-06);
    color: #456BEC;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -1px;
    white-space: nowrap;
    text-decoration: none;
}

.tab_area .inner .tab_con .con ul li a.filter-label.active {
    background: #3359D7;
    color: #fff;
}

.tab_area .inner .tab_con .tab_detail .details {
    display: grid;
    grid-template-columns: 100px auto;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tab_area .inner .tab_con .tab_detail .details .label_title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -1px;
    white-space: nowrap;
    cursor: default;
    line-height: 40px;
}

.tab_area .inner .tab_con .tab_detail .sch_btn {
    display: inline-block;
    line-height: 50px;
    height: 50px;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -1px;
    color: #fff;
    padding: 0 45px;
    border-radius: 190px;
    background: var(--man-color-02);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 20px;
    border: none;
    cursor: pointer;
}

/* ==========================================
   갤러리 목록 (.list_box) - 원본 동일
   ========================================== */
.list_box {
    padding: 0 16.66% 120px;
}

.list_box .banner {
    font-size: 26px;
    letter-spacing: -1px;
    text-align: center;
    padding: 20px 0;
    margin: 50px 0;
    background: #FAFAFA;
    border-radius: 16px;
}
/* 원본 동일 — 건수 숫자 강조(브랜드 컬러) */
.list_box .banner .num {
    color: var(--man-color-02);
    font-weight: 700;
}

.list_box > ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 32px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.list_box > ul > li {
    position: relative;
    border: none !important;
    padding: 0 !important;
}

.list_box > ul > li .img_box {
    position: relative;
    margin-bottom: 20px;
}

.list_box > ul > li .img_box img {
    width: 100%;
    aspect-ratio: 278/218;
}

/* Before/After 이미지 수평 배치 (원본 동일) */
.list_box > ul > li .img_box .img_wrap {
    display: flex;
}

.list_box > ul > li .img_box .img_wrap > div {
    flex: 1;
    position: relative;
}

/* Before/After 컨테이너 - 원본 동일 */
.list_box > ul > li .img_box .img_wrap .bf_con,
.list_box > ul > li .img_box .img_wrap .af_con {
    flex: 1;
    position: relative;
}

/* Before/After 라벨 - 원본 동일 */
.list_box > ul > li .img_box .img_wrap .bf_con p,
.list_box > ul > li .img_box .img_wrap .af_con p {
    font-size: 16px;
    color: #FFF;
    text-align: center;
    height: 24px;
    line-height: 24px;
    width: 100%;
    background-color: #8A8D9F;
    margin: 0;
}

.list_box > ul > li .img_box .img_wrap .af_con p {
    background-color: #676A7D;
}

.list_box > ul > li .img_box .img_wrap [class^='text_box'] {
    font-size: 16px;
    color: #FFF;
    text-align: center;
    height: 24px;
    line-height: 24px;
    width: 100%;
    background-color: #8A8D9F;
}

.list_box > ul > li .img_box .img_wrap .text_box02 {
    background-color: #676A7D;
}

/* 로그인 필요 블러 오버레이 (원본 동일) */
.list_box > ul > li .img_box .blur {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(2px);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
}

/* 로그인 시 블러 제거 */
body.is-login .list_box > ul > li .img_box .blur {
    display: none !important;
}

.list_box > ul > li .img_box .blur p {
    width: 100%;
    height: 100%;
    font-weight: 500;
    font-size: 18px;
    line-height: 26px;
    letter-spacing: -.26px;
    color: #fff;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 카드 정보 영역 (원본 동일) */
.list_box > ul > li .text_box {
    text-align: center;
}

.list_box > ul > li .text_box .top {
    font-weight: 500;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.list_box > ul > li .text_box .title_target {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.list_box > ul > li .text_box .title_target .badge {
    line-height: 26px;
    height: 26px;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: #fff;
    padding: 0 12px;
    background: var(--man-color-02);
    border-radius: 100px;
    text-align: center;
}

.list_box > ul > li .text_box .title_target .badge span {
    display: inline-block;
}

.list_box > ul > li .text_box .title_target strong {
    font-weight: 500;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: #777C81;
}

.list_box > ul > li .text_box .title_treatment {
    font-size: 16px;
    letter-spacing: -1px;
    margin: 10px 0;
}

.list_box > ul > li .text_box .title_treatment span + span::before {
    content: '|';
    margin: 0 10px;
    font-weight: normal;
    color: #B9BAC1;
}

.list_box > ul > li .text_box .title_writer {
    font-size: 20px;
    letter-spacing: -1px;
}

.list_box > ul > li .text_box .bottom {
    margin-top: 10px;
}

.list_box > ul > li .text_box .date {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: #B9BAC1;
    margin: 0;
}

/* p 태그 badge 스타일 (원본 동일) */
.list_box > ul > li .text_box p.badge {
    line-height: 26px;
    height: 26px;
    font-size: 16px;
    letter-spacing: -0.02em;
    color: #fff;
    padding: 0 12px;
    background: var(--man-color-02);
    border-radius: 100px;
    text-align: center;
    margin: 0;
}

.list_box > ul > li .text_box p.title_treatment {
    font-size: 16px;
    letter-spacing: -1px;
    margin: 0;
}

.list_box > ul > li .text_box p.title_treatment span + span::before {
    content: '|';
    margin: 0 10px;
    font-weight: normal;
    color: #B9BAC1;
}

/* ==========================================
   페이지네이션 (원본 스타일)
   ========================================== */
.pagination_box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
    padding-bottom: 60px;
}

.pagination_box a,
.pagination_box span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: #999;
    text-decoration: none;
}

.pagination_box a:hover {
    color: var(--man-color-02);
}

/* 원본(pg_current) 동일 — 원형 배경 없이 굵은 텍스트 강조 */
.pagination_box .active,
.pagination_box .on a {
    color: var(--man-color-02);
    font-weight: 700;
}

.pagination_box .prev,
.pagination_box .next {
    font-size: 14px;
    color: #999;
}

/* ==========================================
   주의 문구 (.note_box) - 원본 동일
   ========================================== */
.note_box {
    width: 100%;
    background-color: #f8f8f8;
    padding: 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    flex-direction: column;
    margin-top: 60px;
}

.note_text {
    font-size: 16px;
    line-height: 1.4;
    color: #888;
    font-weight: 500;
    text-align: left;
}

/* ==========================================
   반응형 - PC (1540px)
   ========================================== */
@media screen and (max-width: 1540px) {
    .tab_area .inner {
        padding: 0 12%;
    }
    .list_box {
        padding: 0 12% 120px;
    }
}

/* ==========================================
   반응형 - PC (1440px)
   ========================================== */
@media screen and (max-width: 1440px) {
    .tab_area .inner {
        padding: 0 8%;
    }
    .list_box {
        padding: 0 8% 120px;
    }
}

/* ==========================================
   반응형 - PC (1058px)
   ========================================== */
@media screen and (max-width: 1058px) {
    .tab_area .inner {
        padding: 0 6%;
    }
    .list_box {
        padding: 0 6% 100px;
    }
}

/* ==========================================
   반응형 - 태블릿 (1024px)
   ========================================== */
@media screen and (max-width: 1024px) {
    .tab_area .inner {
        padding: 0 5%;
        margin-top: 80px;
    }
    .tab_area .inner .tab_con .con {
        padding: 40px 5% 40px;
    }
    .tab_area .inner .tab_con .con ul {
        gap: 12px;
    }
    .tab_area .inner .tab_con .con ul li label,
    .tab_area .inner .tab_con .con ul li a.filter-label {
        font-size: 16px;
        padding: 0 24px;
        line-height: 34px;
    }

    .tab_area .inner .tab_con .tab_detail .details {
        gap: 12px;
        align-items: flex-start;
    }
    .tab_area .inner .tab_con .tab_detail .sch_btn {
        line-height: 40px;
        height: 40px;
    }
    .tab_area .inner .tab_con .tab_detail .details .label_title {
        font-size: 18px;
        line-height: 34px;
    }

    .list_box {
        padding: 0 5% 100px;
    }
    .list_box .banner {
        font-size: 20px;
        margin: 20px 0;
    }
    .list_box > ul {
        grid-template-columns: repeat(1, 1fr);
        row-gap: 32px;
    }
    .list_box > ul > li .img_box .blur p {
        font-size: 18px;
        line-height: 26px;
    }
    .list_box > ul > li .text_box .title_target {
        gap: 8px;
    }
    .list_box > ul > li .text_box .title_target .badge {
        line-height: 34px;
        height: 34px;
        font-size: 22px;
        padding: 0 16px;
    }
    .list_box > ul > li .text_box .title_target strong {
        font-size: 14px;
    }
    .list_box > ul > li .text_box .title_treatment {
        font-size: 22px;
    }
    .list_box > ul > li .text_box .title_writer {
        font-size: 18px;
    }

    .list_box > ul > li .img_box .img_wrap [class^='text_box'],
    .list_box > ul > li .img_box .img_wrap .bf_con p,
    .list_box > ul > li .img_box .img_wrap .af_con p {
        font-size: 20px;
        line-height: 30px;
        height: 30px;
    }
    .list_box > ul > li .text_box .date {
        font-size: 16px;
    }
    .list_box > ul > li .text_box p.badge {
        line-height: 34px;
        height: 34px;
        font-size: 22px;
        padding: 0 16px;
    }
    .list_box > ul > li .text_box p.title_treatment {
        font-size: 22px;
    }

    .note_box {
        padding: 24px 40px;
        margin-top: 40px;
    }
}

/* ==========================================
   반응형 - 모바일 (768px)
   ========================================== */
@media screen and (max-width: 768px) {
    .tab_area .inner {
        margin-top: 60px;
    }
    .tab_area .inner .tab_con .con {
        padding: 24px 5%;
        border-radius: 16px;
    }
    .tab_area .inner .tab_con .con ul {
        gap: 10px;
    }
    .tab_area .inner .tab_con .con ul li label,
    .tab_area .inner .tab_con .con ul li a.filter-label {
        padding: 0 12px;
        line-height: 30px;
        font-size: 14px;
    }

    .tab_area .inner .tab_con .tab_detail .details {
        grid-template-columns: 60px auto;
        gap: 16px;
        margin-bottom: 24px;
    }
    .tab_area .inner .tab_con .tab_detail .details .label_title {
        font-size: 16px;
        font-weight: 500;
        line-height: 30px;
    }
    .tab_area .inner .tab_con .tab_detail .sch_btn {
        line-height: 40px;
        height: 40px;
        font-size: 16px;
        padding: 0 30px;
        margin-top: 40px;
        display: block;
        width: 100%;
        max-width: 480px;
    }

    .list_box {
        padding: 0 5% 60px;
    }
    .list_box .banner {
        font-size: 18px;
        line-height: 1.4;
        padding: 20px 24px;
        text-wrap: balance;
        word-break: keep-all;
    }
    .list_box > ul {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
    }
    .list_box > ul > li .img_box {
        border-radius: 8px;
    }
    .list_box > ul > li .img_box img {
        border-radius: 8px;
    }
    .list_box > ul > li .img_box .img_wrap {
        border-radius: 8px;
        overflow: hidden;
    }
    .list_box > ul > li .img_box .img_wrap [class^='text_box'],
    .list_box > ul > li .img_box .img_wrap .bf_con p,
    .list_box > ul > li .img_box .img_wrap .af_con p {
        font-size: 14px;
        line-height: 22px;
        height: 22px;
    }
    .list_box > ul > li .text_box .title_target .badge,
    .list_box > ul > li .text_box p.badge {
        line-height: 22px;
        height: 22px;
        font-size: 16px;
        padding: 0 12px;
    }
    .list_box > ul > li .text_box .title_treatment,
    .list_box > ul > li .text_box p.title_treatment {
        font-size: 18px;
    }
    .list_box > ul > li .text_box .date {
        font-size: 12px;
    }

    .pagination_box {
        margin-top: 40px;
        padding-bottom: 40px;
        gap: 6px;
    }
    .pagination_box a,
    .pagination_box span {
        min-width: 32px;
        height: 32px;
        font-size: 15px;
    }

    .note_box {
        padding: 24px 16px;
        margin-top: 30px;
    }
    .note_text {
        font-size: 14px;
    }
}

/* ==========================================
   자필후기 갤러리 스타일 - 원본 동일
   ========================================== */

/* 자필후기 갤러리 - 원본 동일 (3열 레이아웃) */
.list_box.handwritten > ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 20px;
    row-gap: 52px;
}

/* 자필후기 카드 스타일 */
.list_box.handwritten > ul > li {
    padding: 16px 4% 25px;
    border-radius: 16px;
    border: 1px solid #DFE0E2;
    cursor: pointer;
}

/* 자필후기 이미지 영역 */
.list_box.handwritten > ul > li .img_box {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    aspect-ratio: 331/181;
}

.list_box.handwritten > ul > li .img_box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 331/181;
}

/* 자필후기 블러 오버레이 - 원본 스타일 */
.list_box.handwritten > ul > li .img_box .blur {
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(13, 29, 61, 0.80) 0%, rgba(13, 29, 61, 0.80) 100%);
    backdrop-filter: blur(2px);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list_box.handwritten > ul > li .img_box .blur p {
    color: #fff;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
}

/* 자필후기 텍스트 영역 */
.list_box.handwritten > ul > li .text_box {
    font-weight: 500;
    text-align: center;
}

.list_box.handwritten > ul > li .text_box .title_target {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    font-size: 20px;
}

.list_box.handwritten > ul > li .text_box .title_treatment {
    font-size: 18px;
    letter-spacing: -0.02em;
    margin-top: 10px;
}

/* 자필후기 반응형 - 태블릿 (1024px) */
@media screen and (max-width: 1024px) {
    .list_box.handwritten > ul {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 10px;
        row-gap: 40px;
    }
}

/* 자필후기 반응형 - 모바일 (768px) */
@media screen and (max-width: 768px) {
    .list_box.handwritten > ul {
        grid-template-columns: repeat(1, 1fr);
        gap: 20px;
    }
}

/* ==========================================
   갤러리 모달 (이미지 확대 보기)
   ========================================== */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 900px;
    max-height: 90vh;
    overflow: auto;
    margin: 20px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-body {
    display: flex;
    flex-direction: column;
}

.modal-images {
    display: flex;
    gap: 4px;
}

.modal-before,
.modal-after {
    position: relative;
    flex: 1;
}

.modal-before img,
.modal-after img {
    width: 100%;
    height: auto;
    display: block;
}

.modal-before .label,
.modal-after .label {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.modal-info {
    padding: 24px;
    text-align: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-meta .tag {
    background: #f0f0f0;
    color: #666;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
}

@media screen and (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
    .modal-images {
        flex-direction: column;
    }
}
