/* ==========================================================================
   Hudson Valley Portraits — stylesheet
   Editorial / gallery aesthetic. Images carry the colour; the page stays quiet.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --ink:        #171514;
  --ink-2:      #5d5955;
  --ink-3:      #8f8a85;
  --paper:      #ffffff;
  --paper-2:    #f7f6f4;
  --rule:       #e4e1dd;
  --rule-soft:  #efedea;

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body:    "Jost", "Helvetica Neue", Arial, sans-serif;

  --track-wide: 0.18em;
  --track-mid:  0.11em;

  --shell:   1240px;
  --measure: 46rem;

  --step-1: clamp(0.78rem, 0.75rem + 0.15vw, 0.85rem);
  --step-0: clamp(0.95rem, 0.9rem + 0.2vw, 1.05rem);
  --step-1u: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.7rem, 1.35rem + 1.5vw, 2.6rem);
  --step-4: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem);

  --gap:    clamp(1rem, 0.7rem + 1.4vw, 1.75rem);
  --band:   clamp(3.5rem, 2rem + 6vw, 7rem);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
picture { display: block; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.2; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.28em; }
a:hover { color: var(--ink-2); }

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

/* --- Layout primitives -------------------------------------------------- */
.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

.band { padding-block: var(--band); }
.band--tight { padding-block: clamp(2.25rem, 1.5rem + 3vw, 4rem); }
.band--alt { background: var(--paper-2); }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.measure { max-width: var(--measure); }
.center { margin-inline: auto; text-align: center; }

/* When .measure is combined with .shell, keep the shell full width and
   constrain its children instead, so text lines up with everything else. */
.shell.measure { max-width: var(--shell); }
.shell.measure > * { max-width: var(--measure); }
.shell.measure.center > * { margin-inline: auto; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip:focus { left: 0; }

/* --- Type styles -------------------------------------------------------- */
.eyebrow {
  font-size: var(--step-1);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.1rem;
  display: block;
}

.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-4);
  line-height: 1.08;
  letter-spacing: -0.005em;
}

.headline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--step-3);
  line-height: 1.15;
}

.subhead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.25;
}

.lede {
  font-size: var(--step-1u);
  line-height: 1.65;
  color: var(--ink-2);
  font-weight: 300;
}

.fine {
  font-size: var(--step-1);
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  font-size: var(--step-1);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  padding: 1.05rem 2.4rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }

.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: transparent; color: var(--ink); }

/* --- Header ------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule-soft);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.35rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.4rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.1;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(1.1rem, 0.4rem + 1.5vw, 2.4rem); }

.nav a {
  font-size: var(--step-1);
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.nav__toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--ink);
}
.nav__toggle svg { display: block; }

/* Overlay-only pieces: hidden until the mobile breakpoint turns them on. */
.nav__close, .nav__brand, .nav__meta { display: none; }

