/* ============================================================
   Nathan McLune — shared site stylesheet
   Black & white, monospace, dark/light toggle.
   Extends the token system already set up in current-branding.html
   ============================================================ */

:root {
  --bg:        #FFFFFF;
  --card:      #FFFFFF;
  --cardAlt:   #F5F5F5;
  --text:      #111111;
  --royal:     #000000;
  --subtext:   #000000;
  --violet:    #000000;
  --lavText:   #6B6B6B;
  --border:    #E0E0E0;
  --silver:    #8A8A8A;
}
[data-theme="dark"] {
  --bg:        #121212;
  --card:      #1E1E1E;
  --cardAlt:   #262626;
  --text:      #FFFFFF;
  --royal:     #FFFFFF;
  --subtext:   #FFFFFF;
  --violet:    #FFFFFF;
  --lavText:   #A0A0A0;
  --border:    #333333;
  --silver:    #999999;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Monaco, Consolas, monospace;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── Header (locked/sticky) ── */
header.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 999;
  isolation: isolate;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 0 0;
  background: var(--bg);
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 8px;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-top h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--royal);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.header-top p {
  font-size: 13px;
  color: var(--lavText);
  margin: 0;
}
.theme-toggle {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--cardAlt);
  color: var(--subtext);
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* site nav — sits under the name/toggle row, inside the same sticky header */
.site-nav {
  display: flex;
  gap: 4px;
  margin: 12px 0 0;
  padding-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex-shrink: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lavText);
  padding: 6px 10px;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: #FFFFFF;
  background: #000000;
}
[data-theme="dark"] .site-nav a[aria-current="page"] {
  color: #000000;
  background: #FFFFFF;
}

/* ── Sections ── */
section { padding: 28px 0; border-bottom: 0.5px solid var(--border); }
section:last-of-type { border-bottom: none; }
section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
}
section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 12px;
}
/* utility: a section with no divider and no top padding — used where a
   heading block (.page-title / .project-title) already provides the
   spacing above it (homepage projects grid, project photo galleries) */
section.section-flush {
  padding-top: 0;
  border-bottom: none;
}
/* utility: an inline text link that matches body text colour and is
   underlined — used for links inside a paragraph (e.g. Workshops page) */
.text-link {
  color: var(--text);
  text-decoration: underline;
}

/* ── Page title block (About / Projects / Workshops) ── */
.page-title {
  padding: 28px 0 8px;
}
.page-title h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.page-title p {
  font-size: 13px;
  color: var(--lavText);
  margin: 0;
}

/* ── Portrait (About page) ── */
.portrait {
  max-width: 220px;
  margin: 0 auto 8px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ── Homepage project covers (one image per project, links through) ── */
.project-covers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 4px 0 8px;
}
.project-covers a {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.project-covers .cover-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cardAlt);
  margin-bottom: 8px;
}
.project-covers .cover-frame img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.project-covers a:hover .cover-frame img { transform: scale(1.04); opacity: 0.92; }
.project-covers .cover-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  text-decoration: underline;
}
@media (max-width: 420px) {
  .project-covers { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .project-covers .cover-title { font-size: 9.5px; }
}

/* ── Project detail page: title + intro + mixed image grid ── */
.project-title { padding: 28px 0 4px; }
.project-title h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.project-intro {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 22px;
}
.mixed-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.mixed-grid .grid-row { display: grid; gap: 10px; }
.mixed-grid .grid-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.mixed-grid .grid-row.cols-2 { grid-template-columns: repeat(2, 1fr); }
.mixed-grid a {
  display: block;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--cardAlt);
}
.mixed-grid a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.mixed-grid .grid-row.cols-3 a img { aspect-ratio: 2 / 3; }
.mixed-grid .grid-row.cols-2 a img { aspect-ratio: 3 / 2; }
.mixed-grid a:hover img { transform: scale(1.04); opacity: 0.92; }
.mixed-grid a::after {
  content: "↗";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: rgba(0,0,0,0.55);
  color: #FFFFFF;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ── Tall/stack row: a tall portrait flanked either side of two stacked landscape images ── */
.mixed-grid .grid-row.tall-stack {
  grid-template-columns: repeat(3, 1fr);
}
.mixed-grid .grid-row.tall-stack .tall-cell img { aspect-ratio: 2 / 3; }
.mixed-grid .grid-row.tall-stack .stack-cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mixed-grid .grid-row.tall-stack .stack-cell a img { aspect-ratio: 3 / 2; }

/* ── About page favourites / facts lists ── */
.about-list { margin: 0 0 20px; padding: 0; list-style: none; }
.about-list li {
  font-size: 14px;
  line-height: 1.7;
  padding-left: 14px;
  position: relative;
  margin-bottom: 4px;
}
.about-list li::before {
  content: "▪";
  position: absolute;
  left: 0;
  color: var(--lavText);
  font-size: 10px;
  top: 7px;
}
.about-list li strong { font-weight: 700; }

/* ── Back link on project pages ── */
.back-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--lavText);
  margin: 18px 0 4px;
}
.back-link:hover { color: var(--text); }

/* ── Footer ── */
footer { padding: 14px 0 0; text-align: center; }
footer p { font-size: 12px; color: var(--silver); margin: 0 0 16px; }
.social-links { display: flex; justify-content: center; gap: 14px; }
.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.social-links svg {
  width: 18px;
  height: 18px;
  stroke: #FFFFFF;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.social-links a.instagram { background: #D6249F; }
.social-links a.substack  { background: #FF6719; }
.social-links a.email     { background: #6B7280; }

/* ── Lightbox overlay (in-page image preview, see lightbox.js) ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 48px 20px;
}
.lightbox-overlay[hidden] { display: none; }
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}
.lightbox-close {
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #111111;
  font-size: 22px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close.left { left: max(16px, env(safe-area-inset-left, 0px)); }
.lightbox-close.right { right: max(16px, env(safe-area-inset-right, 0px)); }
body.lightbox-open { overflow: hidden; }
