/* === Gallery Layout === */
.gallery-wrapper {
  display: grid;
  grid-template-columns: 220px 1.8fr;
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 3rem;
}

/* === TOC Sidebar === */
.toc {
  position: sticky;
  top: 80px;
  align-self: start;
  font-size: 1.2rem;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc a {
  text-decoration: none;
  color: var(--color-primary);
  display: block;
  padding: 0.5rem 0;
  transition: color 0.2s;
}

.toc a:hover {
  color: var(--color-hover);
}

.toc a.active {
  font-weight: bold;
}

/* === Gallery Section Titles === */
#gallery-content h2 {
  scroll-margin-top: 70px;
  margin-top: 2rem;
}

/* === Gallery Items === */
.gallery-item {
  margin-bottom: 4rem;
}

.gallery-item-content {
  margin-top: 2rem;
  text-align: left;
}

.gallery-images {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  margin-top: 2rem;
}

.section-intro,
.image-discussion {
  text-align: left !important;
}

.section-intro p,
.image-discussion p {
  text-align: left !important;
  margin: 0;
}

/* === Figures === */
.gallery-figure {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  text-align: center;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-figure img {
  max-width: 100%;
  height: auto;
  flex-shrink: 1;
  min-width: 0;
  border: 3px solid var(--color-primary);
  border-radius: 18px;
  display: block;
  margin: 0 auto;
}

/* === Captions === */
.image-titlecard {
  font-size: 1.1rem;
  color: #222;
  margin-top: 0.8rem;
  text-align: left !important;
  font-weight: normal !important;
  max-width: 90%;
}

.image-titlecard strong {
  font-weight: bold !important;
}

/* === Paragraphs === */
.gallery-item p {
  line-height: 1.5;
  text-align: left;
  margin-top: 1rem;
}

.section-intro {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  max-width: 85%;
  text-align: left;
}
