/* -- Hero section -- */
.detail-hero {
  display: grid;
  grid-template-columns: 540px 1fr;
  gap: 2rem;
  align-items: start;
  padding: 1.5rem 1rem;
  max-width: 1152px;
  margin: 0 auto;
}

.back-link {
  display: block;
  text-align: center;
  margin: 1.5rem 0 0.5rem;
  font-size: 0.85rem;
}

/* -- Detail title above image -- */
.detail-title {
  font-size: 2rem;
  font-weight: 700;
  color: #e0e0e0;
  text-align: center;
  margin: 0.5rem 1rem 1.2rem;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-hero .hero-image {
    max-width: 320px;
    margin: 0 auto;
  }

  .detail-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .hero-right {
    text-align: left;
  }

  .detail-downloads .download-list li a {
    justify-content: flex-start;
  }
}

.hero-image {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-image img {
  width: 100%;
  height: auto;
}

/* -- Meta table -- */
.detail-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  font-size: 1.0rem;
}

.detail-meta dt {
  font-weight: 600;
  color: #90caf9;
}

.detail-meta dd {
  color: #ccc;
}

/* -- Right column wrapper -- */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* -- Downloads -- */
.detail-downloads h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #2a3a5e;
  color: #e0e0e0;
}

.detail-downloads .download-list {
  gap: 0.4rem;
}

.detail-downloads .download-list li a {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}

.detail-downloads .download-list .file-icon {
  font-size: 0.95rem;
}

.detail-downloads .download-list .file-size {
  font-size: 0.72rem;
}

.detail-section {
  max-width: 1152px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.detail-section h2 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: #e0e0e0;
  border-bottom: 1px solid #2a3a5e;
  padding-bottom: 0.4rem;
}

.detail-section p {
  font-size: 24px;
  margin-bottom: 1.8rem;
  color: #bbb;
}

.detail-section pre {  
  background: #0f1629;
  border: 1px solid #1e2d4a;
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 1.0rem;
  color: #a5d6a7;
  margin-bottom: 1rem;
}

.download-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.download-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1f2d55; /*#16213e*/
  border: 1px solid #2a3a5e;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  color: #90caf9;
  font-size: 0.88rem;
  transition: background 0.2s, border-color 0.2s;
}

.download-list li a:hover {
  background: #1a2a4e;
  border-color: #64b5f6;
}

.download-list .file-icon {
  font-size: 1.1rem;
}

.download-list .file-size {
  margin-left: auto;
  color: #ccc;
  font-size: 0.78rem;
}


.hero-gallery-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 4px;
  background: #111827;
}

.hero-main-image {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /*background: #111827;*/
  background: #1a1a2e;
  cursor: pointer;
}

/* Each slide fills the box but preserves its own proportions */
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.hero-slide[hidden] {
  display: none !important;
}

.hero-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; 
  display: block;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 0.4rem;
  font-size: 0.8rem;
  color: #9e9e9e;
}

.gallery-prev,
.gallery-next {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #e0e0e0;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gallery-prev:hover:not(:disabled),
.gallery-next:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.35);
}

.gallery-prev:disabled,
.gallery-next:disabled {
  opacity: 0.4;
  cursor: default;
}

.gallery-counter {
  min-width: 2.4rem;
  text-align: center;
  user-select: none;
}

.gallery-prev:focus-visible,
.gallery-next:focus-visible {
  outline: 2px solid #64b5f6;
  outline-offset: 2px;
}

#favorite-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  background: #1f2d55;
  color: #90caf9;
  border: 1px solid #2a3a5e;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
#favorite-btn:hover {
  background: #1a2a4e;
  border-color: #64b5f6;
}
#favorite-btn.favorited {
  background: #1b3a2a;
  border-color: #4caf50;
  color: #a5d6a7;
}

/* -- Comment Section Styles -- */
#comment-form {
  max-width: 800px;
  margin-bottom: 1.5rem;
}


#comment-form label {
  display: block;
  font-size: 1.2rem; 
  color: #9e9e9e;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

#comment-form input[type="text"],
#comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  background: #16213e;
  color: #e0e0e0;
  border: 1px solid #2a3a5e;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1.3rem; /* Slightly larger for readability, matches pre/code blocks */
  resize: vertical;
  box-sizing: border-box;
}

#comment-form input:focus,
#comment-form textarea:focus {
  outline: none;
  border-color: #64b5f6;
  box-shadow: 0 0 0 2px rgba(100, 181, 246, 0.2);
}

#comment-submit {
  padding: 0.6rem 1.2rem;
  background: #1f2d55;
  color: #90caf9;
  border: 1px solid #2a3a5e;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

#comment-submit:hover:not(:disabled) {
  background: #2a3b6e;
  border-color: #64b5f6;
}

#comment-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

#comment-error {
  display: block;
  margin-top: 0.5rem;
  color: #e57373;
  font-size: 0.9rem;
}

#comments-list {
  margin-top: 4rem;
  max-width: 800px;
}

#comment-status {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

#comment-status.success {
  color: #a5d6a7;
}

#comment-status.error {
  color: #e57373;
}

.comment-item {
  border: 1px solid #2a3a5e;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #16213e;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: #9e9e9e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.2rem;
}

.comment-author {
  font-weight: 700;
  color: #cfd8dc;  
}

.comment-date {
  font-family: monospace;
  color: #78909c;
}

.comment-body {
  font-size: 1.3rem; 
  line-height: 1.6;
  color: #ccc;
  word-wrap: break-word;
}

.no-comments {
  font-style: italic;
  color: #78909c;
}
