:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --text-primary: #e0e0e0;
  --text-secondary: #aaaaaa;
  --border-color: #333333;

  --accent: #e50914;
  --accent-hover: #ff2a2a;
  --accent-subtle: #8b0000;

  --success: #00c853;
  --warning: #ffd600;
  --error: #d50000;
}

body {
  font-family: "Times New Roman", Times, serif;
  font-size: 10pt;
  background-color: var(--bg-color);
  color: var(--text-primary);
  margin: 0;
}

#header {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  border-bottom: solid 2px var(--border-color);
  align-items: center;
  height: 5vh;
  width: 100%;
  background-color: var(--bg-color);
  z-index: 10;
}

#header-text {
  color: var(--accent);
  font-size: 2rem;
  font-weight: bolder;
}

#header-copy {
  margin-right: 2rem;
  font-size: 1rem;
  font-weight: bold;
}

.main-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Book container on side */
.book-container {
  flex: 0 0 300px;
  text-align: center;
  margin: 20px;
}

.book-container img {
  width: 250px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.download-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 24px;
  font-size: 1.3rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--text-primary);
  background-color: var(--accent);
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.download-btn:hover {
  background-color: var(--accent-hover);
  cursor: pointer;
}

.content-container {
  flex: 1;
  padding: 20px;
}

/* Video adjustments: maintain 16:9 ratio */
.video-container {
  margin: 20px auto;
  max-width: 800px;
  text-align: center;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 ratio */
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid var(--border-color);
  border-radius: 8px;
}

/* Gallery grid */
.display {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.gallery {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  padding: 10px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px var(--accent-subtle);
  border-color: var(--accent-hover);
}

.gallery img {
  width: 100%;
  height: 180px; /* fixed thumbnail height */
  object-fit: cover; /* crop to keep proportions */
  display: block;
  border-radius: 4px;
}

.matID {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--accent);
  margin-top: 10px;
}

.desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

input[type="hidden"] {
  display: none;
}

/* Responsive tweaks */
@media (max-width: 1200px) {
  .main-container {
    flex-direction: column;
    align-items: center;
  }

  .book-container {
    flex: none;
    margin: 10px 0;
  }

  .book-container img {
    width: 200px;
  }

  .download-btn {
    font-size: 1.1rem;
    padding: 10px 20px;
  }

  .display {
    grid-template-columns: repeat(2, 1fr);
    padding: 10px;
  }

  .video-container {
    max-width: 95%;
  }
}

.display-container {
  width: 90%;
  display: flex;
  justify-content: center;
  aligh-items: center;
}

@media (max-width: 500px) {
  .display {
    grid-template-columns: 1fr;
  }
}
