/* Project detail page */

/* Base */
.project-detail-page {
  background: var(--page);
  color: #171717;
}

.project-detail-page img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Header: transparent, like home page */
.project-detail-page .site-header,
.project-detail-page .project-detail-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  padding: 8px 0;
  background: rgba(17, 19, 18, 0);
  border-bottom: 1px solid rgba(216, 185, 130, 0);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

.project-detail-page .site-header.is-scrolled,
.project-detail-page .site-header:has(.main-nav.is-open),
.project-detail-page .project-detail-header.is-scrolled,
.project-detail-page .project-detail-header:has(.main-nav.is-open) {
  background: rgba(17, 19, 18, 0.75);
  border-bottom-color: rgba(216, 185, 130, 0.18);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.project-detail-page .header-inner {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  min-height: 92px;
  gap: 36px;
  align-items: center;
}

.project-detail-page .logo img {
  width: 92px;
  height: auto;
}

.project-detail-page .main-nav {
  display: grid;
  grid-template-columns: repeat(4, 86px) 78px;
  justify-content: end;
  align-items: center;
  gap: 32px;
  font-size: 13px;
}

.project-detail-page .main-nav a,
.project-detail-page .phone,
.project-detail-page .header-actions .btn,
.project-detail-page .btn-secondary {
  color: var(--text);
}

.project-detail-page .main-nav > a {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.project-detail-page .main-nav a:hover {
  color: var(--accent);
}

.project-detail-page .header-actions {
  display: flex;
  width: 212px;
}

.project-detail-page .header-actions .btn {
  width: 100%;
  border-color: var(--accent);
  background: transparent;
  white-space: nowrap;
}

.project-detail-page .header-actions .btn:hover {
  background: rgba(216, 185, 130, 0.12);
}

.project-detail-page .menu-toggle span {
  background: var(--text);
}

/* Hero */
.detail-hero {
  position: relative;
  min-height: 680px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--bg);
}

.detail-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(17, 19, 18, 0.58) 0%,
    rgba(17, 19, 18, 0.42) 48%,
    rgba(17, 19, 18, 0.30) 100%
  );
}

.detail-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding-top: 54px;
  text-align: center;
}

.detail-hero-title-line {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) 1px minmax(0, 1.5fr);
  align-items: center;
  justify-content: stretch;
  gap: 58px;
  width: min(86vw, 1120px);
  max-width: min(86vw, 1120px);
  margin: 0 auto;
  padding: 0 18px;
  color: var(--text);
  font-size: clamp(20px, 1.65vw, 32px);
  line-height: 1.32;
  font-weight: 400;
  letter-spacing: 0.025em;
  text-transform: none;
  white-space: normal;
}

.detail-hero-title-line span {
  display: inline-block;
  min-height: 2.64em;
  text-align: center;
}

.detail-hero-title-line .title-divider {
  flex: 0 0 1px;
  width: 1px;
  height: 1.15em;
  background: rgba(244, 241, 236, 0.75);
}

/* Project info */
.ref-project-info {
  padding: 92px 0 0;
  background: var(--page);
  color: #171717;
}

.ref-project-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 96px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(168, 134, 83, 0.22);
}

.ref-project-description {
  max-width: 820px;
}

.ref-project-description .section-kicker,
.ref-project-meta dt {
  color: var(--accent-dark);
}

.ref-project-description h2 {
  max-width: 720px;
  margin: 18px 0 34px;
  color: #171717;
  font-size: clamp(30px, 3.1vw, 54px);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: 0;
}

.ref-project-description p {
  max-width: 760px;
  margin: 0 0 20px;
  color: #3f3b36;
  font-size: 17px;
  line-height: 1.78;
}

.ref-project-description p:last-child {
  margin-bottom: 0;
}

.ref-project-meta {
  display: grid;
  gap: 28px;
  margin: 0;
}

.ref-project-meta div {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(168, 134, 83, 0.22);
}

.ref-project-meta div:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.ref-project-meta dt {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ref-project-meta dd {
  margin: 0;
  color: #171717;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 400;
}

/* Overview */
.detail-overview {
  padding: 78px 0;
  background: var(--page);
  color: #171717;
}

.detail-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 86px;
  align-items: stretch;
}

.detail-text {
  max-width: 820px;
}

