#galeria .thumb {
  display: block;
  overflow: hidden;
  position: relative;
}
#galeria .thumb img { display: block; }
#galeria .thumb .image-caption {
  position: absolute;
  inset: auto auto 8px 8px;
  max-width: calc(100% - 16px);
  padding: 0;
  color: var(--base);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.35;
  text-shadow: 0 1px 2px rgb(47 31 22 / 55%);
  isolation: isolate;
}
#galeria .thumb .image-caption::before {
  content: "";
  position: absolute;
  inset: -48px -54px -10px -10px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgb(41 29 22 / var(--shade)) 60%);
  mask-image: linear-gradient(to right, black calc(100% - 54px), transparent);
}
#galeria .thumb[href$="/fachada.webp"] { --shade: .65; }
#galeria .thumb[href$="/cocina.webp"] { --shade: .66; }
#galeria .thumb[href$="/dormitorio.webp"] { --shade: .62; }
#galeria .thumb[href$="/bano.webp"] { --shade: .53; }
#galeria .thumb[href$="/segundo-dormitorio.webp"] { --shade: .65; }
#galeria .thumb[href$="/terraza-piscina.webp"] { --shade: .47; }
@media (max-width: 820px) {
  #galeria .thumb[href$="/fachada.webp"] { --shade: .35; }
  #galeria .thumb[href$="/cocina.webp"] { --shade: .49; }
  #galeria .thumb[href$="/dormitorio.webp"] { --shade: .30; }
  #galeria .thumb[href$="/bano.webp"] { --shade: .46; }
  #galeria .thumb[href$="/segundo-dormitorio.webp"] { --shade: .55; }
  #galeria .thumb[href$="/terraza-piscina.webp"] { --shade: .38; }
}

@media (max-width: 740px) {
#proyecto .details { padding-top: 0; gap: 0; }
    #proyecto .details section { border-bottom: 1px solid #dfd6cb; }
    #proyecto .details h3 { margin: 0; }
    #proyecto .details h3 button {
      width: 100%; min-height: 48px; display: flex; align-items: center;
      justify-content: space-between; gap: 16px; padding: 12px 0;
      background: none; border: 0; color: inherit; font: inherit;
      text-align: start; cursor: pointer;
    }
    #proyecto .details button[aria-expanded="true"] { padding: 18px 0 8px; }
    #proyecto .details button:focus-visible { outline: 2px solid #8a543c; outline-offset: 2px; }
    #proyecto .details button::after {
      content: ""; width: 12px; height: 12px; flex: none; color: #776052;
      background: linear-gradient(currentColor, currentColor) center / 12px 1px no-repeat,
                  linear-gradient(currentColor, currentColor) center / 1px 12px no-repeat;
    }
    #proyecto .details button[aria-expanded="true"]::after { background-size: 12px 1px, 0 0; }
    #proyecto .panel { padding-bottom: 16px; }
    #proyecto .details p + p { margin-top: 16px; }
    #proyecto .details h3:has(> span:only-child) { padding: 16px 0 8px; }
  }


