/* Vapor & Ar · página Trabalhos
   Índice editorial com prévia que segue o cursor, filtro por setor com contagem,
   trilho de fotos de campo com arrasto e atestados em papel. */

/* ---------- topo ---------- */
.tb-topo { position: relative; overflow: hidden; background: var(--ink); color: #c9d6e4; padding: var(--topo-y) 0 calc(var(--topo-y) * .85); }
.tb-topo-bg { position: absolute; inset: 0 0 0 38%; }
.tb-topo-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .42; filter: grayscale(1) contrast(1.1); }
.tb-topo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--heat) 0%, var(--heat-2) 30%, transparent 70%); opacity: .8; }
.tb-topo-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ink) 0%, rgba(13, 26, 43, .82) 35%, rgba(13, 26, 43, .55) 100%), linear-gradient(0deg, var(--ink), transparent 50%); }
.tb-topo .wrap { position: relative; }
.tb-topo h1 { color: #fff; margin-bottom: .3em; }
.tb-topo .lead { color: #c4d3e3; max-width: 34em; margin: 0; }
.tb-topo-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: end; }
.tb-cont { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid rgba(255, 255, 255, .18); }
.tb-cont > div { padding: 16px 0 0; }
.tb-cont > div + div { padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .12); }
.tb-cont dt { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #93acc4; }
.tb-cont dd { margin: 6px 0 0; font-family: var(--serif); font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .tb-topo-grid { grid-template-columns: 1fr; }
  .tb-topo-bg { inset: 0; }
  .tb-topo-bg img { opacity: .28; }
}

/* ---------- índice ---------- */
.tb-cab { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 14px 32px; margin-bottom: clamp(18px, 2.4vw, 28px); }
.tb-cab h2 { margin: 0; }
.tb-filtros { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.tb-filtros button {
  background: none; border: 0; padding: 10px 0; min-height: 44px; cursor: pointer; font: 500 .95rem/1 var(--sans); color: var(--muted);
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.tb-filtros button sup { font-family: var(--mono); font-size: .7rem; color: var(--blue); margin-left: 2px; }
.tb-filtros button:hover { color: var(--ink); }
.tb-filtros button[aria-pressed="true"] { color: var(--ink); border-color: var(--heat); }

.tb-lista { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.tb-item { border-top: 1px solid var(--line); transition: opacity .35s var(--ease); }
.tb-item[hidden] { display: none; }
.tb-h { margin: 0; font: inherit; }
.tb-linha {
  width: 100%; background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink); font: inherit;
  display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(0, 15rem) 12rem 30px; gap: 0 24px; align-items: center;
  padding: clamp(18px, 2vw, 24px) 0; position: relative;
}
.tb-linha::before { content: ""; position: absolute; left: 0; top: -1px; height: 2px; width: 0; background: var(--heat); transition: width .5s var(--ease); }
.tb-n { font-family: var(--mono); font-size: .85rem; color: var(--muted); transition: color .3s; align-self: start; padding-top: .55em; }
.tb-tit { font-family: var(--serif); font-size: clamp(1.3rem, 2.1vw, 1.85rem); line-height: 1.15; letter-spacing: -.01em; transition: transform .45s var(--ease); }
.tb-cli { font-weight: 600; font-size: .95rem; line-height: 1.35; color: var(--ink-2); }
.tb-loc { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); line-height: 1.6; }
.tb-mini { display: none; }
.tb-mais { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: background .3s, border-color .3s, transform .45s var(--ease); justify-self: end; }
.tb-mais::before, .tb-mais::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; margin: -.75px 0 0 -5.5px; background: var(--ink); transition: transform .35s var(--ease), background .3s; }
.tb-mais::after { transform: rotate(90deg); }
.tb-linha[aria-expanded="true"] .tb-mais { background: var(--ink); border-color: var(--ink); transform: rotate(180deg); }
.tb-linha[aria-expanded="true"] .tb-mais::before { background: #fff; }
.tb-linha[aria-expanded="true"] .tb-mais::after { transform: rotate(0); background: #fff; }
.tb-linha:hover::before, .tb-linha[aria-expanded="true"]::before { width: 100%; }
.tb-linha:hover .tb-n, .tb-linha[aria-expanded="true"] .tb-n { color: var(--heat); }
.tb-linha:hover .tb-tit { transform: translateX(8px); }
.tb-lista.tem-foco .tb-item:not(.foco) .tb-linha { opacity: .42; }
.tb-linha { transition: opacity .35s var(--ease); }

/* painel: abre com altura animada (grid 0fr -> 1fr) */
.tb-painel { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .55s var(--ease); }
.tb-painel-in { overflow: hidden; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); padding: 0 0 0 76px; }
.tb-painel-in > * { margin-bottom: clamp(22px, 2.6vw, 32px); }
.js .tb-item:not(.aberto) .tb-painel { grid-template-rows: 0fr; }
.js .tb-item:not(.aberto) .tb-painel-in { visibility: hidden; transition: visibility 0s .55s; }
.tb-fig { margin: 0; position: relative; border-radius: var(--r); overflow: hidden; background: var(--ink); aspect-ratio: 16 / 10; }
.tb-fig > img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); } /* algumas fotos do portfólio têm moldura branca */
.tb-fig.logo { background: #fff; border: 1px solid var(--line); display: grid; place-items: center; align-content: center; gap: 14px; padding: 24px; }
.tb-fig.logo > img { width: auto; height: auto; max-width: 58%; max-height: 120px; object-fit: contain; }
.tb-fig.logo figcaption { font-size: .8rem; color: var(--muted); text-align: center; }
.tb-badge { position: absolute; left: 12px; top: 12px; background: #fff; border-radius: 10px; padding: 7px 10px; box-shadow: var(--shadow); }
.tb-badge img { height: 30px; width: auto; max-width: 110px; object-fit: contain; }
.tb-txt { align-self: center; }
.tb-rot { font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }
.tb-itens { list-style: none; counter-reset: it; padding: 0; margin: 0 0 18px; }
.tb-itens li { counter-increment: it; display: grid; grid-template-columns: 34px 1fr; padding: 10px 0; border-top: 1px solid var(--line-2); color: var(--ink-2); }
.tb-itens li::before { content: counter(it, decimal-leading-zero); font-family: var(--mono); font-size: .78rem; color: var(--heat); padding-top: 3px; }
.tb-quem { font-size: .92rem; color: var(--muted); margin: 0 0 14px; }
.tb-quem strong { color: var(--ink); }
.tb-nota { font-size: .82rem; color: var(--muted); margin: 18px 0 0; max-width: 60em; }

/* prévia que segue o cursor (só com mouse) */
.tb-cursor {
  position: fixed; left: 0; top: 0; z-index: 60; width: 300px; aspect-ratio: 4 / 3; pointer-events: none; border-radius: 12px; overflow: hidden;
  background: var(--ink); box-shadow: 0 24px 60px rgba(13, 26, 43, .28); opacity: 0; transform: translate3d(-999px, -999px, 0) scale(.85);
  transition: opacity .25s, scale .35s var(--ease); will-change: transform;
}
.tb-cursor.on { opacity: 1; }
.tb-cursor img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); }
.tb-cursor.logo img { transform: none; }
.tb-cursor.logo { background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.tb-cursor.logo img { width: auto; height: auto; max-width: 64%; max-height: 52%; object-fit: contain; }
@media (hover: none), (pointer: coarse) { .tb-cursor { display: none; } }

@media (max-width: 1020px) {
  .tb-linha { grid-template-columns: 44px minmax(0, 1fr) 12rem 30px; }
  .tb-loc { display: none; }
}
@media (max-width: 720px) {
  .tb-linha { grid-template-columns: minmax(0, 1fr) 64px; gap: 6px 14px; padding: 16px 0; }
  .tb-n { grid-column: 1; padding: 0; font-size: .74rem; }
  .tb-n::after { content: attr(data-loc); }
  .tb-tit { grid-column: 1; font-size: 1.22rem; }
  .tb-cli { grid-column: 1; font-weight: 500; font-size: .88rem; color: var(--muted); }
  .tb-mini { display: block; grid-column: 2; grid-row: 1 / span 3; align-self: center; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--ink); }
  .tb-mini img { width: 100%; height: 100%; object-fit: cover; }
  .tb-mini.logo { background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
  .tb-mini.logo img { width: auto; height: auto; max-width: 80%; max-height: 60%; object-fit: contain; }
  .tb-mais { display: none; }
  .tb-linha:hover .tb-tit { transform: none; }
  .tb-painel-in { grid-template-columns: 1fr; padding: 0; gap: 16px; }
  .tb-painel-in > * { margin-bottom: 0; }
  .tb-painel-in > :last-child { margin-bottom: 22px; }
  .tb-filtros { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scrollbar-width: none; gap: 20px; width: calc(100% + var(--gutter) * 2); }
  .tb-filtros::-webkit-scrollbar { display: none; }
  .tb-filtros button { white-space: nowrap; flex: none; }
  .tb-cont dd { font-size: 1.8rem; }
  .tb-cont > div + div { padding-left: 10px; }
}

/* ---------- trilho de fotos de campo ---------- */
.tb-campo { overflow: hidden; }
.tb-campo-cab { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: var(--head-gap); }
.tb-campo-cab h2 { margin-bottom: .25em; }
.tb-campo-cab .lead { margin: 0; font-size: 1.05rem; }
.tb-setas { display: flex; gap: 10px; flex: none; }
.tb-setas button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff; font-size: 1.2rem; cursor: pointer; transition: background .25s, border-color .25s; }
.tb-setas button:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.tb-setas button:disabled { opacity: .3; cursor: default; }
.tb-trilho {
  --ini: max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  display: flex; gap: clamp(12px, 1.6vw, 20px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: 0 var(--ini); scroll-padding: 0 var(--ini); scrollbar-width: none; cursor: grab;
}
.tb-trilho::-webkit-scrollbar { display: none; }
.tb-trilho.arrastando { cursor: grabbing; scroll-snap-type: none; }
.tb-trilho.arrastando img { pointer-events: none; }
.tb-trilho:focus-visible { outline-offset: -3px; }
.tb-foto { margin: 0; flex: none; scroll-snap-align: start; width: clamp(240px, 30vw, 400px); user-select: none; }
.tb-foto-img { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #0a1524; }
.tb-foto-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s; filter: saturate(.85); }
.tb-foto:hover .tb-foto-img img { transform: scale(1.04); filter: saturate(1); }
.tb-foto.desenho .tb-foto-img { background: #fff; }
.tb-foto.desenho .tb-foto-img img { object-fit: contain; padding: 10px; filter: none; }
.tb-foto.termo .tb-foto-img { box-shadow: inset 0 0 0 1px rgba(240, 138, 60, .45); }
.tb-foto figcaption { padding: 12px 2px 0; font-size: .9rem; color: #c4d3e3; line-height: 1.4; }
.tb-foto figcaption span { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); margin-bottom: 4px; }
.tb-foto.termo figcaption span { color: var(--heat-2); }
.tb-progresso { height: 2px; background: rgba(255, 255, 255, .14); margin-top: clamp(20px, 2.4vw, 28px); border-radius: 2px; overflow: hidden; }
.tb-progresso i { display: block; height: 100%; width: 100%; background: var(--sky); transform-origin: 0 50%; transform: scaleX(.2); transition: transform .2s; }
@media (max-width: 720px) {
  .tb-setas { display: none; }
  .tb-foto { width: 78vw; }
}

/* ---------- atestados ---------- */
.tb-at-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.tb-at-txt h2 { margin-bottom: .35em; }
.tb-at-txt > p { color: var(--muted); }
.tb-at-lista { list-style: none; padding: 0; margin: 20px 0 0; }
.tb-at-lista li { padding: 14px 0 14px 16px; border-top: 1px solid var(--line); border-left: 2px solid transparent; transition: border-color .3s, background .3s; }
.tb-at-lista li:last-child { border-bottom: 1px solid var(--line); }
.tb-at-lista li.ativo { border-left-color: var(--heat); background: linear-gradient(90deg, rgba(212, 97, 42, .06), transparent 70%); }
.tb-at-lista .mono { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.tb-at-lista b { display: block; font-family: var(--serif); font-size: 1.2rem; font-weight: 500; color: var(--ink); margin: 2px 0; }
.tb-at-lista li > span:last-child { display: block; font-size: .9rem; color: var(--muted); line-height: 1.5; }
.tb-docs { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: center; padding: 12px clamp(8px, 2vw, 24px); }
.tb-doc {
  position: relative; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in;
  box-shadow: var(--shadow-lg); transition: transform .5s var(--ease), box-shadow .5s, z-index 0s .1s;
}
.tb-doc img { width: 100%; height: auto; border-radius: 2px; }
.tb-doc.d1 { transform: rotate(-4deg) translate(10%, 4%); z-index: 1; }
.tb-doc.d2 { transform: rotate(3deg) translate(-8%, -3%); z-index: 2; }
.tb-doc:hover, .tb-doc:focus-visible, .tb-doc.ativo { transform: rotate(0) translate(0, -6px) scale(1.04); z-index: 3; box-shadow: 0 30px 70px rgba(13, 26, 43, .25); }
.tb-doc-zoom { position: absolute; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: #fff; font-size: .78rem; font-weight: 600; padding: 7px 11px; border-radius: 999px; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease); }
.tb-doc-zoom svg { width: 14px; height: 14px; }
.tb-doc:hover .tb-doc-zoom, .tb-doc:focus-visible .tb-doc-zoom { opacity: 1; transform: none; }
@media (hover: none) { .tb-doc-zoom { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .tb-at-grid { grid-template-columns: 1fr; }
  .tb-docs { order: -1; max-width: 520px; }
}

/* ---------- link para o relatório ---------- */
.tb-rel {
  margin-top: clamp(32px, 4vw, 52px); display: grid; grid-template-columns: 180px minmax(0, 1fr) 56px; gap: 24px; align-items: center;
  text-decoration: none; color: inherit; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 24px 14px 14px;
  transition: border-color .3s, box-shadow .3s, transform .35s var(--ease);
}
.tb-rel:hover { color: inherit; border-color: #c9d6e2; box-shadow: var(--shadow); transform: translateY(-2px); }
.tb-rel-img { border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--ink); }
.tb-rel-img img { width: 100%; height: 100%; object-fit: cover; }
.tb-rel-txt .mono { display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.tb-rel-txt b { display: block; font-family: var(--serif); font-size: clamp(1.25rem, 2vw, 1.55rem); font-weight: 500; color: var(--ink); margin: 2px 0 4px; line-height: 1.2; }
.tb-rel-txt > span:last-child { display: block; font-size: .92rem; color: var(--muted); }
.tb-rel-seta { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 1.2rem; transition: transform .35s var(--ease); }
.tb-rel:hover .tb-rel-seta { transform: translateX(4px); }
@media (max-width: 720px) {
  .tb-rel { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px; }
  .tb-rel-seta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tb-painel, .tb-linha::before, .tb-tit, .tb-mais, .tb-doc, .tb-foto-img img, .tb-cursor { transition: none !important; }
  .tb-trilho { scroll-behavior: auto; }
}
