:root {
    color-scheme: dark;
    --bg: #000;
    --bg2: #222;

    --tx: #fff;
    --tx2: #aaa;
    --tx3: #777;

    --bd: #bbb;
    --bd2: #fff;

    --red: #f66;
    --red-bg: #711;

    --blue: #8df;
    --blue-bg: #148;

    --green: #5fb;
    --green-bg: #053;

  --radius: 4px;
  --font: monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #333;
    --bg2: #444;
  }
}

html,
body {
  background: var(--bg);
}

* {
  box-sizing: border-box;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  cursor: pointer;
  font-family: var(--font);
  /* transition: 0.05s; */

  /* great debug tool */
  /* border: 1px solid var(--blue) */
}

a {
  text-decoration: none;
  color: inherit;
    &:hover {
    color: var(--blue);
  };
}

p {
  margin-bottom: 8px;
}

body {
  max-width: 90em;
  margin: 0 auto;
  padding: 2rem;
  color: var(--tx);
  font-family: var(--font);
  line-height: 1.6;
}

h1 {
  font-size: 24px;
  font-weight: 600;
}

h2 {
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 500;
}

.subtitle {
  margin-bottom: 24px;
  color: var(--tx2);
  font-size: 18px;
}

.selectbox {
  margin-top: 8px;
  margin-bottom: 12px;
  padding: 16px 20px;
  background: var(--bg2);
  border-radius: var(--radius);

  & h3 {
    margin-bottom: 10px;
    color: var(--tx2);
    font-size: 16px;
    font-weight: 500;
  }
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.opt {
  padding: 6px 14px;
  background: var(--bg);
  border: 2px solid var(--bd);
  border-radius: var(--radius);
  font-size: 15px;
  cursor: pointer;
  user-select: none;

  &:hover {
    border-color: var(--green);
    color: var(--green);
  }

  &.sel {
    border-color: var(--green);
    background: var(--green-bg);
    color: var(--green);
    font-weight: 500;
  }
}

.tag {
  padding: 4px 8px 1px;
  background: var(--bg2);
  border-radius: var(--radius);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 500;

  &.tag-match {
    background: var(--green-bg);
    color: var(--green);
    border: 2px solid var(--green);
  }
}

.link {
  color: var(--tx2);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0px;
}

#dropdown-button {
  padding: 4px 8px;
  cursor: pointer;
  border: 2px solid var(--bd);
  border-radius: var(--radius);
  background: var(--bg);
}

#dropdown-button:hover,
#dropdown:hover {
  border-color: var(--bd2);
}

#dropdown {
  display: grid;
  grid-template-rows: 0fr;
  border: 2px solid var(--bd);
  border-radius: var(--radius);
  margin-bottom:12px; 
  font-size: 14px;
}

#dropdown-content {
  overflow: hidden;
  background: var(--bg);
  border-radius: var(--radius);
}

#dropdown.open {
  grid-template-rows: 1fr;
}

#dropdown-content-inner {
  padding: 12px;
}

.contact-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.contact-buttons a {
  flex: 1;
  padding: 4px;
  margin: 0px 8px;
  text-align: center;
  background-color: var(--bg);
  color: var(--bd2);
  border-radius: var(--radius);
  border: 2px solid var(--bd);
  border-radius: var(--radius);
}

.contact-buttons a:hover {
  color: var(--blue);
  border-color: var(--blue);
}

@media (max-width: 500px) {
  .contact-buttons {
    flex-direction: column;
  }
}


.moment {
  margin-bottom: 10px;
  padding: 16px 20px;
  background: var(--bg);
  border: 2px solid var(--bd);
  border-radius: var(--radius);

  &:hover {
    border-color: var(--bd2);

    & .moment-footer {
      border-color: var(--bd2);
    }
  }

  & .name {
    font-size: 20px;
    font-weight: 600;
  }

  & .blurb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    color: var(--tx2);
    gap: 8px;
    margin-top: 10px;
    font-size: 16px;
  }

  & .desc {
    margin-top: 10px;
    color: var(--tx);
    font-size: 16px;
  }

  & .moment-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap; 
    border-top: 2px solid var(--bd);
    margin-top: 10px;
  }

  & .date {
    margin-top: 16px;
    color: var(--tx3);
    font-size: 14px;
  }  
  
  & .tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end; 
    gap: 8px;
    margin-top: 16px;
    margin-left: auto;
    text-align: right;
  }
}

.reset {
  padding: 6px 14px;
  background: var(--bg);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;

  &:hover {
    background: var(--red-bg);
  }
}

.layout-wrapper { 
  display: flex; 
  justify-content: space-between; 
  gap: 1.5rem; 
}

.text-col { 
  flex: 1; 
  object-fit: cover;
}

.desc-truncate {
  display: -webkit-box;
  line-clamp: 5;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel-container.hidden { 
  display: none; 
}

.layout-wrapper {
  display: flex;
  gap: 1.5rem;
}

.text-col {
  flex: 1;
}

.media-col {
  width: 300px;
  max-width: 100%;
  display: block;
  flex-direction: column;
}

.moment.expanded .media-col {
  width: 400px;
  max-width: 100%;
}

.hero-img {
  border-radius: var(--radius);
  object-fit: cover;
}

.moment.expanded .hero-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
}

.hero-frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.moment.expanded .hero-frame {
  aspect-ratio: 4 / 4;
  object-fit: contain;
  border-radius: var(--radius);
  background-color: var(--bg);
  margin-top: auto;
  margin-bottom: auto;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0.5rem;
}

.thumbnail-grid.hidden {
  display: none; 
}

.thumb-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  border-color: var(--bd);
  border-radius: var(--radius); 
}

.thumb-img:hover {
  border-color: var(--bd2);
}

.thumb-img.active {
  border-color: var(--bd2);
}

@media (max-width: 900px) {
  .layout-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .media-col {
    order: -1;
    width: 300px;
    max-width: 100%;
    align-self: center;
    object-fit: cover; 
    border-radius: var(--radius); 
    flex-shrink: 0; 
  }

  .moment.expanded .media-col {
    width: 400px;
    max-width: 100%;
  }

  .desc-truncate {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}