:root {
  color-scheme: light;
  --brand: #123b83;
  --action: #1457c5;
  --accent: #bd192c;
  --ink: #182744;
  --muted: #52617a;
  --line: #d9e2ef;
  --surface: #f5f7fb;
  --white: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--white);
  scrollbar-gutter: stable;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; line-height: 1.45; }
body:has(dialog[open]) { overflow: hidden; }
.container { width: min(100% - 1.5rem, 72rem); margin-inline: auto; }
main { flex: 1; padding-block: clamp(1rem, 3vw, 2rem) 2.75rem; }
.site-header { background: var(--brand); border-bottom: 3px solid var(--accent); }
.brand { min-height: 3.75rem; display: flex; align-items: center; gap: .65rem; color: var(--white); font-weight: 750; }
.brand img { display: block; object-fit: contain; background: var(--white); padding: .18rem; border-radius: .3rem; }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 1rem; color: var(--muted); font-size: .9rem; }
h1, h2, h3, p, dl, dd, fieldset { margin: 0; }
h1, h2, h3 { color: var(--brand); line-height: 1.18; overflow-wrap: anywhere; }
h1 { max-width: 28ch; font-size: clamp(1.42rem, 4vw, 2.7rem); letter-spacing: -.028em; margin-bottom: clamp(1rem, 3vw, 1.75rem); }
h1 span { display: inline-block; }
h2 { font-size: clamp(1.16rem, 3vw, 1.65rem); }
h3 { font-size: 1.1rem; }
p, li, dd { overflow-wrap: anywhere; }

