/* TRIOOO Room Gallery Lightbox Modal & Panel Interactions */

.room-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1), visibility 280ms;
}

.room-gallery-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.room-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: #0d1612;
  cursor: pointer;
}

.room-gallery-modal__dialog {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  background: #0d1612;
  color: var(--linen);
  pointer-events: auto;
}

/* Header */
.room-gallery-modal__header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  background: #0d1612;
  border-bottom: 1px solid rgba(243, 241, 232, 0.09);
}

.room-gallery-modal__tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.room-gallery-modal__tabs::-webkit-scrollbar {
  display: none;
}

.room-gallery-modal__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(243, 241, 232, 0.07);
  border: 1px solid rgba(243, 241, 232, 0.14);
  color: rgba(243, 241, 232, 0.75);
  font-family: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 200ms ease;
}

.room-gallery-modal__tab:hover {
  background: rgba(243, 241, 232, 0.14);
  color: var(--linen);
  border-color: rgba(243, 241, 232, 0.28);
}

.room-gallery-modal__tab.is-active {
  background: var(--linen);
  color: var(--forest);
  border-color: var(--linen);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.room-gallery-modal__tab-count {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.25;
}
.room-gallery-modal__tab.is-active .room-gallery-modal__tab-count {
  background: rgba(36, 62, 53, 0.16);
  color: var(--forest);
  font-weight: 700;
}
.room-gallery-modal__tab:not(.is-active) .room-gallery-modal__tab-count {
  background: rgba(243, 241, 232, 0.12);
  color: rgba(243, 241, 232, 0.85);
}

.room-gallery-modal__meta {
  display: flex;
  align-items: center;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.08em;
  color: rgba(243, 241, 232, 0.65);
}

.room-gallery-modal__current {
  color: var(--linen);
}

.room-gallery-modal__sep {
  margin: 0 4px;
  opacity: 0.4;
}

.room-gallery-modal__close {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(243, 241, 232, 0.08);
  border: 1px solid rgba(243, 241, 232, 0.18);
  color: var(--linen);
  font-family: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
}

.room-gallery-modal__close:hover {
  background: rgba(243, 241, 232, 0.2);
  border-color: var(--linen);
  transform: scale(1.02);
}

.room-gallery-modal__close-icon {
  font-size: 12px;
  line-height: 1;
}

/* Stage / Main Viewer */
.room-gallery-modal__stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px 72px;
  background: #0d1612;
  overflow: hidden;
}

.room-gallery-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(22, 34, 28, 0.9);
  border: 1px solid rgba(243, 241, 232, 0.2);
  color: var(--linen);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.room-gallery-modal__nav--prev {
  left: 24px;
}

.room-gallery-modal__nav--next {
  right: 24px;
}

