.page-section {
  background: var(--bg);
}

.section-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Mini mindmap ── */
.section-mindmap-area {
  position: relative;
  overflow: visible;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  padding-top: 38px;
  padding-left: 48px;
  height: 300px; /* tall enough to let the drop line breathe */
}

.smm-wrap {
  position: relative;
  width: 400px;
  height: 148px;
  flex-shrink: 0;
}

.smm-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
  display: none; /* branch lines now use PNG images */
}

/* Handwritten branch line images */
.smm-branch-wrap {
  position: absolute;
  display: none;
  pointer-events: none;
  user-select: none;
  transform-origin: center center;
}

.smm-branch-wrap img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.smm-node {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.smm-node.clickable {
  cursor: pointer;
}

.smm-parent {
  top: 20px;
  left: 38%;
  cursor: default;
}

.smm-child-left {
  top: 122px;
  left: 14%;
}

.smm-child-right {
  top: 122px;
  left: 72%;
}

/* Handwritten vertical drop line image */
.drop-line-img {
  position: absolute;
  pointer-events: none;
  user-select: none;
  object-fit: fill;
  display: none; /* shown + positioned by JS */
}

/* Active/inactive child styling */
.smm-active {
  opacity: 1;
}

.smm-inactive {
  opacity: 0.38;
}

.smm-hw-img {
  display: block;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.smm-parent-img {
  height: 11px;
  width: auto;
}

.smm-child-img {
  height: 11px;
  width: auto;
}

/* ── Gallery panel ── */
.section-gallery-panel {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 24px 0 80px;
  position: relative;
}

.gallery-scroll {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.gallery-scroll::-webkit-scrollbar {
  display: none;
}

.gallery-row {
  display: flex;
  gap: 10px;
  padding: 0 24px;
  width: max-content;
}

.gallery-thumb {
  flex-shrink: 0;
  width: auto;
  min-width: 140px;
  max-width: 380px;
  overflow: visible;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-thumb img {
  height: 240px;
  width: auto;
  max-width: 380px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.2s ease;
  background: #e8e4dc;
  flex-shrink: 0;
}

.gallery-thumb:hover img {
  opacity: 0.7;
}

/* Project name — sits below the image, centered */
.thumb-name {
  width: 100%;
  max-width: 380px;
  padding: 6px 4px 0;
  font-family: var(--font-body);
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text);
  text-align: center;
  white-space: normal;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  line-height: 1.4;
}

.gallery-thumb:hover .thumb-name {
  opacity: 1;
}

/* Scroll arrow buttons */
.gallery-arrow {
  flex-shrink: 0;
  width: 40px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  opacity: 0.5;
  transition: opacity 0.2s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-arrow:hover {
  opacity: 1;
}

.gallery-arrow-left  { padding-left: 16px; }
.gallery-arrow-right { padding-right: 16px; }

.gallery-empty {
  font-family: var(--font-body);
  font-size: 0.65rem;
  color: var(--text-light);
  letter-spacing: 0.04em;
  padding: 8px 0;
}

/* ── Tablet (769-1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
  .section-mindmap-area {
    padding-left: 48px;
    height: 260px;
  }

  .smm-wrap {
    width: 340px;
    height: 130px;
  }

  .smm-child-left  { top: 104px; left: 20%; }
  .smm-child-right { top: 104px; }
}

/* ── Mobile (≤768px) ── */
@media (max-width: 768px) {
  .section-mindmap-area {
    padding-top: 64px;
    padding-left: 36px;
    height: 260px;
  }

  .smm-wrap {
    width: 100%;
    max-width: 300px;
    height: 130px;
  }

  .smm-child-left  { top: 104px; left: 22%; }
  .smm-child-right { top: 104px; }

  .smm-parent-img { height: 10px; }
  .smm-child-img  { height: 10px; }

  #smm-branch-right img { transform: scaleY(0.65); }

  /* Gallery: vertical scroll, no arrows */
  .gallery-arrow { display: none; }

  .gallery-scroll {
    scroll-snap-type: y mandatory;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 60vh;
  }

  .gallery-row {
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 16px;
    gap: 20px;
  }

  .gallery-thumb {
    width: 88vw;
    max-width: 88vw;
    min-width: unset;
    scroll-snap-align: start;
  }

  .gallery-thumb img {
    height: auto;
    width: 88vw;
    max-width: 88vw;
    object-fit: contain;
  }

  /* Name hidden by default; appears on first tap */
  .thumb-name {
    opacity: 0;
    max-width: 88vw;
    padding: 10px 8px 0;
  }

  .gallery-thumb.tapped .thumb-name {
    opacity: 1;
  }

  .section-gallery-panel {
    padding: 24px 0 40px;
  }
}