@media (max-width: 900px) {
  .nav__toggle { display: block; }

  /* Full-screen overlay. Fixed to the viewport — which only works because the
     header no longer creates a containing block via backdrop-filter. */
  html:not(.js) .nav__toggle { display: none; }
  html:not(.js) .nav {
    position: static;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 1rem;
    width: 100%;
  }
  html:not(.js) .masthead__inner { flex-wrap: wrap; }

  .js .nav {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: var(--paper);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 5.5rem 1.75rem 2.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.32s var(--ease), transform 0.32s var(--ease),
                visibility 0s linear 0.32s;
  }
  .js .nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.32s var(--ease), transform 0.32s var(--ease),
                visibility 0s;
  }

  .nav a {
    width: 100%;
    font-size: 1.05rem;
    letter-spacing: 0.13em;
    padding: 1.35rem 0;
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    color: var(--ink);
    border-bottom: 1px solid var(--rule-soft);
  }
  .nav a:first-of-type { border-top: 1px solid var(--rule-soft); }
  .nav a:hover,
  .nav a[aria-current="page"] { border-bottom-color: var(--rule); }
  .nav a[aria-current="page"] { color: var(--ink-3); }

  /* Links fade up in sequence once the overlay is open. */
  .js .nav[data-open="true"] a { animation: navIn 0.4s var(--ease) backwards; }
  .js .nav[data-open="true"] a:nth-of-type(1) { animation-delay: 0.06s; }
  .js .nav[data-open="true"] a:nth-of-type(2) { animation-delay: 0.11s; }
  .js .nav[data-open="true"] a:nth-of-type(3) { animation-delay: 0.16s; }
  .js .nav[data-open="true"] a:nth-of-type(4) { animation-delay: 0.21s; }
  .js .nav[data-open="true"] a:nth-of-type(5) { animation-delay: 0.26s; }

  .js .nav__brand {
    display: block;
    position: absolute;
    top: 1.35rem;
    left: 1.75rem;
    text-decoration: none;
  }

  .js .nav__close {
    display: block;
    position: absolute;
    top: 1.15rem;
    right: 1.4rem;
    background: none;
    border: 0;
    padding: 0.6rem;
    cursor: pointer;
    color: var(--ink);
    line-height: 0;
  }

  .js .nav__meta {
    display: block;
    margin-top: auto;
    padding-top: 2.5rem;
    font-size: var(--step-1);
    color: var(--ink-3);
    letter-spacing: 0.02em;
  }
  .nav__meta a {
    display: inline;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    font-size: var(--step-1);
    letter-spacing: 0.02em;
    color: var(--ink-2);
    text-transform: none;
    text-decoration: underline;
    text-underline-offset: 0.25em;
  }
  .nav__meta a:first-of-type { border-top: 0; }
  .nav__meta p { margin-bottom: 0.35rem; }
}

@keyframes navIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .js .nav[data-open="true"] a { animation: none; }
}

/* --- Hero --------------------------------------------------------------- */
.hero { padding-top: clamp(2.5rem, 1.5rem + 4vw, 5rem); }

.hero__copy { max-width: 54rem; }
.hero__copy .lede { margin-top: 1.75rem; }

.hero__figure { margin: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 0 0; }
.hero__figure img {
  width: 100%;
  max-height: 76vh;
  object-fit: cover;
  object-position: center 22%;
}

/* --- Split section ------------------------------------------------------ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}
.split--reverse .split__media { order: 2; }

@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
}

.split__body .subhead { margin-bottom: 1.35rem; }

/* --- Lists -------------------------------------------------------------- */
.ticks {
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.ticks li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink-2);
  font-size: var(--step-0);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.82em;
  width: 0.7rem;
  height: 1px;
  background: var(--ink-3);
}

.ticks--includes { margin-top: 1.25rem; }

/* --- Card grid ---------------------------------------------------------- */
.grid {
  display: grid;
  gap: clamp(1.75rem, 1rem + 3vw, 3.25rem);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
}

.card { display: flex; flex-direction: column; }
.card picture { margin-bottom: 1.5rem; display: block; }
.card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center 30%;
}
.card .subhead { margin-bottom: 0.85rem; }
.card p { color: var(--ink-2); }
.card__link {
  margin-top: 1.25rem;
  font-size: var(--step-1);
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.35rem;
  align-self: flex-start;
  transition: border-color 0.3s var(--ease);
}
.card__link:hover { border-bottom-color: var(--ink); }

/* --- Region list -------------------------------------------------------- */
.regions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
}
.regions li { border-bottom: 1px solid var(--rule); }
.regions a {
  display: block;
  padding: 1.6rem 0.25rem;
  text-decoration: none;
  transition: padding-left 0.3s var(--ease);
}
.regions a:hover { padding-left: 0.9rem; }
.regions strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-1u);
  font-weight: 400;
  margin-bottom: 0.25rem;
}
.regions span { font-size: var(--step-1); color: var(--ink-3); }

/* --- Gallery ------------------------------------------------------------ */
/* Columns are packed at build time and rendered as plain flex columns, so
   nothing re-flows as lazy images load. */