.detail-text .section-kicker,
.detail-gallery .section-kicker {
  color: var(--accent-dark);
}

.detail-text h2 {
  max-width: 640px;
  margin-bottom: 34px;
  color: #171717;
  font-size: clamp(24px, 1.9vw, 34px);
  line-height: 1.18;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.detail-text p {
  max-width: 720px;
  margin-bottom: 20px;
  color: #3f3b36;
  font-size: 17px;
  line-height: 1.78;
}

.detail-text p:last-child {
  margin-bottom: 0;
}

/* Project meta */
.detail-meta {
  align-self: stretch;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0 0 48px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(168, 134, 83, 0.28);
  box-shadow: none;
}

.detail-meta-item {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(168, 134, 83, 0.24);
}

.detail-meta-item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.detail-meta-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 17px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.detail-meta-item strong {
  display: block;
  color: #171717;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 700;
}

/* Plan */
.detail-plan {
  padding: 88px 0;
  background: var(--page);
  color: #171717;
}

.detail-plan-list {
  display: grid;
  gap: 72px;
}

.detail-plan-title {
  margin: 0 0 24px;
  color: var(--accent-dark);
  font-family: var(--font-main);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-plan-image {
  width: 100%;
  background: var(--page);
  border: none;
  overflow: hidden;
}

.detail-plan-image img {
  width: 100%;
  height: auto;
  display: block;
}

.detail-plan-compare {
  background: var(--page);
  border: none;
  overflow: hidden;
}

.detail-plan-compare-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f6f4ef;
  user-select: none;
}

.detail-plan-before,
.detail-plan-after {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.detail-plan-after-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 0 var(--compare-position, 50%));
}

.detail-plan-after {
  width: 100%;
  min-width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-plan-after-wrap .detail-plan-after {
  width: 100%;
  max-width: none;
}

.detail-plan-label {
  position: absolute;
  top: 18px;
  z-index: 3;
  padding: 0;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-plan-label-before {
  left: 18px;
}

.detail-plan-label-after {
  right: 18px;
}

.detail-plan-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-position, 50%);
  z-index: 4;
  width: 1px;
  background: rgba(168, 134, 83, 0.78);
  transform: translateX(-50%);
  pointer-events: none;
}

.detail-plan-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(168, 134, 83, 0.86);
  background: rgba(244, 242, 237, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  transform: translate(-50%, -50%) rotate(45deg);
}

.detail-plan-divider::after {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.detail-plan-range {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}

/* Gallery */
.detail-gallery {
  padding: 88px 0 96px;
  background: var(--page);
  color: #171717;
}

.detail-gallery-head {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: end;
  margin-bottom: 42px;
}

.detail-gallery-head .section-title {
  color: #171717;
}

.detail-gallery-head .section-title span {
  color: var(--accent-dark);
}

.detail-gallery-head p {
  max-width: 280px;
  color: #6b665f;
  font-size: 14px;
  line-height: 1.6;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover img {
  transform: scale(1.035);
}

/* Lightbox */
.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 11, 10, 0.94);
  user-select: none;
}

.project-lightbox.is-open {
  display: flex;
}

.lightbox-content {
  position: relative;
  width: min(86vw, 1280px);
  max-height: 86vh;
}

.lightbox-content img {
  width: 100%;
  max-height: 86vh;
  object-fit: contain;
}

.lightbox-counter {
  position: absolute;
  left: 0;
  top: -34px;
  color: var(--text-muted);
  font-size: 14px;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  z-index: 3;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.lightbox-close {
  top: 26px;
  right: 34px;
  font-size: 42px;
  line-height: 1;
}

.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  font-size: 72px;
  line-height: 1;
  opacity: 0.86;
}

.lightbox-prev {
  left: 34px;
}

.lightbox-next {
  right: 34px;
}

.lightbox-close:hover,
.lightbox-arrow:hover {
  color: var(--accent);
}

/* Contact from the main page */
.project-detail-page .contact {
  background: var(--page);
}