#proyecto .overview { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 5vw; }
@media (min-width: 741px) {
  #proyecto .overview > div {
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }
  /* Keep 72% of the spare column height above the project introduction. */
  #proyecto .overview > div::before { content: ""; flex: 18; }
  #proyecto .overview > div::after { content: ""; flex: 7; }
}
header .brand span {
  position: relative;
  border-inline-start: 0;
  line-height: 1;
  padding-block-start: 2px;
}
header .brand span::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  height: 1.5em;
  border-inline-start: 1px solid var(--line);
  transform: translateY(-50%);
}
@media (max-width: 820px) {
  header .brand { gap: 8px; }
  header .brand span {
    display: inline-block;
    font-size: clamp(.625rem, 2.8vw, .8125rem);
    padding-inline-start: 8px;
  }
}
#proyecto .overview .intro { max-inline-size: none; }
@media (min-width: 1024px) {
  #proyecto .overview {
    grid-template-columns: minmax(39rem, 1fr) minmax(0, 1.2fr);
    column-gap: clamp(24px, 3vw, 64px);
  }
}
#proyecto dl { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 24px; padding-top: 16px; border-top: 1px solid #d7cdc1; }
#proyecto dl div { display: flex; flex-direction: column-reverse; }
#proyecto dt { font-size: .875rem; letter-spacing: normal; color: var(--muted); }
#proyecto dd { font: 400 var(--type-figure)/1.25 Georgia, serif; }
@media (min-width: 821px) {
  #proyecto dl { text-align: center; }
  #proyecto dt { font-size: 1.05rem; }
  #proyecto dd { font-size: calc(var(--type-figure) * 1.2); }
}
#proyecto .living-room a { display: block; }
#proyecto .living-room img { width: 100%; aspect-ratio: 1.85; height: auto; object-fit: cover; }
#proyecto .living-room a::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 16rem 6rem at bottom left, rgb(34 24 18 / 34%), transparent); }
#proyecto .living-room .image-caption { position: absolute; inset: auto auto 8px 8px; padding: 0; font-size: 1.05rem; line-height: 1.35; color: var(--base); text-shadow: 0 1px 2px rgb(34 24 18 / 50%); }
#proyecto .details { margin-top: 24px; border-top: 1px solid #dfd6cb; display: grid; grid-template-columns: repeat(3,1fr); padding-top: 24px; gap: clamp(24px,3vw,48px); }
#proyecto .details h3 { font: 600 1rem/1.4 "Segoe UI",Arial,sans-serif; letter-spacing: normal; margin: 0 0 8px; }
#proyecto .details p + p { margin-top: 12px; }
@media (max-width: 740px) {
  #proyecto .overview, #proyecto .details { grid-template-columns: 1fr; }
  #proyecto .overview { gap: 24px; }
  #proyecto dl { text-align: center; margin-top: 16px; padding-top: 12px; }
  #proyecto .living-room img { aspect-ratio: 4/3; }
  #proyecto .details { gap: 0; padding: 0; }
  #proyecto .details h3 { margin: 0; }
  #proyecto .details p + p { margin-top: 16px; }
}

