/* davebaiocchi.net — rebuilt from the Squarespace 7.0 original.
   Type and colour are lifted from the original's own values: Amatic SC 700/50px
   wordmark, nav 13px/300, link blue #0057A8, text #2E2E2E on #1A1A1A headings.
   museo-sans and proxima-nova were licensed to the site through Squarespace's
   Adobe Fonts account and don't survive the move; Nunito Sans replaces both. */

@font-face {
  font-family: 'Nunito Sans';
  src: url('/assets/fonts/nunito-sans-var.woff2') format('woff2-variations');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Amatic SC';
  src: url('/assets/fonts/amatic-sc-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink:    #1A1A1A;
  --body:   #2E2E2E;
  --link:   #0057A8;
  --muted:  #6E6E6E;
  --rule:   #E6E6E6;
  --bg:     #FFFFFF;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 40rem;
  --max: 78rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: 'Nunito Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--ink); color: #fff; padding: .75rem 1rem;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }

/* ---------------- header ---------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 1rem;
}

.brand {
  font-family: 'Amatic SC', cursive;
  font-weight: 700;
  font-size: clamp(2.25rem, 4vw, 3.125rem);   /* 50px at full size, as the original */
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .01em;
}
.brand:hover { color: var(--link); }

.menu-toggle {
  display: none;
  background: none; border: 0; padding: .5rem; cursor: pointer; color: var(--body);
}
.bars, .bars::before, .bars::after {
  display: block; width: 22px; height: 2px; background: currentColor; border-radius: 2px;
}
.bars { position: relative; }
.bars::before, .bars::after { content: ''; position: absolute; left: 0; }
.bars::before { top: -7px; } .bars::after { top: 7px; }

.menu {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 2vw, 1.75rem);
  list-style: none; margin: 0; padding: 0;
}
.menu a, .menu button {
  font-size: 13px; font-weight: 300; line-height: 1;
  color: var(--body); text-decoration: none;
  background: none; border: 0; padding: .35rem 0; cursor: pointer;
  font-family: inherit;
}
.menu a:hover, .menu button:hover { color: var(--link); }
.menu a[aria-current="page"], .menu button.current { color: var(--link); }

.has-sub { position: relative; }
.sub {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 14rem; margin: .5rem 0 0; padding: .6rem 0;
  list-style: none; background: #fff;
  border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: 0 8px 28px rgb(0 0 0 / .09);
  opacity: 0; visibility: hidden; transition: opacity .14s ease;
  z-index: 40;
}
.has-sub:hover .sub,
.has-sub:focus-within .sub,
.has-sub.open-menu .sub { opacity: 1; visibility: visible; }
.sub li { display: block; }
.sub a { display: block; padding: .45rem 1.1rem; font-size: 13px; white-space: nowrap; }

@media (max-width: 860px) {
  .site-header { flex-wrap: wrap; align-items: flex-start; }
  .menu-toggle { display: block; margin-left: auto; }
  #nav { flex-basis: 100%; display: none; }
  #nav.open { display: block; }
  .menu { flex-direction: column; align-items: flex-start; gap: 0; padding: .5rem 0 1rem; }
  .menu > li { width: 100%; border-top: 1px solid var(--rule); }
  .menu a, .menu button { display: block; padding: .8rem 0; font-size: 16px; width: 100%; text-align: left; }
  .sub {
    position: static; transform: none; opacity: 1; visibility: visible;
    border: 0; box-shadow: none; margin: 0; padding: 0 0 .4rem .9rem;
    display: none;
  }
  .has-sub.open-menu .sub { display: block; }
  .sub a { padding: .55rem 0; font-size: 15px; }
}

/* ---------------- landing ---------------- */

.landing { height: 100%; }
.cover { position: relative; min-height: 100svh; display: grid; place-items: center; isolation: isolate; }
.cover-img {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; object-fit: cover;
}
/* The forest photo is busy; white text over the trunks is hard to read at wide
   aspect ratios where the crop loses the sky. A soft centre scrim fixes contrast
   without flattening the picture. */
.cover-scrim {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 60% 45% at 50% 52%,
              rgb(0 0 0 / .42) 0%, rgb(0 0 0 / .26) 45%, rgb(0 0 0 / 0) 78%);
}

