/* ---------------------------------------------------------------
   Chuck Tuck Events
   Graphite room, tungsten stage light. Photos carry the color.
   --------------------------------------------------------------- */

:root {
  --graphite: #131417;   /* page */
  --panel:    #1a1b1f;   /* sidebar */
  --rule:     #2b2c31;
  --paper:    #ede8e0;   /* text */
  --dust:     #9a968f;   /* secondary text */
  --tungsten: #f2a93b;   /* stage light: active + actions only */

  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", sans-serif;
  --label:   "Big Shoulders Text", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body:    "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --sidebar-w: 300px;
  --gap: 6px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--graphite);
  color: var(--paper);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--tungsten);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--tungsten);
  color: #1a1206;
  font-weight: 500;
  text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  padding: 2.5rem 2rem 2rem;
  background: var(--panel);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

/* The one loud thing on the page */
.wordmark {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-weight: 800;
  font-size: 4.25rem;
  line-height: .82;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
}
.wordmark span + span { color: var(--dust); }
.wordmark:hover span + span { color: var(--tungsten); }

.tagline {
  margin: 1.25rem 0 2.25rem;
  font-family: var(--label);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--dust);
}

.menu-toggle { display: none; }

.nav { display: flex; flex-direction: column; flex: 1; }

.nav ul { list-style: none; margin: 0; padding: 0; }

.nav a {
  position: relative;
  display: inline-block;
  padding: .2rem 0;
  font-family: var(--label);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.25;
  text-decoration: none;
  color: var(--paper);
}
.nav a:hover { color: var(--tungsten); }

/* Active page: a lit bar, like a stage light on */
.nav a[aria-current="page"] { color: var(--tungsten); }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -2rem; top: 50%;
  width: 1.1rem; height: 2px;
  background: var(--tungsten);
  box-shadow: 0 0 10px rgba(242, 169, 59, .7);
}

.nav-group {
  margin: 0 0 .2rem;
  font-family: var(--label);
  font-weight: 500;
  font-size: 1rem;
  color: var(--dust);
}
.nav-sub { margin-bottom: 1.1rem !important; padding-left: .9rem !important; border-left: 1px solid var(--rule) !important; }
.nav-sub a { font-size: 1.15rem; }
.nav-top + .nav-top { margin-top: .9rem; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 2.5rem;
}

.social { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-bottom: 1rem !important; }
.social a {
  font-family: var(--body);
  font-weight: 500;
  font-size: .9rem;
  color: var(--dust);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}
.social a:hover { color: var(--paper); text-decoration-color: var(--tungsten); }

.copyright {
  margin: 0;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--dust);
}

/* ---------- Main ---------- */

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: var(--gap);
}

.gallery-head {
  padding: 2.5rem 1.5rem 1.75rem;
  max-width: 60ch;
}

.page-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: .95;
  letter-spacing: -.005em;
}

.gallery-intro {
  margin: .6rem 0 0;
  color: var(--dust);
}

/* ---------- Photo grid ---------- */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3;
  column-gap: var(--gap);
}

.grid-item {
  break-inside: avoid;
  margin-bottom: var(--gap);
}

.grid-item a {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--panel);
  cursor: zoom-in;
}

.grid-item img {
  width: 100%;
  height: auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  transition: opacity .25s ease;
}

.grid-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1rem .8rem;
  background: linear-gradient(to top, rgba(10, 10, 12, .85), transparent);
  font-family: var(--label);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}

@media (hover: hover) {
  .grid:hover .grid-item img { opacity: .72; }
  .grid .grid-item a:hover img,
  .grid .grid-item a:focus-visible img { opacity: 1; }
  .grid-item a:hover .grid-caption,
  .grid-item a:focus-visible .grid-caption { opacity: 1; transform: none; }
}

.empty {
  max-width: 44ch;
  padding: 3rem 1.5rem;
  color: var(--dust);
}
.empty code {
  color: var(--paper);
  font-size: .9em;
}

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

