/* Copyright 2026, Seth Cousins all rights reserved */

/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg:           #F8F7F4;
  --text:         #1A1A1A;
  --text-title:   #444343;
  --text-mid:     #6B6B6B;
  --text-light:   #9B9B9B;
  --border:       #DDDBD6;
  --border-light: #ECEAE6;
  --accent:       #2D5A3D;      /* availability "available" */
  --nav-width:    160px;
  --gap:          24px;

  font-size: 16px;
}

/* ============================================================
   Fonts — import at top of stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img, video {
  display: block;
  max-width: 100%;
}

/* ============================================================
   Layout shell
   ============================================================ */
.site-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   Left navigation
   ============================================================ */
/* Persistent sidebar removed — the slide-in overlay panel is now the only nav
   at every viewport. The shared nav-* classes below are reused inside the panel. */
.site-nav {
  display: none;
}

/* Artist name at top of page — aligned to the right of the fixed menu icon */
.site-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--text-title);
  padding: 20px 24px 6px 72px;
}

.site-title a:hover {
  opacity: 0.6;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 10px;
}

.nav-links {
  list-style: none;
  margin-bottom: 24px;
}

.nav-links li + li {
  margin-top: 2px;
}

.nav-links a {
  display: block;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-mid);
  padding: 3px 0;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a.active {
  color: var(--text);
  font-weight: 400;
}

.nav-divider {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: 8px 0 20px;
}

.nav-secondary {
  list-style: none;
}

.nav-secondary li + li {
  margin-top: 2px;
}

.nav-secondary a {
  display: block;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-mid);
  padding: 3px 0;
  transition: color 0.15s;
}

.nav-secondary a:hover,
.nav-secondary a.active {
  color: var(--text);
}

.nav-social {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.nav-social-link {
  color: var(--text-light);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.nav-social-link:hover {
  color: var(--text);
}

.home-social {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-top: 28px;
}

/* Site footer — social links left, copyright right */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 48px;
  border-top: 0.5px solid var(--border);
}

.site-footer-social {
  display: flex;
  gap: 14px;
  align-items: center;
}

.site-footer-copy {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Nav toggle — always visible, top-left */
.nav-toggle {
  display: block;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg);
  border: 0.5px solid var(--border);
  padding: 8px 10px;
  cursor: pointer;
  line-height: 1;
}

.nav-toggle-box {
  transition: transform 0.3s ease;
  transform-origin: center;
}

.nav-toggle.open .nav-toggle-box {
  /* horizontal lines rotate to vertical when the menu opens */
  transform: rotate(90deg);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  margin: 4px 0;
}

/* Slide-in nav panel — overlays the page without fully covering it */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(280px, 80vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 0.5px solid var(--border);
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.06);
  z-index: 150;
  padding: 72px 32px 40px 28px;
  overflow-y: auto;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.nav-overlay.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.3s ease, visibility 0s;
}

/* Transparent backdrop — captures outside clicks to close, leaves page visible */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: visibility 0s linear 0.3s;
}

.nav-backdrop.open {
  visibility: visible;
  transition: visibility 0s;
}

/* The toggle itself closes the panel now — the × button is redundant */
.nav-overlay-close {
  display: none;
}

/* ============================================================
   Main content area
   ============================================================ */
.site-main {
  margin-left: 0;
  flex: 1;
  min-width: 0;
}

/* ============================================================
   Home page
   ============================================================ */

.home-intro {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 72px 40px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-mid);
  text-align: left;
}

.home-intro p + p {
  margin-top: 1.2em;
}

/* Masonry grid — items flow left-to-right across columns (column count is
   set in js/masonry.js); each column stacks at its own natural height. */
.home-grid {
  display: flex;
  gap: 16px;
  padding: 0 64px 64px;
}

.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-grid-item {
  display: block;
}

.home-grid-item:hover {
  opacity: 0.9;
}

.home-grid-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Category nav (mobile wayfinding — hidden on desktop where sidebar nav is visible) */
.home-cat-nav {
  display: none;
}

/* ============================================================
   Category grid
   ============================================================ */
.category-header {
  padding: 48px 72px 32px;
  border-bottom: 0.5px solid var(--border);
}

.category-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.category-description {
  margin-top: 16px;
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 1000px;
}

.category-grid {
  display: flex;
  gap: 16px;
  padding: 32px 48px;
}

/* ============================================================
   Piece detail
   ============================================================ */
.piece-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.piece-header {
  padding: 6px 84px 6px;
  border-bottom: 0.5px solid var(--border);
}

