/* ==========================================================================
   e-Laborando — Página de Portfólio (portfolio/index.html)
   Usa as variáveis, botões, cabeçalho e rodapé de css/style.css.
   ========================================================================== */

/* ---------- Abertura ---------- */
.pf-intro { padding: calc(var(--header-h) + clamp(48px, 7vw, 96px)) 0 clamp(32px, 4vw, 48px); }
.pf-title {
  font-size: clamp(2.3rem, 5.2vw, 4.4rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1.02;
  max-width: 15ch; text-wrap: balance; margin-bottom: 4px;
}

/* ---------- Filtros ---------- */
.pf-gallery { padding-bottom: var(--section-y); }
/* Reserva o espaço da galeria enquanto o JavaScript monta os projetos (evita salto de layout — CLS) */
.js .pf-gallery > .container { min-height: 520px; }
.pf-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 0 28px; margin-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}
.pf-filters[hidden] { display: none; }
.pf-filter {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--white); color: var(--navy);
  font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s, transform .25s var(--ease);
}
.pf-filter:hover { border-color: var(--navy); }
.pf-filter:active { transform: scale(.97); }
.pf-count { font-size: .72rem; font-weight: 600; min-width: 22px; padding: 2px 7px; border-radius: 99px; background: var(--surface); color: var(--text-soft); }
/* Filtro selecionado: cor de destaque (texto azul-marinho sobre laranja = contraste AA) */
.pf-filter.is-active { background: var(--orange); border-color: var(--orange); color: var(--navy); font-weight: 600; }
.pf-filter.is-active .pf-count { background: rgba(19,22,41,.12); color: var(--navy); }

/* ---------- Galeria em mosaico ---------- */
.pf-grid { columns: 3; column-gap: 20px; margin: 0; padding: 0; list-style: none; }
.pf-grid[hidden] { display: none; }
.pf-item { break-inside: avoid; margin-bottom: 20px; }
.pf-item[hidden] { display: none; }
.pf-item.is-in { animation: pfIn .5s var(--ease) both; }
@keyframes pfIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.pf-card { display: block; text-decoration: none; color: inherit; border-radius: var(--radius-lg); }
.pf-media {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); background: var(--surface);
  border: 1px solid var(--line);
}
/* esqueleto enquanto a capa carrega */
.pf-media::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.6) 50%, transparent 70%) var(--surface);
  background-size: 200% 100%; animation: pfShimmer 1.4s linear infinite;
}
.pf-media.is-loaded::before, .pf-media.is-missing::before { display: none; }
.pf-media.is-missing { background: repeating-linear-gradient(45deg, var(--surface) 0 12px, #EEF0F5 12px 24px); }
@keyframes pfShimmer { to { background-position: -200% 0; } }

.pf-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.01);
  transition: opacity .5s var(--ease), transform .8s var(--ease);
}
.pf-media.is-loaded img { opacity: 1; }
.pf-media.is-missing img { display: none; }
.pf-card:hover .pf-media img, .pf-card:focus-visible .pf-media img { transform: scale(1.045); }

/* Camada do degradê: também recebe o clique e o botão direito no lugar da imagem
   (proteção contra "salvar imagem"), sem alterar a aparência — o clique continua
   abrindo o projeto, porque a camada pertence ao cartão. */
.pf-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(19,22,41,.55));
  opacity: 0; transition: opacity .35s var(--ease);
}
.pf-card:hover .pf-media::after, .pf-card:focus-visible .pf-media::after { opacity: 1; }

/* Selo (ex.: projeto demonstrativo) e quantidade de imagens */
.pf-selo {
  position: absolute; left: 12px; top: 12px; z-index: 1; max-width: calc(100% - 90px);
  padding: 6px 11px; border-radius: 99px; background: rgba(255,255,255,.94); color: var(--navy);
  font-size: .7rem; font-weight: 600; line-height: 1.3; box-shadow: var(--shadow-sm);
}
.pf-qtd {
  position: absolute; right: 12px; top: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 99px; background: rgba(19,22,41,.72); color: var(--white); font-size: .72rem; font-weight: 600;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pf-qtd svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pf-open {
  position: absolute; right: 14px; bottom: 14px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 99px; background: var(--white); color: var(--navy);
  font-size: .8rem; font-weight: 600; box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.pf-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-card:hover .pf-open, .pf-card:focus-visible .pf-open { opacity: 1; transform: none; }
/* Em telas de toque o indicador fica sempre visível */
@media (hover: none) { .pf-open { opacity: 1; transform: none; padding: 7px 12px; } }

.pf-info { display: grid; gap: 2px; padding: 14px 4px 0; }
.pf-cat { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.pf-name { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.02em; transition: color .2s; }
.pf-card:hover .pf-name { color: var(--orange-text, #C24100); }
.pf-desc { font-size: .875rem; color: var(--text-soft); font-weight: 300; }
.pf-card:focus-visible { outline: none; }
.pf-card:focus-visible .pf-media { outline: 2px solid var(--orange); outline-offset: 3px; }

@media (max-width: 960px) { .pf-grid { columns: 2; } }
@media (max-width: 560px) { .pf-grid { columns: 1; } }

.pf-cat-vazia { padding: 32px 0; color: var(--text-soft); }

/* ---------- Estado vazio ---------- */
.pf-empty { display: grid; justify-items: center; text-align: center; gap: 14px; padding: clamp(48px, 8vw, 96px) 16px; border: 1px dashed var(--line-strong); border-radius: 28px; }
.pf-empty[hidden] { display: none; }
.pf-empty-ico { display: grid; grid-template-columns: repeat(2, 22px); gap: 6px; margin-bottom: 10px; }
.pf-empty-ico i { height: 22px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); }
.pf-empty-ico i:nth-child(2) { background: var(--orange); border-color: var(--orange); }
.pf-empty h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.035em; }
.pf-empty p { color: var(--text-soft); font-weight: 300; max-width: 46ch; margin-bottom: 10px; }
.pf-noscript { padding: 24px 0; color: var(--text-soft); }

/* O modal (.pf-modal, .pf-m-*, .pf-zoom) fica em css/modal.css — compartilhado com as prévias dos aplicativos. */

/* Seleção de texto nos elementos azul-marinho desta página */
.pf-tab.is-active::selection, .pf-dev.is-active::selection, .pf-zoom ::selection { background: var(--orange); color: var(--white); }
