/* ==========================================================================
   Provision Homes — the two listing pages, /our-work and /gallery.
   Loads after base.css and chrome.css.

   Shared: the flat title band, the sticky filter toolbar, the result count
   and the empty state. Then the project grid (/our-work), the masonry wall
   and its lightbox (/gallery).
   ========================================================================== */

/* ---------- Title band, flat variant ----------
   chrome.css sizes the band for the project page, where the hero photo
   rides up over it. These pages have no overlap. */
.title-block--listing { padding: 56px var(--pad) 64px; }
.title-block--listing .title-block__inner {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px 70px;
  margin-top: 0;
}
.title-block--listing .title-block__ghost-mark {
  width: 360px; height: 315px; right: -50px; top: 10px;
}
.title-block--listing .title-block__title { margin-top: 24px; }

/* ---------- Sticky filter toolbar ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(var(--cream-rgb), .96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(var(--ink-rgb), .18);
  padding: 0 var(--pad);
}
.toolbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 28px;
  padding: 18px 0;
}
.toolbar__count {
  font-size: 12px;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .7);
  white-space: nowrap;
}
.toolbar__clear {
  background: none;
  border: none;
  border-bottom: 1px solid var(--wine);
  padding: 0 0 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--wine);
  white-space: nowrap;
}
.toolbar__clear[hidden] { display: none; }

/* Labelled <select> filters (/gallery) */
.filters { display: flex; flex-wrap: wrap; gap: 14px 16px; }
.filter { display: flex; flex-direction: column; gap: 8px; }
.filter__label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .6);
}
.filter__field { position: relative; display: block; }
.filter__field svg {
  position: absolute;
  right: 14px;
  top: 50%;
  margin-top: -3px;
  pointer-events: none;
}
.select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  cursor: pointer;
  min-width: 180px;
  width: 100%;
  padding: 12px 38px 12px 14px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: transparent;
  color: var(--bitter);
  border: 1px solid rgba(var(--ink-rgb), .35);
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.select.is-active {
  background: var(--wine);
  color: var(--cream);
  border-color: var(--wine);
}

/* Chip filters + sort (/our-work) */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  border-radius: 0;
  background: transparent;
  color: var(--bitter);
  border: 1px solid rgba(var(--ink-rgb), .3);
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.chip:hover { border-color: var(--wine); color: var(--wine); }
.chip[aria-pressed="true"] {
  background: var(--wine);
  color: var(--cream);
  border-color: var(--wine);
}
.sort { display: flex; align-items: center; gap: 14px; }
.sort__label {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
}
.sort .select { min-width: 0; letter-spacing: .14em; padding: 12px 40px 12px 16px; }

/* ---------- Results region ---------- */
.results { padding: 40px var(--pad) 96px; }
.results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 28px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .7);
}
.empty {
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.empty[hidden] { display: none; }
.empty p {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.4;
  color: rgba(var(--ink-rgb), .8);
}

/* ---------- /our-work: the project grid ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 56px 32px;
}
.project {
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--bitter);
  animation: riseIn 600ms cubic-bezier(.22, .7, .25, 1) both;
}
.project:hover { color: var(--bitter); }
.project__frame {
  outline: 1px solid rgba(var(--ink-rgb), .22);
  outline-offset: 6px;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--sand);
}
.project__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(.22, .7, .25, 1);
}
a.project:hover .project__frame img { transform: scale(1.04); }
a.project:hover .project__name { color: var(--wine); }
.project__body { display: flex; flex-direction: column; gap: 10px; }
.project__name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  text-wrap: balance;
  transition: color 200ms ease;
}
.project__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--ink-rgb), .16);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(var(--bitter-rgb), .72);
}

/* ---------- /gallery: the masonry wall ---------- */
.wall { columns: 300px; column-gap: 24px; }
.wall__item {
  display: block;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 24px;
  padding: 0;
  border: none;
  background: var(--sand);
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  animation: fadeIn 500ms ease both;
}
.wall__item img {
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 700ms cubic-bezier(.22, .7, .25, 1);
}
.wall__item:hover img { transform: scale(1.04); }
.wall__item:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- /gallery: lightbox ---------- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(var(--bitter-rgb), .96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 60px 90px 30px;
  animation: fadeIn 240ms ease both;
}
.viewer[hidden] { display: none; }
.viewer__img {
  max-width: min(1200px, 100%);
  max-height: 72vh;
  object-fit: contain;
  display: block;
  outline: 1px solid rgba(var(--gold-rgb), .5);
  outline-offset: 8px;
}
.viewer__btn {
  position: absolute;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid rgba(var(--cream-rgb), .4);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.viewer__btn:hover { background: var(--wine); border-color: var(--wine); }
.viewer__close { top: 22px; right: 26px; font-size: 22px; }
.viewer__prev  { left: 24px;  top: 50%; margin-top: -22px; font-size: 20px; }
.viewer__next  { right: 24px; top: 50%; margin-top: -22px; font-size: 20px; }
.viewer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 8px 22px;
  color: var(--cream);
  text-align: center;
}
.viewer__caption { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.viewer__project {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 3px;
  white-space: nowrap;
}
.viewer__count {
  font-size: 11px;
  line-height: 1;
  letter-spacing: .2em;
  color: rgba(var(--cream-rgb), .55);
}

/* ---------- Breakpoints ---------- */
@media (max-width: 820px) {
  .title-block--listing { padding: 44px var(--pad) 52px; }
  .toolbar__inner { align-items: stretch; }
  .filters { width: 100%; }
  .filter { flex: 1 1 160px; }
  .select { min-width: 0; }
  .sort { width: 100%; }
  .sort .select { flex: 1; }
  .viewer { padding: 60px 20px 24px; }
  .viewer__prev { left: 8px; }
  .viewer__next { right: 8px; }
}

@media (max-width: 700px) {
  .results { padding: 32px var(--pad) 72px; }
  .projects { gap: 40px 24px; }
  .wall { columns: 1; }
  .viewer__img { max-height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
  .project, .wall__item, .viewer { animation: none; }
}

/* ---------- CTA band, static border ----------
   The project page draws its border in on scroll; these pages show it
   outright, as their designs do. */
.cta-band--static .cta-band__border span { transform: none; animation: none; }

/* ---------- Current-page marker in the nav ---------- */
.nav-list a.is-current,
.menu__nav a.is-current,
.site-footer__nav a.is-current { color: var(--gold); }
.nav-list a.is-current { border-bottom-color: var(--gold); }