/* Tablet */
@media (max-width: 1100px) {
  .project-detail-page .header-inner {
    grid-template-columns: 120px 1fr;
    gap: 28px;
  }

  .project-detail-page .header-actions {
    display: none;
  }

  .project-detail-page .main-nav {
    grid-template-columns: repeat(4, 80px) 78px;
    justify-content: end;
    gap: 16px;
    font-size: 12px;
  }

  .detail-overview-grid {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .ref-project-info-grid {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .ref-project-meta {
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
  }

  .ref-project-meta div {
    padding-bottom: 0;
    border-bottom: none;
  }

  .detail-meta {
    max-width: 560px;
    padding: 34px 0 0;
    border-left: none;
    border-top: 1px solid rgba(168, 134, 83, 0.28);
  }
}

/* Mobile */
@media (max-width: 760px) {
  .project-detail-page .site-header,
  .project-detail-page .project-detail-header {
    padding: 8px 0;
  }

  .project-detail-page .header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .project-detail-page .logo img {
    width: 74px;
  }

  .project-detail-page .main-nav {
    display: flex;
    gap: 30px;
    font-size: 18px;
    justify-content: center;
  }

  .project-detail-page .main-nav > a {
    min-height: 0;
  }

  .detail-hero {
    min-height: 560px;
  }

  .detail-hero-content {
    padding-top: 76px;
  }

  .detail-hero-title-line {
    display: flex;
    width: auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    white-space: normal;
    font-size: clamp(20px, 6vw, 28px);
  }

  .detail-hero-title-line span {
    min-height: 0;
    text-align: center;
  }

  .detail-hero-title-line .title-divider {
    display: block;
    width: 72px;
    height: 1px;
    min-height: 0;
    flex: 0 0 1px;
    background: rgba(244, 241, 236, 0.75);
  }

  .detail-overview,
  .ref-project-info,
  .detail-plan,
  .detail-gallery {
    padding: 64px 0;
  }

  .detail-plan-compare-stage {
    display: grid;
    gap: 18px;
    overflow: visible;
    background: transparent;
  }

  .detail-plan-list {
    gap: 48px;
  }

  .detail-plan-title {
    margin-bottom: 18px;
    font-size: 15px;
  }

  .detail-plan-before,
  .detail-plan-after {
    height: auto;
    object-fit: contain;
  }

  .detail-plan-after-wrap {
    position: static;
    width: 100%;
    overflow: visible;
    clip-path: none;
  }

  .detail-plan-after-wrap .detail-plan-after {
    width: 100%;
  }

  .detail-plan-label {
    position: static;
    order: -1;
    color: var(--accent-dark);
  }

  .detail-plan-label-before {
    grid-row: 1;
  }

  .detail-plan-before {
    grid-row: 2;
  }

  .detail-plan-label-after {
    grid-row: 3;
    margin-top: 8px;
  }

  .detail-plan-after-wrap {
    grid-row: 4;
  }

  .detail-plan-divider,
  .detail-plan-range {
    display: none;
  }

  .ref-project-info-grid {
    padding-bottom: 0;
  }

  .ref-project-description h2 {
    font-size: clamp(30px, 8vw, 40px);
  }

  .ref-project-description p {
    font-size: 16px;
    line-height: 1.7;
  }

  .ref-project-meta {
    grid-template-columns: 1fr;
  }

  .ref-project-meta div {
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(168, 134, 83, 0.22);
  }

  .ref-project-meta div:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }

  .detail-text h2 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .detail-text p {
    font-size: 16px;
    line-height: 1.7;
  }

  .detail-meta {
    max-width: none;
    padding-top: 30px;
  }

  .detail-meta-item span {
    font-size: 14px;
  }

  .detail-meta-item strong {
    font-size: 17px;
  }

  .detail-gallery-head {
    display: grid;
    gap: 18px;
  }
  .lightbox-content {
    width: 90vw;
  }

  .lightbox-arrow {
    font-size: 52px;
  }

  .lightbox-prev {
    left: 14px;
  }

  .lightbox-next {
    right: 14px;
  }

  .lightbox-close {
    top: 18px;
    right: 20px;
    font-size: 36px;
  }
}

/* Gallery: 69 photo slots */
.detail-gallery-zone {
  margin-bottom: 56px;
}

.detail-gallery-zone:last-child {
  margin-bottom: 0;
}

.detail-gallery-zone-head {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(168, 134, 83, 0.22);
}

.detail-gallery-zone-head h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

#gallery-entrance-area .detail-gallery-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 170px;
  gap: 3px;
}

#gallery-entrance-area .gallery-item {
  height: auto;
}

