/* Reset */
html,
body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
::-webkit-scrollbar { width: 0; height: 0; background: transparent; }

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

img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

h1 {
  font-family: "Geologica", sans-serif;
  font-weight: 500;
  font-size: 58px;
}

p, a, .name {
  text-decoration: none;
  text-transform: uppercase;
  font-family: "Geologica", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: blue;
  transition: color 0.3s;
}

/* Home tag */
.center-right {
  font-family: "Geologica", sans-serif;
  color: blue;
  text-transform: lowercase;
  position: absolute;
  right: 1%;
  top: 50%;
  transform: rotate(90deg) translateY(-50%);
  font-size: 1rem;
  text-align: center;
  z-index: 900;            /* ensures HOME is clickable above content */
  pointer-events: auto;
}

.whitespace.w-1 { width: 100vw; height: 50vh; }
.whitespace.w-2 { width: 100vw; height: 45vh; }

.gallery {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5em;
}

.project { position: relative; width: 100vw; min-height: 100vh; display: flex; }
.index { flex: 1; padding-left: 2em; height: 0; }
.images {
  flex: 9;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5em;
  align-items: start;
}

/* Responsive grid */
@media (max-width: 1400px) { .images { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1024px) { .images { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .images { grid-template-columns: 1fr; } }

.img {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  position: relative;
  background: #f0f0f0;
}
.img img {
  opacity: 0.9;
  transition: opacity 0.3s;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.img img.loaded { opacity: 1; }

.index .mask {
  position: absolute;
  top: 0;
  left: 2em;
  height: 70px;
  overflow: hidden;
  color: blue;
}
.index .mask h1 { position: relative; }
.index .mask h1 span { position: relative; display: inline-block; }
.digit-wrapper, .digit-wrapper span { display: inline-block; position: relative; }

/* Names column */
.project-names {
  position: fixed;
  width: 300px;
  top: 50vh;
  left: 37%;
  transform: translateX(-50%);
  z-index: 50;
}
.name p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: gray;
  margin: 4px 0;
  text-align: left;
}
.name.active p { color: #000; }
.indicator {
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.symbol {
  width: 12px;
  height: 12px;
  background-color: black;
  clip-path: polygon(0 50%, 100% 100%, 100% 0);
}

/* Preview image */
.preview-img {
  position: fixed;
  bottom: 2em;
  right: 3%;
  overflow: hidden;
  z-index: 20;
}
.preview-img img {
  max-width: 50vw;
  max-height: 70vh;
  object-fit: contain;
  transition: opacity 0.5s ease;
}
.preview-img img:not(:first-child) {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

/* Series watermark (pale blue title) */
.series-name {
  position: absolute;
  bottom: 20px;
  left: 2em;
  font-family: "Geologica", sans-serif;
  color: rgba(0, 0, 255, 0.4);
  font-size: 42px;
  z-index: -1;              /* behind images on desktop/tablet by design */
  text-transform: uppercase;
  white-space: nowrap;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
  color: blue;
}
.lightbox-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}
.lightbox-image-container {
  position: relative;
  width: 100%;
  height: 80vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.lightbox-caption {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 1em 2em;
  text-align: center;
  max-width: 80%;
  border-radius: 4px;
}
.lightbox-caption h2 {
  font-family: "Geologica", sans-serif;
  font-size: 18px;
  margin: 0 0 0.3em;
  text-transform: uppercase;
  color: blue;
}
.lightbox-caption p {
  font-family: "Geologica", sans-serif;
  font-size: 14px;
  margin: 0;
  color: blue;
}
.lightbox-counter { margin-top: 0.5em; font-size: 12px; color: rgba(0, 0, 255, 0.7); }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 10;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(0, 0, 0, 0.6); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  width: 8px;
  height: 100vh;
  background-color: blue;
  transform-origin: top;
  transform: scaleY(0);
}

/* Hide HOME button when lightbox is active */
body.lightbox-open .home-link {
  display: none !important;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .project { flex-direction: column; min-height: auto; padding: 2rem 1rem; }

  .index { flex: none; padding: 1rem 0; text-align: center; }
  .index .mask { left: 50%; transform: translateX(-50%); }
  .index .mask h1 { font-size: clamp(36px, 10vw, 48px); }

  .project-names { display: none; }
  .preview-img { display: none; }

  .center-right {
    position: fixed;
    top: 1rem;
    right: 1rem;
    transform: none;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    z-index: 2000; /* keep HOME clickable on mobile */
  }

  .lightbox-close { top: 0.5rem; right: 0.5rem; font-size: 1.5rem; }

 
.series-name {
  font-size: 28px;
  bottom: 0.6px;
  z-index: 10;
  pointer-events: none;

  /* Force shift to the very left */
  left: 0.5em;     /* was 2em before */
  text-align: left;
}


  .lightbox-prev, .lightbox-next { width: 44px; height: 44px; font-size: 20px; }

  /* ---------- EDGE-TO-EDGE LIGHTBOX IMAGE ON MOBILE ---------- */
  /* Remove padding so the media can truly hit the edges */
  .lightbox-content {
    padding: 0;                 /* no side padding */
    width: 100vw;               /* full viewport width */
    height: 100vh;              /* full viewport height */
  }

  /* Make the image container span the full viewport width */
  .lightbox-image-container {
    width: 100vw;               /* edge to edge horizontally */
    height: calc(100vh - 140px);/* leave room for caption & close/controls */
  }

  /* Force the image itself to 100vw (no margins left/right) */
  .lightbox-content img {
    width: 100vw;               /* fill left-to-right */
    max-width: 100vw;           /* prevent shrinking margins */
    height: 100%;               /* scale to container height */
    max-height: 100%;           /* keep inside viewport */
    object-fit: contain;        /* preserve aspect ratio */
  }

  /* Make caption span width so it aligns with edges too */
  .lightbox-caption {
    margin-top: 0;
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    padding: 0.75em 1em;
  }
}