.piece-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Image frame */
.piece-image-frame {
  padding: 20px;
  max-height: calc(100vh - 200px);
  background: #F2F1EE;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.piece-image-frame img,
.piece-image-frame video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.piece-image-frame img.loaded,
.piece-image-frame video {
  opacity: 1;
}

/* Frame nav buttons */
.frame-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  border: 0.5px solid var(--border);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}

.piece-image-frame:hover .frame-nav {
  opacity: 1;
}

.frame-nav:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.frame-nav-prev { left: 16px; }
.frame-nav-next { right: 16px; }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #2A2A2A;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 40px 10px;
}

.lightbox-media img,
.lightbox-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.5s, color 0.15s;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  padding: 16px 20px;
  transition: color 0.15s;
  z-index: 10;
  user-select: none;
  opacity: 0;
  transition: opacity 0.5s, color 0.15s;
}

.lightbox-nav:hover {
  color: #fff;
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

/* Controls reveal on mouse move / click, then fade out (toggled in piece.js) */
.lightbox.controls-visible .lightbox-nav,
.lightbox.controls-visible .lightbox-close {
  opacity: 1;
}

/* Make image frame cursor indicate clickable */
.piece-image-frame {
  cursor: zoom-in;
}

/* Filmstrip */
.filmstrip-wrap {
  padding: 16px 48px;
  border-bottom: 0.5px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.filmstrip {
  display: flex;
  gap: 8px;
  width: max-content;
}

.filmstrip-thumb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  border: 1.5px solid transparent;
  background: var(--border-light);
  transition: border-color 0.15s;
  overflow: hidden;
}

.filmstrip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.filmstrip-thumb.active {
  border-color: var(--text);
}

.filmstrip-thumb .play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
}

.filmstrip-thumb .play-icon::after {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 13px;
  border-color: transparent transparent transparent #fff;
  margin-left: 2px;
}

/* Prev / Next */
.piece-nav {
  padding: 16px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-mid);
}

.piece-nav-counter {
  text-align: center;
}

.piece-nav-btn {
  background: none;
  border: 0.5px solid var(--border);
  padding: 6px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-mid);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.piece-nav-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

.piece-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Metadata */
.piece-meta {
  padding: 28px 48px 64px;
  border-top: 0.5px solid var(--border);
}

.piece-meta-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 0.8rem;
  color: var(--text-mid);
  margin-bottom: 16px;
}

.piece-meta-availability {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 0.5px solid currentColor;
  margin-top: 12px;
  margin-bottom: 20px;
}

.availability-available {
  color: var(--accent);
}

.availability-sold {
  color: var(--text-light);
}

.availability-nfs {
  color: var(--text-light);
}

.piece-meta-description {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 560px;
}

/* ============================================================
   CV & Info pages
   ============================================================ */
.static-page {
  padding: 48px 72px 80px;
  max-width: 680px;
}

.static-page h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 0.5px solid var(--border);
}

.static-page h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--text-mid);
  font-style: normal;
}

.cv-entries {
  list-style: none;
}

.cv-entry {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 16px;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.cv-entry-year {
  color: var(--text-light);
  padding-top: 0;
}

.cv-entry-detail {
  color: var(--text);
}

.cv-entry-detail em {
  color: var(--text-mid);
  font-style: italic;
}

.info-block {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text-mid);
  margin-bottom: 28px;
}

.info-block a {
  color: var(--text);
  border-bottom: 0.5px solid var(--border);
  transition: border-color 0.15s;
}

.info-block a:hover {
  border-color: var(--text);
}

.info-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 6px;
}

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 768px) {
  /* Home */
  .home-intro {
    padding: 60px 72px 28px;
  }
  
  .home-intro p {
    margin-bottom: 28px;
  }

  .home-grid {
    padding: 0 24px 48px;
    gap: 8px;
  }

  .masonry-col {
    gap: 8px;
  }

  /* Category */

  .category-grid {
    padding: 24px 24px 48px;
    gap: 8px;
  }

  /* Piece */
  .piece-image-frame {
    padding: 10px;
    min-height: 240px;
  }
  
  .filmstrip-wrap {
    padding: 12px 24px;
  }

  .piece-nav {
    padding: 12px 24px;
  }

  .piece-meta {
    padding: 24px 24px 48px;
  }

  /* Static pages */
  .static-page {
    padding: 60px 24px 60px;
  }

  /* Footer */
  .site-footer {
    padding: 20px 24px;
  }
}