#ubicacion { display: grid; grid-template-columns: minmax(26rem,1fr) minmax(0,2.2fr); align-items: center; gap: clamp(18px,3vw,48px); border: 0; }
#ubicacion .place-intro > div { width: fit-content; max-width: 100%; }
#ubicacion .place-intro p { contain: inline-size; }
#ubicacion .place-intro h2 + .intro { contain-intrinsic-inline-size: 21.5rem; }
:lang(en) #ubicacion .place-intro h2 + .intro { contain-intrinsic-inline-size: 26rem; }
#ubicacion .intro { margin: 10px 0 6px; max-inline-size: none; text-wrap: pretty; }
.place-images { display: grid; grid-template-columns: 1fr 1.78fr; gap: clamp(10px,1.3vw,18px); align-items: stretch; }
#ubicacion .place-images .aerial { width: 100%; height: 100%; min-height: 0; max-height: none; object-fit: cover; object-position: 50% 45%; }
.area-map { display: block; }
.area-map img { width: 100%; height: auto; }
.contact-dock .talk { border-radius: 999px; min-height: 48px; }
.directions { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; margin-top: 10px; border: 1px solid #a88571; border-radius: 12px; color: #714832; text-decoration: none; }
.directions:hover { background: var(--second); }
#villas { border-top: 1px solid #e7ded5; }
#villas .planrow { grid-template-columns: repeat(3,minmax(0,1fr)); gap: clamp(12px,2vw,28px); margin-top: 18px; }
#villas .planrow figure { grid-column: auto; }
#villas .planrow .thumb {
  display: block;
  padding: 6px;
  border: 1px solid #decec1;
  border-radius: var(--image-radius);
}
#villas .planrow .image-caption {
  margin: 0;
  padding: 2px 3% 6px;
  text-align: left;
}
#villas .planrow figure img, #villas .planrow figure:first-child img {
  display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 1800/1324; object-fit: contain;
  padding: 0; border: 0; background: var(--base);
}
#viewer[data-group="plans"] .viewer-figure { width: min(100%,calc(var(--stage-limit) * 1800/1324)); }
#viewer[data-group="plans"] .viewer-stage { aspect-ratio: 1800/1324; background: var(--base); }
.contact-dock .talk, #contacto .primary-action {
  background: #e2c69c; color: #342c25; border: 1px solid #8d775d; font-weight: 600;
}
#contacto .primary-action { justify-self: start; width: fit-content; padding-inline: 24px; border-radius: 12px; }
.contact-dock .talk:hover, #contacto .primary-action:enabled:hover { background: #d8b98a; filter: none; }
.contact-dock .talk:focus-visible, #contacto .primary-action:focus-visible {
  outline: 2px solid #fffdf9; outline-offset: 2px; box-shadow: 0 0 0 5px #4d4034;
}
@media (max-width: 820px) {
  #ubicacion { grid-template-columns: minmax(0,1fr); }
  .place-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .directions { margin: 0; }
}
@media (max-width: 640px) {
  #ubicacion { gap: 16px; }
  .place-images { grid-template-columns: 1fr; }
  #ubicacion .place-images .aerial { height: auto; aspect-ratio: 898/900; }
  #villas .planrow {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 12px;
    padding-right: var(--g);
    margin-right: calc(-1 * var(--g));
  }
  #villas .planrow figure { flex: 0 0 92%; min-width: 0; scroll-snap-align: start; }
  .gallery-pages, .plan-dots { display: flex; justify-content: center; width: 100%; }
  .plan-dots button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; }
  .plan-dots button::before { content: ""; width: 6px; height: 6px; border-radius: 8px; background: #998a7e; }
  .plan-dots button[aria-current="true"]::before { width: 16px; background: #79523b; }
}
@media (min-width: 900px) {
  #villas .plans { display: grid; grid-template-columns: minmax(13rem,.85fr) minmax(0,2.3fr); column-gap: clamp(18px,3vw,48px); align-content: center; }
  #villas .plans > .kicker { grid-column: 1; align-self: end; margin: 0 0 8px; }
  #villas .plans > h2 { grid-column: 1; align-self: start; }
  #villas .plans > p:not(.kicker) { grid-column: 1; max-width: 38ch; margin-top: 10px; }
  #villas .planrow { grid-area: 1 / 2 / 4 / 3; margin: 0; align-self: center; }

}
@media (min-width: 900px) {
  #ubicacion, #villas { padding-inline-end: max(var(--g), 10rem); }
}

#inicio .offer {
  display: grid; width: fit-content; max-width: 100%; gap: 16px;
  justify-content: stretch; justify-items: stretch;
}
.hero-copy .hero-talk {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 16px; border-radius: 12px;
  border: 1px solid rgb(255 253 249 / .72); color: #fffdf9; background: rgb(41 32 25 / .25);
  pointer-events: auto; text-decoration: none; text-shadow: 0 1px 2px #31251d;
}
.hero-copy .hero-talk:hover { background: rgb(41 32 25 / .45); }
.hero-copy .hero-talk:focus-visible { outline: 2px solid #fffdf9; outline-offset: 3px; }
@media (min-width: 821px) {
  header::before {
    opacity: var(--header-tint);
    background: linear-gradient(to bottom, rgb(48 37 30 / .77), rgb(48 37 30 / .71) 65%, rgb(48 37 30 / .68));
    backdrop-filter: blur(6px);
    transition: opacity 1.65s ease-out;
  }
  header nav a, header .brand span { text-shadow: 0 1px 3px #332920, 0 0 2px #332920; }
}
@media (min-width: 821px) and (hover: hover) and (pointer: fine) {
  #villas .planrow .thumb:hover { background: #f6f0e8; border-color: #bca993; }
  #villas .planrow .thumb { transition: background-color .22s, border-color .22s; }
}
@media (min-width: 821px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #galeria .thumb img { transition: transform .42s ease-out; }
  #galeria .thumb:hover img { transform: scale(1.02); }
}
@media (max-width: 820px) {
  header #mainnav.open {
    display: flex; flex-flow: column nowrap; align-items: stretch; gap: 0;
    inset-inline: auto max(8px, env(safe-area-inset-right));
    top: calc(100% + 3px); max-height: calc(100dvh - 64px);
    width: clamp(152px, 50vw, 250px); max-width: calc(100vw - 16px);
    overflow-y: auto; padding: 4px 8px;
    color: #fffdf9; background: rgb(48 37 30 / .60);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border: 1px solid rgb(255 253 249 / 24%); border-radius: 12px;
    box-shadow: 0 5px 14px rgb(38 27 21 / .12); animation: menu-in .24s ease-out;
  }
  header #mainnav a {
    align-self: stretch; min-height: 48px; justify-content: flex-end; text-align: end; padding-inline: 8px;
    color: #fffdf9; text-shadow: 0 1px 2px rgb(30 22 17 / .55);
    border-radius: 0; border-bottom: 1px solid rgb(255 253 249 / 23%);
  }
  header #mainnav a:last-child { border-bottom-color: transparent; }
  header #mainnav a:is(:hover,:focus-visible,[aria-current="location"]) {
    color: #fffdf9; background: rgb(25 18 13 / .18); border-radius: 8px;
  }
  header #mainnav a:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
  #ubicacion .directions {
    justify-self: start; min-height: 44px; padding: 0 4px; margin-top: -10px; border: 0;
    border-radius: 4px; color: #695849; font-size: .875rem; font-weight: 400;
    text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #a99785;
  }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 680px) and (orientation: portrait) {
  #inicio.hero { height: auto; min-height: 96svh; max-height: none; }
  #inicio .hero-image { position: absolute; inset: 0; height: 100%; }
  #inicio .hero-image picture { height: 100%; }
  #inicio .hero-image picture img { width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: 50% 58%; filter: brightness(1.045) saturate(1.055); }
  #inicio .hero-image::after {
    background: radial-gradient(ellipse 110% 35% at 12% 74%, rgb(29 22 17 / .72), rgb(29 22 17 / .42) 44%, transparent 100%);
  }
  #inicio .hero-copy { align-self: end; margin: 76px var(--g) clamp(26px,5svh,52px); }
  #inicio .hero-copy h1 { font-size: clamp(2.6rem,11vw,3.75rem); }
  #inicio .hero-copy .lead { margin-top: 8px; max-width: none; text-wrap: pretty; }
  #inicio .hero-location { display: block; }
  #inicio .hero-copy .offer { margin-top: 10px; }
  #inicio .offer { gap: 12px; }
}
@media (max-width: 640px) {
  #contacto { min-height: clamp(550px,91.3svh,682px); }
  #contacto .field-control :is(input,textarea) {
    background: rgb(255 253 249 / .496);
    color: #211b16;
    padding-block: 22px 4px;
    line-height: 1.3;
  }
  #contacto .field-control input { min-height: 49px; }
  #contacto .field-control textarea { min-height: 70px; }
  #contacto .field-control label { color: #211b16; top: 12px; }
  #contacto .field-control :is(input,textarea):is(:focus,:not(:placeholder-shown),:autofill) + label { top: 2px; }
  #contacto .field-control :is(input,textarea):focus { background: rgb(255 253 249 / .676); }
  #galeria .gallery-grid img { aspect-ratio: 4 / 5; }
  #ubicacion .place-intro { width: 100%; }
  #ubicacion .place-intro .intro { max-width: none; text-wrap: pretty; }
  #inversion .payment-schedule { row-gap: 16px; }
  #inversion .payment-schedule li:not(:last-child)::before { height: calc(100% + 16px); }
}
@media (prefers-reduced-motion: reduce) {
  header::before, #villas .planrow .thumb, #villas .planrow .thumb img { transition: none; }
  header #mainnav.open { animation: none; }
}

