/* ==========================================================================
   _add_board_view.css — board view & latest skin 공통 클래스
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section background
   -------------------------------------------------------------------------- */
.section-bg-light {
  background: #fff;
}

/* --------------------------------------------------------------------------
   Admin 버튼 영역
   -------------------------------------------------------------------------- */
.view-admin-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.view-admin-bar .btn-outline {
  font-size: var(--font-size-body-sm);
}
.view-admin-bar .btn-danger {
  font-size: var(--font-size-body-sm);
  color: #dc2626;
}

/* --------------------------------------------------------------------------
   카드 헤더 (공지 / 채용)
   -------------------------------------------------------------------------- */
.view-card-header {
  background: var(--color-primary-50);
  border-bottom: 1px solid var(--color-primary-100);
  padding: 1rem 1.5rem;
}

/* 카테고리 뱃지 + 제목 행 */
.view-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.view-cat-badge {
  flex-shrink: 0;
  margin-top: 3px;
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: var(--font-size-caption);
  font-weight: 600;
  white-space: nowrap;
}

/* 색상 변형 */
.view-cat-badge--event   { background: #eff6ff; color: #2563eb; }
.view-cat-badge--bid     { background: #fef3c7; color: #b45309; }
.view-cat-badge--mgmt    { background: #f0fdf4; color: #16a34a; }
.view-cat-badge--default { background: #f5f5f5; color: var(--color-light-600); }
.view-cat-badge--teacher { background: #dbeafe; color: #1d4ed8; }
.view-cat-badge--promo   { background: var(--color-light-100); color: var(--color-light-600); }
.view-cat-badge--press   { background: var(--color-primary-100); color: var(--color-primary-700); }
.view-cat-badge--story   { background: var(--color-primary-100); color: var(--color-primary-700); }

/* 제목 */
.view-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-light-900);
  line-height: 1.5;
  margin: 0;
}

/* 메타 행 */
.view-meta-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: var(--font-size-body-sm);
  color: var(--color-light-500);
}
.view-meta-row--gap-lg {
  gap: 1.5rem;
}
.view-meta-label {
  font-weight: 600;
  color: var(--color-light-600);
  margin-right: 0.25rem;
}
.view-meta-deadline--done {
  color: var(--color-light-400);
}

/* --------------------------------------------------------------------------
   본문 영역 (page-card 안쪽)
   -------------------------------------------------------------------------- */
.view-content-wrap {
  padding: 2rem 1.5rem;
}

/* story view 전용 — 제목 h2 */
.view-story-title {
  font-size: var(--font-size-heading-1);
  font-weight: 800;
  color: var(--color-light-900);
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

/* archive view 제목 h2 */
.view-archive-title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-light-900);
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* 날짜 단독 메타 (story / archive) */
.view-date-meta {
  font-size: var(--font-size-body-sm);
  color: var(--color-light-400);
  margin-bottom: 1.5rem;
  font-variant-numeric: tabular-nums;
}

/* story 출처 + 날짜 메타 행 */
.view-source-meta {
  display: flex;
  gap: 1.5rem;
  font-size: var(--font-size-body-sm);
  color: var(--color-light-500);
  margin-bottom: 1.5rem;
}
.view-source-meta .view-date-num {
  font-variant-numeric: tabular-nums;
}

/* 구분선 */
.view-divider {
  height: 1px;
  background: var(--color-border);
  margin-bottom: 1.5rem;
}

/* 본문 */
.view-body {
  line-height: 1.8;
  font-size: var(--font-size-body);
  color: var(--color-light-700);
  min-height: 200px;
  word-break: break-word;
}
.view-body iframe{
  max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto !important;
}
.view-body--notice {
  min-height: 300px;
}

/* --------------------------------------------------------------------------
   Thumbnail (story view)
   -------------------------------------------------------------------------- */
.view-thumbnail-wrap {
  aspect-ratio: 16 / 9;
  background: var(--color-primary-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.view-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   첨부파일
   -------------------------------------------------------------------------- */
.view-files {
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
}
.view-files--press {
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
  margin-top: 1.5rem;
}
.view-files-label {
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  color: var(--color-light-700);
  margin-bottom: 0.5rem;
}
.view-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0;
}
.view-file-link {
  font-size: var(--font-size-body-sm);
  color: var(--color-primary-600);
  text-decoration: none;
}
.view-file-link:hover {
  text-decoration: underline;
}
.view-file-size {
  font-size: var(--font-size-caption);
  color: var(--color-light-400);
}

/* --------------------------------------------------------------------------
   Archive 문서 다운로드 zone
   -------------------------------------------------------------------------- */
.view-doc-zone {
  border: 2px dashed var(--color-border);
  border-radius: 0.75rem;
  padding: 3rem;
  text-align: center;
  background: var(--color-light-50);
}
.view-doc-desc {
  margin-top: 1rem;
  color: var(--color-light-500);
  font-size: var(--font-size-body);
}
.view-doc-btn-row {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: center;
}
.view-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--color-primary-600);
  color: #fff;
  text-decoration: none;
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  font-family: inherit;
  transition: background-color 0.15s ease;
}
.view-doc-btn:hover {
  background-color: var(--color-primary-700);
}
.view-doc-btn--disabled {
  margin-top: 1.25rem;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  background: var(--color-primary-600);
  color: #fff;
  border: none;
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  font-family: inherit;
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   이전글 / 다음글 네비게이션
   -------------------------------------------------------------------------- */
.prev-next-nav {
  margin-top: 1rem;
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: #fff;
}
.prev-next-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}
.prev-next-item:last-child,
.prev-next-item--last {
  border-bottom: none;
}
.prev-next-item:hover {
  background-color: var(--color-light-50);
}
.prev-next-label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  color: var(--color-primary-600);
  min-width: 52px;
}
.prev-next-label--empty {
  color: var(--color-light-300);
}
.prev-next-subject {
  font-size: var(--font-size-body-sm);
  color: var(--color-light-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prev-next-date {
  margin-left: auto;
  flex-shrink: 0;
  font-size: var(--font-size-caption);
  color: var(--color-light-400);
}
.prev-next-empty-text {
  font-size: var(--font-size-body-sm);
  color: var(--color-light-300);
}
/* div 타입 (링크 없는 빈 이전/다음글) — hover 없음 */
.prev-next-item-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.prev-next-item-empty--last {
  border-bottom: none;
}

/* --------------------------------------------------------------------------
   목록으로 버튼
   -------------------------------------------------------------------------- */
.list-back-wrap {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}
.list-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: var(--font-size-body-sm);
  font-weight: 600;
  color: var(--color-light-700);
  text-decoration: none;
  background: #fff;
  transition: background-color 0.15s ease;
}
.list-back-btn:hover {
  background-color: var(--color-light-50);
}

/* --------------------------------------------------------------------------
   Latest 스킨 — 인애니메이션 공통
   -------------------------------------------------------------------------- */
.inview-anim {
  opacity: 0;
  animation-delay: var(--anim-delay, 0ms);
}

/* --------------------------------------------------------------------------
   Latest 스킨 — notice 카드
   -------------------------------------------------------------------------- */
.latest-notice-item {
  display: block;
  border-radius: 16px;
  background: white;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
.latest-notice-item:hover {
  box-shadow: 0 6px 20px rgba(22, 83, 167, 0.1);
  border-color: var(--color-primary-200);
}
.latest-notice-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.latest-notice-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  background-color: var(--color-light-900);
  color: #fff;
  letter-spacing: 0.02em;
}
.latest-notice-arrow {
  width: 16px;
  height: 16px;
  color: var(--color-light-300);
}
.latest-notice-title {
  font-weight: 500;
  line-height: 1.375;
  color: var(--color-light-800);
  font-size: var(--font-size-body-lg);
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-notice-date-row {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-light-400);
}
.latest-notice-date-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.latest-notice-date-text {
  font-size: var(--font-size-caption);
}
.latest-notice-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--color-light-400);
  font-size: var(--font-size-body-sm);
}

