/* ===================================================================
   PAGE-SPECIFIC CSS - 地図ページ(map/index.html)専用
   ★common.cssの後に読み込むこと
   ★url()のパスはこのCSSファイル(css/)を基準にしている
   =================================================================== */

.nav-link {
  width: 110px;
}

@media (max-width: 1150px) and (min-width: 901px) {
  .nav-link {
    width: 96px;
  }
}

/* ─── SVGディバイダー（このページはSVGで描画） ─── */

.section-divider svg {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: -1px;
}

.section-divider.has-hero-icon {
  overflow: visible;
}

.section-divider .divider-hero-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(150px, 18vw, 230px);
  height: auto;
  z-index: 6;
  pointer-events: none;
}

/* 横長イラスト用。上のルールと同じ詳細度にして後から上書きする（!important不要） */
.section-divider .divider-hero-icon-wide {
  width: clamp(280px, 34vw, 560px);
}

/* ─── ページヒーロー（パララックス単体画像。sliderは使わない） ─── */

#page-hero {
  position: relative;
  z-index: 2;
  min-height: clamp(420px, 56vw, 720px);
  overflow: hidden;
  display: flex;
  align-items: center;
}

.page-hero-bg {
  position: absolute;
  inset: -20% 0;
  z-index: 0;
  /* ★CSSファイル(css/)からの相対パスなので ../map/img/ になる */
  background-image: url("../map/img/map_visual.webp");
  background-size: cover;
  background-position: center;
  will-change: transform;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vw, 5rem) clamp(1.5rem, 5vw, 3rem);
  color: #fff;
}

.page-hero-en {
  font-family: var(--font-en);
  font-size: clamp(2.6rem, 9vw, 5rem);
  letter-spacing: 0.16em;
  line-height: 1;
  text-align: center;
}

.page-hero-ja {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.6vw, 1.5rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  margin-top: 0.6rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .page-hero-bg {
    transform: none !important;
  }
}

/* ─── ページリード文（ヒーロー直下の導入文） ─── */

#page-lead {
  background: #f9f8f8;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 3rem)
    clamp(1rem, 3vw, 2rem);
  text-align: center;
}

.page-lead-text {
  max-width: 720px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-dark);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.page-lead-text.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 各カテゴリセクション共通 ─── */

.category-section {
  position: relative;
  padding: clamp(2.5rem, 4vw, 4rem) clamp(1.5rem, 5vw, 3rem);
}

#geography {
  background: #f9f8f8;
  padding-bottom: clamp(9rem, 14vw, 14rem);
}

#built-by-misawa {
  background: #acc1d1;
  padding-top: clamp(9rem, 14vw, 14rem);
}

#built-by-misawa .category-ja {
  color: #015d97;
}

#domefuji {
  background: var(--bg-white);
}

.category-header {
  max-width: 720px;
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
}

.category-ja {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 700;
  color: var(--dark-navy);
  letter-spacing: 0.1em;
  margin-bottom: 1.1rem;
}

.category-desc {
  font-size: 13.5px;
  line-height: 2;
  color: var(--text-dark);
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.category-desc.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── 昭和基地の建物：カルーセル ─── */

.building-carousel {
  --bc-items: 3.2;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100vw;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.building-carousel-viewport {
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}

.building-carousel-viewport.dragging {
  cursor: grabbing;
}

.building-carousel-track {
  display: flex;
  align-items: stretch;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.building-carousel-track.no-transition {
  transition: none;
}

.building-slide {
  flex: 0 0 calc(100% / var(--bc-items));
  padding: 0 clamp(0.6rem, 1.4vw, 1rem);
  user-select: none;
  -webkit-user-drag: none;
}

.building-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-radius: clamp(14px, 2vw, 20px);
  overflow: hidden;
  box-shadow:
    0 14px 28px rgba(29, 41, 60, 0.12),
    0 2px 6px rgba(29, 41, 60, 0.06);
}

.building-card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--light-blue-gray);
  pointer-events: none;
}

.building-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.building-card-body {
  padding: clamp(1.1rem, 2.2vw, 1.4rem) clamp(1.2rem, 2.4vw, 1.6rem)
    clamp(1.4rem, 2.6vw, 1.8rem);
}

.building-card-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  margin-bottom: 0.7rem;
}

.building-card-name {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 700;
  color: var(--dark-navy);
  letter-spacing: 0.06em;
}

.building-card-badge {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.building-card-badge img {
  width: 160px;
  height: auto;
  object-fit: contain;
}

.building-card-desc {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-dark);
  letter-spacing: 0.03em;
}

.building-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: clamp(1.6rem, 3vw, 2.2rem);
}

.building-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--light-blue-gray);
  cursor: pointer;
}

.building-dots button.active {
  background: var(--misawa-blue);
}

@media (max-width: 900px) {
  .building-carousel {
    --bc-items: 2.2;
  }
}

@media (max-width: 560px) {
  .building-carousel {
    --bc-items: 1.15;
  }
}

/* ─── ドームふじ観測拠点II：見出しブロック ─── */

.dome-map {
  max-width: 420px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.dome-map.visible {
  opacity: 1;
  transform: scale(1);
}

.dome-map img {
  width: 100%;
  height: auto;
  display: block;
}

.dome-head {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.dome-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  color: #005c97;
  letter-spacing: 0.1em;
}

.dome-lead {
  margin-top: 1.6rem;
  font-size: 13.5px;
  line-height: 2;
  color: #333333;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.dome-lead.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── ドームふじ観測拠点II：写真＋文章の交互レイアウト ─── */

.dome-rows {
  max-width: var(--max-w);
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vw, 4rem);
  padding: 0 clamp(1.5rem, 5vw, 3rem) 0;
}
.back-top {
  text-align: center;
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 3rem) 10rem;
}

