/* ============================================================
   PORTFOLIO PAGE  —  assets/css/portfolio.css
   Loaded on the "portfolio" page via functions.php.
   Built on the global design tokens in style.css.
   ============================================================ */

/* ============================================================
   01. HERO
   ============================================================ */
.we-pf-hero {
  position: relative;
  padding: 128px 0 72px;
  text-align: center;
  overflow: hidden;
  background: var(--color-bg-warm);
  border-bottom: 1px solid var(--color-line);
}
.we-pf-hero__mesh {
  position: absolute;
  inset: -30% 0 auto 0;
  height: 120%;
  background:
    radial-gradient(60% 55% at 50% 0%, var(--color-base-tint), transparent 70%),
    radial-gradient(40% 40% at 85% 10%, rgba(220,74,26,.05), transparent 70%);
  pointer-events: none;
}
.we-pf-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 40%, #000, transparent 75%);
          mask-image: radial-gradient(60% 60% at 50% 40%, #000, transparent 75%);
  opacity: .5;
  pointer-events: none;
}
.we-pf-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}
.we-pf-hero h1 {
  margin-bottom: 20px;
}
.we-pf-hero .we-lead {
  max-width: 620px;
  margin: 0 auto;
}

/* Hero stat strip */
.we-pf-hero__stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 48px;
  margin-top: 44px;
}
.we-pf-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.we-pf-stat__num {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: var(--fw-black);
  line-height: 1;
  color: var(--color-ink);
  letter-spacing: -.5px;
}
.we-pf-stat__num small {
  font-size: 16px;
  font-weight: var(--fw-bold);
  color: var(--color-ink-3);
}
.we-pf-stat__lbl {
  font-size: var(--fz-small);
  color: var(--color-ink-3);
}

/* ============================================================
   02. FILTER BAR
   ============================================================ */
.we-pf-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 48px;
}
.we-pf-filter {
  font-family: var(--font-body);
  font-size: var(--fz-small);
  font-weight: var(--fw-bold);
  color: var(--color-ink-2);
  background: var(--color-bg-alt);
  border: 1.5px solid var(--color-line);
  border-radius: var(--r-full);
  padding: 9px 20px;
  transition: var(--trans-base);
  white-space: nowrap;
}
.we-pf-filter:hover {
  color: var(--color-base);
  border-color: var(--color-base-border);
  background: var(--color-base-tint);
}
.we-pf-filter.is-active {
  color: #fff;
  background: var(--color-base);
  border-color: var(--color-base);
}

/* ============================================================
   03. GRID
   ============================================================ */
.we-pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 32px;
}

/* Featured project spans two columns on wide screens. */
.we-pf-card--featured {
  grid-column: span 2;
}
@media (max-width: 800px) {
  .we-pf-card--featured { grid-column: span 1; }
}

/* Hidden by filter */
.we-pf-card.is-hidden { display: none; }

/* ============================================================
   04. CARD
   ============================================================ */
.we-pf-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: var(--trans-base);
}
.we-pf-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-base-border);
  box-shadow: var(--sh-lg);
}

/* ── Media / screenshot area ─────────────────────────────── */
.we-pf-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-gray-1);
}
.we-pf-card--featured .we-pf-card__media {
  aspect-ratio: 16 / 8;
}
.we-pf-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .5s ease;
}
.we-pf-card:hover .we-pf-card__img {
  transform: scale(1.04);
}