.page {
  max-width: 68rem;
  padding: 3rem 1.5rem 4rem;
}

.page p { max-width: 62ch; }

.lede { font-size: 1.1rem; color: var(--dust); margin: 1rem 0 2rem; }
.lede a { color: var(--paper); text-underline-offset: 3px; }

.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 3rem;
  align-items: start;
}
.about-portrait { width: 100%; height: auto; }
.about-body .page-title { margin-bottom: 1.25rem; }
.about-body p { font-size: 1.08rem; }

.featured-title {
  margin: 2.25rem 0 .5rem;
  font-family: var(--label);
  font-weight: 500;
  font-size: 1rem;
  color: var(--dust);
}
.featured-list {
  list-style: none;
  margin: 0 0 2.25rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.9rem;
  line-height: 1.1;
}

.button {
  display: inline-block;
  padding: .8rem 1.5rem;
  border: 0;
  background: var(--tungsten);
  color: #1a1206;
  font: 600 1.15rem/1 var(--label);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: #ffc063; }

/* ---------- Form ---------- */

.form { max-width: 40rem; }

.field { margin-bottom: 1.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field label {
  display: block;
  margin-bottom: .35rem;
  font-weight: 500;
  font-size: .95rem;
}
.optional { color: var(--dust); font-weight: 400; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .75rem .85rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--paper);
  font: inherit;
  color-scheme: dark;
}
.field textarea { resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--tungsten); outline: none; }
.field [aria-invalid="true"] { border-color: #e8705f; }
.field-error { margin: .35rem 0 0; color: #f09385; font-size: .9rem; }
.field ::placeholder { color: #6f6c67; }

.hp { position: absolute; left: -9999px; }

.notice {
  max-width: 40rem;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--tungsten);
  background: var(--panel);
}
.notice p { margin: 0; }
.notice-error { border-left-color: #e8705f; }

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 10, .97);
  touch-action: pan-y;
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: calc(100vw - 8rem);
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 6rem);
  max-height: calc(100dvh - 6rem);
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity .2s ease;
}
.lightbox-img.is-loading { opacity: .25; }

.lightbox-caption {
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  width: 100%;
  padding-top: .8rem;
  font-family: var(--label);
  font-weight: 500;
  font-size: 1.05rem;
}
.lightbox-count { color: var(--dust); white-space: nowrap; }

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  font: 300 3rem/1 var(--body);
  cursor: pointer;
  opacity: .7;
}
.lb-btn:hover { opacity: 1; color: var(--tungsten); }
.lb-close { top: .75rem; right: .75rem; font-size: 2.6rem; }
.lb-prev  { left: .75rem;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: .75rem; top: 50%; transform: translateY(-50%); }

body.lightbox-open { overflow: hidden; }

/* Edge-to-edge rows (home page). Before the script runs, the normal grid shows. */
.grid--fill.is-filled {
  columns: auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.grid--fill.is-filled .grid-item {
  flex: none;
  margin: 0;
  overflow: hidden;
}
.grid--fill.is-filled .grid-item a { height: 100%; }
.grid--fill.is-filled .grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;   /* keep faces and stages in frame when cropping */
}

/* ---------- Large monitors ---------- */

@media (min-width: 1800px) {
  :root { --sidebar-w: 340px; }
  .grid { columns: 4; }
  .wordmark { font-size: 5rem; }
}

/* ---------- Laptop / tablet landscape ---------- */

@media (max-width: 1200px) {
  .grid { columns: 2; }
}

@media (min-width: 861px) and (max-width: 1100px) {
  :root { --sidebar-w: 240px; }
  .sidebar { padding: 2rem 1.5rem 1.5rem; }
  .wordmark { font-size: 3.4rem; }
  .nav a { font-size: 1.15rem; }
  .nav-sub a { font-size: 1.05rem; }
  .nav a[aria-current="page"]::before { left: -1.5rem; width: .8rem; }
  .about { grid-template-columns: 1fr; gap: 2rem; }
  .about-portrait { max-width: 32rem; }
}

