/* ============================================================
   HENRY VILLIERME, Site Stylesheet
   ============================================================
   Design tokens (edit here to retheme the whole site):
   ------------------------------------------------------------ */
:root {
  --paper:      #F6F3EC;  /* warm ivory background */
  --paper-dim:  #EFEADD;  /* slightly deeper panel background */
  --ink:        #211F1B;  /* near-black warm charcoal for text */
  --ink-soft:   #6B6558;  /* muted secondary text */
  --sage:       #4B5E45;  /* deep sage, primary accent */
  --sage-dim:   #3C4B38;  /* sage, darker, for hover states */
  --stone:      #B7A98D;  /* warm stone, hairlines & borders */
  --stone-dim:  #D8D0BE;  /* lighter stone, for subtle fills */
  --white:      #FFFFFF;

  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; /* matches --font-body for now, per request */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-accent: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; /* Franklin Gothic-alike, used only for the top nav, the home hero headline, and section subheadings (added V179) */

  --max-width: 1180px;
  --gutter: clamp(24px, 5vw, 72px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; -webkit-user-drag: none; user-drag: none; }

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ------------------------------------------------------------
   Header / Navigation
   ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--stone-dim);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 24px;
}

.wordmark {
  font-family: var(--font-body);
  font-size: 1.79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.wordmark span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
  font-weight: 400;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  margin: 5px 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px clamp(16px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
}

.main-nav a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 4px;
  position: relative;
}

/* Nav gets the Franklin Gothic-alike treatment; scoped to the header only
   so the footer's repeated wordmark/links stay in the body font (V179). */
.site-header .wordmark,
.site-header .main-nav a {
  font-family: var(--font-accent);
  font-weight: 700;
}

/* Subtitle line matches the wordmark's font so both lines read as one
   unit; at its existing size, Libre Franklin's letterforms happen to
   bring "BAY AREA FIGURATIVE PAINTER" to almost exactly the same
   rendered width as "HENRY VILLIERME" above it (V182). */
.site-header .wordmark span {
  font-family: var(--font-accent);
}

