/* =========================================
   활동 페이지 전용 스타일
   도근환 선거 캠프
   ========================================= */

/* ----------------------------------------
   활동 필터 탭
   ---------------------------------------- */
.activity-tabs {
  margin-bottom: var(--space-8);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.activity-tabs::-webkit-scrollbar {
  display: none;
}

.activity-tabs__list {
  display: flex;
  list-style: none;
  gap: var(--space-1, 4px);
  border-bottom: 2px solid var(--color-border);
}

.activity-tabs__btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  font-family: inherit;
  color: var(--color-text-light);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.activity-tabs__btn:hover {
  color: var(--color-accent);
}

.activity-tabs__btn--active,
.activity-tabs__btn[aria-pressed="true"] {
  color: var(--color-primary);
  font-weight: var(--font-bold);
  border-bottom-color: var(--color-accent);
}

.activity-tabs__btn:focus,
.activity-tabs__btn:focus-visible {
  outline: none;
  outline-offset: 0;
}

/* ----------------------------------------
   활동 카드 목록 (리스트 레이아웃)
   ---------------------------------------- */
.activity-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-4);
}

/* 필터링 숨기기 */
.activity-card[hidden] {
  display: none;
}

.activity-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  height: 100%;
}

.activity-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* 썸네일 */
.activity-card__thumb {
  flex-shrink: 0;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.activity-card__thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
}

/* 카드 본문 */
.activity-card__body {
  padding: var(--space-4) var(--space-6);
  flex: 1;
}

.activity-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

/* 전체 탭일 때 태그 숨김, 개별 탭 선택 시 표시 */
.activity-card__tag {
  display: none;
}

.activity-list--filtered .activity-card__tag {
  display: inline-block;
}

.activity-card__date {
  font-size: var(--text-xs);
  color: var(--color-text-xlight);
  font-weight: var(--font-medium);
}

/* 카테고리 태그 */
.activity-card__tag {
  display: inline-block;
  padding: 2px var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
}

.activity-card__tag--field {
  background-color: #D1FAE5;
  color: #065F46;
}

.activity-card__tag--press {
  background-color: var(--color-primary-xlight);
  color: var(--color-primary-dark);
}

.activity-card__tag--council {
  background-color: #FEF3C7;
  color: #92400E;
}

.activity-card__title {
  font-size: var(--text-base, 1rem);
  font-weight: var(--font-bold);
  color: var(--color-text);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-3);
}

.activity-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
}

/* ----------------------------------------
   게시판 목록 (언론보도, 5분 자유발언)
   ---------------------------------------- */
.board-list {
  list-style: none;
  border-top: 2px solid var(--color-primary, #1B3A5C);
}

.board-list__item {
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.board-list__item--empty {
  padding: var(--space-8, 2rem) 0;
  text-align: center;
  color: var(--color-text-light, #6b7280);
  font-size: var(--text-sm, 0.875rem);
}

.board-list__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  padding: var(--space-4, 1rem) var(--space-2, 0.5rem);
  color: var(--color-text, #1a1a1a);
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.board-list__link:hover {
  background-color: var(--color-secondary, #f9fafb);
}

.board-list__subject {
  flex: 1;
  font-size: var(--text-base, 1rem);
  font-weight: var(--font-medium, 500);
  line-height: var(--leading-snug, 1.375);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-list__date {
  flex-shrink: 0;
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-xlight, #9ca3af);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .board-list__link {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1, 0.25rem);
  }

  .board-list__subject {
    white-space: normal;
  }
}

/* ----------------------------------------
   게시판 표 스타일 (5분 자유발언)
   ---------------------------------------- */
.board-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--color-primary, #1B3A5C);
}

.board-table th {
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--font-bold, 700);
  color: var(--color-text, #1a1a1a);
  background-color: var(--color-bg-gray, #f9fafb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  text-align: left;
  white-space: nowrap;
}

.board-table td {
  padding: var(--space-3, 0.75rem) var(--space-4, 1rem);
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text, #1a1a1a);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  vertical-align: middle;
}

.board-table tbody tr:hover {
  background-color: var(--color-secondary, #f9fafb);
}

.board-table__no {
  width: 60px;
  text-align: center !important;
  color: var(--color-text-light, #6b7280) !important;
}

.board-table__subject {
  width: auto;
}

.board-table__subject a {
  color: var(--color-text, #1a1a1a);
  text-decoration: none;
  line-height: var(--leading-relaxed, 1.625);
  transition: color 0.15s ease;
}

.board-table__subject a:hover {
  color: var(--color-primary, #3b82f6);
}

.board-table__subject small {
  display: inline;
  margin-left: var(--space-2, 0.5rem);
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-xlight, #9ca3af);
  font-weight: normal;
}

.board-table__source {
  width: 100px;
  text-align: center !important;
  white-space: nowrap;
  font-size: var(--text-xs, 0.75rem) !important;
  color: var(--color-text-light, #6b7280) !important;
}

.board-table__date {
  width: 100px;
  text-align: center !important;
  white-space: nowrap;
  color: var(--color-text-xlight, #9ca3af) !important;
  font-size: var(--text-xs, 0.75rem) !important;
}

@media (max-width: 767px) {
  .board-table__no {
    display: none;
  }

  .board-table th.board-table__no {
    display: none;
  }

  .board-table__source {
    display: none;
  }

  .board-table th.board-table__source {
    display: none;
  }

  .board-table__subject small {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
}

/* ----------------------------------------
   사진 갤러리 (3열 그리드)
   ---------------------------------------- */
.gallery-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.gallery-item__btn {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.gallery-item__btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.gallery-item__img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.gallery-item__img-placeholder span {
  font-size: var(--text-xs);
  color: var(--color-text-xlight);
}

.gallery-item__btn:hover .gallery-item__img-placeholder {
  transform: scale(1.05);
}

/* 호버 오버레이 */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(59, 130, 246, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item__btn:hover .gallery-item__overlay,
.gallery-item__btn:focus-visible .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__zoom-icon {
  font-size: 2rem;
  color: var(--color-text-white);
  font-weight: var(--font-bold);
  line-height: 1;
}

/* ----------------------------------------
   라이트박스 오버레이
   ---------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
}

/* .lightbox--active 클래스로 표시 */
.lightbox--active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 960px;
  padding: var(--space-4);
}

.lightbox__img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__close {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: var(--color-text-white);
  font-size: var(--text-xl);
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-fast);
}

.lightbox__close:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.lightbox__close:focus-visible {
  outline: 2px solid var(--color-text-white);
  outline-offset: 2px;
}

.lightbox__prev,
.lightbox__next {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  color: var(--color-text-white);
  font-size: 2rem;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-fast);
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.lightbox__prev:focus-visible,
.lightbox__next:focus-visible {
  outline: 2px solid var(--color-text-white);
  outline-offset: 2px;
}

.lightbox__img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-lg, 8px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* ----------------------------------------
   반응형: 태블릿 (768px 이상)
   ---------------------------------------- */
@media (min-width: 768px) {
  .activity-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
  }
}

/* ----------------------------------------
   반응형: 데스크탑 (1024px 이상)
   ---------------------------------------- */
@media (min-width: 1024px) {
  .activity-list {
    grid-template-columns: repeat(4, 1fr);
  }

  .activity-tabs__btn {
    padding: var(--space-3) var(--space-6);
  }
}