/* Short screens (small laptops): keep the footer from crowding the menu */
@media (min-width: 861px) and (max-height: 700px) {
  .sidebar { padding-top: 1.5rem; }
  .wordmark { font-size: 3rem; }
  .tagline { margin: .75rem 0 1.25rem; }
  .sidebar-foot { padding-top: 1.25rem; }
}

/* ---------- Mobile: sidebar becomes a top bar ---------- */

@media (max-width: 860px) {
  .sidebar {
    position: sticky;
    top: 0;
    inset: auto;
    z-index: 20;
    width: auto;
    height: auto;
    max-height: 100vh;
    padding: 1rem max(1.25rem, env(safe-area-inset-right)) 1rem max(1.25rem, env(safe-area-inset-left));
    padding-top: max(1rem, env(safe-area-inset-top));
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .sidebar.is-open { max-height: 100dvh; }
  .nav a { padding: .35rem 0; }

  .sidebar-top { align-items: center; }

  .wordmark {
    flex-direction: row;
    gap: .35rem;
    font-size: 2.1rem;
    line-height: 1;
  }

  .tagline { display: none; }

  .menu-toggle {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem 0 .5rem .5rem;
    border: 0;
    background: none;
    color: var(--paper);
    font: 600 1.15rem/1 var(--label);
    cursor: pointer;
  }
  .menu-toggle-bars,
  .menu-toggle-bars::before,
  .menu-toggle-bars::after {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    transition: transform .2s ease;
  }
  .menu-toggle-bars { position: relative; }
  .menu-toggle-bars::before,
  .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .menu-toggle-bars::before { top: -6px; }
  .menu-toggle-bars::after  { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-bars::after  { transform: translateY(-6px) rotate(-45deg); }

  .nav { display: none; padding: 1.5rem 0 .5rem; }
  .sidebar.is-open .nav { display: flex; }
  .sidebar.is-open { overflow-y: auto; }
  .nav a { font-size: 1.5rem; }
  .nav-sub a { font-size: 1.35rem; }
  .nav a[aria-current="page"]::before { left: -1.25rem; width: .7rem; }
  .sidebar-foot { padding-top: 1.75rem; }

  .main {
    margin-left: 0;
    padding-left: max(var(--gap), env(safe-area-inset-left));
    padding-right: max(var(--gap), env(safe-area-inset-right));
    padding-bottom: max(var(--gap), env(safe-area-inset-bottom));
  }
  .field input, .field select, .field textarea { font-size: 16px; } /* stops iPhone zooming into fields */
  .button { padding: 1rem 1.5rem; width: 100%; text-align: center; }
  .about .button { width: auto; }

  .gallery-head { padding: 1.75rem .75rem 1.25rem; }
  .page { padding: 2rem .75rem 3rem; }

  .about { grid-template-columns: 1fr; gap: 1.75rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }

  .lightbox-figure { max-width: 100vw; }
  .lightbox-caption { padding: .8rem 1rem 0; }
  .lb-prev, .lb-next { top: auto; bottom: max(.5rem, env(safe-area-inset-bottom)); transform: none; }
  .lb-close { top: max(.75rem, env(safe-area-inset-top)); }
  .lightbox-caption { padding-bottom: 3.5rem; }
}

/* Phone turned sideways */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .sidebar { position: relative; }
  .grid { columns: 2; }
  .lightbox-img { max-height: calc(100dvh - 3rem); }
  .lightbox-caption { padding-bottom: 0; font-size: .95rem; }
  .lb-prev, .lb-next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox-figure { max-width: calc(100vw - 7rem); }
}

@media (max-width: 480px) {
  :root { --gap: 4px; }
  .grid { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
