/* Sousa Solution — cards de obra (carrossel) e ampliação. 03/12/2026: redesign "régua do assentador" (DESIGN.md).
   Um card = uma obra. FOTOS INTEIRAS (proporção nativa, nada cortado): a caixa é 3:4, a proporção da maioria das fotos do
   acervo (celular em pé); foto deitada fica inteira, centrada sobre o preto. As obras formam uma parede de peças com
   rejunte (6 px). Sem JS: a trilha rola na horizontal e cada foto abre o derivado maior. Com JS (gallery.js): setas,
   contador "1 / N", teclado e ampliação em <dialog>. Sem autoplay. */

.grid-note { position: relative; margin: 0 0 22px; padding-left: 26px; font-size: .95rem; max-width: 80ch; color: var(--c-muted); }
.grid-note::before { content: ''; position: absolute; left: 0; top: calc(.75em - 6.5px); width: 13px; height: 13px; background: var(--plus); }
.tone-alu .grid-note { color: var(--c-steel-2); }
.project-grid { display: grid; gap: var(--joint); grid-template-columns: minmax(0, 1fr); align-items: stretch; }
/* 2 colunas (tablet): com número ímpar de obras, a última vira uma fileira inteira (foto à esquerda, texto à direita) */
@media (min-width: 700px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) and (max-width: 1099.98px) {
  .project-grid:not(.project-grid-one):has(> .project-card:first-child:nth-last-child(2n+1)) > .project-card:last-child { grid-column: 1 / -1; flex-direction: row; }
  .project-grid:not(.project-grid-one):has(> .project-card:first-child:nth-last-child(2n+1)) > .project-card:last-child .pc-media { flex: 0 0 calc(50% - var(--joint) / 2); }
}
/* 3 colunas (computador, grade de 6): nunca uma obra sozinha na última fileira. Sobra 1 → as 4 primeiras em 2 + 2;
   sobra 2 → as 2 primeiras em dupla. As obras em dupla ficam maiores (abrem a parede). */
@media (min-width: 1100px) {
  .project-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .project-grid > .project-card { grid-column: span 2; }
  .project-grid:not(.project-grid-one):has(> .project-card:first-child:nth-last-child(3n+1)) > .project-card:nth-child(-n+4),
  .project-grid:not(.project-grid-one):has(> .project-card:first-child:nth-last-child(3n+2)) > .project-card:nth-child(-n+2) { grid-column: span 3; }
}
/* uma obra só: foto grande à esquerda, título e fatos à direita */
.project-grid-one { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .project-grid-one > .project-card { grid-column: 1 / -1; flex-direction: row; }
  .project-grid-one .pc-media { flex: 0 0 56%; }
  .project-grid-one .pc-body { align-self: end; padding: 40px 44px; }
  .project-grid-one .pc-title { font-size: 1.9rem; }
}

