/* ============================================================
   assets/gallery.css — Gallery page specific styles
   Uses tokens from assets/style.css only.
   ============================================================ */

/* ----- BREADCRUMB ----- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 0;
  margin: 0;
  list-style: none;
}
.breadcrumb__item { display: flex; align-items: center; gap: 8px; }
.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: rgba(255, 255, 255, 0.5);
}
.breadcrumb__link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
}
.breadcrumb__link:hover, .breadcrumb__link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}
.breadcrumb__current { color: #ffffff; font-weight: 500; }

/* ----- HERO BANNER ----- */
.gallery-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 360px;
  background:
    linear-gradient(135deg, rgba(31, 58, 95, 0.80), rgba(31, 58, 95, 0.55)),
    url('https://images.unsplash.com/photo-1566073771259-6a8506099945?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80')
      center / cover no-repeat;
  color: #ffffff;
  overflow: hidden;
}
.gallery-hero__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 140px 24px 44px;
}
.gallery-hero__title {
  color: #ffffff;
  margin-bottom: 10px;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
}
.gallery-hero__subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  max-width: 560px;
  margin-bottom: 22px;
}

/* ----- FILTER TABS ----- */
.filter-tabs-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0 8px;
  margin-bottom: 8px;
}
.filter-tabs-wrapper::-webkit-scrollbar { display: none; }

.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 0 4px;
  width: max-content;
  min-width: 100%;
  justify-content: center;
}
.filter-tabs__button {
  flex-shrink: 0;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand);
  background: transparent;
  border: 2px solid var(--brand);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.filter-tabs__button:hover,
.filter-tabs__button:focus-visible {
  background: rgba(31, 58, 95, 0.06);
}
.filter-tabs__button[aria-pressed="true"] {
  background: var(--brand);
  color: #ffffff;
}

/* Live status */
.gallery__status {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ----- MASONRY GRID ----- */
.gallery__grid {
  column-count: 4;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin: 0 0 16px;
  position: relative;
}
.gallery-item[hidden] { display: none; }

.gallery-item__trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}

.gallery-item__image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.gallery-item__trigger:hover .gallery-item__image,
.gallery-item__trigger:focus-visible .gallery-item__image {
  transform: scale(1.03);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: rgba(31, 58, 95, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.gallery-item__trigger:hover .gallery-item__overlay,
.gallery-item__trigger:focus-visible .gallery-item__overlay {
  opacity: 1;
}
.gallery-item__overlay svg {
  width: 40px;
  height: 40px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gallery-item__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  margin: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.gallery-item:hover .gallery-item__caption,
.gallery-item:focus-within .gallery-item__caption {
  opacity: 1;
}

/* Always show captions where hover isn't available */
@media (hover: none) {
  .gallery-item__caption { opacity: 1; }
}

/* ----- LIGHTBOX ----- */
.lightbox-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 92vw;
  width: max-content;
  color: var(--text);
}
.lightbox-dialog::backdrop {
  background: rgba(0, 0, 0, 0.92);
}

.lightbox {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 92vw;
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox__close:hover,
.lightbox__close:focus-visible { background: #ffffff; }
.lightbox__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.lightbox__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  min-height: 200px;
}

.lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.lightbox__nav:hover,
.lightbox__nav:focus-visible { background: #ffffff; }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__nav svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid #eef1f5;
}
.lightbox__caption {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
  flex: 1;
  min-width: 0;
}
.lightbox__counter {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Scroll lock while dialog is open */
body.lightbox-open { overflow: hidden; }

/* ----- ROOM SHORTCUT STRIP ----- */
.room-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.room-shortcut {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}
.room-shortcut:hover,
.room-shortcut:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.room-shortcut__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.room-shortcut__body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.room-shortcut__name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand);
  margin: 0;
}
.room-shortcut__link {
  font-size: 0.85rem;
  color: var(--accent-dark);
  font-weight: 600;
}

/* ----- VIDEO TOUR ----- */
.video-tour {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  max-width: 900px;
  margin: 0 auto;
}
.video-tour__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.video-tour:hover .video-tour__thumb,
.video-tour:focus-within .video-tour__thumb { opacity: 0.85; }

.video-tour__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background 0.2s ease;
}
.video-tour__play:hover,
.video-tour__play:focus-visible {
  background: var(--accent-dark);
  transform: translate(-50%, -50%) scale(1.05);
}
.video-tour__play svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  margin-left: 4px;
}

.video-tour__note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 16px;
}

/* ----- CTA BAND ----- */
.gallery-cta {
  background: linear-gradient(135deg, var(--brand), #34598a);
  color: #ffffff;
  padding: 64px 24px;
  text-align: center;
}
.gallery-cta__inner {
  max-width: 720px;
  margin: 0 auto;
}
.gallery-cta__title {
  color: #ffffff;
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  margin-bottom: 14px;
}
.gallery-cta__text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 28px;
}
.gallery-cta__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.gallery-cta__actions .btn--outline {
  color: #ffffff;
  border-color: #ffffff;
}
.gallery-cta__actions .btn--outline:hover,
.gallery-cta__actions .btn--outline:focus-visible {
  background: #ffffff;
  color: var(--brand);
}

/* ----- RESPONSIVE ----- */
@media (max-width: 1024px) {
  .gallery__grid { column-count: 3; }
  .room-shortcuts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .gallery-hero { min-height: 320px; }
  .gallery-hero__inner { padding: 120px 20px 40px; }
}

@media (max-width: 768px) {
  .gallery-hero { min-height: 300px; }
  .gallery-hero__inner { padding: 108px 20px 36px; }

  .filter-tabs { justify-content: flex-start; }

  .gallery__grid { column-count: 3; }

  .room-shortcuts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .gallery__grid { column-count: 2; column-gap: 12px; }
  .gallery-item { margin-bottom: 12px; }
}

@media (max-width: 480px) {
  .gallery-hero { min-height: 260px; }
  .gallery-hero__inner { padding: 96px 16px 30px; }
  .gallery-hero__title { font-size: 1.85rem; }

  .filter-tabs__button { padding: 9px 18px; font-size: 0.85rem; }

  .room-shortcuts { grid-template-columns: 1fr; }

  .gallery-cta { padding: 48px 20px; }
  .gallery-cta__actions { flex-direction: column; align-items: stretch; }
  .gallery-cta__actions .btn { width: 100%; }

  /* Larger lightbox controls for touch */
  .lightbox__nav { width: 48px; height: 48px; }
  .lightbox__close { width: 48px; height: 48px; }
  .lightbox__image { max-height: 65vh; }
}

/* ----- REDUCED MOTION ----- */
@media (prefers-reduced-motion: reduce) {
  .gallery-item__image,
  .gallery-item__overlay,
  .gallery-item__caption,
  .filter-tabs__button,
  .room-shortcut,
  .video-tour__thumb,
  .video-tour__play,
  .lightbox__close,
  .lightbox__nav {
    transition: none !important;
  }
  .gallery-item__trigger:hover .gallery-item__image,
  .gallery-item__trigger:focus-visible .gallery-item__image {
    transform: none;
  }
  .video-tour__play:hover,
  .video-tour__play:focus-visible {
    transform: translate(-50%, -50%);
  }
}