/* Wrapper co giãn theo container cha */
.idl-gallery {
  --gap: 14px;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0,0,0,.06);
  max-width:  min(1100px, 100%);
  margin:     0 auto;
  display:    grid;
  grid-template-rows: auto auto;
  gap:        var(--gap);
}

/* Ảnh lớn: giữ tỉ lệ 4/5 như mẫu, bo góc nhẹ */
.idl-gallery-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Khung ảnh lớn co giãn theo chiều ngang, không cần media-queries */
.idl-gallery-main .idl-main-img {
    width: 51rem;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Hàng thumbnail: cuộn ngang, snap mượt, auto-wrap thành nhiều dòng nếu đủ chỗ */
.idl-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
  justify-content: flex-start;
  /* Khi không đủ rộng sẽ cho phép cuộn ngang */
  scroll-snap-type: x mandatory;
  padding-bottom: 2px;
}

/* Mỗi thumb là 1 button để dễ a11y + focus */
.idl-thumb {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: clamp(8px, 1vw, 12px);
  flex: 0 0 auto;
  scroll-snap-align: start;
  outline: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
  transition: transform .15s ease, box-shadow .15s ease, outline-color .15s ease;
}

/* Kích thước thumb: fluid bằng clamp -> ~72–104px tuỳ bề ngang */
.idl-thumb img {
  display: block;
  width: clamp(64px, 11vw, 104px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* Active/hover state */
.idl-thumb:is(:hover, :focus-visible) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}
.idl-thumb.is-active {
  outline: 2px solid #111;       /* viền đen mảnh như mẫu */
  outline-offset: 2px;
}