#gallery-entrance-area .gallery-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-entrance-area .gallery-item:nth-child(2),
#gallery-entrance-area .gallery-item:nth-child(5) {
  grid-column: span 2;
}

#gallery-entrance-area .gallery-item:nth-child(6) {
  grid-row: span 2;
}

#gallery-entrance-area .gallery-item:nth-child(8) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-living-dining .detail-gallery-grid {
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 145px;
  gap: 3px;
}

#gallery-living-dining .gallery-item {
  height: auto;
}

#gallery-living-dining .gallery-item:nth-child(1) {
  grid-column: span 4;
  grid-row: span 2;
}

#gallery-living-dining .gallery-item:nth-child(2),
#gallery-living-dining .gallery-item:nth-child(3) {
  grid-column: span 2;
}

#gallery-living-dining .gallery-item:nth-child(4),
#gallery-living-dining .gallery-item:nth-child(5),
#gallery-living-dining .gallery-item:nth-child(6) {
  grid-column: span 2;
}

#gallery-living-dining .gallery-item:nth-child(7) {
  grid-column: span 3;
  grid-row: span 2;
}

#gallery-living-dining .gallery-item:nth-child(8) {
  grid-column: span 3;
  grid-row: span 2;
}

#gallery-living-dining .gallery-item:nth-child(9),
#gallery-living-dining .gallery-item:nth-child(10) {
  grid-column: span 3;
}

#gallery-kitchen-area .detail-gallery-grid {
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 150px;
  gap: 3px;
}

#gallery-kitchen-area .gallery-item {
  height: auto;
}

#gallery-kitchen-area .gallery-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 3;
}

#gallery-kitchen-area .gallery-item:nth-child(2),
#gallery-kitchen-area .gallery-item:nth-child(3) {
  grid-column: span 3;
}

#gallery-kitchen-area .gallery-item:nth-child(4),
#gallery-kitchen-area .gallery-item:nth-child(5),
#gallery-kitchen-area .gallery-item:nth-child(6) {
  grid-column: span 1;
}

#gallery-kitchen-area .gallery-item:nth-child(7) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-kitchen-area .gallery-item:nth-child(8),
#gallery-kitchen-area .gallery-item:nth-child(9),
#gallery-kitchen-area .gallery-item:nth-child(10) {
  grid-column: span 1;
}

#gallery-bedroom .detail-gallery-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: 3px;
}

#gallery-bedroom .gallery-item {
  height: auto;
}

#gallery-bedroom .gallery-item:nth-child(1),
#gallery-bedroom .gallery-item:nth-child(2) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-bedroom .gallery-item:nth-child(3),
#gallery-bedroom .gallery-item:nth-child(4),
#gallery-bedroom .gallery-item:nth-child(5),
#gallery-bedroom .gallery-item:nth-child(6) {
  grid-column: span 1;
}

#gallery-bedroom .gallery-item:nth-child(7) {
  grid-column: span 2;
}

#gallery-bedroom .gallery-item:nth-child(8),
#gallery-bedroom .gallery-item:nth-child(9) {
  grid-column: span 1;
}

#gallery-bedroom .gallery-item:nth-child(10) {
  grid-column: span 4;
}

#gallery-childrens-room .detail-gallery-grid {
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 150px;
  gap: 3px;
}

#gallery-childrens-room .gallery-item {
  height: auto;
}

#gallery-childrens-room .gallery-item:nth-child(1) {
  grid-column: span 3;
  grid-row: span 2;
}

#gallery-childrens-room .gallery-item:nth-child(2),
#gallery-childrens-room .gallery-item:nth-child(3) {
  grid-column: span 2;
}

#gallery-childrens-room .gallery-item:nth-child(4) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-childrens-room .gallery-item:nth-child(5),
#gallery-childrens-room .gallery-item:nth-child(6),
#gallery-childrens-room .gallery-item:nth-child(7) {
  grid-column: span 1;
}

#gallery-childrens-room .gallery-item:nth-child(8) {
  grid-column: span 3;
}

#gallery-childrens-room .gallery-item:nth-child(9),
#gallery-childrens-room .gallery-item:nth-child(10) {
  grid-column: span 1;
}

#gallery-bathroom-1 .detail-gallery-grid {
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 132px;
  gap: 3px;
}