.gallery {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
}
.gallery__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
@media (max-width: 760px) {
  .gallery { flex-direction: column; }
}

.gallery__item {
  padding: 0;
  border: 0;
  background: none;
  width: 100%;
  cursor: zoom-in;
  display: block;
  position: relative;
}
.gallery__item img { transition: opacity 0.4s var(--ease); width: 100%; }
.gallery__item:hover img { opacity: 0.82; }

/* --- Back to top ------------------------------------------------------- */
.totop {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--step-1);
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.totop:hover { color: var(--ink); border-bottom-color: var(--ink); }
.totop svg { display: block; }

/* --- Lightbox ----------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: #0e0d0c;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 3rem 1.25rem;
}
.lightbox[data-open="true"] { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  object-fit: contain;
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 1rem;
  line-height: 0;
}
.lightbox button:hover { color: #fff; }
.lightbox__close { top: 0.75rem; right: 0.75rem; }
.lightbox__prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* --- Breadcrumbs -------------------------------------------------------- */
.crumbs {
  font-size: var(--step-1);
  color: var(--ink-3);
  letter-spacing: 0.03em;
  padding-block: 1.25rem 0;
}
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.crumbs li::after { content: "/"; margin-left: 0.5rem; color: var(--rule); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { text-decoration: none; color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }

/* --- FAQ ---------------------------------------------------------------- */
.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  padding: 1.6rem 2.5rem 1.6rem 0;
  font-family: var(--font-display);
  font-size: var(--step-1u);
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--ink-3);
}
.faq details[open] summary::after { content: "\2013"; }
.faq details > div {
  padding: 0 2.5rem 1.75rem 0;
  color: var(--ink-2);
  max-width: var(--measure);
}

/* --- Form --------------------------------------------------------------- */
.form { display: grid; gap: 1.5rem; max-width: 40rem; }
.form__row { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form__row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.55rem; }
.field label {
  font-size: var(--step-1);
  letter-spacing: var(--track-mid);
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 300;
  color: var(--ink);
  padding: 0.9rem 1rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 0;
  width: 100%;
  transition: border-color 0.25s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--ink); outline: none; }
.field textarea { min-height: 9rem; resize: vertical; }

.form__note { font-size: var(--step-1); color: var(--ink-3); }

.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.alert {
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--ink);
  background: var(--paper-2);
  font-size: var(--step-0);
}

/* --- Map embed ---------------------------------------------------------- */
.map {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  filter: saturate(0.35) contrast(0.95);
  transition: filter 0.5s var(--ease);
}
.map:hover { filter: none; }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 620px) { .map { aspect-ratio: 4 / 3; } }

/* --- Footer ------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.75rem, 2rem + 3vw, 4.5rem) 2.5rem;
  margin-top: var(--band);
}
.foot__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: clamp(2rem, 1rem + 3vw, 4rem);
}
@media (max-width: 820px) { .foot__grid { grid-template-columns: 1fr; } }

.foot h2 {
  font-family: var(--font-display);
  font-size: var(--step-1u);
  font-weight: 400;
  margin-bottom: 1rem;
}
.foot p, .foot address {
  color: var(--ink-2);
  font-style: normal;
  font-size: var(--step-0);
  margin: 0 0 0.5rem;
}
.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule); }
.foot a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.foot__links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.foot__links a { border: 0; }

.foot__base {
  border-top: 1px solid var(--rule-soft);
  margin-top: clamp(2rem, 1.5rem + 2vw, 3rem);
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  font-size: var(--step-1);
  color: var(--ink-3);
}
.foot__base a { border: 0; color: var(--ink-3); }

/* --- Reveal animation ---------------------------------------------------
   Scoped to .js so that without JavaScript every element stays visible.
   Hiding content behind a script is both an accessibility and an SEO risk. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* --- Print -------------------------------------------------------------- */
@media print {
  .masthead, .foot, .nav__toggle, .lightbox { display: none !important; }
  body { color: #000; }
}
