/**
 * GBSA Main Page Styles
 * kubfweb 메인 페이지 디자인 기반 구현
 * Prefix: bb-main-
 */

/* 헤더/네비게이션 - 다른 페이지와 동일한 너비 */
body:has(.bb-main-content) #tnb {
  max-width: 1652px;
  margin-left: auto;
  margin-right: auto;
}
body:has(.bb-main-content) #gnb .gnb_wrap {
  max-width: 1652px;
}
body:has(.bb-main-content) .subTopLocNav {
  max-width: 1652px;
}

/* ctWrap - 전체 폭 유지 (슬라이더가 전체 화면으로 나오도록) */
/* main.css가 #ctWrap을 100%로 설정하므로 그대로 둔다 */

/* 콘텐츠 영역만 1692px로 제한 */
.bb-main-content {
  max-width: 1692px;
  margin: 0 auto;
  padding: 0;
}

/* main.css가 #sideBar를 숨기는 것 복원 (모바일 메뉴) */
@media all and (max-width: 980px) {
  #sideBar {
    display: block !important;
  }
}

/* 슬라이더 버튼 테마 색상 */
#ctWrap .mainVisualImage .mvSlider ul li .WCMSScontS > dl dd a.themeBgColor {
  background: #092077;
}

/* Container */
.bb-main-container {
  max-width: 1692px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* ========================================
   Scoreboard Section
   ======================================== */
.bb-main-scoreboard-section {
  padding: 40px 0;
}

/* 메인 페이지에서 bb-sb-hero의 Box/Plays 버튼 숨김 */
.bb-main-scoreboard-section .bb-sb-btn-box,
.bb-main-scoreboard-section .bb-sb-btn-plays {
  display: none;
}

/* League Tabs */
.bb-main-league-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 0.8vw, 20px);
  justify-content: center;
  margin-top: clamp(8px, 0.52vw, 13px);
  max-width: none;
  width: 100%;
}

.bb-main-league-tab {
  width: 100%;
  height: clamp(36px, 2.2vw, 55px);
  border-radius: clamp(6px, 0.4vw, 10px);
  font-family: 'Roboto', 'Noto Sans KR', sans-serif;
  font-size: clamp(13px, 0.76vw, 19px);
  font-weight: 500;
  line-height: clamp(14px, 0.84vw, 21px);
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid #ddd;
  background: #fff;
  color: #000;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(5px, 0.32vw, 8px) clamp(8px, 0.48vw, 12px);
}

.bb-main-league-tab.active {
  background: #092077;
  color: #fff;
  border-color: #ddd;
}

.bb-main-league-tab:hover:not(.active) {
  border-color: #092077;
}

/* ========================================
   Board Section
   ======================================== */
.bb-main-board-section {
  padding: clamp(30px, 2.4vw, 60px) 0;
  background: #fff;
}

.bb-main-board-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(30px, 3vw, 75px);
}

.bb-main-board {
  background: #fff;
}

.bb-main-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: clamp(6px, 0.4vw, 10px);
  border-bottom: 2px solid #000;
  margin-bottom: clamp(12px, 0.72vw, 18px);
  height: clamp(32px, 1.92vw, 48px);
}

.bb-main-board-title {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: clamp(18px, 1.1vw, 28px);
  font-weight: 800;
  color: #000;
  line-height: 1.2;
}

.bb-main-board-more {
  width: clamp(20px, 1.2vw, 30px);
  height: clamp(20px, 1.2vw, 30px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bb-main-board-more svg {
  width: clamp(15px, 0.88vw, 22px);
  height: clamp(15px, 0.88vw, 22px);
}

.bb-main-board-list {
  display: flex;
  flex-direction: column;
  gap: clamp(9px, 0.56vw, 14px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.bb-main-board-item {
  display: flex;
  align-items: center;
  gap: clamp(7px, 0.44vw, 11px);
  height: clamp(20px, 1.2vw, 30px);
}

.bb-main-board-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(50px, 3vw, 75px);
  height: clamp(20px, 1.2vw, 30px);
  border-radius: 2px;
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: clamp(13px, 0.8vw, 20px);
  font-weight: 500;
  color: #fff;
  flex-shrink: 0;
}

.bb-main-board-tag.notice {
  background: #3bc8fc;
}

.bb-main-board-tag.news {
  background: #b8ed55;
}

.bb-main-board-tag.media {
  background: #faca5b;
}

.bb-main-board-item-title {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: clamp(14px, 0.85vw, 21px);
  font-weight: 400;
  color: #000;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

.bb-main-board-item-title:hover {
  text-decoration: underline;
}

/* ========================================
   Gallery Section
   ======================================== */
.bb-main-gallery-section {
  background: #fff;
  margin-bottom: clamp(28px, 1.88vw, 47px);
  padding: 0;
}

.bb-main-gallery-section .bb-main-container {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  box-shadow: 0px 8px 13px -3px rgba(0, 0, 0, 0.07);
  padding: clamp(24px, 1.6vw, 40px);
}

.bb-main-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: clamp(10px, 0.68vw, 17px);
  border-bottom: 2px solid #000;
  margin-bottom: clamp(12px, 0.8vw, 20px);
}

.bb-main-gallery-title {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: clamp(18px, 1.1vw, 28px);
  font-weight: 800;
  color: #000;
  line-height: 1.2;
}

.bb-main-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 1.6vw, 40px);
}

.bb-main-gallery-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

.bb-main-gallery-thumb {
  width: 100%;
  aspect-ratio: 300 / 185;
  object-fit: cover;
  border-radius: 0;
  margin-bottom: clamp(8px, 0.52vw, 13px);
  background: #d9d9d9;
}

.bb-main-gallery-item-title {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  font-size: clamp(14px, 0.88vw, 18px);
  font-weight: 500;
  color: #000;
  line-height: 1.5;
  margin: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ========================================
   Teams Section
   ======================================== */
.bb-main-teams-section {
  padding: clamp(28px, 1.88vw, 47px) 0 clamp(36px, 2.4vw, 60px);
  background: #fff;
}

.bb-main-teams-section .bb-main-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(18px, 1.16vw, 29px);
}

.bb-main-teams-select-wrap {
  flex-shrink: 0;
}

.bb-main-teams-select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: clamp(6px, 0.36vw, 9px) clamp(28px, 1.6vw, 36px) clamp(6px, 0.36vw, 9px) clamp(10px, 0.6vw, 15px);
  font-family: 'Roboto', 'Noto Sans KR', sans-serif;
  font-size: clamp(12px, 0.64vw, 14px);
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  height: clamp(32px, 2vw, 42px);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.bb-main-teams-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 0.88vw, 22px);
  align-items: center;
  flex: 1;
}