/* Gradient placeholder (when no screenshot is provided) */
.we-pf-card__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1f2b, #0d1117);
}
.we-pf-card__ph[data-i="0"] { background: linear-gradient(135deg, #dc4a1a, #8a2c0d); }
.we-pf-card__ph[data-i="1"] { background: linear-gradient(135deg, #1e293b, #0d1117); }
.we-pf-card__ph[data-i="2"] { background: linear-gradient(135deg, #3b7cf5, #1e3a8a); }
.we-pf-card__ph[data-i="3"] { background: linear-gradient(135deg, #16a34a, #14532d); }
.we-pf-card__ph[data-i="4"] { background: linear-gradient(135deg, #7c3aed, #3b0764); }
.we-pf-card__ph-initials {
  font-family: var(--font-heading);
  font-size: 64px;
  font-weight: var(--fw-black);
  color: rgba(255,255,255,.92);
  letter-spacing: -1px;
  z-index: 1;
}
.we-pf-card__ph-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 75%);
          mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 75%);
}

/* "Visit site" badge — reveals on hover */
.we-pf-card__visit {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-white);
  color: var(--color-ink);
  font-size: var(--fz-small);
  font-weight: var(--fw-bold);
  border-radius: var(--r-full);
  box-shadow: var(--sh-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
}
.we-pf-card__visit .wpx-icon { color: var(--color-base); }
.we-pf-card:hover .we-pf-card__visit {
  opacity: 1;
  transform: none;
}

/* ── Card body ───────────────────────────────────────────── */
.we-pf-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  flex: 1;
}
.we-pf-card__meta {
  display: flex;
  align-items: center;
}
.we-pf-card__cat {
  display: inline-flex;
  align-items: center;
  font-size: var(--fz-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-base);
}
.we-pf-card__title {
  font-size: var(--fz-h3);
  line-height: 1.25;
}
.we-pf-card__title a {
  transition: color .18s ease;
}
.we-pf-card__title a:hover {
  color: var(--color-base);
}
.we-pf-card__desc {
  font-size: var(--fz-body);
  color: var(--color-ink-2);
  line-height: var(--lh-body);
  margin: 0;
}
.we-pf-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}

/* Featured card: slightly larger title + roomier body */
.we-pf-card--featured .we-pf-card__body { padding: 32px; gap: 14px; }
.we-pf-card--featured .we-pf-card__title { font-size: 28px; }
.we-pf-card--featured .we-pf-card__desc  { font-size: var(--fz-lead); max-width: 60ch; }

/* Empty-state (filter matched nothing) */
.we-pf-empty {
  display: block;
  text-align: center;
  color: var(--color-ink-3);
  font-size: var(--fz-lead);
  padding: 48px 0;
}
/* Respect the [hidden] attribute — it's toggled by the filter JS. */
.we-pf-empty[hidden] {
  display: none;
}

/* ============================================================
   05. CTA
   ============================================================ */
.we-pf-cta {
  background: var(--color-bg-dark);
  padding: var(--sp-3xl) 0;
}
.we-pf-cta__inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.we-pf-cta__inner h2 {
  color: #fff;
  margin-bottom: 18px;
}
.we-pf-cta__inner h2 em { color: var(--color-base); }
.we-pf-cta__inner p {
  color: rgba(255,255,255,.62);
  font-size: var(--fz-lead);
  line-height: var(--lh-lead);
  max-width: 520px;
  margin: 0 auto 32px;
}
.we-pf-cta__btns {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* ============================================================
   06. SINGLE PROJECT PAGE  (single-project.php)
   ============================================================ */
.we-pj-head {
  position: relative;
  padding: 128px 0 44px;
  text-align: center;
  background: var(--color-bg-warm);
  border-bottom: 1px solid var(--color-line);
}
.we-pj-head__inner { max-width: 760px; }
.we-pj-back {
  display: inline-block;
  font-size: var(--fz-small);
  font-weight: var(--fw-bold);
  color: var(--color-ink-3);
  margin-bottom: 20px;
  transition: color .18s ease;
}
.we-pj-back:hover { color: var(--color-base); }
.we-pj-head h1 { margin-bottom: 18px; }
.we-pj-head .we-lead { max-width: 620px; margin: 0 auto; }
.we-pj-head__actions { margin-top: 28px; }

/* Screenshot frame */
.we-pj-shot {
  margin-top: -32px;
  padding-bottom: var(--sp-xl);
  background: linear-gradient(var(--color-bg-warm) 32px, var(--color-bg) 32px);
}
.we-pj-shot__frame {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--color-line);
  box-shadow: var(--sh-xl);
}
.we-pj-shot__frame img { width: 100%; display: block; }

/* Body */
.we-pj-content {
  font-size: var(--fz-lead);
  color: var(--color-ink-2);
  line-height: var(--lh-lead);
}
.we-pj-content h2 { font-size: var(--fz-h3); margin: 32px 0 12px; }
.we-pj-content h3 { margin: 28px 0 10px; }
.we-pj-content p  { margin-bottom: 18px; }
.we-pj-content ul, .we-pj-content ol { margin: 0 0 18px 20px; }
.we-pj-content li { margin-bottom: 6px; }
.we-pj-content a  { color: var(--color-base); text-decoration: underline; text-underline-offset: 3px; }
.we-pj-content img { border-radius: var(--r-md); margin: 18px 0; }

/* Meta sidebar */
.we-pj-meta {
  position: sticky;
  top: 96px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  padding: 24px;
}
.we-pj-meta__row {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line);
}
.we-pj-meta__row:first-child { padding-top: 0; }
.we-pj-meta__row:last-child  { padding-bottom: 0; border-bottom: none; }
.we-pj-meta__k {
  display: block;
  font-size: var(--fz-micro);
  font-weight: var(--fw-bold);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-ink-3);
  margin-bottom: 6px;
}
.we-pj-meta__v {
  font-size: var(--fz-body);
  font-weight: var(--fw-semi);
  color: var(--color-ink);
  word-break: break-word;
}
.we-pj-meta__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ============================================================
   07. RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .we-pf-hero { padding: 104px 0 56px; }
  .we-pf-hero__stats { gap: 28px; }
  .we-pf-stat__num { font-size: 28px; }

  .we-pf-grid { grid-template-columns: 1fr; gap: 24px; }
  .we-pf-card__ph-initials { font-size: 52px; }

  /* Always show the visit badge on touch (no hover) */
  .we-pf-card__visit { opacity: 1; transform: none; }

  .we-pj-head { padding: 104px 0 36px; }
  .we-pj-meta { position: static; }
}
