/* Minimal, neutral base with safe fallbacks */
:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --ink: #222;
  --muted-ink: #555;
  --line: #e5e5e5;
  /* was 900px */
  --container-max: 1280px; /* try 1200–1440 if you like it wider */
  --pad: clamp(12px, 2vw, 24px); /* scales padding on larger screens */
  --gap: 10px;
  --radius: 8px;
  --nav-h: 40px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  color: var(--ink, #222);
  background: #08031A repeat;
  background-size: 300px 300px; /* or auto */
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
               Noto Sans, Helvetica, Arial, "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  line-height: 1.6;
}

/* Canvas layer for background animation */
#bgCanvas {
  position: fixed;
  inset: 0;              /* top/right/bottom/left = 0 */
  width: 100%;         /* dynamic viewport width – handles mobile UI changes */
  height: 100%;        /* dynamic viewport height */
  display: block;

}

#container {
  position: relative;
  z-index: 1;
}

/* Layout container */
#container {
  max-width: var(--container-max, 1280px);
  margin: 0 auto;
  padding: 0 var(--pad, 20px);

}

/* Optional global safety so images don't overflow in general layouts */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================== */
/* Header (hero) – Base styles */
/* =========================== */

/* Header container */
#header {
  position: relative;
  width: 100%;
  border: 0px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  overflow: hidden;
}

/* Ratio box: 16:9 => 9/16 = 56.25% padding-top */
#header .header-media {
  position: relative;
  width: 100%;
  height: 0;
  padding-top: 25%; /* aspect ratio */
}

/* Fill the ratio box */
#header .header-image,
#header .header-overlay,
#header .header-content {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* replaces inset: 0 */
}

/* Image covers */
#header .header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 80%;
  filter: brightness(1.1);
}

/* Overlay for contrast */
#header .header-overlay {
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.30) 0%,
    rgba(0,0,0,0.20) 45%,
    rgba(0,0,0,0.45) 100%
  );
}

/* Text block anchored to bottom with padding */
#header .header-content {
  left: var(--pad, 20px);
  right: auto; /* ensure left-aligned */
  bottom: auto; /* ensure top-aligned */
  top: var(--pad, 40px);
  z-index: 1;
  color: #fff;
  max-width: min(700px, 90%);
  display: grid;
  gap: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Typography */
#header .header-content h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(1.5rem, 2.2rem + 1.2vw, 3rem);
}

#header .header-content .kicker {
  margin: 0;
  color: rgba(255,255,255,0.9);
  font-size: clamp(0.95rem, 0.9rem + 0.5vw, 1.25rem);
}


/* =========================== */
/* Navbar                      */
/* =========================== */

#navbar {
  margin-top: var(--gap, 10px);
  height: var(--nav-h, 40px);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  display: flex;         /* nav is flex container */
  overflow-x: auto;
}

#navbar ul {
  display: flex;         /* ul is flex container for li items */
  align-items: center;   /* (you already had this lower down) */
  gap: var(--pad, 20px);
  padding: 0 var(--pad, 20px);
  margin: 0;
  list-style: none;
  white-space: nowrap;

  flex: 1 1 auto;        /* allow ul to grow and take full width */
  min-width: 100%;       /* ensures it spans the row for the auto margin to work */
}

#navbar li { margin: 0; }

#navbar a {
  text-decoration: none;
  color: var(--muted-ink, #555);
  font-weight: 600;
}

#navbar a:hover,
#navbar a:focus {
  color: var(--ink, #222);
  text-decoration: underline;
}

/* Push THIS li to the right edge */
#navbar li.nav-right {
  margin-left: auto;     /* !important no longer needed if above is applied */
}


/* =========================== */
/* Main row: sidebars + main   */
/* =========================== */

#flex {
  display: flex;
  gap: var(--gap, 10px);
  margin: var(--pad, 20px) 0;
}

