* {
  margin: 0rem;
  padding: 0rem;
  box-sizing: border-box; /* Padding and border don't make a box bigger */
}

:root {
  --color1: #36151E;
  --color2: #593F62;
  --color3: #7B6D8D;
  --color4: #9499B1;
  --color5: #A5C4D4;

  --colorA: #D81159;
  --colorB: #FFBC42;
  --colorC: #385CFA;
  --colorD: #48E015;
  --colorE: #39BFD0;

  --dark: #000;
  --gray: #2C2C2C;
  --white: #FFF;

  h1{
    font-family: 'Space Mono';
    color: var(--colorC);
    margin: 0; /* centers if the browser is really wide */
  }

  p {
    font-family: 'Lilex';
    font-size: 14px;
    line-height: 1.15;
    color: var(--white);
  }
}

body {
  background-color: var(--gray);
    background-attachment: fixed;
  font-family: 'Space Mono';
  width: 100%;
  margin: 0;
  padding: 0;
  min-height: 75vh; /* Make the content fill the page so the footer is at the bottom */
  display: flex;
    flex-direction: column;
    justify-content: space-between;
}

main {
  margin: 0 auto; /* Center if the browser is really wide */
    margin-bottom: 1em; /* Gap before the footer */
  min-width: 25%; /* Don't let the content get too narrow */
  max-width: 90%; /* Don't let the content get too wide */
  padding: 0;
    padding-top: 0.5rem;
  display: flex;
    flex-wrap: wrap;
    flex-direction: column;
}

header{
  text-align: center;
  width: 100%; /* fills the full width of the window */
  min-height: 3rem;
  margin: 0; /* removes the default margin */
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 8px solid var(--colorA);
}

footer {
  width: 100%;
  margin: 0 auto;
  padding: 10px;
  border-top: 10px solid var(--colorA);
  text-align: center;
}

.imgcontainer{
  width: 70%;
}

img {
  width: 60%;
  display: inline-block;
}

.gallery {
  position: relative;
  width: 100%;
  height: auto;
  border: 2px solid var(--white);
  background: #2e2e2e;
}

.txtcontainer{
  border-top: 1px solid var(--colorB);
  border-bottom: 1px solid var(--colorE);
  padding: 0.5rem 0;
  width: 60%;
  margin: 0 auto;
  text-align: center;
}

.lightbox { /* full-size preview overlay; */
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.active {
  display: flex;
}

#lightbox-img {
  width: auto; /* overrides the global "img { width: 60% }" rule so the preview isn't shrunk */
  max-width: 90vw;
  max-height: 90vh;
  border: none;
}

.corner-img {
  position: fixed;
  bottom: 0;
  right: 0;
  width: auto;
  opacity: 0.5;
  z-index: -1; /* stays behind every other element on the page */
}

img.center {
  width: auto; /* keep the footer image at its original size, overriding the global img width:60% */
  margin: 0 auto;
}

.content-layout {
  display: flex;
  align-items: flex-start;
  width: 90%;
  margin: 10px auto;
  gap: 1rem;
}

.filter-panel {
  flex: 0 0 150px; /* fixed width sidebar, doesn't grow/shrink with the gallery */
  position: sticky;
  top: 1rem;
}

.filter-btn {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.4rem;
  font-family: 'Space Mono';
  color: white;
  background: var(--dark);
  border: 1px solid var(--colorD);
  cursor: pointer;
}

.filter-btn.active {
  background: var(--colorC);
  color: var(--dark);
  border: 1px solid var(--white);
}

.grid-container {
  /* flex+wrap (not CSS grid) so leftover cards in a short/filtered row center instead of hugging the left edge */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start; /* keep each card its own height instead of stretching to match the tallest in the row */
  gap: 1rem;
  flex: 1; /* fills the remaining width next to the fixed-width filter panel */

  .gallery.filtered-out {
    display: none;
  }

  .gallery {
    width: 200px;
    padding: 5px;
    transition: all .25s ease-in-out;

    &.spread-item {
      width: 420px; /* two page-card widths plus the internal gap, sits next to a single-page card */
    }

    img {
      width: 100%;
      max-width: 200px; /* caps image size so it doesn't stretch as the card/window grows */
      display: block;
      margin: 0 auto;
      border: 1px solid var(--colorD);
      transition: all .5s ease-in-out;
    }

    p {
      width: 100%; /* stretch the caption box to the card's full width, overriding .txtcontainer's 60% */
      margin: 5px auto;
      padding: 0;
      text-align: center;
      font-style: italic;
      font-family: 'Jersey 25';
      color: var(--white);
    }

    p.blurb {
      font-style: normal;
      font-size: 10px;
      font-family: 'Space Mono';
    }

    .spread {
      display: grid;
      grid-template-columns: repeat(2, 1fr); /* 2 photos per row; extras wrap to a new row */
      gap: 4px;

      img {
        width: 100%;
        margin: 0;
      }
    }
  }
}

.marquee { /*stamps animation*/
  --gap: 10px;
  margin: 0 auto;
  width: 90%;
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: var(--gap);

  .marquee_content:hover {animation-play-state: paused;}
  .marquee_content {
    flex-shrink: 0;
    min-width: 100%;
    display: flex;

    img {
      width: auto; /* keep stamps at native size instead of scaling with the window */
      flex-shrink: 0;
    }
  }
}

.enable-animation .marquee_content {animation: scroll 200s linear infinite;}

@keyframes scroll {
  from {transform: translateX(0);}
  to {transform: translateX(calc(-100% - var(--gap)));}
}
  
/* Pause animation when reduced-motion is set */
@media (prefers-reduced-motion: reduce) {
  .marquee_content {animation-play-state: paused !important;}
}