@media (max-width: 640px) {
  #ubicacion .cabarete-distance { display: inline-block; max-width: 100%; }
}
.viewer-dots { display: none; }
@media (max-width: 820px) {
  #viewer[data-group="photos"] .viewer-figure { width: 100%; }
  #viewer[data-group="photos"] button { touch-action: manipulation; }
  #viewer[data-group="photos"] .viewer-stage {
    height: min(65vw, calc(90svh - 158px));
    aspect-ratio: auto;
  }
  #viewer[data-group="photos"]:not(.zoomed) .viewer-stage img { object-fit: cover; }
  #viewer[data-group="photos"] #viewer-caption { min-height: 2.9em; }
  #viewer[data-group="photos"] .viewer-nav { display: none; }
  #viewer[data-group="photos"] .viewer-dots:not(:empty) { display: flex; justify-content: center; }
  #viewer .viewer-dots button {
    display: grid; place-items: center; flex: 0 1 44px; min-width: 24px; min-height: 44px;
    padding: 0; border: 0; background: transparent; border-radius: 8px;
  }
  #viewer .viewer-dots button::before {
    content: ""; display: block; width: 6px; height: 6px; border-radius: 6px; background: #978678;
  }
  #viewer .viewer-dots button[aria-current="true"]::before { width: 15px; background: #79523b; }
}

