/* ==========================================================================
   PHOTO GRID  —  Airbnb-style 1 large + 2×2 tile layout
   Displayed at the top of the accommodation detail card, full-bleed.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GRID CONTAINER
   -------------------------------------------------------------------------- */
.lux-photo-grid {
  position:   relative;
  display:    grid;
  /* 3fr left (main) / 2fr right (tiles) — matches Airbnb proportions */
  grid-template-columns: 3fr 2fr;
  grid-template-rows:    420px;
  gap:                   3px;
  width:                 100%;
  /* No border-radius on the container — the card's overflow:hidden on
     .entry-content clips the corners cleanly. */
  background:            var(--lux-line); /* gap colour */
  order:                 0;              /* first in the flex column */
}

/* --------------------------------------------------------------------------
   2. MAIN PHOTO (left, full height)
   -------------------------------------------------------------------------- */
.lux-photo-grid__main {
  display:  block;
  overflow: hidden;
}

.lux-photo-grid__main img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
  transition: transform .4s ease;
}
.lux-photo-grid__main:hover img,
.lux-photo-grid__main:focus img {
  transform: scale(1.03);
}

/* --------------------------------------------------------------------------
   3. TILE GRID (right, 2×2)
   -------------------------------------------------------------------------- */
.lux-photo-grid__tiles {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows:    1fr 1fr;
  gap:                   3px;
}

.lux-photo-grid__tile {
  display:  block;
  overflow: hidden;
}

.lux-photo-grid__tile img {
  width:      100%;
  height:     100%;
  object-fit: cover;
  display:    block;
  transition: transform .4s ease;
}
.lux-photo-grid__tile:hover img,
.lux-photo-grid__tile:focus img {
  transform: scale(1.05);
}

/* --------------------------------------------------------------------------
   4. "SHOW ALL PHOTOS" BUTTON  (bottom-right corner of the grid)
   -------------------------------------------------------------------------- */
.lux-photo-grid__show-all {
  position:       absolute;
  bottom:         14px;
  right:          14px;
  display:        inline-flex;
  align-items:    center;
  gap:            7px;
  padding:        8px 14px;
  background:     #fff;
  border:         1px solid rgba(0, 0, 0, .18);
  border-radius:  8px;
  font-size:      .78rem;
  font-weight:    600;
  letter-spacing: .02em;
  color:          var(--lux-ink);
  cursor:         pointer;
  transition:     background .15s, box-shadow .15s;
  z-index:        10;
  white-space:    nowrap;
}
.lux-photo-grid__show-all:hover {
  background:  var(--lux-paper);
  box-shadow:  0 2px 8px rgba(0,0,0,.12);
}
.lux-photo-grid__show-all svg {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. ADAPTIVE: fewer than 5 photos
   -------------------------------------------------------------------------- */

/* 1 photo: hide tiles panel, main spans full width */
.lux-photo-grid[data-count="1"] {
  grid-template-columns: 1fr;
}
.lux-photo-grid[data-count="1"] .lux-photo-grid__tiles { display: none; }

/* 2-4 photos: show tiles but fewer cells — CSS handles gracefully via auto */

/* 5+ photos: show the "Show all" button (hidden by default for ≤5) */
.lux-photo-grid[data-count="1"] .lux-photo-grid__show-all,
.lux-photo-grid[data-count="2"] .lux-photo-grid__show-all,
.lux-photo-grid[data-count="3"] .lux-photo-grid__show-all,
.lux-photo-grid[data-count="4"] .lux-photo-grid__show-all,
.lux-photo-grid[data-count="5"] .lux-photo-grid__show-all {
  display: none;
}

/* --------------------------------------------------------------------------
   6. RESPONSIVE: collapse to single-column on small screens
   -------------------------------------------------------------------------- */
@media (max-width: 48em) {
  .lux-photo-grid {
    grid-template-columns: 1fr;
    grid-template-rows:    260px;
  }
  .lux-photo-grid__tiles {
    display: none;
  }
  /* Always show "Show all" on mobile so user can reach other photos */
  .lux-photo-grid__show-all {
    display: inline-flex !important;
  }
}

/* --------------------------------------------------------------------------
   7. FANCYBOX THUMBNAIL STRIP  —  repositioned to bottom (horizontal)

   Fancybox 3's default thumbs layout is a vertical strip on the right.
   We override it to a horizontal scrollable bar at the bottom, matching
   the Airbnb / modern gallery convention.
   -------------------------------------------------------------------------- */

/* Reposition container: full width at the bottom, fixed height */
.fancybox-thumbs {
  top:    auto      !important;
  bottom: 0         !important;
  left:   0         !important;
  right:  0         !important;
  width:  100%      !important;
  height: 90px      !important;
}

/* Horizontal scroll on the list */
.fancybox-thumbs-x .fancybox-thumbs__list {
  overflow-x: auto  !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  height: 100% !important;
}

/* Thumbnail items: inline-block so they flow horizontally */
.fancybox-thumbs__list a {
  display: inline-block !important;
  float:   none         !important;
  width:   120px        !important;
  height:  78px         !important;
  max-width: none       !important;
  max-height: none      !important;
}

/* Shrink the main image area to make room for the bottom strip
   (overrides the default right:212px that Fancybox sets) */
.fancybox-show-thumbs .fancybox-inner {
  right:  0   !important;
  bottom: 90px !important;
}

/* Active thumbnail indicator — default is 6px, reduce to 2px */
.fancybox-thumbs__list a::before {
  border-width: 2px !important;
}