.shelf + .shelf { margin-top: 1.4rem; }
.shelf { scroll-margin-top: .75rem; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 1.15rem .7rem; }
.cards:not(:empty) { margin-top: .6rem; }
.card {
  min-width: 0;
  color: var(--white);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  border-radius: .9rem;
}
.card:focus-visible { outline-color: #c8ddff; }
.card-cover { position: relative; isolation: isolate; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; border-radius: .9rem; background: var(--surface); color: var(--muted); }
.card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-cover .cover-back { z-index: -1; transform: scale(1.14); filter: blur(16px) brightness(.85); }
.card-cover .cover-entire { object-fit: contain; }
.card-body { display: grid; gap: .25rem; padding: .55rem .2rem .45rem; }
.card h3 { color: inherit; font-size: clamp(.9rem, 2vw, 1.03rem); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.card-title-rooms { white-space: nowrap; }
.card-neighborhood { color: #e0ebfc; font-size: .8rem; font-weight: 400; line-height: 1.25; }
.price { font-weight: 770; color: var(--brand); }
.card .price { color: inherit; font-size: clamp(.97rem, 2.2vw, 1.15rem); }
.card-tags { list-style: none; padding: 0; margin: .2rem 0 0; display: flex; flex-wrap: wrap; gap: .23rem; }
.card-tags li { background: #e5edfb; color: var(--accent); font-size: .75rem; font-weight: 630; padding: .13rem .33rem; border-radius: .25rem; }
.card-tags li:first-child { border-inline-start: 2px solid var(--accent); }
.card-tags .tag-more { background: #fcebf0; color: #9f1329; }

.notice { color: var(--muted); margin-top: .6rem; }
#route-status { background: var(--surface); border-left: 3px solid var(--accent); padding: .55rem .75rem; }
.muted { color: var(--muted); }
.multiline { white-space: pre-line; }

button, input, select { font: inherit; }
.button, .icon-button {
  cursor: pointer; color: var(--brand); font-weight: 680; border: 1px solid var(--line);
  background: var(--white); border-radius: .5rem; text-decoration: none;
  min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .45rem .75rem; text-align: center;
}
.button:hover, .icon-button:hover { background: var(--surface); }
.button.primary { background: var(--action); border-color: var(--action); color: var(--white); }
.button.primary:hover { background: var(--brand); }
.card-cta.button { align-self: start; margin-inline: .2rem; background: transparent; color: inherit; border-color: #aec9ee; font-size: .78rem; letter-spacing: .04em; }
.card:is(:hover, :focus-visible) .card-cta { background: #e0ebfc; color: var(--brand); }
.catalog-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  max-width: 36rem;
  margin: 0 auto 1rem;
}
.search-field { position: relative; min-width: 0; }
.search-icon { position: absolute; inset: .8rem auto auto .85rem; color: var(--brand); pointer-events: none; }
#catalog-search {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .45rem .75rem .45rem 2.5rem;
  border: 1px solid #aabfe1;
  border-radius: 1.5rem;
  background: var(--white);
  color: var(--ink);
}
#catalog-search::placeholder { color: var(--muted); opacity: 1; }
.catalog-tools :focus-visible { outline-color: #c8ddff; }
.filter-button { border-radius: 1.5rem; color: var(--action); border-color: #aabfe1; }
.search-suggestions {
  position: absolute;
  z-index: 2;
  inset: calc(100% + .35rem) 0 auto;
  max-height: min(16rem, 40dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: .25rem;
  list-style: none;
  border: 1px solid #aabfe1;
  border-radius: .9rem;
  background: var(--white);
  box-shadow: 0 .4rem 1.25rem #15213838;
}
.search-suggestions li + li { border-top: 1px solid var(--line); }
.search-suggestions a {
  display: grid;
  gap: .15rem;
  padding: .55rem .65rem;
  border-radius: .5rem;
  color: var(--brand);
  font-size: .875rem;
  font-weight: 650;
  text-decoration: none;
}
.search-suggestions a:hover, .search-suggestions a:focus-visible { background: var(--surface); }
.search-suggestions a:focus-visible { outline-color: var(--action); outline-offset: -2px; }
.search-suggestion-price { color: var(--muted); font-size: .8rem; font-weight: 500; }
#filter-count { background: var(--accent); color: var(--white); padding-inline: .4em; border-radius: .35em; }
.icon-button { width: 2.75rem; padding: 0; font-size: 1.55rem; flex: none; }
:focus-visible { outline: 3px solid var(--action); outline-offset: 3px; }
#retry { margin-top: .6rem; }

dialog {
  width: min(100% - 1rem, 52rem); max-width: none; max-height: calc(100dvh - 1rem);
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: .9rem;
  background: var(--white); color: var(--ink); overscroll-behavior: contain;
}
dialog::backdrop { background: #12213cc4; }
.dialog-bar {
  position: sticky; top: 0; z-index: 2; background: var(--white); border-bottom: 1px solid var(--line);
  min-height: 3.4rem; padding: .3rem .85rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem;
}
.filter-dialog { width: min(100% - 1rem, 27rem); }
#filters { display: grid; gap: .5rem; padding: .85rem; }
#filters label, #filters legend { font-size: .91rem; font-weight: 650; }
#filters select, #filters input[type="number"] {
  width: 100%; min-width: 0; min-height: 2.75rem; color: var(--ink);
  background: var(--white); padding: .4rem .55rem; border: 1px solid #a0afc3; border-radius: .45rem;
}
#filters fieldset { border: 0; padding: .2rem 0; min-width: 0; }
.price-fields, .filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.conditions select { margin-top: .25rem; }
.filter-actions { position: sticky; bottom: 0; background: var(--white); padding-block: .35rem; }

.property-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.property-dialog .dialog-bar { flex: none; justify-content: flex-end; }
.property-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.property-contact { flex: none; }
.property-heading, .property-details, .property-contact { padding-inline: clamp(.85rem, 4vw, 1.65rem); }
.property-heading { padding-block: .85rem .65rem; }
.property-heading .muted { margin-top: .2rem; }
.property-heading .price { margin-top: .3rem; font-size: 1.32rem; }
.property-details { display: grid; gap: 1rem; padding-block: .95rem 1.2rem; }
.property-details h3 { margin-bottom: .35rem; }
.property-details ul { margin: .35rem 0 0; padding-left: 1.25rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: .55rem; }
.features div { background: var(--surface); border-radius: .45rem; padding: .55rem; }
.features dt { color: var(--muted); font-size: .86rem; }
.features dd { font-weight: 650; }
.property-contact { background: var(--white); border-top: 1px solid var(--line); padding-block: .7rem .85rem; }
.property-contact p { margin-bottom: .35rem; font-size: .9rem; color: var(--muted); }
.button.whatsapp { background: #137642; border-color: #137642; color: var(--white); min-height: 3rem; }
.button.whatsapp:hover { background: #0d5e34; }

.gallery { min-width: 0; }
.gallery-rail {
  width: 100%; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-x pan-y pinch-zoom;
  height: clamp(10rem, 46dvh, 28rem); background: var(--surface);
}
.gallery-rail::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%; min-width: 0; height: 100%; scroll-snap-align: start;
  position: relative; display: grid; place-items: center; border: 0; padding: 0; margin: 0;
  background: transparent; color: inherit;
}
button.slide { cursor: zoom-in; }
.slide:focus-visible { outline-offset: -4px; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.photo-error { text-align: center; padding: .6rem; }
.gallery-nav { display: flex; align-items: center; justify-content: space-between; gap: .35rem; padding: .25rem .75rem; }
.gallery-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .55rem; color: var(--muted); font-size: .86rem; text-align: center; }
.photo-counter { font-variant-numeric: tabular-nums; }
.details-hint { text-align: center; color: var(--brand); font-size: .85rem; padding: .2rem .75rem .65rem; }
.viewer {
  width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0;
  background: #152138; color: var(--white); overflow: hidden;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer .dialog-bar { flex: none; background: #152138; border-color: #596783; padding-inline: 1rem; }
.viewer h2, .viewer .gallery-meta { color: var(--white); }
.viewer .gallery { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.viewer .gallery-rail { flex: 1; min-height: 0; height: auto; background: #152138; }
.viewer .gallery-nav { flex: none; padding-bottom: max(.4rem, env(safe-area-inset-bottom)); }

@media (min-width: 22.5em) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 46em) {
  .container { width: min(100% - 3rem, 72rem); }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: .9rem; }
  .property-dialog .gallery { margin-inline: .85rem; }
}
@media (min-width: 64em) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 1rem; } }
@media (max-width: 45.99em) {
  .filter-dialog { width: 100%; margin: auto 0 0; border-radius: .9rem .9rem 0 0; max-height: calc(100dvh - .5rem); }
  .property-dialog { width: calc(100% - .4rem); max-height: calc(100dvh - .4rem); }
  .property-contact .button { width: 100%; }
}
@media (pointer: coarse) {
  .gallery-nav .icon-button { border-color: transparent; background: transparent; }
  .viewer .gallery-nav .icon-button { color: var(--white); }
}
@media (prefers-reduced-motion: no-preference) {
  .button { transition: border-color .15s, background-color .15s; }
}

/* Revisão visual da tarefa 06 */
body { background: linear-gradient(135deg, #244d80, #15335b); }
.site-header { background: var(--white); border-bottom: 1px solid #c95463; box-shadow: 0 3px 12px #15386a10; }
.brand { min-height: 4rem; letter-spacing: .015em; color: var(--brand); }
.brand img { background: transparent; padding: 0; border-radius: 0;  }
.property-heading { position: relative; padding-right: 3.5rem; }
.property-close { position: absolute; right: .4rem; top: .35rem; border: 0; background: #eef3fb; z-index: 2; }
.gallery-nav { padding-block: 0; min-height: 2rem; }
.gallery-meta { font-size: .72rem; color: #6d7c90; }
.gallery-nav .icon-button { font-size: 1.15rem; border: 0; background: transparent; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .5rem; padding-block: .4rem; }
.filter-chip { min-height: 2.75rem; border: 1px solid #bdcde5; border-radius: 1.5rem; padding: .4rem .75rem; background: #f4f7fc; color: #123b83; cursor: pointer; }
.filter-chip[aria-pressed="true"] { background: #123b83; color: white; border-color: #123b83; }

#opportunities-title { color: #ff777b; font-size: clamp(1.2rem, 3vw, 1.65rem); font-weight: 750; }
#catalog-title { color: #ffffff; }
#opportunities-title, #catalog-title { text-transform: uppercase; }
main > .shelf > .notice, main > .shelf > noscript { color: #ffffff; }
.brand > span { flex: 1; min-width: 0; }
.brand > img { flex: none; }
.site-menu { position: relative; flex: none; font-weight: 600; }
.site-menu summary {
  width: 2.75rem; height: 2.75rem; display: flex; align-items: center; justify-content: center;
  list-style: none; border: 1px solid #d2deed; border-radius: .5rem; cursor: pointer;
}
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu[open] summary { background: var(--surface); }
.site-menu nav {
  position: absolute; top: calc(100% + .5rem); right: 0; z-index: 5;
  width: min(18rem, calc(100vw - 1.5rem)); padding: .4rem; background: white;
  border: 1px solid #c4d3e8; border-radius: .65rem; box-shadow: 0 8px 24px #15386a22;
}
.site-menu a, .site-menu nav button { display: block; padding: .7rem .75rem; color: var(--brand); text-decoration: none; border-radius: .35rem; }
.site-menu a:hover, .site-menu nav button:hover { background: var(--surface); }
.about { margin-top: 2rem; border-top: 1px solid #b8cbe3; padding-top: 1.25rem; }
.about p { max-width: 42rem; color: var(--muted); margin-top: .55rem; }
@media (max-width: 24em) { .brand { gap: .45rem; font-size: .9rem; } }

/* Apresentação institucional: imagem inteira, sem recorte ou sobreposição. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.institutional-banner { margin: 0 auto 1rem; max-width: 36rem; }
.institutional-banner img { display: block; width: 100%; height: auto; border-radius: .6rem; }
main.container { padding-top: .75rem; }
.site-menu nav button { width: 100%; border: 0; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.about-dialog { width: min(54rem, calc(100% - 1rem)); max-height: calc(100dvh - 1rem); padding: 0; border: 1px solid #b8cbe3; border-radius: .8rem; background: white; }
.about-dialog .dialog-bar { position: sticky; top: 0; z-index: 1; background: white; }
.about-dialog .dialog-bar h2 { font-size: 1.1rem; }
.about-content > img { display: block; width: 100%; height: auto; }
.about-copy { padding: 1.25rem; }
.about-copy > * + * { margin-top: 1rem; }
.about-lead { color: var(--accent); font-weight: 750; font-size: 1.2rem; }
.about-copy address { font-style: normal; }
.about-copy a { color: var(--brand); }
@media (min-width: 48em) {
  .about-content { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .about-content > img { position: sticky; top: 4rem; }
}

.property-details video { display: block; width: 100%; max-height: 55dvh; margin-top: .75rem; background: #182744; border-radius: .5rem; }

/* Ajustes de exibição nas capas, na galeria e no visor. Os arquivos permanecem intactos. */
.photo-filters { position: absolute; pointer-events: none; }
:is(.card-cover, .slide) img[src^="assets/imoveis/ABQ-001/"]:not(.cover-back) {
  filter: url("#photo-soft-light") saturate(1.05);
}
:is(.card-cover, .slide) img[src^="assets/imoveis/ABQ-002/"]:not(.cover-back) {
  filter: url("#photo-light-detail") saturate(1.06);
}
:is(.card-cover, .slide) img[src^="assets/imoveis/ABQ-005/"]:not(.cover-back, [src$="/03.jpg"], [src$="/05.jpg"], [src$="/09.jpg"]) {
  filter: url("#photo-soft-light") saturate(1.04);
}
