/* ==========================================================================
   Provision Homes — foundations shared by every page.
   Design tokens, reset, the house mark, and the skip link.
   Page-specific styles live alongside this: styles.css, portfolio.css.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --ink:        #3A3D3A;  /* header, footer, CTA ground */
  --ink-2:      #4C4F4A;  /* mid green-grey */
  --cream:      #FBFAF8;  /* page ground */
  --sand:       #F2EFE9;  /* testimonials ground */
  --gold:       #C9A227;  /* accent */
  --wine:       #6E2F2C;  /* primary button */
  --wine-dark:  #57231F;

  --rule-dark:  rgba(48, 50, 48, .18);
  --rule-mid:   rgba(48, 50, 48, .25);
  --rule-soft:  rgba(48, 50, 48, .22);
  --rule-light: rgba(255, 255, 255, .2);
  --body-ink:   rgba(0, 0, 0, .68);
  --on-dark:    rgba(255, 255, 255, .8);

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --gutter: clamp(20px, 4vw, 80px);
  --frame-inset: clamp(14px, 1.8vw, 26px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold); }
input, textarea, button { font: inherit; font-family: var(--sans); }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  font-size: 11px;
  letter-spacing: .2em;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- The house mark ---------- */
.mark { display: block; flex: none; }
.mark--header { width: 22px; height: 19px; stroke-width: 2.4; }
.mark--hero   { width: 30px; height: 26px; stroke-width: 2.2; }
.mark--tiny   { width: 12px; height: 11px; stroke-width: 3.2; color: var(--ink); }
.mark--micro  { width: 10px; height: 9px;  stroke-width: 3.2; color: var(--ink); }


/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 22, 26, .92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 72px 20px 24px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }

/* While a lightbox is open, the sticky header and mobile CTA would otherwise
   ghost through the scrim and collide with its close button. */
.overlay-open .site-header,
.overlay-open .sticky-cta {
  opacity: 0 !important;
  pointer-events: none !important;
}
.lightbox__img {
  max-width: min(1160px, 90vw);
  max-height: 70vh;
  object-fit: contain;
  cursor: default;
}
.lightbox__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  font-size: 10px;
  letter-spacing: .24em;
}
.lightbox__count { color: rgba(255, 255, 255, .55); }
.lightbox__close,
.lightbox__nav {
  position: absolute;
  background: none;
  border: 1px solid rgba(255, 255, 255, .5);
  color: #fff;
  cursor: pointer;
}
.lightbox__close {
  top: 22px; right: 22px;
  padding: 10px 14px;
  font-size: 10px;
  letter-spacing: .2em;
}
.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 60px;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__nav:hover,
.lightbox__close:hover { background: var(--wine); border-color: var(--wine); color: #fff; }

.lightbox__thumbs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; cursor: default; }
.lightbox__thumbs button {
  width: 74px;
  height: 52px;
  flex: none;
  padding: 0;
  border: none;
  cursor: pointer;
  background-color: #1c1e22;
  background-size: cover;
  background-position: center;
  outline: 1px solid rgba(255, 255, 255, .28);
  outline-offset: -1px;
  opacity: .55;
  transition: opacity 200ms ease;
}
.lightbox__thumbs button:hover { opacity: .85; }
.lightbox__thumbs button[aria-current="true"] {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  opacity: 1;
}

@media (max-width: 700px) {
  .lightbox__nav { width: 38px; height: 48px; font-size: 22px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__thumbs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; }
}