.main-nav a[aria-current="page"] {
  color: var(--sage);
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  align-items: flex-end;
  background: #1a1a1a url("../images/archive/hero-henry-studio-1996.jpg") center 18% / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(20,18,15,0.72) 0%, rgba(20,18,15,0.15) 55%, rgba(20,18,15,0.05) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: 64px var(--gutter) 56px;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  color: var(--paper);
}
.hero h1 {
  font-family: var(--font-accent);
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.01em;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin: 0;
  max-width: 16ch;
}
.hero p {
  margin: 20px 0 0;
  max-width: 46ch;
  color: var(--paper);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Smaller page header used on interior pages instead of the big hero */
.page-header {
  padding: 24px 0 40px;
  border-bottom: 1px solid var(--stone-dim);
}
.page-header .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.page-header h1 {
  font-family: var(--font-accent);
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.01em;
  font-size: clamp(1.693rem, 3.848vw, 2.616rem);
  margin: 12px 0 0;
}
.page-header .lede {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
}

/* ------------------------------------------------------------
   Section rhythm
   ------------------------------------------------------------ */
section { padding: 88px 0; }
section.tight { padding: 56px 0; }
section + section { border-top: 1px solid var(--stone-dim); }

.section-heading {
  font-family: var(--font-accent);
  font-weight: 700;
  font-style: normal;
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  margin: 0 0 8px;
}
.section-kicker {
  font-size: 0.858rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 10px;
  display: block;
}

.lede-col {
  max-width: 680px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.letter-photo-row { grid-template-columns: 1fr auto; }

/* Float-based text wrap (Letter page): image floats right, text wraps
   down its left side, then reclaims full width once past the image */
.letter-wrap { overflow: hidden; } /* clearfix so the float doesn't bleed past this container */
.letter-photo-float {
  float: right;
  width: 663px;
  max-width: 55%;
  margin: 24px 0 28px 40px;
}
/* Modifier: half-size float (e.g. Vincent Price book cover), overridden
   back to full-width by the mobile breakpoint below like any other float */
.letter-photo-float--sm { width: 332px; }

.prose p { margin: 0 0 1.2em; color: var(--ink); }
.prose p.muted { color: var(--ink-soft); }

/* placeholder content callouts, remove once real content is added */
.content-placeholder {
  border: 1.5px dashed var(--stone);
  background: var(--paper-dim);
  padding: 18px 20px;
  border-radius: 2px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 18px 0;
}
.content-placeholder strong { color: var(--sage-dim); }

/* ------------------------------------------------------------
   Buttons / links
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 26px;
  border: 1px solid var(--ink);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--sage); border-color: var(--sage); color: var(--paper); }
.btn.primary:hover { background: var(--sage-dim); border-color: var(--sage-dim); }

.text-link {
  border-bottom: 1px solid var(--stone);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.text-link:hover { color: var(--sage); border-color: var(--sage); }

/* ------------------------------------------------------------
   Inline archival photo (About page, placed within the narrative)
   ------------------------------------------------------------ */
.about-photo {
  max-width: 380px;
  margin: 56px auto;
  text-align: center;
}
.about-photo .frame {
  aspect-ratio: 4 / 5;
  background: var(--paper-dim);
  border: 1px solid var(--stone-dim);
  overflow: hidden;
}
.about-photo .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.about-photo figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ------------------------------------------------------------
   Archival photo grid (About page, historical photos)
   ------------------------------------------------------------ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
  margin-top: 8px;
}
.photo-grid figure { margin: 0; }
.photo-grid .frame {
  aspect-ratio: 4 / 5;
  background: var(--paper-dim);
  border: 1px solid var(--stone-dim);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-grid .frame img { width: 100%; height: 100%; object-fit: cover; }
.photo-grid figcaption {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* ------------------------------------------------------------
   Letter styling (A Letter page)
   ------------------------------------------------------------ */
.letter-block {
  border-left: 3px solid var(--stone);
  padding-left: clamp(18px, 3vw, 32px);
  margin: 32px 0;
}
.letter-block p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.14rem;
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 1.1em;
}
.letter-signoff {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: -6px;
}

/* ------------------------------------------------------------
   Poster grid (Posters page)
   ------------------------------------------------------------ */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 28px;
}
.poster-grid figure { margin: 0; }
.poster-grid .frame {
  aspect-ratio: 2 / 3;
  background: var(--paper-dim);
  border: 1px solid var(--stone-dim);
  overflow: hidden;
}
.poster-grid .frame img { width: 100%; height: 100%; object-fit: cover; }
.poster-grid .work-title { font-family: var(--font-display); font-style: italic; font-size: 1.05rem; margin-top: 14px; }
.poster-grid .work-meta { font-size: 0.85rem; color: var(--ink-soft); margin-top: 3px; }

/* ------------------------------------------------------------
   Gallery grid (Gallery page)
   ------------------------------------------------------------ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 48px;
}
.filter-bar button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.filter-bar button.active,
.filter-bar button:hover {
  color: var(--ink);
  border-color: var(--sage);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 88px 32px;
}
.gallery-item { cursor: pointer; }
.gallery-item figure { margin: 0; }
.gallery-item .frame {
  aspect-ratio: 4 / 5;
  background: var(--paper-dim);
  border: 1px solid var(--stone-dim);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.035); }
.gallery-item figcaption { margin-top: 14px; }
.gallery-item .work-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
}
.gallery-item .work-meta {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 3px;
}

/* Centered short row beneath a 3-column .gallery-grid — "pyramid" layout,
   e.g. Gallery page Available Works: a full row of 3, then a shorter row
   of 2 (or fewer) centered underneath rather than left-aligned. Item width
   is calculated to match the 3-column grid's track width exactly, so tiles
   in the centered row line up with the columns above at any viewport width. */
.gallery-grid-centered-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 88px;
}
.gallery-grid-centered-row .gallery-item {
  flex: 0 1 calc((100% - 64px) / 3);
}
@media (max-width: 860px) {
  .gallery-grid-centered-row .gallery-item { flex-basis: calc((100% - 32px) / 2); }
}
@media (max-width: 640px) {
  .gallery-grid-centered-row { flex-direction: column; align-items: center; gap: 88px; }
  .gallery-grid-centered-row .gallery-item { flex-basis: 100%; width: 100%; max-width: 420px; }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.94);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 40px;
  overflow-y: auto;
}
.lightbox.open { display: flex; }
.lightbox img { max-height: 74vh; max-width: 100%; margin: 0 auto; flex-shrink: 0; }
.lightbox img.early-work-frame {
  /* White mat border, 1/32 in (96px per inch ÷ 32 = 3px) */
  border: 3px solid #fff;
  box-sizing: border-box;
}
.lightbox-caption {
  margin-top: 6px; /* 1/16 in (96px per inch ÷ 16 = 6px), always relative to the image, never overlapping it */
  text-align: center;
  color: var(--paper);
  max-width: 90%;
  flex-shrink: 0;
}
.lightbox-caption .work-title { font-family: var(--font-display); font-style: italic; font-size: 1.1rem; }
.lightbox-caption .work-meta { color: var(--stone-dim); font-size: 0.85rem; margin-top: -2px; white-space: pre-line; }
.lightbox-caption .work-note { color: var(--stone-dim); font-size: 0.85rem; font-style: italic; margin-top: 0.75em; opacity: 0.85; display: none; white-space: pre-line; }
.lightbox-close {
  position: absolute;
  top: 28px;
  right: 32px;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

/* ------------------------------------------------------------
   Exhibitions (list / timeline)
   ------------------------------------------------------------ */
.exhibit-list { list-style: none; margin: 0; padding: 0; }
.exhibit-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 26px 0;
  border-top: 1px solid var(--stone-dim);
}
.exhibit-list li:last-child .exhibit-row { border-bottom: 1px solid var(--stone-dim); }
.exhibit-year {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--sage);
}
.exhibit-name { font-size: 1.08rem; }
.exhibit-venue { color: var(--ink-soft); font-size: 0.95rem; margin-top: 3px; }
.exhibit-type {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
  align-self: start;
  padding-top: 4px;
}