aside {
  width: 200px;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  padding: var(--pad, 20px);
  font-size: 0.95rem;
}

#content {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  padding: var(--pad, 20px);
  flex: 1;
  order: 2;
}

/* Preserve left/right ordering */
#leftSidebar  { order: 1; }
#rightSidebar { order: 3; }

/* Simple box component */
.box {
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  padding: var(--pad, 20px);
  background: #fafafa;
}
/* Hide filtered-out figures */
.gallery figure[hidden] {
  display: none !important;
}

/* Optional: style active nav link */
#navbar a.is-active {
  color: var(--ink, #222);
  text-decoration: underline;
}

/* =========================== */
/* Footer                      */
/* =========================== */

#footer {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  margin: 0 0 var(--pad, 20px) 0;
  padding: 10px;
  text-align: center;
  color: var(--muted-ink, #555);
}



@media screen and (max-width: 800px) {
  #flex {
    display: flex;   /* re-state to be explicit */
    flex-wrap: wrap; /* allow wrapping */
  }

  aside {
    width: 100%;     /* sidebars full width on small screens */
  }

  /* Reorder like the original template */
  #content      { order: 1; }
  #leftSidebar  { order: 2; }
  #rightSidebar { order: 3; }

  #navbar ul {
    flex-wrap: wrap;  /* allow nav items to wrap */
    gap: 16px;
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* =========================== */
/* Gallery Style               */
/* =========================== */


.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--gap, 10px);
}

.gallery figure {
  margin: 0;
}

.gallery button.thumb {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  display: block;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}

.gallery img.thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.gallery button.thumb:hover img,
.gallery button.thumb:focus img {
  transform: scale(1.03);
}

/* Lightbox overlay/modal */
#lightbox[hidden] { display: none !important; }

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 9999;
}

.lightbox-dialog {
  position: relative;
  max-width: min(92vw, 1000px);
  max-height: 90vh;
  width: 100%;
  background: #000; /* dark canvas behind image */
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

.lightbox-stage {
  position: relative;
  background: #000;
}

.lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  object-fit: contain;
  background: #000;
}

.lightbox-caption {
  color: #eee;
  background: rgba(0,0,0,0.6);
  padding: 10px 14px;
  font-size: 0.95rem;
}

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 10px;
  border: 0;
  background: rgba(255,255,255,0.15);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(2px);
}

.lightbox-close { right: 10px; }
.lightbox-prev  { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 10px; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}

/* Caret icons */
.lightbox-prev::before,
.lightbox-next::before,
.lightbox-close::before {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
}

.lightbox-prev::before  { content: "◀"; }
.lightbox-next::before  { content: "▶"; }
.lightbox-close::before { content: "✕"; }

/* Make controls larger on touch */
@media (pointer: coarse) {
  .lightbox-close, .lightbox-prev, .lightbox-next {
    width: 48px; height: 48px;
  }
  .gallery img.thumb {
    height: 160px;
  }
}


/*---- Photographer Animation--------*/
/* Stage behind content */
#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 10; /* Keep your main container above this */
}

/* Each walker (wrapper so we can mirror & flash) */
.walker {
  position: absolute;
  left: 0; top: 0;
  transform: translate3d(0,0,5);
  will-change: transform;
}

/* The GIF image itself */
.walker img {
  display: block;
  width: auto; height: auto;
  image-rendering: auto; /* or pixelated if you want chunky pixels */
}

/* Mirror when moving left (if using right-facing art only) */
.walker[data-dir="-1"] {
  transform: scaleX(-1) translate3d(0,0,5);
  transform-origin: center;
}

/* Flash overlay when they “take the photo” */
.flash {
  position: absolute;
  inset: -40px; /* bleed a bit beyond sprite bounds */
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 60%);
  opacity: 0.0;
  pointer-events: none;
  transition: opacity 120ms ease-out;
}
.flash.is-on { opacity: 1; }