.project-card { display: flex; flex-direction: column; background: var(--c-tile); }
.tone-alu .project-card { background: var(--c-alu-tile); }
/* a foto fica inteira sobre a própria peça (as sobras laterais têm a cor da peça, sem faixa preta) */
.pc-media { position: relative; overflow: hidden; }
.pc-track {
  display: flex; align-items: center; margin: 0; padding: 0; list-style: none; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; aspect-ratio: 4 / 5;
}
@media (min-width: 700px) { .pc-track { aspect-ratio: 3 / 4; } } /* celular 4:5 (a página não fica comprida demais) */
/* obra com metade ou mais das fotos deitadas (cozinhas, pisos): caixa 4:3 em todas as telas */
.pc-landscape .pc-track { aspect-ratio: 4 / 3; }
.pc-track::-webkit-scrollbar { display: none; }
.pc-track:focus-visible { outline: 2px solid var(--c-gold); outline-offset: -2px; }
.pc-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pc-figure { margin: 0; position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: stretch; justify-content: center; }
.pc-zoom { display: flex; flex: 1; min-height: 0; width: 100%; align-items: center; justify-content: center; cursor: zoom-in; }
.pc-zoom:focus-visible { outline: 2px solid var(--c-gold); outline-offset: -2px; }
.pc-zoom .media { width: 100%; height: 100%; }
.pc-zoom .media img { width: 100%; height: 100%; object-fit: contain; transition: transform .9s var(--ease); }
.pc-zoom:hover .media img { transform: scale(1.025); }
/* etapa (só nas obras com fotos durante e depois): uma linha SOB a foto, nunca por cima dela */
.pc-stage {
  flex: none; align-self: flex-start; margin: 10px 0 0 16px; padding: 4px 9px; font-size: .7rem; font-stretch: 110%; font-weight: 640;
  letter-spacing: .1em; text-transform: uppercase; color: var(--c-head); border: 1px solid var(--c-hair-strong);
}
.pc-stage.stage-after { background: var(--c-gold); border-color: var(--c-gold); color: var(--c-on-gold); }
/* setas e contador numa régua SOB a foto (nada escuro sobre a imagem) */
.pc-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0; }
.pc-controls[hidden] { display: none; }
.pc-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); cursor: pointer;
  background: transparent; color: var(--c-head); border: 1px solid var(--c-hair-strong);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, opacity .16s ease;
}
.pc-btn:hover { background: var(--c-gold); color: var(--c-on-gold); border-color: var(--c-gold); }
.pc-btn[disabled] { opacity: .3; cursor: default; background: transparent; color: var(--c-head); border-color: var(--c-hair-strong); }
.tone-alu .pc-btn, .tone-alu .pc-btn[disabled] { color: var(--c-steel); border-color: rgba(20, 20, 22, .3); }
.pc-count { order: -1; margin-right: auto; padding-left: 8px; color: var(--c-muted); font-size: .86rem; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.tone-alu .pc-count { color: var(--c-steel-2); }
.pc-body { padding: 18px 20px 22px; }
.pc-title { margin: 0 0 8px; font-size: 1.3rem; line-height: 1.14; }
.pc-area { margin: 0 0 2px; font-size: .92rem; font-weight: 600; color: var(--c-gold); }
/* cidade sorteada ("Serving <cidade> and the Atlanta area") em cinza; só a cidade real da obra fica em dourado */
.project-card[data-city-real="no"] .pc-area { color: var(--c-muted); font-weight: 520; }
.tone-alu .pc-area, .tone-alu .project-card[data-city-real="no"] .pc-area { color: var(--c-steel); }
.pc-facts { margin: 0; font-size: .86rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.tone-alu .pc-facts { color: var(--c-steel-2); }

/* ampliação (criada pelo gallery.js) */
.lightbox { border: 0; padding: 0; margin: auto; max-width: 96vw; max-height: 94vh; background: transparent; color: var(--c-head); overflow: visible; }
.lightbox::backdrop { background: rgba(var(--rgb-ink), .95); }
.lightbox-inner { display: grid; gap: 12px; justify-items: center; }
.lightbox img { display: block; max-width: 94vw; max-height: 82vh; width: auto; height: auto; background: var(--c-ink); }
.lightbox-bar { display: flex; align-items: center; justify-content: center; gap: 10px; }
.lightbox-btn {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: var(--radius); border: 0;
  background: var(--c-gold); color: var(--c-on-gold); font: inherit; font-weight: 640; cursor: pointer; transition: background-color .16s ease;
}
.lightbox-btn:hover { background: var(--c-gold-h); }
.lightbox-btn[disabled] { opacity: .4; cursor: default; }
.lightbox-count { font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: center; color: var(--c-muted); }
.lightbox-title { margin: 0; max-width: 90vw; text-align: center; font-stretch: var(--stamp-w); font-weight: 680; font-size: 1.2rem; line-height: 1.2; color: var(--c-head); }
.lightbox-title:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open] { animation: lb-in .32s var(--ease) both; }
  .lightbox[open]::backdrop { animation: lb-fade .32s ease both; }
}
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pc-track { scroll-behavior: auto; } }
