/* Minimal gallery site — inspired by clean art studio layouts */

:root {
  --bg: #faf9f7;
  --bg-alt: #f2f0ec;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --border: #e0ddd7;
  --font-sans: "Outfit", system-ui, sans-serif;
  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
  --max-w: 1100px;
  /* Must match horizontal gap on 3-col grids (used to size a lone last row) */
  --grid-col-gap: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding-top: 8rem;
  overflow-x: hidden;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* —— Header: one visual block — title + hairline + links (no separate “box” on the nav) —— */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 0;
}

.header-inner {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  padding: 0.95rem 1.25rem 0.5rem;
}

.logo {
  display: block;
  width: 100%;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6.2vw, 2.95rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.1;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.75;
}

/* Full-width link bar under the title (wider than content column); link font size unchanged */
.site-nav {
  width: 100%;
  margin: 0;
  padding: 0.6rem clamp(1rem, 5vw, 4rem) 0.7rem;
  box-sizing: border-box;
  text-align: center;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
}

.nav-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: min(1280px, 100%);
  column-gap: clamp(1.5rem, 6.5vw, 3.75rem);
  row-gap: 0.55rem;
}

.nav-list li {
  margin: 0;
}

.nav-list li:not(:last-child) .nav-link::after {
  content: "·";
  display: inline-block;
  margin-inline-start: clamp(0.85rem, 2.5vw, 1.35rem);
  color: var(--text-muted);
  font-weight: 300;
  pointer-events: none;
}

.nav-link {
  display: inline-block;
  font-size: clamp(0.82rem, 1.35vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.45rem 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
  text-decoration: none;
  color: var(--text-muted);
}

.nav-link[aria-current="page"],
.nav-link.nav-link--current {
  font-weight: 500;
  border-bottom-color: var(--text);
}

@media (max-width: 520px) {
  .nav-list li:not(:last-child) .nav-link::after {
    display: none;
  }
}

@media (max-width: 420px) {
  .nav-list {
    gap: 0.35rem 0.6rem;
  }

  .nav-link {
    font-size: clamp(0.75rem, 3.2vw, 0.86rem);
    letter-spacing: 0.1em;
  }
}

/* Main */
.section {
  padding: 2.5rem 1.25rem 3.5rem;
}

.section--tight-top {
  padding-top: 1.5rem;
}

.section--alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  margin: 0 0 1.5rem;
}

.lede {
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section-intro {
  text-align: center;
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 auto 2rem;
  font-size: 0.95rem;
}

.section-intro--empty:empty {
  display: none;
  margin: 0;
}

/* Keep “Available at Amazon” on one line when the intro wraps */
.illustrations-amazon-line {
  white-space: nowrap;
}

@media (max-width: 380px) {
  .illustrations-amazon-line {
    white-space: normal;
  }
}

.gallery-block + .gallery-block {
  margin-top: 2.75rem;
}

.gallery-section-title {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.prose {
  max-width: 38rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
}

.prose p + p {
  margin-top: 1rem;
}

/* About: portrait + text */
.about-layout {
  max-width: 52rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 2.5rem;
  align-items: start;
  padding: 0 0.15rem;
}

@media (min-width: 720px) {
  .about-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.9fr);
    align-items: center;
  }
}

.about-figure {
  margin: 0;
  max-width: 22rem;
  width: 100%;
  justify-self: center;
}

.about-photo {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  background: var(--border);
}

.about-body {
  min-width: 0;
}

.about-body.prose,
.about-body .prose {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.about-cv-cta {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.about-cv-cta-sep {
  color: var(--text-muted);
}

button.text-btn-link,
a.text-btn-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

button.text-btn-link:hover,
a.text-btn-link:hover {
  opacity: 0.75;
}

/* About — CV modal (<dialog>) */
.cv-dialog {
  border: none;
  padding: 0;
  margin: auto;
  max-width: min(34rem, 94vw);
  width: 100%;
  background: transparent;
}

.cv-dialog::backdrop {
  background: rgba(26, 26, 26, 0.45);
}

.cv-dialog-panel {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.12);
  max-height: min(88vh, 46rem);
  display: flex;
  flex-direction: column;
}

.cv-dialog-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.cv-dialog-close:hover {
  color: var(--text);
}

.cv-dialog-title {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  padding: 1.25rem 2.75rem 0.5rem 1.25rem;
  color: var(--text);
}

.cv-dialog-source {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 1.25rem 0.75rem;
}

.cv-dialog-source a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cv-dialog-scroll {
  overflow-y: auto;
  padding: 0 1.25rem 1.35rem;
  -webkit-overflow-scrolling: touch;
}

.cv-prose {
  max-width: none;
  margin: 0;
  text-align: left;
}

.cv-section-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.15rem 0 0.4rem;
}