:root { --image-radius: 12px; }

#inicio, #contacto,
#proyecto .living-room a, #galeria .thumb, #ubicacion .area-map {
  border-radius: var(--image-radius);
  overflow: clip;
}
#ubicacion .aerial, #villas .planrow .thumb img,
#villas .planrow figure:first-child img, #viewer .viewer-stage {
  border-radius: var(--image-radius);
}

#proyecto .intro,
#proyecto .panel p,
#ubicacion .intro,
#villas .plans > h2 + p,
#inversion .investment-price,
#inversion .stage-name {
  color: #75695f;
}


@media (min-width: 641px) {
  .plan-dots { display: none; }
}
@media (min-width:900px) {
  #villas .plans { display:block; }
  #villas .plans > p:not(.kicker) { max-width:none; margin:8px 0 0; }
  #villas .planrow { gap:18px; margin:20px 0 0; }
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 12px var(--g);
}
.footer-credit {
  --footer-logo-height: clamp(20.16px, 5.88vw, 29.12px);
  --credit-gap: clamp(8px, 2.4vw, 20px);
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}
.footer-credit img { display: block; width: auto; height: var(--footer-logo-height); }
.footer-wording {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: var(--credit-gap);
  margin-inline: 4px var(--credit-gap);
  padding-inline-start: 6px;
  line-height: 1;
}
.footer-wording::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  height: calc(var(--footer-logo-height) * .62);
  border-inline-start: 1px solid var(--line);
}
.footer-residences {
  font-size: clamp(7.84px, 2.016vw, 11.2px);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.footer-byline { color: var(--muted); font-size: .8125rem; }
.footer-links { display: flex; align-items: center; justify-self: end; gap: 14px; margin-right: max(0px, calc(70px - var(--g))); }
.footer-links a { margin: 0; }
#contacto .field-control textarea {
  font-size: var(--type-caption);
  font-weight: 400;
  padding-top: 32px;
  field-sizing: content;
  max-height: 14rem;
}
#contacto .field-control textarea:is(:focus, :not(:placeholder-shown), :autofill) + label {
  top: 9px;
}
@media (max-width: 640px) {
  #contacto .field-control textarea { padding-top: 26px; padding-bottom: 6px; }
  #contacto .field-control textarea:is(:focus, :not(:placeholder-shown), :autofill) + label { top: 6px; }
}
@media (max-width: 820px) {
  footer { grid-template-columns: 1fr; justify-items: center; gap: 14px; padding: 16px 8px 4px; }
  .footer-credit { grid-column: 1; }
  .footer-links { justify-self: center; margin: 0; }
}
@media (max-width: 350px) {
  .footer-credit { --credit-gap: 4px; }
  .footer-wording { margin-inline-start: 2px; padding-inline-start: 3px; }
}

/* Ronda 02: punto sutil aprobado en las tres columnas. */
#proyecto .detail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  color: #75695f;
}
#proyecto .detail-list li {
  position: relative;
  margin: 0;
  padding-left: 20px;
  text-align: left;
}
#proyecto .detail-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
