/* A galeria mantém a paleta, a tipografia e a largura do site. */
#ambientes { scroll-margin-top: 86px; }
.rooms { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 48px 24px; }
.room { min-width: 0; grid-column: span 2; }
.room:nth-child(-n+2) { grid-column: span 3; }
.room-photo { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 6px; background: var(--navy); isolation: isolate; }
.room:nth-child(-n+2) .room-photo { aspect-ratio: 9 / 10; }
.room-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.room-photo::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, rgba(13,36,56,.8)); pointer-events: none; }
.room-photo:hover img, .room-photo:focus-visible img { transform: scale(1.035); }
.room-view { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 22px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; letter-spacing: .06em; }
.room-view > span { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; font-size: 20px; }
.room-info { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 22px; }
.room-info h3 { font-size: clamp(14px, 1.6vw, 18px); line-height: 1.4; }
.room-count { flex: none; color: var(--mist); font-size: 12px; letter-spacing: .06em; }
.room > p { color: var(--mist); font-size: 14px; margin-top: 8px; }
.room-contact { display: inline-flex; align-items: center; gap: 12px; color: var(--green-hi); font-size: 13px; font-weight: 600; text-decoration: none; margin-top: 15px; min-height: 44px; }
.room-contact:hover { text-decoration: underline; text-underline-offset: 5px; }
.gallery-note { color: var(--mist); font-size: 14px; margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--line); }

.project-gallery { width: min(1280px, calc(100% - 48px)); max-width: none; height: min(920px, calc(100dvh - 48px)); max-height: none; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--deep); color: var(--white); overflow: hidden; }
.project-gallery::backdrop { background: rgba(5,17,27,.94); }
.project-gallery[open] { display: flex; flex-direction: column; }
.gallery-header { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.gallery-heading { display: grid; gap: 4px; }
.gallery-heading .eyebrow { font-size: 10px; }
.gallery-heading h2 { font-size: clamp(14px, 2vw, 20px); }
.gallery-control { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); color: var(--white); background: var(--ink); cursor: pointer; transition: background .2s, border-color .2s; }
.gallery-control:hover { background: var(--navy); border-color: var(--green); }
.gallery-control svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.gallery-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 16px 80px; }
.gallery-stage img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; transition: opacity .2s; }
.gallery-stage[aria-busy="true"] img { opacity: .25; }
.gallery-stage[aria-busy="true"] { background: linear-gradient(110deg, var(--deep), var(--ink), var(--deep)); }
.gallery-stage .gallery-control { position: absolute; top: calc(50% - 23px); }
.gallery-prev { left: 18px; }
.gallery-next { right: 18px; }
.gallery-error { position: absolute; inset: 24px 80px; display: grid; align-content: center; justify-items: center; gap: 18px; text-align: center; font-size: 14px; color: var(--mist); }
.gallery-error button { font: inherit; cursor: pointer; }
.gallery-footer { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.gallery-caption { font-size: 14px; color: var(--mist); }
.gallery-counter { display: block; color: var(--green-hi); font-size: 11px; letter-spacing: .15em; margin-bottom: 4px; }
.gallery-footer .btn { flex: none; }
body.gallery-open { overflow: hidden; }
@media (max-width: 980px) {
  .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room, .room:nth-child(-n+2) { grid-column: auto; }
  .room:nth-child(-n+2) .room-photo { aspect-ratio: 4 / 5; }
}
@media (max-width: 640px) {
  .rooms { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .room-info { margin-top: 18px; }
  .room-info h3 { font-size: 17px; }
  .room-view { left: 20px; right: 20px; bottom: 18px; }
  .project-gallery { width: 100%; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .gallery-header { padding: max(14px, env(safe-area-inset-top)) 16px 14px; }
  .gallery-stage { padding: 10px 8px 64px; }
  .gallery-stage .gallery-control { top: auto; bottom: 8px; }
  .gallery-prev { left: calc(50% - 56px); }
  .gallery-next { right: calc(50% - 56px); }
  .gallery-footer { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px 16px max(18px, env(safe-area-inset-bottom)); }
  .gallery-footer .btn { width: 100%; }
  .gallery-error { inset: 20px 24px 70px; }
}
