/* Matt Crookshank — minimal portfolio
   Cleaned + de-duplicated stylesheet
*/

:root{
  --bg:#ffffff;
  --fg:#111111;
  --muted:#6b6b6b;
  --border:#e8e8e8;
  --max:980px;
  --pad:18px;
  --radius:10px;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }

body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--fg);
  background:var(--bg);
  line-height:1.45;
}

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

.wrapper{
  max-width:var(--max);
  margin:0 auto;
  padding:0 var(--pad);
}

/* Header / Nav */
header{
  position:sticky;
  top:0;
  background:rgba(255,255,255,0.92);
  backdrop-filter:blur(8px);
  z-index:10;
  border-bottom:1px solid rgba(0,0,0,0.04);
}

.navbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
}

.brand{
  font-weight:600;
  letter-spacing:0.02em;
  font-size:1.3rem;
}

.brand a:hover{ text-decoration:none; }

nav{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  justify-content:flex-end;
}

nav a{
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
  text-decoration:none;
}

nav a:hover{ text-decoration:underline; }
nav a.active{ color:var(--fg); text-decoration:none; }

/* Main / Typography */
main{ padding:28px 0 64px; }
h1{ font-size:18px; letter-spacing:.12em; text-transform:uppercase; margin:0 0 18px; }
h2{ font-size:14px; letter-spacing:.12em; text-transform:uppercase; margin:26px 0 12px; }

p{ margin:0 0 14px; color:var(--fg); }
.muted{ color:var(--muted); }

/* Default text width on most pages */
.prose{
  max-width:72ch;
}

/* About hero */
.hero-text{
  max-width:72ch;
}

.hero-text .lede{
  font-size:1.25rem;
  line-height:1.75;
}

.hero{
  max-width:600px;
  margin:18px 0 0;
}

.hero img{
  width:100%;
  height:auto;
  display:block;
  border-radius:var(--radius);
  border:1px solid var(--border);
}

.image-credit{
  margin:10px 0 0;
  font-size:12px;
  color:var(--muted);
}

.image-credit a{ text-decoration:none; }
.image-credit a:hover{ text-decoration:underline; }

/* Gallery */
.gallery{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:18px;
  align-items:start;

  max-width:1200px;
  margin:0 auto;
  padding:0 18px;
}

@media (max-width:560px){
  .gallery{
    grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
    gap:14px;
    padding:0 12px;
  }
  .navbar{ align-items:flex-start; }
  nav{ justify-content:flex-start; }
}

/* Card */
.card{
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  background:#fff;
}

.card button,
.card .lightbox-trigger{
  all:unset;
  display:flex;                 /* centers thumbnails when using object-fit:contain */
  align-items:center;
  justify-content:center;
  width:100%;
  cursor:pointer;
}

.card button:focus-visible,
.card .lightbox-trigger:focus-visible{
  outline:2px solid rgba(17,17,17,0.25);
  outline-offset:2px;
}

/* Default thumbnail behavior:
   - paintings + digital should show whole image (contain)
   - photos can override to cover for a tighter grid look
*/
img.thumb{
  width:100%;
  aspect-ratio:4 / 5;
  height:auto;                  /* derived from aspect-ratio */
  display:block;
  object-fit:contain;
  object-position:center;
  background:#fff;              /* clean letterboxing */
}

/* Optional square thumbs */
.thumb-square{ aspect-ratio:1 / 1; }

/* Meta */
.meta{ padding:12px 12px 14px; }
.title{
  font-size:13px;
  letter-spacing:.06em;
  text-transform:uppercase;
  margin:0 0 6px;
}
.caption{
  font-size:13px;
  color:var(--muted);
  margin:0;
}

/* Gallery notes (photo page additions) */
.gallery-note{
  margin:0.75rem 0 2rem 0;
  font-size:0.95rem;
  opacity:0.8;
}
.gallery-note .inquire-link{
  color:inherit;
  text-decoration:none;
  font-style:italic;
}
.gallery-note .inquire-link:hover{ text-decoration:underline; }

