/* Accordion interaction adapted from the supplied React Bits reference. */
.destination-gallery-section { scroll-margin-top: 100px; }
.destination-gallery-section .section-title { margin-bottom: 24px; }
.destination-gallery {
  --ag-gap: 12px;
  --ag-duration: 600ms;
  --ag-ease: cubic-bezier(.22, 1, .36, 1);
  display: flex;
  gap: var(--ag-gap);
  height: var(--ag-height, clamp(560px, 66vw, 920px));
  margin: 0;
  padding: 4px 0 12px;
  list-style: none;
  perspective: 1200px;
  transition: height var(--ag-duration) var(--ag-ease);
}
.destination-gallery .ag-panel {
  --ag-grow: 1;
  --ag-tilt: -8deg;
  position: relative;
  flex: var(--ag-grow) 1 0%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border-radius: 16px;
  transform: rotateY(var(--ag-tilt));
  transition: flex-grow var(--ag-duration) var(--ag-ease), transform var(--ag-duration) var(--ag-ease);
}
.destination-gallery .ag-panel[data-active] { --ag-grow: 3.25; --ag-tilt: 0deg; }
.destination-gallery .ag-link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
  border-radius: inherit;
  background: #292929;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 8px rgb(0 0 0 / 12%);
  -webkit-tap-highlight-color: transparent;
}
.destination-gallery .ag-link:focus-visible { outline: 3px solid var(--red, #a5311f); outline-offset: 4px; }
.destination-gallery .ag-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ag-media-size, 720px);
  max-width: none;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%);
  filter: grayscale(1) brightness(.65);
  transition: filter var(--ag-duration) var(--ag-ease);
}
.destination-gallery .ag-panel[data-active] .ag-image { object-fit: contain; transform: translate(-50%, -50%); filter: grayscale(0) brightness(1); }
.destination-gallery .ag-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgb(6 0 16 / 4%) 35%, rgb(6 0 16 / 20%) 65%, rgb(6 0 16 / 82%) 100%);
  pointer-events: none;
}
.destination-gallery .ag-label {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 300ms var(--ag-ease), transform var(--ag-duration) var(--ag-ease);
}
.destination-gallery .ag-panel[data-active] .ag-label { opacity: 1; transform: none; }
.destination-gallery .ag-name { font-size: clamp(18px, 1.8vw, 24px); font-weight: 650; line-height: 1.3; }
.destination-gallery .ag-zh { font-size: .75em; font-weight: 400; margin-left: 8px; }
.destination-gallery .ag-arrow { margin-left: auto; font-size: 24px; line-height: 1; }
@media (max-width: 640px) {
  .destination-gallery { flex-direction: column; height: var(--ag-height, 580px); gap: 10px; }
  .destination-gallery .ag-panel { transform: rotateX(calc(-1 * var(--ag-tilt))); }
  .destination-gallery .ag-image { width: 100%; height: var(--ag-media-size, 400px); }
  .destination-gallery .ag-label { left: 20px; right: 20px; bottom: 18px; opacity: 1; transform: none; }
  .destination-gallery .ag-name { font-size: 17px; }
  .destination-gallery .ag-panel[data-active] .ag-name { font-size: 23px; }
  .destination-gallery .ag-zh, .destination-gallery .ag-arrow { opacity: 0; }
  .destination-gallery .ag-panel[data-active] .ag-zh,
  .destination-gallery .ag-panel[data-active] .ag-arrow { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .destination-gallery,
  .destination-gallery .ag-panel,
  .destination-gallery .ag-image,
  .destination-gallery .ag-label { transition: none; transform: none; }
  .destination-gallery .ag-image,
  .destination-gallery .ag-panel[data-active] .ag-image { transform: translate(-50%, -50%); }
}
