/* The legacy gallery hides images without is-active; the new viewer uses one persistent image. */
.gallery.viewer-gallery{aspect-ratio:auto;overflow:visible;background:transparent}
.gallery.viewer-gallery .viewer-stage .viewer-image{display:block!important}

/* Keep the project-page brand mark at the same size as the homepage mark. */
body .nav img#navIcon{width:42px;height:42px}

/* The related-projects row should contain projects, not service articles. */
.related li:not(:has(a[href*="proyecto-"],a[href*="proyectos.html#"])){display:none}

/* Match the main site's footer layout while keeping project-page colors. */
body .foot{background:#2a4a3a;padding:30px 72px 58px}
body .foot .foot-inner{width:100%;max-width:none;min-height:36px;grid-template-columns:1fr auto 1fr;gap:18px;position:relative}
body .foot .foot-mark{width:36px;height:36px;opacity:.55}
body .foot .foot-tag{font-family:Sinteca,sans-serif;font-size:10.5px;font-weight:400;letter-spacing:.3em;color:rgba(244,239,228,.82);white-space:nowrap}
body .foot .foot-cp{font-family:Sinteca,sans-serif;font-size:clamp(9px,.82vw,11.5px);font-weight:400;letter-spacing:normal;text-transform:none;color:rgba(244,239,228,.72);justify-self:end;white-space:nowrap}
body .foot .foot-links{position:absolute;top:calc(100% + 16px);left:50%;transform:translateX(-50%);display:flex;gap:0;margin:0;white-space:nowrap;font-size:10.5px;letter-spacing:.14em}
body .foot .foot-links a{color:rgba(244,239,228,.5);text-decoration:none;border-bottom:1px solid rgba(244,239,228,.16);padding-bottom:2px}
body .foot .foot-links a:hover{color:#f4efe4;border-bottom-color:#f4efe4}
body .foot .foot-links a+a::before{content:"·";display:inline-block;margin:0 9px;color:rgba(244,239,228,.5)}
@media(max-width:1050px){
  body .foot{padding:24px 20px}
  body .foot .foot-inner{grid-template-columns:1fr;justify-items:center;gap:14px}
  body .foot .foot-tag{white-space:normal;text-align:center}
  body .foot .foot-cp{justify-self:center;text-align:center}
  body .foot .foot-links{position:static;transform:none;justify-content:center;flex-wrap:wrap;margin-top:16px;white-space:normal}
}


/* Fixed project selectors switch the main project content in place. */
.related-projects{margin:60px 0 0}
body .hero img{transition:opacity .24s ease}
body .hero img.is-changing{opacity:.2}
.related-projects h2{font:clamp(26px,3.5vw,40px)/1.1 Timeless,serif;margin:0 0 18px}
.viewer-gallery .viewer-image.is-changing{opacity:.18!important}
/* Project selector as an editorial numbered index (not generic pills). */
.residential-buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:2px 4px;padding-top:14px;counter-reset:proj;border:0}
.residential-buttons button{counter-increment:proj;position:relative;border:0;border-radius:0;background:transparent;padding:12px 18px;color:#9b9484;font:600 11px/1 Sinteca,sans-serif;text-transform:uppercase;letter-spacing:.14em;white-space:nowrap;cursor:pointer;transition:color .3s ease}
.residential-buttons button::before{content:counter(proj,decimal-leading-zero);margin-right:9px;color:#a6462f;opacity:.7;font-variant-numeric:tabular-nums}
.residential-buttons button::after{content:"";position:absolute;left:18px;right:18px;bottom:3px;height:1.5px;background:#a6462f;transform:scaleX(0);transform-origin:center;transition:transform .3s ease}
.residential-buttons button:hover,.residential-buttons button:focus-visible{color:#315c4b;background:transparent}
.residential-buttons button.is-active{color:#1f3b30}
.residential-buttons button.is-active::after{transform:scaleX(1)}


/* Residencial / Comercial switch as two editorial tabs with a hairline divider. */
.portfolio-toggle{display:flex;width:fit-content;gap:0;margin:0 auto 18px;padding:0;border:0;border-radius:0}
.portfolio-toggle a,.portfolio-toggle span{position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:auto;padding:8px 20px;border-radius:0;background:transparent;font:600 11px Sinteca,sans-serif;text-transform:uppercase;letter-spacing:.18em;color:#9b9484;text-decoration:none;transition:color .3s ease}
.portfolio-toggle>*+*::before{content:"";position:absolute;left:0;top:50%;transform:translateY(-50%);width:1px;height:12px;background:rgba(49,92,75,.22)}
.portfolio-toggle .is-active{background:transparent;color:#1f3b30}
.portfolio-toggle .is-active::after{content:"";position:absolute;left:20px;right:20px;bottom:1px;height:1.5px;background:#a6462f}
.portfolio-toggle a:hover,.portfolio-toggle a:focus-visible{background:transparent;color:#315c4b}


/* Keep the top nav inside the frame on tablet/intermediate widths. */
@media(max-width:1000px){
  body .nav{padding:0 16px}
  body .nav .nl{gap:12px}
  body .nav .nl a{font-size:10px;letter-spacing:.08em}
  body .nav .nav-wa{padding:10px 12px}
  body .nav .nav-cta{padding:11px 13px}
}
@media(max-width:820px){
  body .nav .nl li:nth-child(-n+5){display:none}
  body .nav .nl{gap:10px}
}
