:root {
  --font: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --bg: #ffffff;
  --text: #000000;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  font-family: var(--font);
}

.home-link {
  text-decoration: none;
  color: var(--text);
  font-weight: bold;
  font-size: 1rem;
}

.random-btn {
  background: #000;
  color: #fff;
  border: none;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 4px;
}

.random-btn:hover {
  background: #333;
}

.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
  position: relative;
}

.side-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  z-index: 10;
  visibility: hidden;
}

.side-button.left {
  left: 1rem;
}

.side-button.right {
  right: 1rem;
}

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

.main-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2rem;
  margin-left: 0vw;
  flex-wrap: nowrap;
}

.main-image {
  width: 65vw;
  height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.caption {
  font-size: 1rem;
  max-width: 25vw;
  min-width: 200px;
  word-wrap: break-word;
  flex-shrink: 0;
}

.caption b {
  font-size: 1.2rem;
  display: block;
}

.caption i {
  display: block;
  opacity: 0.6;
  font-style: italic;
}

@media (orientation: portrait) {
  .main-content {
    justify-content: center;
  }

  .main-block {
    flex-direction: column;
    align-items: center;
    margin-left: 0;
  }

  .main-image {
    width: 85vw;
    height: 50vh;
    margin-bottom: 1rem;
  }

  .caption {
    max-width: 80vw;
    text-align: center;
  }
}

.previews {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #ccc;
  margin-top: 10pt;
}

.preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #000;
  cursor: pointer;
}
