/* ============================================
   Doors Replaced — Door Range Gallery
   Filterable archive + slider shortcode tiles
   Matches site's dark cinematic + copper accent
   ============================================ */

/* ── Archive: Hero ── */
.dr-door-range-hero {
  padding: 7rem 2rem 3rem;
  text-align: center;
  background: var(--near-black);
}

/* ── Filter pills (mirror .project-filter look) ── */
.dr-door-filter {
  position: sticky;
  top: 64px;
  z-index: 100;
  background: rgba(18, 18, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.dr-door-filter::-webkit-scrollbar { display: none; }

.dr-door-filter__pill {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ash, #a0a0a0);
  border-radius: 100px;
  padding: 0.4rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.dr-door-filter__pill:hover {
  border-color: var(--copper);
  color: #fff;
}
.dr-door-filter__pill--active,
.dr-door-filter__pill[aria-pressed="true"] {
  background: var(--copper);
  border-color: var(--copper);
  color: #000;
  font-weight: 600;
}

/* ── Gallery wrapper ── */
.dr-door-gallery {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.dr-door-gallery__header {
  margin-bottom: 1.5rem;
  text-align: center;
}
.dr-door-gallery__title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
}

/* ── Grid layout (archive page) ── */
.dr-door-gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
@media (max-width: 1024px) {
  .dr-door-gallery__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .dr-door-gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}
@media (max-width: 480px) {
  .dr-door-gallery__grid { grid-template-columns: 1fr; }
}

/* ── Slider layout (shortcode) ── */
.dr-door-gallery--slider .dr-door-gallery__rail-wrap {
  position: relative;
}
.dr-door-gallery__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 4rem) / 5);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-behavior: smooth;
  padding-bottom: 0.5rem;
}
.dr-door-gallery__rail::-webkit-scrollbar { display: none; }
.dr-door-gallery__rail > .dr-door-tile {
  scroll-snap-align: start;
}
@media (max-width: 1024px) {
  .dr-door-gallery__rail { grid-auto-columns: calc((100% - 2rem) / 3); }
}
@media (max-width: 768px) {
  .dr-door-gallery__rail { grid-auto-columns: calc((100% - 1rem) / 2); }
}
@media (max-width: 480px) {
  .dr-door-gallery__rail { grid-auto-columns: 80%; }
}

.dr-door-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
  backdrop-filter: blur(8px);
}
.dr-door-gallery__arrow:hover {
  background: var(--copper);
  border-color: var(--copper);
  color: #000;
}
.dr-door-gallery__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.dr-door-gallery__arrow--prev { left: -8px; }
.dr-door-gallery__arrow--next { right: -8px; }
@media (max-width: 480px) {
  .dr-door-gallery__arrow--prev { left: 4px; }
  .dr-door-gallery__arrow--next { right: 4px; }
}

/* ── Tile ── */
.dr-door-tile {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 1 / 2;
  cursor: default;
  transition: transform 0.3s ease, border-color 0.3s ease;
  outline: none;
}
.dr-door-tile:hover,
.dr-door-tile:focus-visible {
  transform: translateY(-2px);
  border-color: var(--copper);
}
.dr-door-tile__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
  padding: 15px;
}
/* Architectural renders are tighter crops — use contain so the door sits inside the frame */
.dr-door-tile[data-range="architectural"] .dr-door-tile__image {
  object-fit: contain;
}
.dr-door-tile__image--placeholder {
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}

/* ── Hover overlay ── */
.dr-door-tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
  padding: 1rem;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.96) 0%,
    rgba(10, 10, 10, 0.85) 35%,
    rgba(10, 10, 10, 0) 75%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.dr-door-tile:hover .dr-door-tile__overlay,
.dr-door-tile:focus-visible .dr-door-tile__overlay,
.dr-door-tile:focus-within .dr-door-tile__overlay {
  opacity: 1;
}

.dr-door-tile__code {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--copper);
  text-transform: uppercase;
}
.dr-door-tile__name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
  margin: 0;
}
.dr-door-tile__panel {
  font-size: 0.875rem;
  color: var(--light);
}
.dr-door-tile__dims {
  font-size: 0.8125rem;
  color: var(--ash);
}
.dr-door-tile__price {
  font-size: 0.8125rem;
  color: var(--white);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* ── Mobile: overlay always visible ── */
@media (hover: none), (max-width: 640px) {
  .dr-door-tile__overlay {
    opacity: 1;
    background: linear-gradient(
      to top,
      rgba(10, 10, 10, 0.94) 0%,
      rgba(10, 10, 10, 0.75) 40%,
      rgba(10, 10, 10, 0) 70%
    );
  }
}

/* ── Filter visibility (only on archive, never on slider) ── */
.dr-door-gallery--archive[data-active-filter="stormbloc"] .dr-door-tile:not([data-range="stormbloc"]),
.dr-door-gallery--archive[data-active-filter="mr"] .dr-door-tile:not([data-range="mr"]),
.dr-door-gallery--archive[data-active-filter="architectural"] .dr-door-tile:not([data-range="architectural"]),
.dr-door-gallery--archive[data-active-filter="pivot"] .dr-door-tile:not([data-range="pivot"]) {
  display: none;
}