#gallery-bathroom-1 .gallery-item {
  height: auto;
}

#gallery-bathroom-1 .gallery-item:nth-child(1),
#gallery-bathroom-1 .gallery-item:nth-child(2) {
  grid-column: span 2;
}

#gallery-bathroom-1 .gallery-item:nth-child(3) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-bathroom-1 .gallery-item:nth-child(4),
#gallery-bathroom-1 .gallery-item:nth-child(5) {
  grid-column: span 2;
}

#gallery-bathroom-1 .gallery-item:nth-child(6) {
  grid-column: span 3;
  grid-row: span 2;
}

#gallery-bathroom-1 .gallery-item:nth-child(7) {
  grid-column: span 3;
  grid-row: span 2;
}

#gallery-bathroom-1 .gallery-item:nth-child(8),
#gallery-bathroom-1 .gallery-item:nth-child(9),
#gallery-bathroom-1 .gallery-item:nth-child(10) {
  grid-column: span 2;
}

#gallery-bathroom-2 .detail-gallery-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 155px;
  gap: 3px;
}

#gallery-bathroom-2 .gallery-item {
  height: auto;
}

#gallery-bathroom-2 .gallery-item:nth-child(1) {
  grid-column: span 4;
  grid-row: span 2;
}

#gallery-bathroom-2 .gallery-item:nth-child(2),
#gallery-bathroom-2 .gallery-item:nth-child(3),
#gallery-bathroom-2 .gallery-item:nth-child(4),
#gallery-bathroom-2 .gallery-item:nth-child(5) {
  grid-column: span 1;
}

#gallery-bathroom-2 .gallery-item:nth-child(6) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-bathroom-2 .gallery-item:nth-child(7) {
  grid-column: span 2;
}

#gallery-bathroom-2 .gallery-item:nth-child(8),
#gallery-bathroom-2 .gallery-item:nth-child(9) {
  grid-column: span 1;
}

/* Final gallery rhythm */
#gallery-entrance-area .detail-gallery-grid,
#gallery-living-dining .detail-gallery-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 170px;
  gap: 3px;
}

#gallery-entrance-area .gallery-item:nth-child(n),
#gallery-living-dining .gallery-item:nth-child(n) {
  grid-column: auto;
  grid-row: auto;
  height: auto;
}

#gallery-entrance-area .gallery-item:nth-child(1),
#gallery-living-dining .gallery-item:nth-child(1),
#gallery-entrance-area .gallery-item:nth-child(8),
#gallery-living-dining .gallery-item:nth-child(8) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-entrance-area .gallery-item:nth-child(2),
#gallery-living-dining .gallery-item:nth-child(2),
#gallery-entrance-area .gallery-item:nth-child(5),
#gallery-living-dining .gallery-item:nth-child(5) {
  grid-column: span 2;
}

#gallery-entrance-area .gallery-item:nth-child(6),
#gallery-living-dining .gallery-item:nth-child(6) {
  grid-row: span 2;
}

#gallery-kitchen-area .detail-gallery-grid,
#gallery-bathroom-1 .detail-gallery-grid {
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 150px;
  gap: 3px;
}

#gallery-kitchen-area .gallery-item:nth-child(n),
#gallery-bathroom-1 .gallery-item:nth-child(n) {
  grid-column: auto;
  grid-row: auto;
  height: auto;
}

#gallery-kitchen-area .gallery-item:nth-child(1),
#gallery-bathroom-1 .gallery-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 3;
}

#gallery-kitchen-area .gallery-item:nth-child(2),
#gallery-bathroom-1 .gallery-item:nth-child(2),
#gallery-kitchen-area .gallery-item:nth-child(3),
#gallery-bathroom-1 .gallery-item:nth-child(3) {
  grid-column: span 3;
}

#gallery-kitchen-area .gallery-item:nth-child(4),
#gallery-bathroom-1 .gallery-item:nth-child(4),
#gallery-kitchen-area .gallery-item:nth-child(5),
#gallery-bathroom-1 .gallery-item:nth-child(5),
#gallery-kitchen-area .gallery-item:nth-child(6),
#gallery-bathroom-1 .gallery-item:nth-child(6),
#gallery-kitchen-area .gallery-item:nth-child(8),
#gallery-bathroom-1 .gallery-item:nth-child(8),
#gallery-kitchen-area .gallery-item:nth-child(9),
#gallery-bathroom-1 .gallery-item:nth-child(9),
#gallery-kitchen-area .gallery-item:nth-child(10),
#gallery-bathroom-1 .gallery-item:nth-child(10) {
  grid-column: span 1;
}