/* --------------------------------------------------------------------------
   Latest 스킨 — gallery-desktop-grid (story / archive)
   -------------------------------------------------------------------------- */
.gallery-desktop-grid {
  display: none;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

/* featured card (grid-row span) */
.gallery-featured-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  grid-row: 1 / 3;
}
.gallery-featured-card:hover .gallery-img,
.gallery-sub-card:hover .gallery-img,
.gallery-few-card:hover .gallery-img {
  transform: scale(1.04);
}

/* gallery-card 안쪽 썸네일 래퍼 */
.gallery-thumb-wrap {
  position: relative;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

/* featured: 썸네일 1:1 고정, 텍스트 영역이 남는 높이 채움 */
.gallery-featured-card .gallery-thumb-wrap {
  flex: 0 0 auto;
  aspect-ratio: 1 / 1;
}
.gallery-featured-card .gallery-card-body-lg {
  flex: 1 1 auto;
}

/* gallery overlay 수정 — position은 class로 */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(9, 31, 84, 0.18);
}

/* gallery img — position은 class로 */
.gallery-img-abs {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 모바일 썸네일 placeholder */
.gallery-mobile-thumb-placeholder {
  width: 88px;
  height: 68px;
  background: var(--color-primary-50);
}

/* 서브 카드 그리드 컨테이너 */
.gallery-sub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: calc(50% - 8px) calc(50% - 8px);
  gap: 1rem;
  grid-row: 1 / 3;
}

