/**
 * Aquamarine Rentals Listing — Gallery Styles
 * File: /assets/css/arl-gallery.css
 *
 * Covers:
 *   - Gallery section wrapper
 *   - Main (featured) image display
 *   - Thumbnail grid / strip
 *   - Hover states
 *   - GLightbox skin overrides to match brand colours
 *   - Responsive breakpoints
 *   - Accessibility focus rings
 *
 * Loaded only on property pages and archive pages.
 * Depends on: arl-frontend.css (for CSS custom properties), glightbox CSS.
 *
 * @package    AquamarineRentals
 * @since      1.3.0
 */

/* ── Prevent direct access reminder (CSS has no PHP guard, but doc note) ── */

/* ═══════════════════════════════════════════════════════════════════════════
   1. GALLERY SECTION WRAPPER
   ═══════════════════════════════════════════════════════════════════════════ */

.arl-gallery-section {
  background: #0a1a1a;          /* near-black to frame the images          */
  padding: 0;                   /* no outer padding — images go edge-to-edge */
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. GALLERY LAYOUT — main image + thumbnail strip
   ═══════════════════════════════════════════════════════════════════════════ */

.arl-gallery {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
}

/* ── 2a. Main (featured) image ─────────────────────────────────────────── */

.arl-gallery__main {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0a1a1a;
  cursor: zoom-in;              /* signals the image is clickable           */
}

.arl-gallery__main-img {
  display: block;
  width: 100%;
  height: 520px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease, filter 0.3s ease;
  /* lazy loading applied via loading="lazy" attribute in template          */
}

.arl-gallery__main:hover .arl-gallery__main-img {
  transform: scale(1.02);
  filter: brightness(0.92);
}

/* "View all photos" badge — sits bottom-right of the main image */
.arl-gallery__count-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--arl-radius, 8px);
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: none;         /* badge is decorative; click goes to image  */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background var(--arl-ease, 0.22s ease);
}

.arl-gallery__main:hover .arl-gallery__count-badge {
  background: rgba(0, 123, 127, 0.80); /* teal on hover */
}

/* ── 2b. Thumbnail strip ────────────────────────────────────────────────── */

.arl-gallery__thumbs {
  display: grid;
  /*
   * Auto-fill columns that are at least 120 px wide.
   * On desktop this typically gives 6–8 columns.
   * On mobile columns collapse to fewer.
   */
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 4px;
  padding: 0;                   /* flush with main image                    */
}

/* Individual thumbnail cell */
.arl-gallery__thumb {
  position: relative;
  aspect-ratio: 4 / 3;         /* consistent height regardless of content  */
  overflow: hidden;
  background: #111;
  cursor: pointer;
  display: block;               /* anchor tag resets                        */

  /* Accessibility: visible focus ring */
  outline: none;
}

.arl-gallery__thumb:focus-visible {
  outline: 3px solid var(--arl-primary, #007B7F);
  outline-offset: 2px;
  z-index: 2;
}

.arl-gallery__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.78);
  transition: transform 0.35s ease, filter 0.25s ease;
}

.arl-gallery__thumb:hover .arl-gallery__thumb-img,
.arl-gallery__thumb:focus-visible .arl-gallery__thumb-img {
  transform: scale(1.08);
  filter: brightness(1);
}

/* Active / selected thumbnail (JS adds this class) */
.arl-gallery__thumb.is-active .arl-gallery__thumb-img {
  filter: brightness(1);
  outline: 3px solid var(--arl-primary, #007B7F);
  outline-offset: -3px;
}

/* "+N more" overlay on the last thumbnail when there are hidden images */
.arl-gallery__thumb--more::after {
  content: attr(data-more);   /* e.g. "+5" injected via JS data attribute  */
  position: absolute;
  inset: 0;
  background: rgba(0, 95, 99, 0.72); /* --arl-secondary with alpha         */
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: background var(--arl-ease, 0.22s ease);
}

.arl-gallery__thumb--more:hover::after {
  background: rgba(0, 123, 127, 0.80);
}

/* ── 2c. No-image placeholder ───────────────────────────────────────────── */

.arl-gallery__placeholder {
  width: 100%;
  height: 360px;
  background: linear-gradient(135deg, var(--arl-primary, #007B7F), var(--arl-secondary, #005F63));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 64px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. GLightbox SKIN OVERRIDES — brand colours
   ═══════════════════════════════════════════════════════════════════════════ */

/* Overlay background */
.glightbox-clean .goverlay {
  background: rgba(0, 10, 10, 0.96);
}

/* Close button */
.glightbox-clean .gclose {
  background: var(--arl-primary, #007B7F);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  opacity: 1;
  transition: background var(--arl-ease, 0.22s ease);
}
.glightbox-clean .gclose:hover { background: var(--arl-secondary, #005F63); }
.glightbox-clean .gclose svg path { fill: #ffffff; }

/* Prev / Next arrows */
.glightbox-clean .gnext,
.glightbox-clean .gprev {
  background: rgba(0, 123, 127, 0.75);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  transition: background var(--arl-ease, 0.22s ease);
}
.glightbox-clean .gnext:hover,
.glightbox-clean .gprev:hover { background: var(--arl-primary, #007B7F); }
.glightbox-clean .gnext svg path,
.glightbox-clean .gprev svg path { fill: #ffffff; }

/* Counter / description */
.glightbox-clean .gdesc-inner .gslide-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tablet ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .arl-gallery__main-img { height: 420px; }
  .arl-gallery__thumbs   { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .arl-gallery__main-img { height: 280px; }
  .arl-gallery__thumbs   { grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .arl-gallery__count-badge { font-size: 11px; padding: 6px 10px; bottom: 10px; right: 10px; }
}

/* ── Small mobile ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .arl-gallery__main-img { height: 220px; }
  .arl-gallery__thumbs   { grid-template-columns: repeat(3, 1fr); }
}
