/* =========================================
   F1 머신 해부학 가이드 (anatomy.css)
   templates/guide/anatomy.html 전용
   guide.css의 공통 레이아웃(.guide-page / .guide-back-btn / .guide-page-title)에 더해
   이 페이지 전용 30초 요약·시스템 섹션·실전 이해·아코디언 스타일만 정의한다.
   팔레트는 사이트 공통값을 따른다: 배경 #0a0a0a / #111 / #1a1a1a, 보더 #2a2a2a, 액센트 #dc2626
   (기존 .anatomy-map-wrapper / .anatomy-pin* / .anatomy-modal* / .anatomy-html-tooltip /
    .anatomy-pin-toggle 인터랙티브 핀 스타일은 guide.css에 그대로 유지 — 이 파일은 건드리지 않는다)
   ========================================= */

/* =========================================
   Hero
   ========================================= */

.anatomy-hero {
  margin-bottom: 1.5rem;
}

.anatomy-hero-label {
  color: #dc2626;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 0.35rem;
}

.anatomy-hero-lead {
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 46rem;
  margin: 0 0 0.85rem;
}

.anatomy-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.anatomy-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  background-color: #111;
  color: #aaa;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.anatomy-badge--accent {
  border-color: #3a2020;
  background-color: rgba(220, 38, 38, 0.12);
  color: #f87171;
}

/* =========================================
   섹션 공통 (scoring/flags/strategy와 동일 규칙)
   ========================================= */

.anatomy-section {
  margin-bottom: 2.75rem;
}

.anatomy-section-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #f5f5f5;
  margin: 0 0 0.5rem;
  padding-left: 0.6rem;
  border-left: 3px solid #dc2626;
  line-height: 1.4;
}

.anatomy-section-desc {
  color: #999;
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0 0 1.25rem;
  max-width: 46rem;
}

.anatomy-note {
  color: #888;
  font-size: 0.825rem;
  line-height: 1.65;
  margin: 0.85rem 0 0;
  max-width: 46rem;
}

.anatomy-callout {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-left: 3px solid #dc2626;
  border-radius: 0.4rem;
  color: #ddd;
  font-size: 0.9rem;
  line-height: 1.7;
}