/* 1~2개 게시글 전용: 2컬럼 동일 비율 그리드 */
.gallery-few-grid {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.gallery-few-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease;
  text-decoration: none;
}

/* 서브 카드 */
.gallery-sub-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* 카드 텍스트 패딩 — featured */
.gallery-card-body-lg {
  padding: 1rem;
  background-color: white;
}
.gallery-card-title-lg {
  font-weight: 600;
  color: var(--color-light-800);
  font-size: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.375;
}
.gallery-card-date-lg {
  margin-top: 0.5rem;
  color: var(--color-light-400);
  font-size: var(--font-size-caption);
}

/* 카드 텍스트 패딩 — sub */
.gallery-card-body-sm {
  padding: 0.75rem;
  background-color: white;
}
.gallery-card-title-sm {
  font-weight: 500;
  color: var(--color-light-800);
  font-size: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.375;
}
.gallery-card-date-sm {
  margin-top: 4px;
  color: var(--color-light-400);
  font-size: var(--font-size-caption);
}

/* --------------------------------------------------------------------------
   Latest 스킨 — gallery-mobile-list (story / archive)
   -------------------------------------------------------------------------- */
.gallery-mobile-list {
  border-top: 1px solid var(--color-border);
}
.gallery-mobile-list-item {
  border-bottom: 1px solid var(--color-border);
}
.gallery-mobile-card-link {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  text-decoration: none;
  /* 모바일: 카드 border/그림자 제거 (구분선은 list-item의 border-bottom 사용) */
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}
.gallery-mobile-thumb-wrap {
  position: relative;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  width: 88px;
  height: 68px;
}
.gallery-mobile-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}
.gallery-mobile-featured-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-primary-500);
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}
.gallery-mobile-title {
  font-weight: 500;
  line-height: 1.375;
  color: var(--color-light-800);
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gallery-mobile-date {
  margin-top: 4px;
  color: var(--color-light-400);
  font-size: var(--font-size-caption);
}
.gallery-mobile-chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  align-self: center;
  color: var(--color-light-300);
}

/* --------------------------------------------------------------------------
   Latest 스킨 — gallery-mobile-more / empty
   -------------------------------------------------------------------------- */
.gallery-mobile-more {
  margin-top: 1.25rem;
  text-align: center;
}
.gallery-mobile-more .btn-outline {
  font-size: 14px;
  padding: 0.5rem 2rem;
}
.gallery-empty {
  padding: 3rem 0;
  text-align: center;
  color: var(--color-light-400);
}