.bb-main-team-item {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.24vw, 6px);
  cursor: pointer;
  transition: opacity 0.3s;
  height: clamp(32px, 1.92vw, 48px);
  text-decoration: none;
}

.bb-main-team-item:hover {
  opacity: 0.7;
}

.bb-main-team-item-logo {
  width: clamp(32px, 1.92vw, 48px);
  height: clamp(32px, 1.92vw, 48px);
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

.bb-main-team-item-name {
  font-family: 'Roboto', 'Noto Sans KR', sans-serif;
  font-size: clamp(11px, 0.64vw, 16px);
  font-weight: 500;
  color: #1c2434;
  line-height: clamp(16px, 0.96vw, 24px);
  white-space: nowrap;
}

/* ========================================
   Footer fix
   ======================================== */
#footer .w_inner,
#footer .ft_wrap {
  max-width: 1540px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1572px) {
  #footer .w_inner,
  #footer .ft_wrap {
    margin-left: 1.6rem;
    margin-right: 1.6rem;
  }
}

/* ========================================
   Responsive - 대형 모니터
   ======================================== */
@media (min-width: 1600px) {
}

/* ========================================
   Responsive - 태블릿 가로 이하
   ======================================== */
@media (max-width: 1200px) {
  .bb-main-container {
    padding: 0 15px;
  }

  .bb-main-board-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .bb-main-gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .bb-main-teams-grid {
    gap: 15px;
  }
}

/* ========================================
   Responsive - 태블릿 세로
   ======================================== */
@media (max-width: 992px) {
  .bb-main-container {
    padding: 0 15px;
  }

  .bb-main-scoreboard-section {
    padding: 25px 0;
  }

  .bb-main-league-tabs {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .bb-main-league-tab {
    font-size: 14px;
    padding: 10px 15px;
    height: auto;
  }
}

/* ========================================
   Responsive - 모바일 가로
   ======================================== */
@media (max-width: 768px) {
  .bb-main-container {
    padding: 0 15px;
  }

  .bb-main-scoreboard-section {
    padding: 15px 0;
  }

  .bb-main-league-tabs {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-bottom: 15px;
  }

  .bb-main-league-tab {
    font-size: 13px;
    padding: 10px 12px;
    height: auto;
    white-space: normal;
    line-height: 1.3;
  }

  .bb-main-board-section {
    padding: 25px 0;
  }

  .bb-main-board-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .bb-main-gallery-section {
    padding: 25px 0;
  }

  .bb-main-gallery-section .bb-main-container {
    padding: 12px;
  }

  .bb-main-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Teams Section - 가로 스크롤 */
  .bb-main-teams-section {
    padding: 25px 0;
  }

  .bb-main-teams-section .bb-main-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .bb-main-teams-filter {
    width: auto;
    min-width: 100px;
  }

  .bb-main-teams-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    width: 100%;
    padding-bottom: 10px;
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .bb-main-teams-grid::-webkit-scrollbar {
    height: 4px;
  }

  .bb-main-teams-grid::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
  }

  .bb-main-teams-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
  }

  .bb-main-team-item {
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: auto;
    height: auto;
    gap: 6px;
  }

  .bb-main-team-item-logo {
    width: 52px;
    height: 52px;
  }

  .bb-main-team-item-name {
    font-size: 11px;
    text-align: center;
    max-width: 70px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ========================================
   Responsive - 모바일 세로
   ======================================== */
@media (max-width: 480px) {
  .bb-main-container {
    padding: 0 10px;
  }


  .bb-main-scoreboard-section {
    padding: 12px 0;
  }

  .bb-main-league-tabs {
    gap: 5px;
    padding-bottom: 12px;
  }

  .bb-main-league-tab {
    font-size: 12px;
    padding: 10px 12px;
  }

  .bb-main-board-section,
  .bb-main-teams-section {
    padding: 15px 0;
  }

  .bb-main-gallery-section {
    padding: 15px 0;
  }

  .bb-main-gallery-section .bb-main-container {
    padding: 10px;
  }

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

  /* Teams - 더 작은 사이즈 */
  .bb-main-teams-grid {
    gap: 12px;
    margin: 0 -10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .bb-main-team-item-logo {
    width: 44px;
    height: 44px;
  }

  .bb-main-team-item-name {
    font-size: 10px;
    max-width: 60px;
  }

  .bb-main-teams-filter {
    font-size: 11px;
    height: 36px;
    min-width: 90px;
  }
}
