@charset "UTF-8";
/* 갤러리형
---------------------------------------------------------------------------- */
.xet-content__gallery {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}

/* 이미지 상자 위에 텍스트가 얹히는 카드 */
.xet-content__gallery > .item {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: var(--card-ratio, 1 / 1);
  background: #2a2a2a;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}
.xet-content__gallery > .item > div + div {
  margin-top: 6px;
}

/* 썸네일: 카드 전체를 채우는 배경 이미지 (약간 어둡게) */
.xet-content__gallery > .item .item__thumbnail {
  position: absolute;
  inset: 0;
  z-index: 0;
  margin: 0;
}
.xet-content__gallery > .item .item__thumbnail a,
.xet-content__gallery > .item .item__thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
}
.xet-content__gallery > .item .item__thumbnail img {
  object-fit: cover;
  transition: transform 0.4s ease;
}
/* hover: 카드 영역은 고정, 안의 이미지만 확대(밖으로 안 나감) + 살짝 어둡게 */
.xet-content__gallery > .item:hover .item__thumbnail img {
  transform: scale(1.08);
}
/* 어둡게 + 하단 그라디언트(텍스트 가독성) */
.xet-content__gallery > .item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  /* 그라디언트 오버레이가 클릭을 가로채지 않도록 → 이미지 영역 클릭 시 링크로 이동 */
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.25) 45%,
    rgba(0, 0, 0, 0.8) 100%
  );
  transition: background 0.3s ease;
}
.xet-content__gallery > .item:hover::after {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.45) 45%,
    rgba(0, 0, 0, 0.85) 100%
  );
}

/* 텍스트들은 이미지 위(오버레이)로 */
.xet-content__gallery > .item > *:not(.item__thumbnail) {
  position: relative;
  z-index: 2;
}
.xet-content__gallery > .item .item__category a {
  color: #fff !important;
}
.xet-content__gallery > .item .item__subject .subject {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #fff !important;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.35;
  word-break: keep-all;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.xet-content__gallery > .item .item__meta {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 10px;
}
.xet-content__gallery > .item .item__meta,
.xet-content__gallery > .item .item__meta span,
.xet-content__gallery > .item .item__meta a {
  color: rgba(255, 255, 255, 0.85) !important;
}

.xet-content__gallery > .item .item__meta .author {
  font-weight: 700;
}
/* 한 줄 가로 슬라이더 + 이전/다음 버튼 (PC/모바일 공통)
---------------------------------------------------------------------------- */
.gallery-carousel {
  position: relative;
}

/* JS가 .xet-content__gallery 를 .gallery-carousel 로 감싸면
   그리드 → 가로 한 줄 슬라이더로 전환된다 */
.gallery-carousel .xet-content__gallery {
  display: flex;
  grid-template-columns: none;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.gallery-carousel .xet-content__gallery::-webkit-scrollbar {
  display: none;
}
.gallery-carousel .xet-content__gallery > .item {
  flex: 0 0 100%; /* 모바일: 한 화면에 1장 */
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

/* 이전/다음 버튼 */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.gallery-nav--prev {
  left: 8px;
}
.gallery-nav--next {
  right: 8px;
}
.gallery-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.gallery-nav[hidden] {
  display: none;
}

/* 모바일: 좌우 여백(kiosk처럼 중앙 정렬 peek) */
@media (max-width: 767px) {
  .gallery-carousel .xet-content__gallery {
    padding: 0 32px 2px;
    scroll-padding: 0 32px;
  }
}

/* 태블릿(≥768px): 한 줄에 2장 */
@media (min-width: 768px) {
  .gallery-carousel .xet-content__gallery > .item {
    flex: 0 0 calc((100% - 16px) / 2);
    scroll-snap-align: start;
  }
}

/* 데스크톱(≥992px): 한 줄에 4장, 간격 30px */
@media (min-width: 992px) {
  .gallery-carousel .xet-content__gallery {
    gap: 30px;
  }
  .gallery-carousel .xet-content__gallery > .item {
    flex: 0 0 calc((100% - 90px) / 4);
  }
}