/* Photo page grid tweaks (if you use .photo-grid / .photo-gallery classes) */
.gallery.photo-grid,
.gallery.photo-gallery,
.photo-grid{
  grid-template-columns:repeat(5, minmax(0, 1fr));
  gap:24px;
}

@media (max-width:1100px){
  .gallery.photo-grid,
  .gallery.photo-gallery,
  .photo-grid{
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }
}

@media (max-width:900px){
  .gallery.photo-grid,
  .gallery.photo-gallery,
  .photo-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
}

@media (max-width:560px){
  .gallery.photo-grid,
  .gallery.photo-gallery,
  .photo-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
  }
}

/* Photo thumbnails: use cover + square tile (prevents extreme tall thumbs on mobile landscape) */
.page-photo img.thumb{
  aspect-ratio:1 / 1;
  object-fit:cover;
  background:#fff;
}

/* Mobile landscape: keep photo grid from feeling oversized */
@media (max-height:500px) and (orientation:landscape){
  .page-photo img.thumb{ aspect-ratio:4 / 3; }
}

/* Series tabs (Painting page) */
.series-nav{
  max-width:1200px;
  margin:0 auto 18px;
  padding:0 18px;
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:10px;
}

.series-tab{
  all:unset;
  cursor:pointer;
  font-size:12px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
}

.series-tab:hover{ text-decoration:underline; }
.series-tab.is-active{ color:var(--fg); }

.series-dot{
  color:var(--muted);
  opacity:0.6;
}

.series-section{ display:none; }
.series-section.is-active{ display:block; }

.series-title{
  margin-top:0;
}

.series-statement{
  max-width:72ch;
  margin:0 0 18px;
  color:var(--muted);
}

/* Lightbox (single source of truth) */
.lightbox{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.90);
  backdrop-filter: blur(2px);
  padding:20px;
}

/* Support both your existing toggle + other common toggles */
.lightbox.is-open,
.lightbox.open,
.lightbox[aria-hidden="false"]{
  display:flex;
}

.lb-inner{
  max-width:min(1100px, 100%);
  max-height:min(88vh, 100%);
  display:flex;
  align-items:center;
  justify-content:center;
}

.lb-img{
  max-width:100%;
  max-height:88vh;
  width:auto;
  height:auto;
  display:block;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.lb-ui{
  position:fixed;
  left:0;
  right:0;
  bottom:18px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  pointer-events:none; /* lets clicks pass unless we re-enable */
}

.lb-ui > *{ pointer-events:auto; }

.lb-caption{
  max-width:min(900px, calc(100vw - 220px));
  font-size:12px;
  color:rgba(255,255,255,0.85);
  text-align:center;
  padding:8px 10px;
}

.lb-close,
.lb-prev,
.lb-next{
  border:1px solid rgba(255,255,255,0.22);
  background:rgba(255,255,255,0.10);
  color:#fff;
  border-radius:999px;
  width:36px;
  height:36px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover{
  background:rgba(255,255,255,0.16);
}

/* Make arrows always visible (not only >1100px) */
.lb-prev{
  position:fixed;
  left:14px;
  top:50%;
  transform:translateY(-50%);
}

.lb-next{
  position:fixed;
  right:14px;
  top:50%;
  transform:translateY(-50%);
}

.lb-close{
  position:fixed;
  right:18px;
  top:18px;
}

/* Press / Contact shared image block */
.press-image{
  width:100%;
  height:auto;
  display:block;
  border-radius:var(--radius);
  border:1px solid var(--border);
  margin-top:18px;
}

.press-caption{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
}

/* Footer */
footer{
  border-top:1px solid var(--border);
  padding:22px 0 28px;
}

.footer-inner{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.footer-centered{ align-items:center; text-align:center; }

.footer-meta{
  font-size:12px;
  color:var(--muted);
}

.footer-meta a{ text-decoration:none; }
.footer-meta a:hover{ text-decoration:underline; }

.footer-sep{ margin:0 8px; opacity:0.6; }

.footer-credo{
  font-size:13px;
  color:var(--muted);
  max-width:72ch;
  margin:0;
}