/* ------------------------------------------------------------
   Contact
   ------------------------------------------------------------ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
}
.contact-detail { margin-bottom: 26px; }
.contact-detail .label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.contact-detail .value { font-size: 1.1rem; }

form.contact-form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 4px;
  border: none;
  border-bottom: 1px solid var(--stone);
  background: transparent;
  color: var(--ink);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--sage);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 4px; }

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--stone-dim);
  padding: 48px 0;
  background: var(--paper-dim);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.footer-inner .wordmark { font-size: 1.05rem; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { font-size: 0.82rem; color: var(--ink-soft); }
.footer-links a:hover { color: var(--sage); }
.copyright { font-size: 0.8rem; color: var(--ink-soft); margin-top: 24px; }
.color-note { font-size: 0.8rem; color: var(--ink-soft); margin-top: 8px; font-style: italic; }

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
  .letter-photo-row { grid-template-columns: 1fr; }
  .letter-photo-float { float: none; width: 100%; max-width: 100%; margin: 0 0 32px 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: 84px; left: 0; right: 0;
    background: var(--paper);
    border-top: 1px solid var(--stone-dim);
    border-bottom: 1px solid var(--stone-dim);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.open { max-height: 320px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter); }
  .main-nav a { display: block; padding: 14px 0; }
  .gallery-grid { grid-template-columns: 1fr; }
  .exhibit-row { grid-template-columns: 1fr; gap: 6px; }
  .exhibit-type { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
