/* Gaffneys Bathroom Services: Projects page layer (gallery.html, Phase 2 batch).
   Loads after site.css and service.css. Every rule is scoped to pj- classes or .page-projects.
   Theme: the portfolio. An ink hero with a loose stack of prints, a filterable grid of consistent square
   tiles (v5.7.0), and a lightbox that shows each genuine photo at its original size (never enlarged). */

/* ---------- A. Hero ---------- */
.pj-hero { position: relative; padding: calc(var(--nav-top) + var(--nav-h) + 48px) 0 88px; background: var(--ink); color: rgba(255,255,255,.82); overflow: hidden; }
.pj-hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(156,200,240,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(156,200,240,.06) 1px, transparent 1px); background-size: 72px 72px; pointer-events: none; }
.pj-hero__grid { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: center; }
.crumbs--dark { color: rgba(255,255,255,.7); }
.crumbs--dark a { color: #fff; border-color: rgba(255,255,255,.35); }
.crumbs--dark a:hover { color: #BFDDF8; }
.crumbs--dark [aria-current="page"] { color: rgba(255,255,255,.7); }
.crumbs--dark li + li::before { border-color: rgba(255,255,255,.4); }
.pj-hero .label { color: #BFDDF8; }
.pj-hero h1 { margin: 18px 0 22px; font-size: clamp(2.4rem, 1.3rem + 3vw, 4.1rem); line-height: 1.02; letter-spacing: -.014em; color: #fff; }
.pj-hero h1 span { display: block; color: #BFDDF8; }
.pj-hero__lede { max-width: 36em; font-size: 1.0625rem; line-height: 1.6; }
.pj-hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.pj-stack { position: relative; height: 420px; }
.pj-stack img { position: absolute; width: 250px; height: 250px; border: 8px solid #fff; border-radius: 3px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
.pj-stack__a { left: 0; top: 30px; transform: rotate(-5deg); }
.pj-stack__b { right: 4%; top: 0; transform: rotate(4deg); }
.pj-stack__c { left: 22%; bottom: 0; transform: rotate(-1deg); z-index: 2; }
.pj-stack__tag { position: absolute; right: 2%; bottom: 26px; z-index: 3; }

/* ---------- B. Portfolio (v5.7.0 redesign) ----------
   Filters sit in the page flow under the heading (no sticky bar), as a quiet tab row with one clear selected
   state. Category totals were removed because photos belong to several types (they added up to 24 for 16
   photos); the live line below the tabs states the true count. Every photo uses the same square tile and
   caption, shown no larger than its native 370px. */
.pj-work { padding: 72px 0 var(--sec); }
.pj-work__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30em); align-items: end; gap: 12px 48px; margin-bottom: 30px; }
.pj-work__head .h2 em { font-style: normal; color: var(--grey); font-size: .5em; letter-spacing: 0; vertical-align: .32em; margin-left: .2em; }
.pj-work__note { margin: 0; font-size: var(--t-small); color: var(--grey); justify-self: end; text-align: right; }
.pj-filters { position: static; display: flex; flex-wrap: wrap; gap: 2px 30px; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.pj-filter { position: relative; display: inline-flex; align-items: center; min-height: 48px; margin: 0 0 -1px; padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; font: 500 .9688rem/1 var(--ui); color: var(--grey); cursor: pointer; transition: color .2s var(--ease), border-color .2s var(--ease); }
.pj-filter:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.pj-filter[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--blue-ink); }
.pj-filter:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 2px; border-radius: 2px; }
.pj-status { min-height: 1.4em; margin: 16px 0 26px; font-size: var(--t-small); color: var(--grey); }

.pj-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 28px; margin: 0; padding: 0; list-style: none; }
.pj-item { min-width: 0; max-width: 370px; }
.pj-item[hidden] { display: none; }
.pj-tile { position: relative; display: block; overflow: hidden; border-radius: var(--r); background: var(--ice-2); }
.pj-item:first-child .pj-tile { border-top-left-radius: var(--arc); }
.pj-tile img { display: block; width: 100%; max-width: 370px; height: auto; aspect-ratio: 1; object-fit: cover; transition: transform .6s var(--ease), filter .4s var(--ease); }
.pj-tile::after { content: ""; position: absolute; inset: 0; background: rgba(16,28,42,0); transition: background-color .3s var(--ease); pointer-events: none; }
.pj-tile:hover::after { background: rgba(16,28,42,.12); }
.pj-tile:hover img { transform: scale(1.03); }
.pj-tile:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 3px; }
.pj-tile__ic { position: absolute; z-index: 1; right: 10px; bottom: 10px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--ink); opacity: 0; transform: translateY(6px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.pj-tile:hover .pj-tile__ic, .pj-tile:focus-visible .pj-tile__ic { opacity: 1; transform: none; }
.pj-cap__t { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font: 400 1.2rem/1.25 var(--display); color: var(--ink); }
.pj-cap { margin: 4px 0 0; font-size: var(--t-small); line-height: 1.5; color: var(--grey); }

/* ---------- Lightbox ---------- */
.pj-lb { width: min(860px, calc(100% - 32px)); max-width: none; max-height: calc(100% - 32px); padding: 0; border: 0; border-radius: var(--arc) var(--r) var(--arc) var(--r); background: #fff; color: var(--text); box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); }
.pj-lb::backdrop { background: rgba(16,28,42,.86); }
.pj-lb__inner { position: relative; display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 36px; padding: 36px; }
.pj-lb__fig { margin: 0; }
.pj-lb__fig img { display: block; width: 370px; max-width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--r); background: var(--ice-2); }
.pj-lb__side { display: flex; flex-direction: column; align-items: flex-start; padding-top: 8px; }
.pj-lb__count { margin: 0; font: 600 .75rem/1.4 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--blue-ink); }
.pj-lb__title { margin: 12px 0 10px; font-size: var(--t-h3); line-height: 1.1; }
.pj-lb__desc { margin: 0 0 18px; }
.pj-lb__nav { display: flex; gap: 10px; margin-top: auto; padding-top: 24px; }
.pj-lb__btn { display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid var(--line-2); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; }
.pj-lb__btn:hover { border-color: var(--ink); }
.pj-lb__btn[data-pj-prev] .ic { transform: rotate(180deg); }
.pj-lb__cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 16px; font-weight: 600; color: var(--blue-ink); text-decoration: underline; text-underline-offset: 4px; }
.pj-lb__close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--mist); color: var(--ink); cursor: pointer; }
.pj-lb__close:hover { background: var(--line); }
.pj-lb button:focus-visible, .pj-lb a:focus-visible { outline: 3px solid var(--blue-ink); outline-offset: 2px; }

