/* ============================================================================
   SNS Content Component - 추가 스타일
   ============================================================================

   파일: /assets/css/components/sns-content.css
   설명: SNS 섹션 전용 추가 스타일

   ⚠ 섹션 자체(.notice-content)와 헤더/탭 디자인은
      테마 CSS(notice-content.css) 를 공유합니다. 여긴 "SNS 전용 차이점"만.

   레이아웃: 소식 섹션과 동일한 Grid 3열 (desktop) / 2열 (tablet) / 1열 (mobile)
   슬라이더 화살표는 Grid 모드에서는 숨김 (데이터 많으면 /sns/ 전용 페이지로 유도)

   ============================================================================ */

/* ─────────── Slider wrapper: Flex + wrap + center
 * Grid 와 달리 카드 개수가 1~2개여도 가운데 정렬됨. 메인 노출은 최대 3개로 제한
 * (JS 에서 slice) → 4개 이상 쌓이는 상황 방지. 더보기는 헤더 버튼/전용 페이지로. */
.sns-content .notice-content__slider-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;                          /* 소식과 동일 */
    justify-content: center;
    align-items: stretch;
    overflow: visible;
    box-sizing: border-box;
}

/* 카드 폭: 소식 Grid 3열 과 동일한 1/3 폭 유지 */
.sns-card {
    flex: 0 0 calc((100% - 80px) / 3);   /* 3개 기준 — gap 40px × 2 = 80 */
    max-width: calc((100% - 80px) / 3);
    box-sizing: border-box;
}

@media (max-width: 834px) {
    .sns-card {
        flex: 0 0 calc((100% - 40px) / 2);    /* Tablet: 2개 기준 */
        max-width: calc((100% - 40px) / 2);
    }
}

@media (max-width: 412px) {
    .sns-card {
        flex: 0 0 100%;                        /* Mobile: 1개 */
        max-width: 100%;
    }
}

/* 화살표 — 소식과 동일하게 노출, 처음/끝 도달 시 비활성 */
.sns-content .notice-content__slider .arrow-button[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ─────────── SNS 카드 ─────────── */
.sns-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 20px;                /* 소식 카드와 동일 */
    overflow: hidden;
    background: #fff;
    box-shadow: 4px 4px 30px 0px rgba(0, 0, 0, 0.25);  /* 소식 카드와 동일 */
    transition: transform var(--transition-normal, 0.2s), box-shadow var(--transition-normal, 0.2s);
    position: relative;
    box-sizing: border-box;
}

.sns-card:hover,
.sns-card:focus {
    transform: translateY(-8px);
    box-shadow: 4px 8px 40px 0px rgba(0, 0, 0, 0.3);
    text-decoration: none;
    color: inherit;
}

/* 썸네일 영역 — 소식 카드와 동일한 500:571 비율 (크기 통일)
 * 관리자는 500×625 로 업로드하지만 표시 시 상하 가운데 crop 되어 자연스럽게 노출됨. */
.sns-card__thumbnail-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 500 / 571;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sns-card__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sns-card__thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

/* SNS 종류 뱃지 (좌상단) */
.sns-card__badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    color: #fff;
    font-weight: 600;
    z-index: 2;
    background: #777;             /* JS 가 inline 으로 SNS 색상 적용 */
    letter-spacing: -0.3px;
    line-height: 1;
}

/* SNS 아이콘 (우상단) — 원 안에 꽉 차게 */
.sns-card__icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.sns-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;        /* 원 안쪽 전체를 덮음 */
    display: block;
}

/* 하단 Footer: 날짜 + NEW */
.sns-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fff;
    min-height: 56px;
}

.sns-card__date {
    font-size: 15px;
    color: #888;
}

.sns-card__new {
    display: inline-block;
    padding: 4px 12px;
    background: #ff4757;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.3px;
}

/* ─────────── 빈 상태 ─────────── */
.sns-content .notice-content__empty {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 400px;
    color: #888;
    font-size: 14px;
}

/* ============================================================================
   전용 페이지 (/sns/) — 4열 그리드 + 페이지네이션
   ============================================================================ */

/* /sns/ 전용 페이지 — notice-content 의 흰색 배경을 투명으로 오버라이드해
 * main 의 sub-bg--board 배경 이미지(보라색 + 캐릭터 + 하단 타원 경계) 노출 */
.sns-list-page {
    background: transparent !important;
    padding-top: 40px;
}

/* 그리드 — 카드 최소 260px 보장하며 컨테이너 폭에 따라 자동 열 수 결정
 * (260px 이하 모바일: 1열, ~540px: 2열, ~820px: 3열, 1100px+: 4열 자동) */
.sns-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 그리드 안 카드 — 메인 섹션 flex 규칙 완전 리셋 */
.sns-list-grid > .sns-card {
    flex: unset !important;
    max-width: none !important;
    width: auto !important;
}

/* 로딩 상태 */
.sns-list-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: #888;
    font-size: 15px;
}

/* 빈 상태 / 에러 — 아이콘 + 메시지 */
.sns-list-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    text-align: center;
    color: #999;
}

.sns-list-empty i {
    font-size: 72px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.sns-list-empty h3 {
    font-size: 20px;
    color: #475569;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.sns-list-empty p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

.sns-list-empty--error i {
    color: #f87171;
}

.sns-list-empty--error h3 {
    color: #dc2626;
}

/* 페이지네이션 */
.sns-list-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 40px 0 80px 0;
}

.sns-pagination__btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.sns-pagination__btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.sns-pagination__btn--active {
    background: #0484ff;     /* 소식/SNS sky 색상 */
    color: #fff;
    border-color: #0484ff;
}

.sns-pagination__btn--active:hover {
    background: #0484ff;
    color: #fff;
}

.sns-pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
