/* Rounded Card Style Kiosk Magazine Banner Widget CSS */
.kiosk-banner-widget {
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

.kiosk-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background-color: rgba(0, 0, 0, 0.06);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.kiosk-progress-bar {
  height: 100%;
  background-color: #2563eb;
  border-radius: 9999px;
  transition: all 0.5s ease-out;
}

.kiosk-grid {
  display: flex;
  flex-direction: row;
  gap: 16px;
  width: 100%;
  box-sizing: border-box; /* 좌우 패딩이 폭 안에 포함되도록(넘침 방지) */
}

/* Mobile: horizontal swipe scroller (Apple rf-cards-scroller style) */
@media (max-width: 767px) {
  .kiosk-grid {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 22px; /* 카드 사이 간격 22px */
    padding: 22px 44px 6px 44px; /* 상22 / 좌·우44(가운데 정렬용 peek 공간, peek=44-gap22=22px) / 하6 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }
  .kiosk-grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge */
  }
  .kiosk-card {
    flex: 0 0 100%; /* 폭 = 뷰포트-좌우패딩. 첫·마지막 포함 모두 가운데 정렬됨 */
    scroll-snap-align: center; /* 화면 정중앙 스냅 */
  }
}

@media (min-width: 768px) {
  /* Fixed widget height so hover only changes WIDTH, never height.
     The bottom edge stays put → no hover-boundary jitter. */
  .kiosk-grid {
    height: 480px;
  }
  .kiosk-card {
    flex: 1 1 0%;
    height: 100%;
    transition:
      flex 0.6s cubic-bezier(0.25, 1, 0.5, 1),
      transform 0.3s ease,
      box-shadow 0.3s ease,
      border-color 0.3s ease;
  }
  /* Image fills the leftover vertical space instead of being sized by width */
  .kiosk-thumb-wrap {
    aspect-ratio: auto;
    flex: 1 1 auto;
    min-height: 0;
  }
  /* Keep title height stable regardless of card width */
  .kiosk-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .kiosk-card.is-active,
  .kiosk-grid:hover .kiosk-card:hover {
    flex: 2.2 1 0% !important;
    border-color: #2563eb !important;
    box-shadow:
      0 10px 25px -5px rgba(37, 99, 235, 0.12),
      0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
  }
  .kiosk-grid:hover .kiosk-card:not(:hover) {
    flex: 1 1 0% !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  }
}

/* Rounded Card Base Styles */
.kiosk-card {
  background-color: #ffffff;
  border-radius: 1rem; /* 16px rounded rectangle */
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-sizing: border-box;
}

.kiosk-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.kiosk-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 14px;
  font-size: 12px;
}

.kiosk-category-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kiosk-cat-primary {
  font-weight: 700;
  color: #fff;
  font-size: 14px;
  padding: 3px 10px;
  border-radius: 15px;
  background-color: var(--po);
}

.kiosk-cat-sub {
  color: #4b5563;
}

.kiosk-index {
  font-size: 16px;
  color: var(--po);
  padding: 2px 8px;
  font-weight: 200;
}

.kiosk-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: #f3f4f6;
  border-radius: 0.75rem; /* 12px rounded image */
  overflow: hidden;
  margin-bottom: 14px;
}

.kiosk-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.kiosk-card:hover .kiosk-thumb-img {
  transform: scale(1.05);
}

.kiosk-badge {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.kiosk-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.kiosk-card:hover .kiosk-title {
  color: var(--po);
}

.kiosk-excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kiosk-card-footer {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--po);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--po);
}

.kiosk-more {
  font-weight: 700;
  color: var(--po);
}

/* Mobile side arrow buttons (shown instead of a bottom nav bar) */
.kiosk-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #111827;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kiosk-arrow:active {
  background: #ffffff;
}

.kiosk-arrow-prev {
  left: 8px;
}

.kiosk-arrow-next {
  right: 8px;
}

/* Desktop uses the accordion + auto-cycle, so no arrows */
@media (min-width: 768px) {
  .kiosk-arrow {
    display: none;
  }
}

/* Dark Mode Support */
body.dark .kiosk-card {
  background-color: #18181b;
  border-color: #27272a;
  color: #f4f4f5;
}

body.dark .kiosk-title {
  color: #f4f4f5;
}

body.dark .kiosk-excerpt {
  color: #a1a1aa;
}

body.dark .kiosk-arrow {
  background: rgba(24, 24, 27, 0.9);
  border-color: #3f3f46;
  color: #f4f4f5;
}