/* ---------- C. Services index ---------- */
.pj-svc { padding: var(--sec) 0; background: var(--mist); }
.pj-svc__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; align-items: start; }
.pj-svc__head .h2 { margin-top: 16px; }
.pj-svc__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin: 0; padding: 0; list-style: none; }
.pj-svc__list a { display: flex; align-items: baseline; gap: 18px; min-height: 64px; padding: 18px 0; border-bottom: 1px solid var(--line-2); font: 400 1.35rem/1.2 var(--display); color: var(--ink); transition: color .2s var(--ease), padding-left .3s var(--ease); }
.pj-svc__list a span { font: 600 .75rem/1 var(--ui); letter-spacing: .12em; color: var(--blue-ink); }
.pj-svc__list a:hover { color: var(--blue-ink); padding-left: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .pj-stack img { width: 220px; height: 220px; }
}
@media (max-width: 1080px) {
  .pj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; }
  .pj-work__head { grid-template-columns: minmax(0, 1fr); }
  .pj-work__note { justify-self: start; text-align: left; }
  .pj-svc__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 1023px) {
  .pj-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .pj-stack { height: 300px; max-width: 520px; }
  .pj-stack img { width: 190px; height: 190px; border-width: 6px; }
  .pj-lb__inner { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; padding: 28px; }
}
@media (max-width: 760px) {
  .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
}
@media (max-width: 760px) {
  .pj-hero { padding: calc(var(--nav-top) + var(--nav-h) + 28px) 0 56px; }
  .pj-hero__ctas { flex-direction: column; }
  .pj-hero__ctas .btn { width: 100%; }
  .pj-stack { height: 236px; }
  .pj-stack img { width: 150px; height: 150px; border-width: 5px; }
  .pj-stack__c { left: 26%; }
  .pj-work { padding-top: 48px; }
  .pj-work__head { margin-bottom: 20px; }
  .pj-filters { gap: 0 20px; }
  .pj-filter { min-height: 44px; font-size: .9063rem; }
  .pj-status { margin: 12px 0 20px; }
  .pj-lb { width: calc(100% - 16px); max-height: calc(100% - 16px); }
  .pj-lb__inner { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 16px 20px; }
  .pj-lb__fig img { width: 100%; max-width: 370px; margin: 0 auto; }
  .pj-lb__close { top: 22px; right: 22px; background: rgba(255,255,255,.94); }
  .pj-lb__title { margin-top: 6px; font-size: 1.5rem; }
  .pj-lb__nav { padding-top: 6px; }
  .pj-svc__list { grid-template-columns: minmax(0, 1fr); }
  .pj-svc__list a { font-size: 1.2rem; }
}
@media (max-width: 559px) {
  .pj-grid { gap: 22px 12px; }
  .pj-cap__t { margin-top: 10px; font-size: 1rem; }
  .pj-cap { font-size: .8125rem; line-height: 1.45; }
  .pj-tile__ic { width: 34px; height: 34px; right: 6px; bottom: 6px; opacity: 1; transform: none; }
  .pj-cap__t { padding-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .pj-tile img, .pj-tile::after, .pj-tile__ic, .pj-filter, .pj-svc__list a { transition: none; }
}