.anatomy-callout--info { border-left-color: #60a5fa; }
.anatomy-callout--warn { border-left-color: #eab308; }

.anatomy-inline-link {
  color: #f87171;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.anatomy-inline-link:hover,
.anatomy-inline-link:focus-visible {
  text-decoration: underline;
}

/* 본문 문단 안의 contextual 내부 링크 (Term 상세 페이지) */
.anatomy-term-link {
  color: #f5f5f5;
  border-bottom: 1px dashed #666;
  text-decoration: none;
}

.anatomy-term-link:hover,
.anatomy-term-link:focus-visible {
  color: #fff;
  border-bottom-color: #dc2626;
}

/* =========================================
   Section: 인터랙티브 F1 머신 (기존 요소 위 안내 문구만 추가)
   ========================================= */

.anatomy-interactive-hint {
  color: #888;
  font-size: 0.825rem;
  line-height: 1.6;
  margin: 0.75rem auto 0;
  max-width: 1200px;
  text-align: center;
}

/* =========================================
   Section: 30초 요약 — 연결된 시스템 흐름
   ========================================= */

.anatomy-summary-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: anatomy-flow;
}

.anatomy-summary-step {
  counter-increment: anatomy-flow;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.2rem 0.75rem;
  padding: 0.85rem 1rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  position: relative;
}

.anatomy-summary-step + .anatomy-summary-step {
  margin-top: 0.55rem;
}

/* 단계 사이 연결선(아래로 이어지는 화살표) — 시스템이 연결되어 있다는 느낌 */
.anatomy-summary-step:not(:last-child)::after {
  content: '↓';
  position: absolute;
  left: 1.1rem;
  bottom: -0.75rem;
  transform: translateX(-50%);
  color: #444;
  font-size: 0.85rem;
  line-height: 1;
}

.anatomy-summary-step::before {
  content: counter(anatomy-flow);
  grid-row: 1 / span 2;
  align-self: start;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #1a1a1a;
  border: 1px solid #3a2020;
  color: #f87171;
  font-size: 0.85rem;
  font-weight: bold;
}

.anatomy-summary-title {
  color: #f5f5f5;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.5;
}

.anatomy-summary-desc {
  color: #aaa;
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* =========================================
   Section: Above vs Below (Aerodynamics)
   ========================================= */

.anatomy-aero-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.anatomy-aero-card {
  padding: 1rem 1.1rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-top: 3px solid #3a3a3a;
  border-radius: 0.5rem;
}

.anatomy-aero-card--above { border-top-color: #60a5fa; }
.anatomy-aero-card--below { border-top-color: #f59e0b; }

.anatomy-aero-tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid #3a3a3a;
  border-radius: 0.25rem;
  background-color: #1a1a1a;
  color: #aaa;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.anatomy-aero-title {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: bold;
  color: #f5f5f5;
  margin: 0 0 0.45rem;
  line-height: 1.4;
}

.anatomy-aero-parts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.anatomy-aero-parts li {
  position: relative;
  padding-left: 0.9rem;
  color: #ccc;
  font-size: 0.875rem;
  line-height: 1.65;
  margin-bottom: 0.4rem;
}

.anatomy-aero-parts li:last-child {
  margin-bottom: 0;
}

.anatomy-aero-parts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #dc2626;
}

@media (min-width: 768px) {
  .anatomy-aero-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* =========================================
   Section: Power Unit — Fuel/Braking 관계 다이어그램
   ========================================= */

.anatomy-pu-flow {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.anatomy-pu-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.anatomy-pu-node {
  padding: 0.65rem 0.9rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  color: #f5f5f5;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.anatomy-pu-node--accent {
  border-color: #3a2020;
  background-color: rgba(220, 38, 38, 0.08);
  color: #f87171;
}

.anatomy-pu-arrow {
  color: #666;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.anatomy-pu-label {
  color: #888;
  font-size: 0.75rem;
  margin-right: 0.2rem;
  flex-shrink: 0;
}

/* 2026 CHANGE 콜아웃 */
.anatomy-change-callout {
  padding: 0.9rem 1rem;
  background-color: rgba(220, 38, 38, 0.06);
  border: 1px solid #3a2020;
  border-left: 3px solid #dc2626;
  border-radius: 0.5rem;
}

.anatomy-change-tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  background-color: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.anatomy-change-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.anatomy-change-list li {
  position: relative;
  padding-left: 0.9rem;
  color: #ddd;
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 0.35rem;
}

.anatomy-change-list li:last-child {
  margin-bottom: 0;
}

.anatomy-change-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #f87171;
}

/* =========================================
   Section: Tyres & Suspension — 힘 전달 체인
   ========================================= */

.anatomy-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.anatomy-chain-node {
  padding: 0.65rem 0.9rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  color: #f5f5f5;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.anatomy-chain-arrow {
  color: #666;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.anatomy-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.anatomy-role-chip {
  padding: 0.55rem 0.7rem;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.4rem;
  color: #ccc;
  font-size: 0.8rem;
  line-height: 1.45;
}

@media (min-width: 768px) {
  .anatomy-role-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* =========================================
   Section: Braking
   ========================================= */

.anatomy-brake-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
}

.anatomy-brake-chip {
  padding: 0.6rem 0.7rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-radius: 0.4rem;
  color: #f5f5f5;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

@media (min-width: 768px) {
  .anatomy-brake-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* =========================================
   Section: Cockpit & Safety — 안전 구조 카드 목록
   ========================================= */

.anatomy-safety-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.anatomy-safety-chip {
  padding: 0.65rem 0.75rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-left: 3px solid #dc2626;
  border-radius: 0.4rem;
  color: #ddd;
  font-size: 0.825rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .anatomy-safety-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================
   Section: 실제 레이스 상황 (4개 카드)
   ========================================= */

.anatomy-scenario-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.anatomy-scenario-card {
  padding: 1rem 1.1rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-left: 3px solid #3a3a3a;
  border-radius: 0.5rem;
}

.anatomy-scenario-tag {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid #3a3a3a;
  border-radius: 0.25rem;
  background-color: #1a1a1a;
  color: #aaa;
  font-size: 0.7rem;
  font-weight: 600;
}

.anatomy-scenario-title {
  font-size: 0.95rem;
  font-weight: bold;
  color: #f5f5f5;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.anatomy-scenario-flow {
  list-style: none;
  margin: 0;
  padding: 0;
}

.anatomy-scenario-flow li {
  position: relative;
  padding-left: 1.1rem;
  color: #bbb;
  font-size: 0.85rem;
  line-height: 1.65;
  margin-bottom: 0.35rem;
}

.anatomy-scenario-flow li:last-child {
  margin-bottom: 0;
}

.anatomy-scenario-flow li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #dc2626;
  font-size: 0.8rem;
}

.anatomy-scenario-flow li:first-child::before {
  content: '';
}

.anatomy-scenario-flow .anatomy-scenario-result {
  color: #f5f5f5;
  font-weight: 600;
}

@media (min-width: 768px) {
  .anatomy-scenario-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================
   details/summary 아코디언 (FAQ — flags/scoring과 동일 규칙)
   ========================================= */

.anatomy-details {
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-radius: 0.5rem;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.anatomy-details > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.85rem 1rem;
  color: #f5f5f5;
  font-size: 0.925rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
}

.anatomy-details > summary::-webkit-details-marker {
  display: none;
}

.anatomy-details > summary::after {
  content: '+';
  margin-left: auto;
  color: #dc2626;
  font-size: 1.1rem;
  font-weight: bold;
  flex-shrink: 0;
}

.anatomy-details[open] > summary::after {
  content: '−';
}

.anatomy-details[open] > summary {
  border-bottom: 1px solid #222;
}

.anatomy-details > summary:hover {
  background-color: #161616;
}

.anatomy-details > summary:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: -2px;
}

.anatomy-details-body {
  padding: 1rem;
}

.anatomy-details-body p {
  color: #bbb;
  font-size: 0.875rem;
  line-height: 1.75;
  margin: 0;
}

/* =========================================
   관련 용어 칩
   ========================================= */

.anatomy-term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.anatomy-term-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.4rem 0.8rem;
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 999px;
  color: #ddd;
  font-size: 0.825rem;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.anatomy-term-chip:hover,
.anatomy-term-chip:focus-visible {
  border-color: #dc2626;
  color: #fff;
}

/* =========================================
   다음 GUIDE 카드
   ========================================= */

.anatomy-next-guide {
  display: block;
  padding: 1.1rem 1.25rem;
  background-color: #111;
  border: 1px solid #2a2a2a;
  border-radius: 0.6rem;
  text-decoration: none;
  transition: border-color 0.2s;
}

.anatomy-next-guide:hover,
.anatomy-next-guide:focus-visible {
  border-color: #dc2626;
}

.anatomy-next-guide-label {
  display: block;
  color: #dc2626;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.anatomy-next-guide-title {
  display: block;
  color: #f5f5f5;
  font-size: 1.05rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
}

.anatomy-next-guide-desc {
  display: block;
  color: #999;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* =========================================
   출처 영역 (scoring/flags와 동일 규칙)
   ========================================= */

.anatomy-source {
  padding-top: 1.5rem;
  border-top: 1px solid #222;
}

.anatomy-source-title {
  font-size: 0.925rem;
  font-weight: bold;
  color: #aaa;
  margin: 0 0 0.6rem;
}

.anatomy-source p {
  color: #888;
  font-size: 0.825rem;
  line-height: 1.7;
  margin: 0 0 0.6rem;
  max-width: 46rem;
}

.anatomy-source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.anatomy-source-meta a {
  color: #999;
  text-decoration: underline;
}

.anatomy-source-meta a:hover,
.anatomy-source-meta a:focus-visible {
  color: #f5f5f5;
}

/* =========================================
   Quick View 모달 (본문 contextual 용어 링크 전용)
   guide.css의 인터랙티브 핀 모달(.anatomy-modal-overlay/.anatomy-modal)과
   시각적 스타일 언어(dark bg/border/red accent/typography)는 동일하게 재사용하되,
   완전히 별도의 클래스(.anatomy-quickview-*)로 구현해 두 모달이 서로 영향을 주지 않는다.
   ========================================= */

.anatomy-quickview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1100; /* 인터랙티브 핀 모달(z-index 미지정, 기본 스택 순서)보다 위에 오도록 여유값 확보 */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.anatomy-quickview-overlay[hidden] {
  display: none;
}

.anatomy-quickview {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.anatomy-quickview-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
}

.anatomy-quickview-close:hover,
.anatomy-quickview-close:focus-visible {
  color: #f5f5f5;
}

.anatomy-quickview-close:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.anatomy-quickview-title {
  font-size: 1.15rem;
  font-weight: bold;
  color: #f5f5f5;
  margin: 0 0.5rem 0.3rem 0;
  padding-right: 1.75rem;
  line-height: 1.4;
}

.anatomy-quickview-eng {
  color: #888;
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.anatomy-quickview-desc {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.65;
  margin: 0 0 1.1rem;
}

.anatomy-quickview-full-link {
  display: inline-flex;
  color: #f87171;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.anatomy-quickview-full-link:hover,
.anatomy-quickview-full-link:focus-visible {
  text-decoration: underline;
}

/* =========================================
   모바일 대응 (최소 360px 보장, 가로 스크롤 방지)
   compact 원칙: 세로 여백만 줄인다. 좌우 padding·font-size·색상은 유지.
   ========================================= */

@media (max-width: 520px) {
  .guide-page {
    padding-inline: 0.25rem;
  }

  .guide-page-title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.35rem;
  }

  .guide-page-subtitle {
    margin-bottom: 1.15rem;
  }

  .anatomy-hero {
    margin-bottom: 1.1rem;
  }

  .anatomy-hero-lead {
    font-size: 0.9rem;
    margin-bottom: 0.7rem;
  }

  .anatomy-section {
    margin-bottom: 1.9rem;
  }

  .anatomy-section-title {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
  }

  .anatomy-section-desc {
    margin-bottom: 1rem;
  }

  .anatomy-callout {
    margin-top: 0.8rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
  }

  .anatomy-summary-step {
    padding: 0.7rem 0.85rem;
  }

  .anatomy-aero-card,
  .anatomy-scenario-card {
    padding: 0.7rem 0.85rem;
  }

  .anatomy-aero-split,
  .anatomy-scenario-grid {
    gap: 0.6rem;
  }

  .anatomy-pu-row {
    gap: 0.4rem;
  }

  .anatomy-pu-node,
  .anatomy-chain-node {
    font-size: 0.8rem;
    padding: 0.55rem 0.7rem;
  }

  .anatomy-safety-grid,
  .anatomy-role-grid,
  .anatomy-brake-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .anatomy-details {
    margin-bottom: 0.45rem;
  }

  .anatomy-details > summary {
    padding: 0.6rem 1rem;
  }

  .anatomy-details-body {
    padding: 0.75rem 1rem;
  }

  .anatomy-quickview {
    padding: 1.25rem;
    max-height: 85vh;
  }

  .anatomy-quickview-title {
    font-size: 1.05rem;
  }
}

/* 과도한 애니메이션 없음 */
@media (prefers-reduced-motion: reduce) {
  .anatomy-term-chip,
  .anatomy-next-guide,
  .anatomy-quickview-close,
  .anatomy-quickview-full-link {
    transition: none;
  }
}
