/* colors because i will not remember these */
:root {
  --midnight-violet: #292036;
  --deep-purple: #482d79;
  --amethyst: #9e8bb8;
  --soft-lilac: #b393ca;
  --parchment: #f5efe6;
  --muted-purple: #6f5a80;
  --mint: #c5ebae;
  --shiny-yellow: #ecff42;
}

/* basic page stuff */
body {
  background: var(--amethyst);
  color: var(--midnight-violet);
  font-family: "Lucida Console", Monaco, monospace;
  font-size: 1.125rem;
  line-height: 1.7;
  position: relative;
  isolation: isolate;
  /* stars go behind everything */
}

/* background stars */
.background-doodle {
  font-family:
    "Segoe UI Symbol",
    "Noto Sans Symbols 2",
    "Noto Sans Symbols",
    "DejaVu Sans",
    sans-serif;
  position: fixed;
  z-index: -1;
  pointer-events: none;
  color: var(--mint);
  text-shadow: 0 0 4px rgba(196, 241, 168, 0.5);
}

/* shiny stars are 1 in 4096 lol */
.background-doodle.shiny {
  color: var(--shiny-yellow);
  font-weight: bold;
  text-shadow:
    0 0 4px #fff27a,
    0 0 10px #fff27a,
    0 0 18px #e4eec3;
}

/* main content box */
article {
  font-family: Verdana, Arial, sans-serif;
  letter-spacing: 0.03em;
  max-width: 800px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--parchment);
  border: 2px solid var(--midnight-violet);
  border-radius: 1px;
}

/* post date and author */
.meta {
  font-family: "Lucida Console", Monaco, monospace;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: var(--muted-purple);
  margin-bottom: 2rem;
}

/* article text */
article h1,
article h2,
article h3 {
  font-family: "Lucida Console", Monaco, monospace;
  letter-spacing: 0.01em;
}

article h1 {
  border-bottom: 2px solid var(--soft-lilac);
  padding-bottom: 1rem;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

article h1::before {
  content: "★";
  color: var(--deep-purple);
  font-size: 1.8rem;
  margin-bottom: 0.35rem;
}

article h2 {
  font-size: 1.6rem;
  margin-top: 2.5rem;
}

article p {
  margin: 1rem 0;
}

article strong {
  font-weight: 700;
}

article em {
  font-style: italic;
}

article li {
  margin: 0.4rem 0;
}

/* normal article images. gallery has different rules */
article img {
  display: block;
  width: 750px;
  max-width: 100%;
  max-height: 50vh;
  height: auto;
  object-fit: contain;
  margin: 1rem auto;
  border-radius: 1px;
  box-shadow: 0 6px 18px #2920367d;
}

/* star bullets */
.star-list {
  list-style: none;
  padding-left: 0;
}

.star-list li::before {
  content: "★";
  color: var(--deep-purple);
  margin-right: 0.5rem;
}

/* smooth scrolling and fix sticky nav overlap */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;

  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;

  width: fit-content;
  margin: 0 auto;
  padding: 0.75rem 1rem;

  background: var(--parchment);
  border: 2px solid var(--midnight-violet);
}

/* links need to look clicky on mobile too */
.site-nav a {
  padding: 0.1rem 0.2rem;
  color: var(--deep-purple);
  text-decoration: underline;
  text-decoration-color: var(--soft-lilac);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--midnight-violet);
  background: var(--mint);
  text-decoration-color: var(--deep-purple);
}

/* top button for long pages */
.page-jump-buttons {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;

  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.page-jump-buttons a {
  padding: 0.5rem 0.75rem;

  color: inherit;
  background: var(--parchment);
  border: 2px solid var(--midnight-violet);
  border-radius: 0.5rem;

  text-decoration: none;
}

.page-jump-buttons a:hover,
.page-jump-buttons a:focus-visible {
  transform: translateY(-2px);
}

/* gallery stuff */
/* center section title */
.carousel-heading {
  text-align: center;
}

.carousel-heading h2 {
  margin: 0 0 0.75rem;
}

/* arrows underneath */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.carousel-button {
  min-width: 7rem;
  padding: 0.5rem 0.75rem;
  color: var(--midnight-violet);
  background: var(--parchment);
  border: 2px solid var(--midnight-violet);
  cursor: pointer;
  font: inherit;
}

.carousel-hint {
  color: var(--muted-purple);
  font-size: 0.9rem;
  text-align: center;
}

.carousel-button:hover,
.carousel-button:focus-visible {
  background: var(--mint);
}

.carousel-view-all {
  margin-bottom: 0.75rem;
  text-align: center;
}

/* horizontal art row */
.carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 30%;
  /* 30% so the next image peeks in a little */
  gap: 1rem;

  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* snap to a card instead of stopping halfway */
  scroll-behavior: smooth;

  padding: 0.5rem 0 1rem;
}

/* okay let me see everything then */
.gallery-section.show-all .carousel-track {
  grid-auto-flow: row;
  grid-auto-columns: unset;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  overflow-x: visible;
  scroll-snap-type: none;
}

.gallery-section.show-all .carousel-controls {
  display: none;
}

/* art card and name */
.gallery-card {
  margin: 0;
  padding: 0.75rem;

  background: var(--parchment);
  border: 2px solid var(--midnight-violet);
  scroll-snap-align: start;
}

.gallery-card img {
  width: 100%;
  max-width: none;
  max-height: none;
  aspect-ratio: 1 / 1;
  /* square image box without cropping */
  object-fit: contain;

  margin: 0;
  box-shadow: none;
}

.gallery-card figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-family: "Lucida Console", Monaco, monospace;
}

/* click image, make bigger */
.gallery-image-button {
  display: block;
  width: 100%;
  padding: 0;

  color: inherit;
  background: none;
  border: 0;
  cursor: zoom-in;
}

.gallery-image-button:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 3px;
}

/* the big image box */
.gallery-lightbox {
  box-sizing: border-box;
  width: min(90vw, 1100px);
  max-height: 95vh;
  padding: 1rem;

  color: var(--midnight-violet);
  background: var(--parchment);
  border: 2px solid var(--midnight-violet);
}

/* dark part behind the big image */
.gallery-lightbox::backdrop {
  background: rgba(41, 32, 54, 0.85);
}

.lightbox-close {
  display: block;
  margin: 0 0 0.75rem auto;
  padding: 0.5rem 0.75rem;

  color: var(--midnight-violet);
  background: var(--parchment);
  border: 2px solid var(--midnight-violet);
  cursor: pointer;
  font: inherit;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: var(--mint);
}

.lightbox-content {
  margin: 0;
}

.lightbox-content img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 75vh;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox-content figcaption {
  margin-top: 0.75rem;
  text-align: center;
}

/* tablet formatting again */
@media (max-width: 850px) {
  .carousel-track {
    grid-auto-columns: calc((100% - 1rem) / 2);
  }
}

/* phone layout. less crowded hopefully */
@media (max-width: 550px) {
  .site-nav {
    justify-content: center;
    max-width: calc(100% - 1rem);
    box-sizing: border-box;
    gap: 0.25rem 0.65rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .gallery-page {
    padding: 1rem;
    margin-bottom: 5rem;
  }

  .gallery-section {
    margin-top: 2rem;
  }

  .carousel-heading h2 {
    font-size: 1.3rem;
  }

  .carousel-track {
    grid-auto-columns: 85%;
  }

  .carousel-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .carousel-hint {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .carousel-button {
    min-width: 0;
  }

  .page-jump-buttons {
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .page-jump-buttons a {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }
}