#gallery-kitchen-area .gallery-item:nth-child(7),
#gallery-bathroom-1 .gallery-item:nth-child(7) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-bedroom .detail-gallery-grid,
#gallery-childrens-room .detail-gallery-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: 3px;
}

#gallery-bedroom .gallery-item:nth-child(n),
#gallery-childrens-room .gallery-item:nth-child(n) {
  grid-column: auto;
  grid-row: auto;
  height: auto;
}

#gallery-bedroom .gallery-item:nth-child(1),
#gallery-childrens-room .gallery-item:nth-child(1),
#gallery-bedroom .gallery-item:nth-child(2),
#gallery-childrens-room .gallery-item:nth-child(2) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-bedroom .gallery-item:nth-child(3),
#gallery-childrens-room .gallery-item:nth-child(3),
#gallery-bedroom .gallery-item:nth-child(4),
#gallery-childrens-room .gallery-item:nth-child(4),
#gallery-bedroom .gallery-item:nth-child(5),
#gallery-childrens-room .gallery-item:nth-child(5),
#gallery-bedroom .gallery-item:nth-child(6),
#gallery-childrens-room .gallery-item:nth-child(6),
#gallery-bedroom .gallery-item:nth-child(8),
#gallery-childrens-room .gallery-item:nth-child(8),
#gallery-bedroom .gallery-item:nth-child(9),
#gallery-childrens-room .gallery-item:nth-child(9) {
  grid-column: span 1;
}

#gallery-bedroom .gallery-item:nth-child(7),
#gallery-childrens-room .gallery-item:nth-child(7) {
  grid-column: span 2;
}

#gallery-bedroom .gallery-item:nth-child(10),
#gallery-childrens-room .gallery-item:nth-child(10) {
  grid-column: span 4;
}

#gallery-bathroom-2 .detail-gallery-grid {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 155px;
  gap: 3px;
}

#gallery-bathroom-2 .gallery-item:nth-child(n) {
  grid-column: auto;
  grid-row: auto;
  height: auto;
}

#gallery-bathroom-2 .gallery-item:nth-child(1) {
  grid-column: span 4;
  grid-row: span 2;
}

#gallery-bathroom-2 .gallery-item:nth-child(6) {
  grid-column: span 2;
  grid-row: span 2;
}

#gallery-bathroom-2 .gallery-item:nth-child(7) {
  grid-column: span 2;
}

.gallery-layout-auto {
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 170px;
  grid-auto-flow: dense;
  gap: 3px;
}

.gallery-layout-auto .gallery-item {
  height: auto;
}

/* Generated galleries cycle through three layouts, independent of zone names. */
.gallery-layout-auto .gallery-item:nth-child(n) {
  grid-column: auto;
  grid-row: auto;
}

.gallery-layout-single .gallery-item {
  grid-column: span 4;
  grid-row: span 2;
}

