/* 이벤트 목록 — 35_Event_1 main-content > board-list-2, .idx-ev1 스코프 */

.idx-ev1 {
  --idx-ev1-bar: #272a31;
  --idx-ev1-panel: #272a31;
  --idx-ev1-caption: #3b3f46;
  --idx-ev1-page: #eeff00;
  width: 100%;
  max-width: 1550px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  box-sizing: border-box;
}

.idx-ev1__bar {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background-color: var(--idx-ev1-bar);
  border-radius: 16px;
  overflow: hidden;
}

.idx-ev1__bar-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: block;
}

.idx-ev1__bar-title {
  margin: 0;
  font: 600 16px/1.2 var(--font-sans, "Inter", Helvetica, sans-serif);
  letter-spacing: -0.08px;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idx-ev1__panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  background-color: var(--idx-ev1-panel);
  border-radius: 16px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.idx-ev1__grid-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.idx-ev1__grid {
  list-style: none;
  margin: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  grid-auto-rows: auto;
  gap: 5px;
  min-width: min(100%, 900px);
  box-sizing: border-box;
}

.idx-ev1__grid > li:nth-child(1) {
  grid-area: 1 / 1 / 2 / 2;
}
.idx-ev1__grid > li:nth-child(2) {
  grid-area: 1 / 3 / 2 / 4;
}
.idx-ev1__grid > li:nth-child(3) {
  grid-area: 2 / 1 / 3 / 2;
}
.idx-ev1__grid > li:nth-child(4) {
  grid-area: 2 / 3 / 3 / 4;
}
.idx-ev1__grid > li:nth-child(5) {
  grid-area: 3 / 1 / 4 / 2;
}
.idx-ev1__grid > li:nth-child(6) {
  grid-area: 3 / 3 / 4 / 4;
}
.idx-ev1__grid > li:nth-child(7) {
  grid-area: 4 / 1 / 5 / 2;
}
.idx-ev1__grid > li:nth-child(8) {
  grid-area: 1 / 2 / 2 / 3;
}
.idx-ev1__grid > li:nth-child(9) {
  grid-area: 1 / 4 / 2 / 5;
}
.idx-ev1__grid > li:nth-child(10) {
  grid-area: 2 / 2 / 3 / 3;
}
.idx-ev1__grid > li:nth-child(11) {
  grid-area: 2 / 4 / 3 / 5;
}
.idx-ev1__grid > li:nth-child(12) {
  grid-area: 3 / 2 / 4 / 3;
}
.idx-ev1__grid > li:nth-child(13) {
  grid-area: 3 / 4 / 4 / 5;
}
.idx-ev1__grid > li:nth-child(14) {
  grid-area: 4 / 2 / 5 / 3;
}

.idx-ev1__card {
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* API 빈 목록: 데스크톱 그리드 nth-child 레이아웃보다 우선 */
.idx-ev1__grid > li.idx-ev1__card--empty:nth-child(n) {
  grid-area: auto;
  grid-column: 1 / -1;
}

.idx-ev1__link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  height: 100%;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  box-sizing: border-box;
}

.idx-ev1__link:focus-visible {
  outline: 2px solid var(--idx-ev1-page);
  outline-offset: 2px;
}

.idx-ev1__thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 10px;
  background-color: #1f2228;
  background-image: url(../img/d_event.png);
  background-size: cover;
  background-position: 50% 50%;
  background-repeat: no-repeat;
}

.idx-ev1__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background-color: var(--idx-ev1-caption);
  border-radius: 10px;
  font: 600 14px/1.2 var(--font-sans, "Inter", Helvetica, sans-serif);
  letter-spacing: -0.07px;
  color: #fff;
  text-align: center;
}

.idx-ev1__pager {
  display: flex;
  min-height: 30px;
  align-items: center;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
}

.idx-ev1__page-current {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 14px/1.45 var(--font-sans, "Inter", Helvetica, sans-serif);
  letter-spacing: -0.07px;
  color: var(--idx-ev1-page);
}

/* 태블릿·모바일: 한 줄에 카드 2개 */
@media (max-width: 1024px) {
  .idx-ev1__grid-wrap {
    overflow-x: visible;
  }

  .idx-ev1__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .idx-ev1__grid > li:nth-child(n) {
    grid-area: auto;
  }
}
