/**
 * 갤러리 게시판 전용 스타일 (그리드 레이아웃)
 * 2025-10-22: 카드 그리드 형태
 */

.gallery-page {
    background: var(--bg-white, #ffffff);
    padding: var(--spacing-4xl) 0 var(--spacing-5xl);
}

.gallery-page .inner {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    padding-top: 0;
}

/* ========== 상단 정보 영역 ========== */
.gallery-page .borad_zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    color: var(--text-light);
    font-size: var(--font-small);
}

.gallery-page .pagination-info-zone {
    justify-content: space-between;
    align-items: center;
}

.gallery-page .pagination-info-text {
    margin: 0;
    font-size: var(--font-small);
    color: var(--muted);
}

.gallery-page .items-per-page-select {
    padding: 6px 30px 6px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: var(--font-small);
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 12 12%27%3E%3Cpath fill=%27%23666%27 d=%27M6 8L2 4h8z%27/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* ========== 갤러리 그리드 레이아웃 ========== */
.gallery-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* ========== 갤러리 카드 ========== */
.gallery-page .gallery-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-page .gallery-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* 카드 이미지 영역 */
/* 2025-10-23: 기본 1:1 정사각형 (4열, 3열) */
.gallery-page .gallery-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-gray);
}

.gallery-page .gallery-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 카드 콘텐츠 영역 */
.gallery-page .gallery-card-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    flex: 1;
}

/* 2025-10-23: 제목 (div, 2줄 고정) */
.gallery-page .gallery-card-title {
    font-size: var(--font-body);
    font-weight: var(--weight-body);
    color: var(--text-primary);
    line-height: var(--line-body);
    letter-spacing: var(--spacing-body);
    /* 2줄 고정 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2025-10-23: 메타 정보 (작성자 좌측, 발행일 우측, 카드 하단 고정) */
.gallery-page .gallery-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
    font-size: var(--font-small);
    font-weight: var(--weight-small);
    line-height: var(--line-small);
    letter-spacing: var(--spacing-small);
    color: var(--text-gray);
}

/* ========== 반응형 ========== */
/* 2025-10-23: 1400px 이하에서 3열로 전환 (컨테이너 max-width 기준) */
@media (max-width: 1400px) {
    /* 3열 */
    .gallery-page .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .gallery-page {
        padding: 0 0 var(--spacing-5xl);
    }

    .gallery-page .inner {
        gap: var(--spacing-2xl);
    }
}

@media (max-width: 860px) {
    .gallery-page {
        padding: var(--spacing-2xl) 0 var(--spacing-4xl);
    }

    /* 모바일: 2열 */
    .gallery-page .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }

    /* 2025-10-23: 모바일(2열, 1열)에서는 와이드 비율 */
    .gallery-page .gallery-card-image {
        aspect-ratio: 16 / 9;
    }

    .gallery-page .gallery-card-content {
        padding: var(--spacing-md);
    }

    .gallery-page .gallery-card-title {
        font-size: var(--font-body);
    }

    .gallery-page .borad_zone {
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .gallery-page .pagination-info-zone {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .gallery-page .pagination-info-text {
        flex-shrink: 0;
    }

    .gallery-page .items-per-page-select {
        flex-shrink: 0;
    }
}

@media (max-width: 640px) {
    /* 작은 모바일: 1열 */
    .gallery-page .gallery-grid {
        grid-template-columns: 1fr;
    }
}