.gallery-layout-pair .gallery-item {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-pattern-a .gallery-item:nth-child(6n + 1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-pattern-a .gallery-item:nth-child(6n + 2),
.gallery-pattern-a .gallery-item:nth-child(6n + 5),
.gallery-pattern-a .gallery-item:nth-child(6n + 6) {
  grid-column: span 2;
}

.gallery-pattern-b .gallery-item:nth-child(6n + 2) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-pattern-b .gallery-item:nth-child(6n + 1),
.gallery-pattern-b .gallery-item:nth-child(6n + 5),
.gallery-pattern-b .gallery-item:nth-child(6n + 6) {
  grid-column: span 2;
}

.gallery-pattern-c .gallery-item:nth-child(6n + 5) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-pattern-c .gallery-item:nth-child(6n + 3),
.gallery-pattern-c .gallery-item:nth-child(6n + 6) {
  grid-column: span 2;
}

.gallery-pattern-c .gallery-item:nth-child(6n + 1) {
  grid-row: span 2;
}

/* Complete the final mosaic row for any image count. */
.gallery-tail-1 .gallery-item:last-child {
  grid-column: span 4;
  grid-row: auto;
}

.gallery-tail-2 .gallery-item:nth-last-child(-n + 2) {
  grid-column: span 2;
  grid-row: auto;
}

.gallery-tail-3 .gallery-item:nth-last-child(3) {
  grid-column: span 2;
  grid-row: auto;
}

.gallery-tail-3 .gallery-item:nth-last-child(-n + 2),
.gallery-tail-4 .gallery-item:nth-last-child(-n + 4) {
  grid-column: auto;
  grid-row: auto;
}

.gallery-tail-5 .gallery-item:nth-last-child(5) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-tail-5 .gallery-item:nth-last-child(-n + 4) {
  grid-column: auto;
  grid-row: auto;
}

.gallery-item {
  display: block;
  width: 100%;
  height: 300px;
  padding: 0;
  border: 0;
  background: #181a19;
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-placeholder {
  background: #ffffff;
  border: 1px solid rgba(23, 23, 23, 0.05);
  cursor: default;
}

.gallery-placeholder:disabled {
  opacity: 1;
}

@media (max-width: 1100px) {
  #gallery-entrance-area .detail-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }

  #gallery-living-dining .detail-gallery-grid,
  #gallery-kitchen-area .detail-gallery-grid,
  #gallery-bedroom .detail-gallery-grid,
  #gallery-childrens-room .detail-gallery-grid,
  #gallery-bathroom-1 .detail-gallery-grid,
  #gallery-bathroom-2 .detail-gallery-grid,
  .gallery-layout-auto {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }

  #gallery-living-dining .gallery-item:nth-child(n),
  #gallery-kitchen-area .gallery-item:nth-child(n),
  #gallery-bedroom .gallery-item:nth-child(n),
  #gallery-childrens-room .gallery-item:nth-child(n),
  #gallery-bathroom-1 .gallery-item:nth-child(n),
  #gallery-bathroom-2 .gallery-item:nth-child(n),
  .gallery-layout-auto .gallery-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  #gallery-living-dining .gallery-item:nth-child(1),
  #gallery-kitchen-area .gallery-item:nth-child(1),
  #gallery-bedroom .gallery-item:nth-child(1),
  #gallery-childrens-room .gallery-item:nth-child(1),
  #gallery-bathroom-1 .gallery-item:nth-child(1),
  #gallery-bathroom-2 .gallery-item:nth-child(1),
  .gallery-layout-auto .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

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

  .gallery-item {
    height: 280px;
  }
}

@media (max-width: 760px) {
  .detail-gallery-zone {
    margin-bottom: 42px;
  }

  .detail-gallery-zone-head {
    min-height: 64px;
  }

  .detail-gallery-zone-head h2 {
    font-size: 24px;
    letter-spacing: 0.05em;
  }

  .detail-gallery-grid {
    grid-template-columns: 1fr;
  }

  #gallery-entrance-area .detail-gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 3px;
  }

  #gallery-living-dining .detail-gallery-grid,
  #gallery-kitchen-area .detail-gallery-grid,
  #gallery-bedroom .detail-gallery-grid,
  #gallery-childrens-room .detail-gallery-grid,
  #gallery-bathroom-1 .detail-gallery-grid,
  #gallery-bathroom-2 .detail-gallery-grid,
  .gallery-layout-auto {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 3px;
  }

  #gallery-entrance-area .gallery-item,
  #gallery-entrance-area .gallery-item:nth-child(n),
  #gallery-living-dining .gallery-item,
  #gallery-living-dining .gallery-item:nth-child(n),
  #gallery-kitchen-area .gallery-item,
  #gallery-kitchen-area .gallery-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
    height: 240px;
  }

  #gallery-bedroom .gallery-item,
  #gallery-bedroom .gallery-item:nth-child(n),
  #gallery-childrens-room .gallery-item,
  #gallery-childrens-room .gallery-item:nth-child(n),
  #gallery-bathroom-1 .gallery-item,
  #gallery-bathroom-1 .gallery-item:nth-child(n),
  #gallery-bathroom-2 .gallery-item,
  #gallery-bathroom-2 .gallery-item:nth-child(n),
  .gallery-layout-auto .gallery-item,
  .gallery-layout-auto .gallery-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
    height: 240px;
  }

  .gallery-item {
    height: 240px;
  }
}
