@font-face {
  font-family: 'Lovelo Black';
  src: url('../assets/Lovelo/lovelo_black.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Lovelo Bold';
  src: url('../assets/Lovelo/lovelo_linebold.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

.sidebar {
  position: absolute;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: rgb(0, 0, 0);
  background-image: url('../assets/pattern-wilder.png');
  background-repeat: repeat-x;
  background-position: top center;
  background-size: 100px auto;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  text-align: right;
}

.sidebar.active {
  right: 0;
}

.close-btn {
  position: absolute;
  top: 30px;
  right: 10px;
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #f2c200;
  line-height: 1;
}

.close-btn:hover {
  color: lightgray;
}

#sidebar-content {
  margin-top: 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  width: 100%;
  margin-top: auto;
  display: block;
}

.sidebar-title {
  font-family: 'Lovelo Black', sans-serif;
  font-size: 56px;
  color: #f2c200;
  margin: 0 0 20px 0;
  line-height: 1.4;
  text-align: left;
}

.sidebar-text {
  font-family: 'Canva Sans', sans-serif;
  font-weight: 500;
  font-size: 16px;
  margin: 0 0 20px 0;
  color: white;
  text-align: left;
}

.site-name {
  font-family: 'Lovelo Black', sans-serif;
  font-size: 32px;
  margin: 0 0 15px 0;
  color: #f2c200;
  text-align: left;
  line-height: 1.2;
}

.site-desc {
  font-family: 'Canva Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 10px 0;
  color: white;
  text-align: left;
}

.site-col {
  font-family: 'Lovelo Black', sans-serif;
  font-size: 56px;
  color: #f2c200;
  margin: 0 0 20px 0;
  line-height: 1.4;
  text-align: left;
}

.site-image {
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 4px;
}

.site-figure {
  margin: 15px 0;
  padding: 0;
}

.site-caption {
  font-family: 'Canva Sans', sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: lightgray;
  text-align: left;
  margin-top: 6px;
  font-style: italic;
}

.site-image-desc {
  font-family: 'Canva Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 6px 0 16px 0;
  color: lightgray;
  text-align: left;
  white-space: pre-line;
}

.site-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 18px 0;
  align-items: flex-start;
}

.site-link {
  font-family: 'Canva Sans', sans-serif;
  font-size: 14px;
  color: #f2c200;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}

.site-link:hover {
  color: #fff1b3;
}

/* Legend and Filter Styles */
.legend-container {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.85);
  padding: 15px 20px;
  border-radius: 8px;
  z-index: 100;
  min-width: 200px;
  border: 2px solid #f2c200;
}

.legend-title {
  font-family: 'Lovelo Black', sans-serif;
  font-size: 18px;
  color: #f2c200;
  margin: 0 0 12px 0;
  text-align: left;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Canva Sans', sans-serif;
  font-size: 14px;
  color: white;
}

.legend-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #f2c200;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  flex-shrink: 0;
}

.legend-label {
  flex: 1;
  font-family: 'Canva Sans', sans-serif;
  color: lightgray;
}

.legend-footer {
  font-family: 'Lovelo Black', sans-serif;
  font-size: 16px;
  color: #f2c200;
  text-align: left;
  padding-top: 12px;
  border-top: 1px solid #f2c200;
  margin-top: 5px;
}

/* Lightbox Styles */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  overflow: auto;
}

.lightbox.active {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.lightbox.active.has-zoom {
  justify-content: flex-start;
  align-items: flex-start;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  cursor: zoom-in;
  transition: all 0.3s ease;
  margin: auto;
}

.lightbox-content.zoomed {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: zoom-out;
  margin: 0;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 40px;
  color: #f2c200;
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
}

.lightbox-close:hover {
  color: #ffffff;
}

.site-image {
  cursor: pointer;
}

/* ── Mobile styles ────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Sidebar slides up from the bottom instead of in from the right */
  .sidebar {
    top: auto;
    right: 0;
    bottom: -50vh;
    width: 100%;
    height: 50vh;
    box-sizing: border-box;
    transition: bottom 0.3s ease;
    padding: 16px 20px;
    background-size: 80px auto;
  }

  .sidebar.active {
    right: 0;
    bottom: 0;
  }

  /* Hide the legend while the sidebar is open so they don't collide */
  .sidebar.active ~ .legend-container {
    display: none;
  }

  .close-btn {
    top: 12px;
    right: 12px;
    font-size: 24px;
  }

  #sidebar-content {
    margin-top: 30px;
  }

  /* Scale down and right-align display text */
  .sidebar-title {
    font-size: 22px;
    line-height: 1.2;
    margin-bottom: 8px;
    text-align: right;
  }

  .sidebar-text {
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
  }

  .sidebar-logo {
    width: 70%;
    margin-top: auto;
    margin-left: auto;
    display: block;
  }

  .site-name {
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 8px;
    text-align: right;
  }

  .site-col {
    font-size: 24px;
    margin-bottom: 8px;
    text-align: right;
  }

  .site-desc {
    font-size: 12px;
    text-align: right;
  }

  .site-image-desc {
    font-size: 12px;
    text-align: right;
  }

  .site-caption {
    font-size: 11px;
    text-align: right;
  }

  /* Right-align popup link and image blocks */
  .site-figure {
    text-align: right;
  }

  .site-links {
    align-items: flex-end;
  }

  .site-link {
    text-align: right;
  }

  /* Compact legend on mobile */
  .legend-container {
    bottom: 10px;
    left: 10px;
    padding: 10px 14px;
    max-height: 45vh;
    overflow-y: auto;
  }

  .legend-title {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .legend-items {
    gap: 6px;
    margin-bottom: 8px;
  }

  .legend-item {
    font-size: 12px;
  }

  .legend-label {
    font-size: 12px;
  }

  .legend-footer {
    font-size: 12px;
    padding-top: 8px;
  }
}
