/* StoneBrook Carpentry — Projects page (builds on main.css) */
.phero { position: relative; overflow: hidden; padding: clamp(45px, 6vw, 85px) 0 clamp(28px, 3.5vw, 48px); background: var(--slate-dark); color: #fff; }
.phero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; animation: kenburns 22s ease-out both; }
.phero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(28,33,38,.85) 0%, rgba(28,33,38,.55) 55%, rgba(28,33,38,.3) 100%); }
.phero .wrap { position: relative; z-index: 1; }
/* Same header height on every project page, with the content anchored to the top, so the
   title and the category tabs stay in the same place when switching between pages. */
.phero { min-height: clamp(310px, calc(19vw + 140px), 416px); }
@media (min-width: 1800px) { .phero { min-height: 440px; } }
@media (max-width: 860px) { .phero { min-height: 322px; } }
@media (max-width: 459px) { .phero { min-height: 354px; } }
@media (max-width: 419px) { .phero { min-height: 392px; } }
@media (max-width: 339px) { .phero { min-height: 414px; } }
.phero .kicker { color: var(--tan-light); }
.phero .kicker::before { display: none; }
.phero h1 { color: #fff; font-size: clamp(2.6rem, 6vw, 5rem); max-width: 14em; }
.phero p:not(.kicker) { max-width: 40em; font-size: 1.15rem; margin: 0; color: rgba(255,255,255,.9); }

.ptabs-bar { position: sticky; top: var(--header-h); z-index: 20; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.05); }
.ptabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-top: 14px; padding-bottom: 14px; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { flex: none; font-family: var(--semi); font-weight: 600; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: 9px 16px; border: 2px solid var(--slate); color: var(--slate); background: #fff; transition: background .2s, color .2s; }
.ptab:hover { background: rgba(47,55,64,.08); }
.ptab.on { background: var(--slate); color: #fff; }

.pcat { padding: clamp(48px, 6vw, 80px) 0 0; scroll-margin-top: calc(var(--header-h) + 70px); }
.pcat[hidden] { display: none; }
.pcat-head { max-width: 760px; margin-bottom: 28px; }
.pcat-head h2 { margin-bottom: .3em; }
.pcat-head p { margin: 0; }
.pgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pshot { position: relative; margin: 0; overflow: hidden; background: var(--slate-dark); }
.pshot-btn { display: block; width: 100%; padding: 0; border: 0; background: var(--paper); cursor: zoom-in; overflow: hidden; }
.pshot-btn img { display: block; width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.pshot-btn:hover img { transform: scale(1.05); }
.pshot figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 14px 12px; pointer-events: none;
  background: linear-gradient(to top, rgba(20,24,28,.88) 0%, rgba(20,24,28,.55) 45%, rgba(20,24,28,0) 100%);
  font-family: var(--semi); font-weight: 600; font-size: .92rem; line-height: 1.3; letter-spacing: .02em; color: var(--tan-light); }
.pshot.fade-in { animation: qIn .45s ease both; }

.pcta { margin-top: clamp(64px, 8vw, 110px); padding: clamp(56px, 7vw, 90px) 0; background: var(--slate); color: rgba(255,255,255,.88); text-align: center; }
.pcta h2 { color: #fff; }
.pcta p { margin: 0 auto 1.6em; max-width: 36em; }

@media (min-width: 861px) and (max-width: 1100px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@media (max-width: 860px) {
  .ptabs-bar { top: var(--header-h); }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pshot figcaption { font-size: .78rem; padding: 36px 10px 9px; }
}

/* Breadcrumb + category links */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; font-family: var(--semi); font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.crumbs a { color: rgba(255,255,255,.85); text-decoration: none; }
.crumbs a:hover { color: var(--tan-light); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--tan-light); }
.pcat-head h2 a { color: inherit; text-decoration: none; }
.pcat-head h2 a:hover { color: var(--tan-deep); }
.pcat-more { display: inline-block; margin-top: 10px; font-family: var(--semi); font-weight: 600; letter-spacing: .04em; color: var(--slate); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--tan); }
.pcat-more:hover { color: var(--tan-deep); }
.pcat-single { padding-top: clamp(36px, 5vw, 56px); }
.pcat-back { margin: 32px 0 0; text-align: center; }
.pcat-back a { font-family: var(--semi); font-weight: 600; letter-spacing: .04em; color: var(--slate); text-underline-offset: 4px; text-decoration-color: var(--tan); }
.ptab:focus-visible { outline: 2px solid var(--tan); outline-offset: 2px; }

/* Switching between project pages: crossfade instead of a hard reload flash, keep the
   header and tabs in place, and skip the header photo's slow zoom (see projects.js). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .tape { view-transition-name: tape; }
  .site-header { view-transition-name: site-header; }
  .ptabs-bar { view-transition-name: project-tabs; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
}
.from-tab .phero-bg { animation: none; }
/* Keep the breadcrumb on one line so long category names never push the title down */
.crumbs { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
.crumbs [aria-current] { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