.room-gallery-modal__nav:hover {
  background: var(--linen);
  color: var(--forest);
  border-color: var(--linen);
  transform: translateY(-50%) scale(1.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.room-gallery-modal__nav:focus-visible {
  outline: 2px solid var(--linen);
  outline-offset: 3px;
}

.room-gallery-modal__viewer {
  max-width: min(94vw, 1100px);
  max-height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.room-gallery-modal__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

.room-gallery-modal__img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: calc(85vh - 200px);
  min-height: 200px;
}

.room-gallery-modal__img {
  max-width: 100%;
  max-height: calc(85vh - 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: opacity 180ms ease, transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  user-select: none;
  -webkit-user-select: none;
}

.room-gallery-modal__img.is-animating {
  opacity: 0.3;
  transform: scale(0.985);
}

.room-gallery-modal__caption {
  margin-top: 14px;
  text-align: center;
  max-width: 640px;
  padding: 0 16px;
}

.room-gallery-modal__photo-title {
  display: block;
  font-family: var(--display);
  font-size: clamp(16px, 1.35vw, 20px);
  color: var(--linen);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.room-gallery-modal__photo-desc {
  margin: 0;
  font-family: var(--text);
  font-size: clamp(13px, 0.95vw, 14.5px);
  color: rgba(243, 241, 232, 0.75);
  line-height: 1.5;
}

/* Thumbnails */
.room-gallery-modal__thumbs-bar {
  position: relative;
  z-index: 10;
  padding: 12px 24px 18px;
  background: #0d1612;
  border-top: 1px solid rgba(243, 241, 232, 0.09);
  display: flex;
  justify-content: center;
}

.room-gallery-modal__thumbs-track {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(243, 241, 232, 0.25) transparent;
}
.room-gallery-modal__thumbs-track::-webkit-scrollbar {
  height: 4px;
}
.room-gallery-modal__thumbs-track::-webkit-scrollbar-track {
  background: transparent;
}
.room-gallery-modal__thumbs-track::-webkit-scrollbar-thumb {
  background: rgba(243, 241, 232, 0.25);
  border-radius: 999px;
}

.room-gallery-modal__thumb {
  flex: 0 0 auto;
  width: 68px;
  height: 50px;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(243, 241, 232, 0.08);
  padding: 0;
  cursor: pointer;
  opacity: 0.45;
  transition: all 180ms ease;
  position: relative;
}

.room-gallery-modal__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.room-gallery-modal__thumb:hover {
  opacity: 0.88;
  transform: translateY(-2px);
}

.room-gallery-modal__thumb.is-active {
  opacity: 1;
  border-color: var(--linen);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transform: scale(1.08);
}

.room-gallery-modal__thumb:focus-visible {
  outline: 2px solid var(--linen);
  outline-offset: 2px;
}

/* In-page room panel interactive enhancements */
.room__panel {
  cursor: pointer;
}
.room__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.16);
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 1;
  pointer-events: none;
}
.room__panel:hover::before {
  opacity: 1;
}

.room__panel figcaption button {
  cursor: pointer;
  pointer-events: auto;
}

.room__panel-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(18, 28, 23, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(243, 241, 232, 0.25);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0.85;
  transform: none !important;
  transition: all 200ms ease;
}
.room__panel.is-active figcaption span:last-child {
  transform: none !important;
}
.room__panel:hover .room__panel-hint {
  opacity: 1;
  background: var(--linen);
  color: var(--forest);
  border-color: var(--linen);
}

.room__bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.room__open-gallery-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--linen);
  border: 1px solid rgba(36, 62, 53, 0.3);
  font-family: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 200ms ease;
}
.room__open-gallery-cta:hover {
  background: #182a24;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.room__open-gallery-cta:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .room-gallery-modal__header {
    padding: 12px 16px;
    gap: 10px;
  }
  .room-gallery-modal__tabs {
    gap: 6px;
  }
  .room-gallery-modal__tab {
    padding: 6px 12px;
    font-size: 12.5px;
  }
  .room-gallery-modal__tab-count {
    padding: 1px 5px;
    font-size: 10px;
  }
  .room-gallery-modal__meta {
    font-size: 12px;
  }
  .room-gallery-modal__close {
    padding: 6px 12px;
    font-size: 12px;
  }
  .room-gallery-modal__close-text {
    display: none;
  }
  .room-gallery-modal__close-icon {
    font-size: 14px;
  }
  .room-gallery-modal__stage {
    padding: 8px 12px;
  }
  .room-gallery-modal__nav {
    width: 40px;
    height: 40px;
    background: rgba(16, 26, 21, 0.85);
  }
  .room-gallery-modal__nav--prev {
    left: 8px;
  }
  .room-gallery-modal__nav--next {
    right: 8px;
  }
  .room-gallery-modal__img-wrap {
    max-height: calc(85vh - 220px);
  }
  .room-gallery-modal__img {
    max-height: calc(85vh - 220px);
  }
  .room-gallery-modal__caption {
    margin-top: 8px;
    padding: 0 8px;
  }
  .room-gallery-modal__photo-title {
    font-size: 14px;
  }
  .room-gallery-modal__photo-desc {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .room-gallery-modal__thumbs-bar {
    padding: 8px 12px 12px;
  }
  .room-gallery-modal__thumb {
    width: 54px;
    height: 40px;
  }
}