.back-top-btn {
  display: inline-block;
  padding: 15px 40px;
  border-radius: 999px;
  background: var(--bg-white);
  color: #0062af;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  box-shadow:
    5px 5px 10px rgba(163, 184, 202, 0.55),
    -5px -5px 10px rgba(255, 255, 255, 0.9);
  transition: box-shadow 0.25s ease;
}

.back-top-btn:hover {
  box-shadow:
    inset 4px 4px 8px rgba(163, 184, 202, 0.5),
    inset -4px -4px 8px rgba(255, 255, 255, 0.9);
}
.dome-row {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.dome-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.dome-row.reverse {
  flex-direction: row-reverse;
}

.dome-row-media {
  flex: 1 1 45%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: var(--light-blue-gray);
}

.dome-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dome-row-text {
  flex: 1 1 45%;
  font-size: 13.5px;
  line-height: 2;
  color: #595656;
  letter-spacing: 0.05em;
}

.dome-row-title {
  font-weight: 700;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: #333333;
  letter-spacing: 0.05em;
  margin-bottom: 0.9rem;
}

.dome-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.dome-row-header .dome-row-title {
  margin-bottom: 0;
}

.dome-award-badge {
  flex-shrink: 0;
  height: 28px;
  width: auto;
  object-fit: contain;
}

.dome-link {
  display: inline-block;
  margin-top: 1.1rem;
  color: var(--misawa-blue);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: opacity 0.2s ease;
}

.dome-link:hover {
  opacity: 0.65;
}

@media (max-width: 760px) {
  .dome-row,
  .dome-row.reverse {
    flex-direction: column;
  }
}

/* ─── 南極大陸 概要図（昭和基地・ドームふじ観測拠点II・南極点の位置を示す図） ─── */

.overview-map {
  max-width: 420px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.overview-map.visible {
  opacity: 1;
  transform: scale(1);
}

.overview-map img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── 南極の地図：見出し（昭和基地）＋座標 ─── */

.map-title {
  max-width: var(--max-w);
  margin: 0 auto 0.5rem;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  letter-spacing: 0.1em;
  color: #015d97;
}

.map-coord {
  max-width: var(--max-w);
  margin: 0 auto 1.2rem;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: #015d97;
}

/* ─── 南極の地図：インタラクティブマップ ───
   PCでは「地図（左）＋map-panel（右）」の2カラム、
   900px以下では「地図→map-panel」の縦積み。 */

.map-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 3rem);
  display: flex;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  flex-wrap: wrap;
  align-items: flex-start;
}

.map-visual {
  flex: 1 1 560px;
  min-width: 280px;
  border-radius: clamp(16px, 2.4vw, 24px);
  overflow: hidden;
  background: #fff;
  box-shadow:
    5px 5px 14px rgba(163, 184, 202, 0.45),
    -5px -5px 14px rgba(255, 255, 255, 0.9);
}

.map-visual svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ピンはキーボードでも操作できるようにしている（tabindex付き） */
#pins g:focus {
  outline: none;
}

#pins g:focus-visible .pin-hit {
  stroke: var(--misawa-blue);
  stroke-width: 5;
}

.map-panel {
  flex: 1 1 380px;
  min-width: 280px;
  padding: clamp(1rem, 1.8vw, 1.3rem);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background: #fff;
  border-radius: clamp(16px, 2.4vw, 24px);
  box-shadow:
    5px 5px 14px rgba(163, 184, 202, 0.45),
    -5px -5px 14px rgba(255, 255, 255, 0.9);
}

.map-panel-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: var(--light-blue-gray);
}

.map-panel-body {
  flex: 1 1 auto;
  padding-top: 0.2rem;
}

.map-panel-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.8rem;
}

.map-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--dark-navy);
  letter-spacing: 0.05em;
}

/* 建物データに misawa: true を指定すると表示されるバッジ（現状は該当データなし） */
.map-panel-misawa-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25em 0.7em;
  border-radius: 4px;
  background: var(--misawa-blue);
  color: #fff;
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.map-panel-misawa-badge[hidden],
.map-panel-desc[hidden],
.map-panel-list[hidden] {
  display: none;
}

.map-panel-desc {
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-dark);
  letter-spacing: 0.03em;
}

.map-panel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dark);
  letter-spacing: 0.03em;
}

.map-panel-list li {
  padding-left: 1.1em;
  position: relative;
}

.map-panel-list li::before {
  content: "・";
  position: absolute;
  left: 0;
}

@media (max-width: 900px) {
  .map-layout {
    flex-direction: column;
    align-items: stretch;
    padding-left: 0;
    padding-right: 0;
  }

  .map-visual,
  .map-panel {
    flex-basis: auto;
    width: 100%;
  }
}
/* ─── 「動きを減らす」設定への対応 ─── */
@media (prefers-reduced-motion: reduce) {
  /* スクロールで現れる要素：浮き上がり・拡大を止め、フェードだけ残す */
  .page-lead-text,
  .category-desc,
  .dome-lead,
  .dome-row,
  .dome-map,
  .overview-map {
    transform: none;
    transition: opacity 0.6s ease;
  }
}
