/* =========================================================
   Construtor de páginas (Gavias Page Builder) — elementos fb
   ========================================================= */

/* Grelha de 12 colunas (empilha abaixo de 900px) */
.fb-full { width: 100%; }
.fb-grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(2rem, 1rem + 4vw, 5rem); row-gap: var(--sp-7);
}
.fb-grid--center { align-items: center; }
.fb-grid--start { align-items: start; }
.fb-grid--end { align-items: end; }
.fb-col { grid-column: 1 / -1; min-width: 0; }
.fb-col--start { align-self: start; }
.fb-col--center { align-self: center; }
.fb-col--end { align-self: end; }
@media (min-width: 900px) {
  .fb-col-1 { grid-column: span 1; } .fb-col-2 { grid-column: span 2; } .fb-col-3 { grid-column: span 3; }
  .fb-col-4 { grid-column: span 4; } .fb-col-5 { grid-column: span 5; } .fb-col-6 { grid-column: span 6; }
  .fb-col-7 { grid-column: span 7; } .fb-col-8 { grid-column: span 8; } .fb-col-9 { grid-column: span 9; }
  .fb-col-10 { grid-column: span 10; } .fb-col-11 { grid-column: span 11; } .fb-col-12 { grid-column: span 12; }
}

/* Abaixo de 900px as colunas empilham: sem espaço horizontal (11 espaços × 32px excedem ecrãs de 360px) */
@media (max-width: 899px) { .fb-grid { column-gap: 0; } }

/* Tablet: colunas estreitas ficam lado a lado; imagens verticais empilhadas passam a horizontais */
@media (min-width: 600px) and (max-width: 899px) {
  .fb-grid { column-gap: var(--sp-5); }
  .fb-col-3 { grid-column: span 6; }
  .fb-col-4 { grid-column: span 4; }
  .fb-col-6 .media-frame img, .fb-col-12 .media-frame img, .media-stack__back img { aspect-ratio: 4 / 3; }
}

/* Espaçamento entre elementos dentro de uma coluna */
.fb-col > * + * { margin-top: var(--sp-5); }
.fb-col > .section-head { margin-bottom: 0; }
.fb-col > .section-head + * { margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.fb-col > .section-head + .checklist, .fb-col > .section-head + .prose, .fb-col > .section-head + .fb-buttons { margin-top: var(--sp-5); }
.fb-col > .fb-buttons, .fb-col > .checklist { margin-top: var(--sp-6); }
.fb-col > .service + .service { margin-top: 0; }
.fb-col.text-center .flex-actions { justify-content: center; }
.fb-col.text-center .section-head { margin-inline: auto; }
.fb-lead p { font-size: var(--fs-lg); color: var(--c-ink-soft); }
.fb-col > .field__hint { margin-top: var(--sp-4); }
.fb-col > .fb-mt-lg { margin-top: clamp(3rem, 2rem + 4vw, 6rem); }

/* Serviço: posição da imagem definida no elemento */
@media (min-width: 900px) {
  .fb-service .service__media { order: 0; }
  .fb-service.fb-service--reverse .service__media { order: 2; }
}

/* Secção sem espaçamento e secção com o cinzento da marca */
.section--none { padding-block: 0; }
.section--brand { background: var(--c-brand-grey); color: #f2f2f1; }
.section--brand h2, .section--brand h3 { color: var(--c-white); }
.section--brand .eyebrow, .section--brand .accent { color: var(--c-accent-bright); }
.section--brand .lead, .section--brand .prose p, .section--brand .feature p, .section--brand .stat__label { color: #dcdcdb; }
.section--brand .checklist li { color: #e6e6e5; }
.section--brand .link-arrow { color: var(--c-white); }

/* Pegada ecológica → Certificado A+ → Passive House (Início) */
.eco-steps { list-style: none; padding: 0; margin-top: var(--sp-6); display: grid; gap: var(--sp-4); }
.eco-steps li {
  position: relative; display: grid; grid-template-columns: 3rem 1fr; column-gap: var(--sp-4); align-items: start;
  padding: var(--sp-4) var(--sp-5); background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius-lg);
}
.eco-steps li + li::before {
  content: ""; position: absolute; left: calc(var(--sp-5) + 1.5rem - 1px); top: calc(-1 * var(--sp-4) - 1px);
  width: 2px; height: var(--sp-4); background: var(--c-accent-light);
}
.eco-steps__n {
  grid-row: span 2; width: 3rem; height: 3rem; display: grid; place-items: center; border-radius: 50%;
  background: var(--c-accent-light); color: var(--c-accent-deep); font-family: var(--f-display); font-weight: 800;
}
.eco-steps li:nth-child(2) .eco-steps__n { background: var(--c-accent); color: var(--c-white); }
.eco-steps h3 { font-size: var(--fs-lg); }
.eco-steps p { color: var(--c-ink-soft); font-size: var(--fs-sm); margin-top: 0.2rem; }
.eco-cert { margin: 0; padding: clamp(1.25rem, 1rem + 2vw, 2.5rem); background: var(--c-white); border-radius: var(--radius-lg); text-align: center; }
.eco-cert img { width: 100%; max-width: 340px; height: auto; margin-inline: auto; }
@media (max-width: 899px) {
  .eco-cert { display: grid; grid-template-columns: minmax(0, 220px) auto; justify-content: center; align-items: center; gap: var(--sp-5); }
  .eco-cert figcaption { margin-top: 0 !important; text-align: left; }
}
@media (max-width: 420px) { .eco-cert { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); } }
.eco-cert figcaption { margin-top: var(--sp-4); font-family: var(--f-display); font-weight: 700; color: var(--c-ink-soft); }

/* Alvará de obras públicas (Início) */
.alvara {
  display: grid; gap: var(--sp-3); justify-items: start;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border: 1px solid rgb(255 255 255 / 0.25); border-left: 4px solid var(--c-accent-bright);
  border-radius: var(--radius-lg); background: rgb(0 0 0 / 0.12);
}
.alvara__label { font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-accent-bright); }
.alvara__num { font-family: var(--f-display); font-weight: 800; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); line-height: 1; letter-spacing: -0.02em; color: var(--c-white); }
.alvara__name { color: #dcdcdb; }

/* Projeto-tipo ainda sem imagem */
.model__media--empty { display: grid; place-items: center; background: var(--c-concrete); border: 1.5px dashed var(--c-line); }
.model__placeholder { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-6); text-align: center; color: var(--c-muted); font-size: var(--fs-sm); }
.model__placeholder svg { width: 64px; height: 64px; color: var(--c-accent); }

/* Invólucro do construtor */
.gavias-builder--content:empty { display: none; }
