/* =========================================================
   Projetos: card (lista) e detalhe (ao abrir)
   Usado no site e no modo apresentação
   ========================================================= */

/* artes com texto: inteiras, sobre fundo desfocado da própria imagem */
.poster-box { position: relative; overflow: hidden; background: var(--blue-2); }
.poster-box::before { content: ""; position: absolute; inset: -20px; background: var(--poster) center / cover no-repeat; filter: blur(18px) saturate(1.1); opacity: .65; transform: scale(1.1); }
.poster-box img.fit-contain { position: relative; z-index: 1; object-fit: contain !important; object-position: center !important; }
.poster-box > span { z-index: 2; }

/* ---------- status ---------- */
.pst { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 6px 11px; border-radius: 999px; border: 1.5px solid var(--ink); color: var(--ink); background: #fff; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pst::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pst.ok { background: var(--g-blue); color: #fff; border-color: transparent; }
.pst.obra { background: var(--g-yellow); color: var(--blue-2); border-color: transparent; }
.pst.compromisso { background: #fff8d6; border-color: var(--yellow-2); color: #7a5f05; }
.pst.cobranca { border-color: var(--blue-2); color: var(--blue-2); }
.pst.proposta { border-color: var(--ink-soft); color: var(--ink-soft); border-style: dashed; }

/* ---------- capa da marca (projetos sem foto) ---------- */
.pbrand { position: relative; background: var(--g-blue); color: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 18px; overflow: hidden; }
.pbrand::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 2px solid rgba(232,226,62,.35); }
.brand-ico { width: 46px; height: 46px; fill: none; stroke: var(--yellow-1); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-tag { position: relative; z-index: 1; font-weight: 900; text-transform: uppercase; font-size: 1.25rem; line-height: 1; letter-spacing: -.01em; }

/* ---------- card ---------- */
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; text-align: left; background: #fff; border: 1px solid var(--line-soft); border-radius: 20px; overflow: hidden; padding: 0; cursor: pointer; font: inherit; color: var(--ink); box-shadow: 0 10px 24px -20px rgba(45,63,137,.55); transition: transform .2s, box-shadow .2s, border-color .2s; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--blue-1); }
.pcard:active { transform: scale(.985); }
.pcard-media { aspect-ratio: 16/10; flex: none; background: var(--mist); }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.pcard-title { font-weight: 900; text-transform: uppercase; color: var(--blue-2); font-size: 1.02rem; line-height: 1.1; text-wrap: balance; }
.pcard-sum { font-size: .9rem; line-height: 1.45; color: var(--ink-soft); }
.pcard-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pcard-foot b { font-weight: 900; color: var(--blue-1); font-size: 1.05rem; }
.pcard-open { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .85rem; color: var(--blue-1); }
.pcard-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- detalhe ---------- */
.pdet { display: grid; gap: 22px; }
.pdet svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pdet-hero { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 24px; align-items: stretch; }
.pdet-media { border-radius: 20px; overflow: hidden; aspect-ratio: 4/3; background: var(--mist); }
.pdet-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdet-media.pbrand { padding: 26px; }
.pdet-media.pbrand .brand-ico { width: 64px; height: 64px; }
.pdet-media.pbrand .brand-tag { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.pdet-head { display: flex; flex-direction: column; gap: 12px; justify-content: center; min-width: 0; }
.pdet-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pdet-cat { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-1); }
.pdet-cat svg { width: 18px; height: 18px; }
.pdet-title { margin: 0; font-weight: 900; text-transform: uppercase; color: var(--blue-2); font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: .98; text-wrap: balance; }
.pdet-sum { margin: 0; font-size: 1.05rem; color: var(--ink-soft); line-height: 1.5; }
.pdet-facts { margin: 4px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.pdet-facts div { border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.pdet-facts dt { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.pdet-facts dd { margin: 2px 0 0; font-weight: 900; color: var(--blue-2); font-size: .98rem; line-height: 1.2; }

.pdet-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pdet-steps li { background: var(--mist); border-radius: 16px; padding: 16px 18px 18px; position: relative; }
.pdet-steps li:not(:last-child)::after { content: ""; position: absolute; right: -11px; top: 50%; width: 10px; height: 10px; border-top: 2px solid var(--line); border-right: 2px solid var(--line); transform: translateY(-50%) rotate(45deg); z-index: 1; }
.pdet-steps .k { display: flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-1); margin-bottom: 8px; }
.pdet-steps .k i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-1); color: #fff; font-weight: 900; font-size: .78rem; letter-spacing: 0; }
.pdet-steps p { margin: 0; font-size: 1rem; line-height: 1.5; }
.pdet-steps p strong { color: var(--blue-2); }
.pdet-steps li.res { background: var(--g-blue); }
.pdet-steps li.res .k { color: var(--yellow-1); }
.pdet-steps li.res .k i { background: var(--yellow-1); color: var(--blue-2); }
.pdet-steps li.res p, .pdet-steps li.res p strong { color: #fff; }

.pdet-docs h3 { margin: 0; font-weight: 900; text-transform: uppercase; color: var(--blue-2); font-size: 1.1rem; }
.pdet-docs-sub { margin: 4px 0 12px; font-size: .88rem; color: var(--ink-soft); }
.pdet-doclist { display: grid; gap: 8px; }
.pdoc { display: grid; grid-template-columns: 170px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; transition: border-color .2s; }
a.pdoc:hover { border-color: var(--blue-1); }
.pdoc-n { font-weight: 900; color: var(--blue-2); font-size: .92rem; line-height: 1.15; }
.pdoc-n small { display: block; font-weight: 400; color: var(--ink-soft); font-size: .76rem; margin-top: 2px; }
.pdoc-t { font-size: .88rem; line-height: 1.4; color: var(--ink-soft); }
.pdoc-go { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.pdoc-go svg { width: 14px; height: 14px; }

.pdet-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 18px; }
.pnav { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px; border-radius: 14px; border: 1.5px solid var(--line-soft); background: #fff; color: var(--blue-2); text-align: left; font: inherit; font-weight: 700; font-size: .88rem; line-height: 1.2; cursor: pointer; min-width: 0; }
.pnav span { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pnav small { display: block; font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.pnav svg { width: 22px; height: 22px; flex: none; stroke-width: 2.6; }
.pnav.next { justify-content: flex-end; text-align: right; background: var(--g-blue); color: #fff; border-color: transparent; }
.pnav.next small { color: rgba(255,255,255,.75); }
.pnav-count { font-size: .78rem; font-weight: 700; color: var(--ink-soft); text-align: center; }

/* ---------- janela do projeto (site) ---------- */
.pmodal { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(20,26,60,.6); padding: 24px; overflow-y: auto; overscroll-behavior: contain; }
.pmodal.open { display: block; }
.pmodal-box { position: relative; max-width: 1040px; margin: 0 auto; background: #fff; border-radius: 26px; padding: clamp(18px, 3vw, 32px); animation: fadeUp .3s ease both; }
.pmodal-close { position: sticky; top: 0; float: right; z-index: 3; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; margin: -6px -6px 0 12px; }
.pmodal-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
body.modal-open { overflow: hidden; }

/* ---------- tablet ---------- */
@media (max-width: 1024px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pmodal { padding: 16px; }
}
@media (max-width: 820px) {
  .pdet-hero { grid-template-columns: 1fr; }
  .pdet-media { aspect-ratio: 16/9; }
  .pdet-steps { grid-template-columns: 1fr; }
  .pdet-steps li:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -11px; transform: translateX(-50%) rotate(135deg); }
  .pdoc { grid-template-columns: 1fr auto; }
  .pdoc-t { grid-column: 1 / -1; grid-row: 2; }
}
/* ---------- celular ---------- */
@media (max-width: 600px) {
  .pgrid { grid-template-columns: 1fr; gap: 12px; }
  .pcard { flex-direction: row; border-radius: 16px; }
  .pcard-media { aspect-ratio: auto; width: 34%; min-height: 100%; }
  .pcard-media.pbrand { padding: 10px; }
  .pcard-media .brand-ico { width: 30px; height: 30px; }
  .pcard-media .brand-tag { font-size: .78rem; }
  .pcard-body { padding: 12px; gap: 6px; }
  .pcard-title { font-size: .92rem; }
  .pcard-sum { font-size: .82rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .pcard .pst { font-size: .6rem; padding: 4px 8px; }
  .pcard-foot b { font-size: .9rem; }
  .pcard-open { font-size: .78rem; }
  .pmodal { padding: 0; }
  .pmodal-box { border-radius: 0; min-height: 100%; padding: 16px 16px 28px; }
  .pdet-title { font-size: 1.6rem; }
  .pdet-sum { font-size: .98rem; }
  .pdet-nav { grid-template-columns: 1fr 1fr; }
  .pnav-count { grid-column: 1 / -1; grid-row: 1; }
}

/* ---------- painel da categoria no site ---------- */
.flag-panel.active { display: block; }
.cat-head { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 24px; align-items: end; margin-bottom: 8px; }
.cat-head .h-section { margin: 8px 0 0; font-size: clamp(2rem, 4vw, 3rem); }
.cat-head .manifesto { margin: 10px 0 4px; font-weight: 700; color: var(--blue-2); font-size: 1.08rem; }
.cat-text { margin: 0; color: var(--ink-soft); max-width: 62ch; }
.cat-head .flag-kpis { margin: 0; justify-content: flex-end; }
.cat-hint { margin: 18px 0 14px; font-size: .88rem; font-weight: 700; color: var(--blue-1); display: flex; align-items: center; gap: 8px; }
.cat-hint::before { content: ""; width: 18px; height: 2px; background: var(--blue-1); }
.flag-btn .ico { position: relative; }
.flag-count { position: absolute; top: 6px; right: 6px; z-index: 2; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--blue-2); font-style: normal; font-weight: 900; font-size: .74rem; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.flag-btn.active .flag-count { background: var(--blue-2); color: #fff; }
@media (max-width: 900px) { .cat-head { grid-template-columns: 1fr; } .cat-head .flag-kpis { justify-content: flex-start; } }
@media (max-width: 600px) {
  .flag-count { top: 3px; right: 3px; min-width: 20px; height: 20px; font-size: .64rem; }
  .cat-head .flag-kpis { display: grid; grid-template-columns: 1fr 1fr; }
  .cat-head .flag-kpi.money { grid-column: 1 / -1; }
}

/* moldura com proporção travada: a foto nunca estica o card */
.pcard-media, .pdet-media { position: relative; overflow: hidden; min-height: 0; height: auto; }
.pcard-media > img, .pdet-media > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pcard-media.pbrand, .pdet-media.pbrand { position: relative; }
@media (max-width: 600px) { .pcard-media { aspect-ratio: auto; align-self: stretch; min-height: 150px; } }
.pcard-media.pbrand, .pdet-media.pbrand { background: var(--g-blue); }
.pdet-facts { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pdet-facts dd { font-size: .92rem; }
.pgrid > *, .pdet > *, .pdet-hero > *, .pcard-body { min-width: 0; }
.pcard { width: 100%; }
@media (max-width: 600px) {
  .pcard .pst { white-space: normal; line-height: 1.25; }
  .pcard-media.pbrand { align-items: center; justify-content: center; }
  .pcard-media .brand-tag { display: none; }
  .pcard-media .brand-ico { width: 40px; height: 40px; }
}
