/* ============================================================
   Portfolio (flag portfolio_v1): landing page, project tiles, project page head and the photo caption tab.
   Locked brand tokens, 8px spacing scale, flat buttons, no shadows. Loaded only on portfolio pages.
   ============================================================ */

/* ---------- landing hero ---------- */
.pfhero { padding: 24px 0 48px; }
.pfhero h1 { margin: 0; font: 800 56px/60px var(--font-display); letter-spacing: -.015em; color: var(--pw-bark); }
.pfhero__line { max-width: 560px; margin: 16px 0 0; font: 400 18px/28px var(--font-body); color: var(--pw-bark-muted); }
.pfhero__cta { display: flex; flex-wrap: wrap; gap: 16px; margin: 24px 0 0; }
.pfhero__cta .btn { min-height: 48px; }

/* ---------- filters under a dashed dieline ---------- */
.pfgrid { padding: 0 0 64px; }
.pffilters { padding-top: 24px; border-top: 1.5px dashed var(--pw-line-strong); }
.pfchips { display: flex; flex-wrap: wrap; gap: 8px; }
.pfchip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--pw-line); border-radius: 999px; background: var(--pw-white); font: 600 14px/20px var(--font-body); color: var(--pw-bark); text-decoration: none; }
.pfchip:hover { border-color: var(--state-border-hover); color: var(--state-text-hover); }
.pfchip.is-on { border-color: var(--pw-forest); background: var(--pw-forest); color: var(--pw-white); }
.pfchip:focus-visible, .ptile__a:focus-visible, .pfsel select:focus-visible, .pjnav__a:focus-visible { outline: 3px solid var(--pw-foil-gold); outline-offset: 2px; }
.pfbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 24px; }
.pfbar__n { flex: 1 1 auto; margin: 0; font: 600 14px/20px var(--font-body); color: var(--pw-bark-muted); }
.pfsel span { white-space: nowrap; }
.pfsel { display: inline-flex; align-items: center; gap: 8px; font: 600 13px/16px var(--font-body); color: var(--pw-bark-muted); text-transform: uppercase; letter-spacing: .06em; }
.pfsel select { min-height: 44px; padding: 0 32px 0 16px; border: 1px solid var(--pw-line-strong); border-radius: 8px; background-color: var(--pw-white); font: 600 14px/20px var(--font-body); letter-spacing: 0; text-transform: none; color: var(--pw-bark); }
@media (min-width: 1024px) and (pointer: fine) { .pfchip, .pfsel select { min-height: 36px; } }

/* ---------- grid ---------- */
.pfgrid__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 32px 0 0; padding: 0; list-style: none; }
@media (max-width: 1279px) { .pfgrid__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .pfgrid__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) {
  .pfgrid__list { grid-template-columns: minmax(0, 1fr); }
  .pfchips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 8px; scrollbar-width: thin; }
  .pfchip { flex: none; }
  .pfhero h1 { font-size: 40px; line-height: 46px; }
}
.ptile { display: flex; min-width: 0; }
.ptile__a { display: flex; flex: 1; flex-direction: column; border: 1px solid var(--pw-line); border-radius: 8px; background: var(--pw-white); color: var(--pw-bark); text-decoration: none; overflow: hidden; transition: border-color 200ms ease-out; }
.ptile__a:hover { border-color: var(--state-border-hover); }
.ptile__photo { display: block; aspect-ratio: 4 / 3; background: var(--pw-kraft-mist); }
.ptile__photo picture, .ptile__photo img { display: block; width: 100%; height: 100%; }
.ptile__photo img { object-fit: cover; }
.ptile__body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px; }
.ptile__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ptile__id { display: inline-block; padding: 2px 8px; border: 1px solid var(--pw-line); border-radius: 4px; font: 600 13px/16px var(--font-mono); color: var(--pw-forest); white-space: nowrap; }
.ptile__ind { font: 400 13px/16px var(--font-body); color: var(--pw-bark-muted); text-align: right; }
.ptile__name { font: 700 22px/28px var(--font-display); color: var(--pw-bark); }
.ptile__line { font: 400 14px/20px var(--font-body); color: var(--pw-bark-muted); }
.ptile__view { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; font: 700 14px/20px var(--font-body); color: var(--pw-forest); }
.ptile--next { flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px; padding: 24px; border: 1.5px dashed var(--pw-line-strong); border-radius: 8px; background: var(--pw-kraft-mist); }
.ptile--next p { margin: 0; font: 700 22px/28px var(--font-display); color: var(--pw-bark); }
.pfmore { margin: 32px 0 0; text-align: center; }
.pfmore .btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.pfempty { margin-top: 32px; padding: 48px 24px; border: 1.5px dashed var(--pw-line-strong); border-radius: 8px; background: var(--pw-kraft-mist); text-align: center; }
.pfempty p { margin: 0 0 16px; font: 600 18px/28px var(--font-body); color: var(--pw-bark); }

/* ---------- project page head (under the H1) ---------- */
.pjid { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 0; }
.pjid__line { font: 400 14px/20px var(--font-body); color: var(--pw-bark-muted); }
.pjcta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; }
.pjcta .btn { min-height: 44px; }
.pjnav { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
.pjnav__a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 700 14px/20px var(--font-body); color: var(--pw-forest); text-decoration: none; }
.pjnav__a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- caption tab on a project photo: bottom-left, 12px from the edges, white on bark at 72%, measured over a pure white photo in the report ---------- */
.pg__cap { position: absolute; left: 12px; bottom: 12px; z-index: 1; max-width: calc(100% - 112px); padding: 4px 8px; border-radius: 4px; background: rgba(35, 27, 21, .72); font: 600 13px/16px var(--font-body); color: var(--pw-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.pz__cap { position: absolute; left: 12px; bottom: 12px; z-index: 2; max-width: calc(100% - 120px); margin: 0; padding: 4px 8px; border-radius: 4px; background: rgba(35, 27, 21, .72); font: 600 13px/16px var(--font-body); color: var(--pw-white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.pz__cap[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .ptile__a { transition: none; } }
