
   gallery.css
   - 사진첩 공통 스타일
   - 적용 대상 예:
     • gallery_family_group.php  (가족 단체사진)
     • gallery-parents.php       (부모님 사진첩)
     • gallery-sieun.php         (시은·원석 사진첩)
     • gallery-myeongeun.php     (명은·크리스티나 사진첩)
     • gallery-doeun.php         (도은 사진첩)
     • gallery-grandkids.php     (손주 사진첩)
   - 레이아웃과 카드, 연도 선택 pill, 사진 그리드 등을 공통화
--------------------------------------------------------- */

/* ▣ 페이지 전체 레이아웃
   - .site-main, .layout-inner 는 site.css 에서 기본 구조 잡혀 있다고 가정
   - 여기서는 사진첩 페이지에 필요한 여백만 추가
*/
.gallery-main {
    padding: 20px 0 30px 0;
    background: transparent;   /* 바탕은 전체 사이트 공통 배경 사용 */
}

.gallery-page {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;  /* 상단 카드와 사진 카드 사이 여백 */
}

/* ---------------------------------------------------------
   1) 상단 헤더 카드 (설명 + 연도 선택)
--------------------------------------------------------- */

/* ----- 카드 스타일 (상단 설명 박스 등) ----- */
.gallery-header-card {
    margin-top: 6px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    padding: 10px 16px !important;
    color: #111827;
}

/* 카드 내부 제목/설명 텍스트 간격 최적화 */
.gallery-title-main {
    margin-top: 2px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #111827;
}

.gallery-title-sub {
    font-size: 12.5px;
    line-height: 1.55;
    margin-bottom: 6px;
    color: #374151;
}

/* 연도 선택 라인 */
.gallery-year-row {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.gallery-year-label {
    font-size: 13px;
    color: #4b5563;
}

/* 연도 pill 버튼 – PC 기본 */
.year-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;          /* ✅ 65px → 60px (조금만 줄임) */
    padding: 3px 10px;        /* ✅ 4px 12px → 3px 10px */
    border-radius: 999px;
    font-size: 12px;          /* 살짝 작게 */
    border: 1px solid #cbd5f5;
    background: #ffffff;
    color: #1f2937;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease,
                border-color 0.15s ease, box-shadow 0.15s ease;
}

.year-pill:hover {
    background: #2563eb;
    color: #f9fafb;
    border-color: #2563eb;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

.year-pill.active {
    background: #1d4ed8;
    color: #f9fafb;
    border-color: #1d4ed8;
}

/* ---------------------------------------------------------
   2) 사진 카드 (선택된 연도에 대한 사진 그리드)
--------------------------------------------------------- */

/* 사진 목록을 감싸는 카드 */
.gallery-photos-card {
    /* .card 기본 스타일 그대로 사용 + 필요시 약간 조정 가능 */
}

/* 연도 제목 */
/* ---------------------------------------------------------
   2) '2023년 가족 단체사진' 글씨 진하게
--------------------------------------------------------- */
.gallery-year-heading {
    font-size: 18px;
    font-weight: 600;
    color: #111827;      /* 기존 대비 훨씬 선명 */
    margin: 10px 0 12px;
}

/* 그리드: 모바일 1열 → 태블릿 2열 → 중간 3열 → PC 4열 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* 각 사진 카드 */
.gallery-item {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* 공통 – PC 기준 기본값 */
.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    aspect-ratio: 4 / 3;   /* ✅ 13/9 → 4/3 */
    object-fit: cover;
    object-position: center center;
}

/* 살짝 떠오르는 호버 효과 */
.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.30);
}

/* 사진이 없을 때 표시하는 메시지 */
.no-photos-text {
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
}

/* 사진 링크(썸네일) */
.gallery-item a {
    display: block;
}

/* 호버 시 살짝 확대 */
.gallery-item:hover img {
    transform: scale(1.03);
}

/* 사진 아래 캡션 (업로드 시간 등) */
.gallery-caption {
    font-size: 12px;
    color: #d1d5db;    /*  #e5e7eb;  */
    padding: 6px 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.9);
    text-align: center;
}

/* "사진이 없습니다" 안내문에서 링크 스타일 */
.no-photos-text a {
    color: #60a5fa;
    text-decoration: none;
}

.no-photos-text a:hover {
    text-decoration: underline;
}

/* ===== 필터 줄(손주 선택 / 연도 선택) ===== */

/* 한 줄(라벨 + pill 버튼들) */
.gallery-filter-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-right: 4px;
}

/* pill 버튼 기본 스타일 */
.gallery-filter-row .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    min-width: 68px;
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #111827;
    text-decoration: none;
    box-sizing: border-box;
    transition:
        background 0.16s ease,
        color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

