/* ==========================================================================
   Mirage Furniture — Settings (#settings)
   The lookbook: real Mirage pieces styled together in lifestyle scenes,
   shown as an editorial masonry grid with a click-to-open lightbox.
   Built by scripts/sections/settings.js. Light section.
   ========================================================================== */

.settings {
  position: relative;
  z-index: 1;                       /* scrolls over the pinned hero */
  width: 100%;
  background: var(--color-bg);
  padding: clamp(4rem, 10vh, 8rem) var(--nav-pad-x);
}

.settings__head {
  max-width: 52rem;
  margin: 0 auto clamp(2rem, 5vh, 3.5rem);
  text-align: center;
}

.settings__eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-sm);
  color: var(--color-text-body);
}

.settings__title {
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
}

/* --- Masonry grid (CSS columns) ------------------------------------------- */
.settings__grid {
  max-width: 76rem;
  margin: 0 auto;
  column-count: 3;
  column-gap: clamp(1rem, 2vw, 1.75rem);
}
@media (max-width: 900px) {
  .settings__grid { column-count: 2; }
}
@media (max-width: 560px) {
  .settings__grid { column-count: 1; }
}

/* --- Scene tile ----------------------------------------------------------- */
.setting {
  break-inside: avoid;
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 clamp(1rem, 2vw, 1.75rem);
  padding: 0;
  border: 0;
  overflow: hidden;
  background: var(--color-bg-alt);   /* neutral block until the image loads */
  color: var(--color-hero-text);
  text-align: left;
  cursor: pointer;
}
.setting--portrait { aspect-ratio: 3 / 4; }
.setting--landscape { aspect-ratio: 4 / 3; }
.setting--square { aspect-ratio: 1 / 1; }

.setting__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.setting:hover .setting__img {
  transform: scale(1.04);
}

.setting__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.1) 42%,
    rgba(0, 0, 0, 0) 70%
  );
  pointer-events: none;
}

.setting__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: clamp(1rem, 1.6vw, 1.4rem);
}
.setting__title {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: clamp(0.9rem, 1.1vw, 1.05rem);
  line-height: 1.25;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
}
.setting__pieces {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  line-height: 1.4;
  opacity: 0.92;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

/* --- Lightbox ------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox__panel {
  position: relative;
  z-index: 1;
  max-width: 80rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}
.lightbox__cap {
  margin-top: 1.1rem;
  text-align: center;
  color: var(--color-hero-text);
}
.lightbox__cap-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-sm);
}
.lightbox__cap-pieces {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  opacity: 0.8;
}
.lightbox__close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: var(--color-hero-text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .setting__img,
  .lightbox {
    transition: none;
  }
}
