:root {
  --bg-color: rgb(255, 252, 240);
  --text-color: rgb(16, 15, 15);
  --secondary-text: rgb(111, 110, 105);
  --arrow-color: rgba(16, 15, 15, 0.3);
  --arrow-hover: rgba(16, 15, 15, 0.6);
}

[data-theme="dark"] {
  --bg-color: rgb(16, 15, 15);
  --text-color: rgb(206, 205, 195);
  --secondary-text: rgb(135, 133, 128);
  --arrow-color: rgba(206, 205, 195, 0.3);
  --arrow-hover: rgba(206, 205, 195, 0.7);
}

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

body {
  font-family: "Andale Mono", "Noto Sans", "Lucida Console", "Lucida Sans Typewriter", "Monaco", "Courier New", monospace;
  font-size: 11px;
  line-height: 18px;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 150px;
  height: 100vh;
  padding: 5px;
  overflow-y: auto;
  z-index: 50;
}

.site-title {
  font-size: 1.6em;
  font-weight: 500;
  margin: 0;
  padding: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.site-title:hover {
  color: var(--secondary-text);
}

.date-nav {
  margin-top: 20px;
}

.date-link {
  display: block;
  padding: 6px 0 0 5px;
  font-size: 11px;
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

.date-link:hover {
  color: var(--secondary-text);
}

.date-link.active {
  color: var(--secondary-text);
  font-weight: 500;
}

.photo-container {
  position: fixed;
  left: 150px;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
}

#photo {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.photo-caption {
  margin-top: 15px;
  font-size: 11px;
  color: var(--secondary-text);
  text-align: center;
  max-width: 600px;
  line-height: 18px;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  z-index: 100;
}

.theme-toggle:hover {
  color: var(--secondary-text);
}

.sun-icon,
.moon-icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

[data-theme="light"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg);
}

[data-theme="light"] .moon-icon {
  opacity: 0;
  transform: rotate(90deg);
}

[data-theme="dark"] .sun-icon {
  opacity: 0;
  transform: rotate(-90deg);
}

[data-theme="dark"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg);
}

.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--arrow-color);
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  z-index: 100;
  padding: 10px;
}

.nav-arrow:hover {
  color: var(--arrow-hover);
}

.nav-arrow.visible {
  opacity: 1;
}

.nav-prev {
  left: 20px;
}

.nav-next {
  right: 20px;
}

.nav-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

@media (max-width: 800px) {
  body {
    overflow-y: auto;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 10px;
    overflow-y: visible;
  }

  .site-title {
    font-size: 1.2em;
    padding: 5px 0;
  }

  .date-nav {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .date-link {
    padding: 0;
    font-size: 11px;
    display: inline;
  }

  .photo-container {
    position: relative;
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    min-height: 70vh;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .photo-wrapper {
    max-width: 95%;
  }

  #photo {
    max-width: 100%;
    max-height: 75vh;
  }

  .photo-caption {
    margin-top: 10px;
    font-size: 11px;
  }

  .nav-arrow {
    opacity: 0.5;
    top: 50%;
    transform: translateY(-50%);
  }

  .nav-prev {
    left: 10px;
  }

  .nav-next {
    right: 10px;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
  }
}