.cover-inner { text-align: center; padding: 2rem var(--gutter); }
.cover-name {
  font-family: 'Amatic SC', cursive; font-weight: 700;
  font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1;
  color: #fff; margin: 0 0 .25em;
  text-shadow: 0 2px 22px rgb(0 0 0 / .38);
}
.cover-tagline {
  font-size: clamp(1.1rem, 2.4vw, 1.875rem); font-weight: 300; letter-spacing: .02em;
  color: #fff; margin: 0 0 2rem; text-shadow: 0 1px 16px rgb(0 0 0 / .42);
}
.cover-cta {
  display: inline-block; background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 700; text-decoration: none;
  padding: .85rem 2.4rem; border-radius: 2px;
  transition: background .16s ease, color .16s ease;
}
.cover-cta:hover { background: var(--link); color: #fff; }

/* ---------------- pages ---------------- */

.page-title {
  font-size: clamp(1.6rem, 2.4vw, 1.875rem);   /* 30px, as the original */
  font-weight: 700; line-height: 1.25; color: var(--ink);
  margin: 0 0 1.75rem; letter-spacing: -.01em;
}

/* The prose column shares the header's outer box (same max-width, same gutter),
   so its left edge lines up with the "Dave Baiocchi" wordmark — and with the
   gallery grids, which already use this box. Line length is then capped on the
   children rather than by centring the whole column. */
.prose {
  max-width: var(--max);
  margin: 0 auto;
  padding: .5rem var(--gutter) 5rem;
  font-size: 1rem;
}
.prose > * { max-width: var(--measure); }
.prose p { margin: 0 0 1.35rem; }
.prose h2 {
  font-size: 1.25rem; font-weight: 700; color: var(--ink);
  margin: 2.75rem 0 1rem; line-height: 1.3;
}
.prose .lede { color: var(--muted); margin-bottom: 2.25rem; }
.prose a { text-decoration: none; border-bottom: 1px solid rgb(0 87 168 / .32); }
.prose a:hover { border-bottom-color: var(--link); }

.talk + .talk, .press-item + .press-item { border-top: 1px solid var(--rule); padding-top: .5rem; }

.portrait { margin: 0 0 2rem; }
.portrait img { width: 100%; border-radius: 2px; }
.portrait figcaption {
  font-size: .875rem; color: var(--muted); margin-top: .6rem; line-height: 1.5;
}

/* ---------------- gallery grid ---------------- */

.gallery-page {
  max-width: var(--max);
  margin: 0 auto;
  padding: .5rem var(--gutter) 4rem;
}

/* Justified rows: every photo keeps its true aspect ratio, rows share a common
   height, and each cell grows in proportion to its aspect so rows fill the
   width. The original cropped nothing to squares and neither does this.
   The ::after item soaks up leftover space so the LAST row keeps its natural
   size instead of stretching a lone photo across the page. */

.grid {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
  /* row height tuned to land ~4-5 photos per row at desktop widths, matching
     the density of the Squarespace original */
  --row: clamp(10rem, 17vw, 16.5rem);
}
.grid::after { content: ''; flex-grow: 1e6; }
.grid > li { height: var(--row); min-width: 0; }

.thumb {
  display: block; width: 100%; height: 100%; padding: 0; border: 0;
  cursor: zoom-in; background: #f2f2f2; overflow: hidden; border-radius: 1px;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity .2s ease, transform .35s ease;
}
.thumb:hover img { opacity: .82; transform: scale(1.03); }

@media (max-width: 560px) {
  /* two-up on phones; rows of six postage stamps help nobody */
  .grid { --row: 30vw; }
}

/* ---------------- gallery text blocks ---------------- */

.block-prose, .block-head { max-width: var(--measure); }
.block-prose { font-size: .9375rem; margin: 0 0 1.75rem; }
.block-prose p { margin: 0 0 1rem; }
.block-prose a { color: var(--link); text-decoration: none; border-bottom: 1px solid rgb(0 87 168 / .32); }
.block-prose a:hover { border-bottom-color: var(--link); }
.block-head {
  font-size: .875rem; font-weight: 700; color: var(--ink);
  margin: 1.75rem 0 .6rem;
}
.block-head:first-child { margin-top: 0; }

.lead, .plate { margin: 0 0 1.5rem; }
.lead-img, .plate-img { width: 100%; max-width: 62rem; border-radius: 1px; }
.lead figcaption, .plate figcaption {
  font-size: .8125rem; color: var(--muted); margin-top: .5rem;
}
.plate { margin-bottom: 2.5rem; }

/* ---------------- Tahoe photo essay ---------------- */

.essay { padding: 2.5rem 0; border-top: 1px solid var(--rule); }
.essay:first-of-type { border-top: 0; }
.essay-title { font-size: 1.375rem; font-weight: 400; color: var(--ink); margin: 0 0 .15rem; }
.essay-date { font-size: .75rem; color: var(--muted); margin: 0 0 1.25rem; }
.essay-figure { margin: 0; }
.essay-img { width: 100%; border-radius: 1px; margin-bottom: 6px; }
.essay-figure figcaption { font-size: .8125rem; color: var(--muted); margin-top: .4rem; }
.essay-body { font-size: .9375rem; }
.essay-body p { margin: 0 0 1rem; }
.essay-body a { color: var(--link); }

@media (min-width: 900px) {
  /* the original ran the essay in a narrow column beside the photo */
  .essay { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
  .essay-title, .essay-date { grid-column: 1 / -1; margin-bottom: 0; }
  .essay-date { margin-bottom: 1.25rem; }
  .essay-body { padding-top: .2rem; }
}

/* ---------------- contact form ---------------- */

.contact-form { margin-top: 2rem; font-size: .9375rem; }
.contact-form .field { margin: 0 0 1.25rem; display: block; }
.contact-form label { display: block; margin-bottom: .35rem; color: var(--body); }
.contact-form .req { color: var(--muted); font-size: .75rem; }
.contact-form input, .contact-form textarea {
  width: 100%; font: inherit; color: var(--body);
  background: #FAFAFA; border: 1px solid #CFCFCF; border-radius: 2px;
  padding: .6rem .7rem;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: 2px solid var(--link); outline-offset: 1px; background: #fff;
}
.contact-form textarea { resize: vertical; }
.row2 { display: grid; gap: 0 1rem; }
@media (min-width: 620px) { .row2 { grid-template-columns: 1fr 1fr; } }

/* honeypot: bots fill it, humans never see it */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.actions { display: flex; align-items: center; gap: 1rem; margin: 0; }
.send {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--ink); color: #fff; border: 0; border-radius: 2px;
  padding: .7rem 2rem;
}
.send:hover { background: var(--link); }
.send[disabled] { opacity: .55; cursor: default; }
.form-status { font-size: .8125rem; color: var(--muted); }
.form-status.ok { color: #1B7F3B; }
.form-status.err { color: #B3261E; }

/* ---------------- lightbox ---------------- */
/* The original opened the photo full-size on white with prev/next beneath and an
   × to close. Same behaviour, plus keyboard and swipe. */

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: #fff;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: clamp(3.5rem, 6vw, 4.5rem) var(--gutter) 1.25rem;
}
.lightbox[hidden] { display: none; }

.lb-figure { margin: 0; display: grid; place-items: center; min-height: 0; }
.lb-img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain;
}

.lb-close {
  position: absolute; top: .75rem; right: var(--gutter);
  background: none; border: 0; cursor: pointer;
  font-size: 1.75rem; line-height: 1; color: var(--body); padding: .35rem .5rem;
}
.lb-close:hover { color: var(--link); }

.lb-nav {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding-top: 1rem; position: relative;
}
.lb-nav button {
  background: none; border: 0; cursor: pointer; font-family: inherit;
  font-size: .9375rem; font-weight: 400; color: var(--link); padding: .3rem .45rem;
}
.lb-nav button:hover { color: var(--ink); }
.lb-nav button:disabled { color: #C4C4C4; cursor: default; }
.lb-sep { color: var(--muted); }
.lb-count {
  position: absolute; right: 0; margin: 0;
  font-size: .75rem; color: var(--muted);
}
@media (max-width: 600px) {
  .lb-count { position: static; margin-left: .75rem; }
}

body.lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