.cv-section-title:first-child {
  margin-top: 0;
}

.cv-line {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

/* CV standalone page (cv.html) */
.cv-page-inner {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.cv-page-intro {
  text-align: center;
}

.cv-prose--page {
  margin-top: 0.5rem;
}

/* Grids — 3 images per row; lone last item centered to one column width */
.hero-grid,
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--grid-col-gap);
}

.hero-grid {
  row-gap: 1rem;
}

.gallery {
  row-gap: 1.5rem;
}

/* Last item is alone on its row when count is 1, 4, 7, 10, … */
.hero-grid > .gallery-item:last-child:nth-child(3n + 1),
.gallery > .gallery-item:last-child:nth-child(3n + 1) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc((100% - 2 * var(--grid-col-gap)) / 3);
  max-width: calc((100% - 2 * var(--grid-col-gap)) / 3);
}

.gallery-item {
  margin: 0;
  text-align: center;
  min-width: 0;
}

.gallery-thumb {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--border);
  cursor: pointer;
  border: none;
  padding: 0;
  width: 100%;
  display: block;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-thumb:hover img,
.gallery-thumb:focus-visible img {
  transform: scale(1.04);
}

.gallery-thumb::after {
  content: "press to zoom";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-thumb:hover::after,
.gallery-thumb:focus-visible::after {
  opacity: 1;
}

/* Homepage: image only; title / medium / size on hover (not a click target) */
#home-gallery .gallery-thumb--home::after {
  display: none;
}

#home-gallery .gallery-thumb--home:hover img,
#home-gallery .gallery-thumb--home:focus-visible img {
  transform: none;
}

.thumb-hover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: stretch;
  padding: 0.65rem 0.7rem 0.75rem;
  text-align: left;
  pointer-events: none;
  background: linear-gradient(transparent 35%, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 0.22s ease;
}

.thumb-hover-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.thumb-hover-detail {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
}

@media (hover: hover) and (pointer: fine) {
  #home-gallery .gallery-thumb--home:hover .thumb-hover-overlay,
  #home-gallery .gallery-thumb--home:focus-visible .thumb-hover-overlay {
    opacity: 1;
  }
}

.gallery-item figcaption {
  margin-top: 0.65rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
}

.gallery-meta {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 0.2rem;
  letter-spacing: 0.04em;
}

/* Contact */
.contact-block {
  text-align: center;
}

.contact-intro {
  margin-left: auto;
  margin-right: auto;
}

.contact-google-note {
  max-width: 40rem;
  margin: 1rem auto 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.contact-form-actions {
  margin: 1.25rem 0 0;
  text-align: center;
}

.contact-submit {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  border: 1px solid var(--text);
  border-radius: 2px;
  background: var(--text);
  color: #fff;
}

a.contact-submit--link {
  display: inline-block;
  text-decoration: none;
}

.contact-submit:hover,
.contact-submit:focus-visible {
  opacity: 0.92;
}

.contact-google-wrap {
  max-width: 40rem;
  margin: 1.25rem auto 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
}

.contact-google-frame {
  display: block;
  width: 100%;
  min-height: 52rem;
  height: 70vh;
  max-height: 56rem;
  border: 0;
}

.contact-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 1rem 0 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 3rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.lightbox[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox-inner {
  margin: 0;
  max-width: min(90vw, 1000px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: min(78vh, 900px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.12);
  order: 1;
  flex-shrink: 0;
}

.lightbox-caption {
  order: 2;
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  white-space: pre-line;
  line-height: 1.45;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: none;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  z-index: 201;
}

.lightbox-close:hover {
  opacity: 0.6;
}