/* hover 시 살짝 강조 */
.gallery-filter-row .pill:hover {
    background: #e5f2ff;
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

/* 현재 선택된 필터 (active) */
.gallery-filter-row .pill.active {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #f9fafb;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.5);
}

/* ======================================
   ★ 전문적인 그라데이션 Pill 버튼 디자인
   ====================================== */

.gallery-filter-row .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 14px;      /* ← 높이 감소: 기존 7px → 5px */
    min-width: 70px;

    font-size: 12px;
    font-weight: 500;

    /* 은은한 그라데이션 */
    background: linear-gradient(135deg, #fafafa 0%, #f1f3f7 100%);
    color: #4a5568;    /*  #1f2937; */

    border: 1px solid #cfd4dc;
    border-radius: 999px;

    text-decoration: none;

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.1s ease;

    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.gallery-filter-row .pill:hover {
    background: linear-gradient(135deg, #eef4ff 0%, #dae7ff 100%);
    border-color: #93b6ff;
    color: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(147, 181, 255, 0.45);
}

.gallery-filter-row .pill.active {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;

    border-color: #1e40af;

    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.45),
                0 0 0 1px rgba(255,255,255,0.2) inset;

    transform: translateY(-1px);
}

/* ---------------------------------------------------------
   3) 반응형 (모바일)
--------------------------------------------------------- */
/* ---------------------------------------------------------
   📱 0) 공통: PC 기본값은 그대로 유지
   - .gallery-item img 는 파일 상단 정의 그대로 사용:
   - width:100%, height:100%, aspect-ratio:13/9, object-fit:cover
   --------------------------------------------------------- */

/* ---------------------------------------------------------
   📱 1) 900px 이하 (태블릿 가로/세로 공통)
   - 2열 그리드
   - 사진은 잘림 최소화를 위해 높이 자동 + contain
   --------------------------------------------------------- */
@media (max-width: 900px) {

    .gallery-main {
        padding: 16px 0 32px 0;
    }

    .gallery-page {
        gap: 14px;
    }

    .gallery-header-card {
        padding: 12px 14px 14px 14px;
        margin-bottom: 12px;
    }

    .gallery-title-main {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .gallery-title-sub {
        font-size: 12px;
        line-height: 1.45;
        margin-bottom: 10px;
    }

    /* 필터 줄 간격 조금 줄이기 */
    .gallery-filter-row {
        margin-top: 4px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .gallery-filter-label {
        font-size: 12px;
    }

    .gallery-filter-row .pill {
        min-width: auto;
        padding: 4px 10px;
        font-size: 11.5px;
        white-space: nowrap;
    }

    /* 태블릿/작은 화면: 2열 그리드 */
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    /* ★ 사진 잘림 방지: 높이 자동 + 비율 강제 해제 */
    .gallery-item img {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;      /* 전체 사진이 보이도록 */
        background: #00000010;    /* 혹시 여백 생길 때 자연스럽게 */
    }
}

/* ---------------------------------------------------------
   📱 2) 760px 이하 (작은 태블릿 / 큰 폰)
   - 여전히 2열, 카드와 텍스트를 조금 더 컴팩트하게
   --------------------------------------------------------- */
@media (max-width: 760px) {

    .gallery-header-card {
        padding: 10px 12px 12px 12px;
    }

    .gallery-title-main {
        font-size: 17px;
    }

    .gallery-title-sub {
        font-size: 11.5px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .gallery-item {
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
        border-radius: 12px;
    }
}

/* ---------------------------------------------------------
   📱 3) 640px 이하 (일반 스마트폰 세로)
   - 1열(세로로 한 장씩 크게)
   --------------------------------------------------------- */
@media (max-width: 640px) {

    .gallery-main {
        padding: 14px 0 24px 0;
    }

    .gallery-header-card {
        margin-top: 4px;
        margin-bottom: 10px;
    }

    /* 핸드폰에서는 카드 안 글자 조금 더 줄이기 */
    .gallery-title-main {
        font-size: 16px;
        margin-bottom: 4px;
    }

    .gallery-title-sub {
        font-size: 11px;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    .gallery-filter-row {
        gap: 4px;
    }

    .gallery-filter-label {
        width: 100%;
        font-size: 11.5px;
        margin-bottom: 3px;
    }

    .gallery-filter-row .pill {
        padding: 3px 9px;
        font-size: 11px;
    }

    /* 스마트폰에서는 1열로 크게 */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .gallery-item {
        border-radius: 12px;
    }

    /* 이미지는 위 900px 이하 설정과 동일: height:auto + contain */
}

/* ---------------------------------------------------------
   📱 4) 480px 이하 (아주 작은 폰)
   - 여백 최소화
   --------------------------------------------------------- */
@media (max-width: 480px) {

    .gallery-main {
        padding: 10px 0 18px 0;
    }

    .gallery-header-card {
        padding: 8px 10px 10px 10px;
    }

    .gallery-title-main {
        font-size: 15px;
    }

    .gallery-title-sub {
        font-size: 10.5px;
    }

    .gallery-filter-row .pill {
        padding: 3px 8px;
        font-size: 10.5px;
    }
}

/* =====================================================
   📱 모바일 · 태블릿 – 사진 잘림 방지 + 4:3 박스 유지
   ===================================================== */
@media (max-width: 900px) {

    /* ① 카드 자체 비율을 4:3으로 고정 */
    .gallery-grid .gallery-item {
        aspect-ratio: 4 / 3;     /* 카드 박스 4:3 */
        height: auto;
        border-radius: 12px;
        overflow: hidden;
    }

    /* ② 이미지: 잘림 없이 전체가 보이도록 contain 사용 */
    .gallery-grid .gallery-item img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;      /* 부모(aspect-ratio:4/3)에 맞게 */
        object-fit: contain;     /* ✅ 상하/좌우 잘림 없이 전체 표시 */
        object-position: center;
        background: #00000010;   /* 여백 생길 때 배경 */
    }

    /* 모바일 그리드 – 기본 2열 */
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    /* ...위에 카드 이미지 코드 뒤나 앞 아무 데나... */

    .year-pill {
        min-width: auto;        /* ✅ 고정 폭 제거 */
        padding: 3px 8px;       /* 좌우 여백 더 줄이기 */
        font-size: 11px;
        white-space: nowrap;    /* 줄바꿈 방지 */
    }


}

/* 아주 작은 화면(폰 세로)에서는 1열 */
@media (max-width: 640px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }


}
