/* ============================================
   /test/ shared shell — masthead, bottom nav,
   kakao floater, calculator modal
   ============================================ */

/* (폰트 @import 제거 2026-06-21 — Noto Serif KR 가 실제 미사용인데 render-blocking 1.8초 유발했음. body 는 시스템 폰트 상속) */

:root {
  /* 강남 럭셔리 K-medical 팔레트 — purple signature + Kakao yellow + warm neutrals */
  --shell-ink: #1a1714;            /* warm near-black, body text */
  --shell-body: #4a463f;           /* warm gray body */
  --shell-muted: #8a8580;          /* warm muted */
  --shell-soft: #f5f3ef;           /* off-white warm tint */
  --shell-hairline: #e8e2d8;       /* warm hairline */
  --shell-brand: #4A2D6B;          /* 187 시그니처 보라 — deep heritage purple */
  --shell-brand-deep: #2E1A48;     /* hover/active 더 깊은 보라 */
  --shell-brand-soft: #f3edfa;     /* lavender soft for backgrounds */
  --shell-kakao: #FAE100;          /* 카카오 시그니처 노랑 */
  --shell-page-bg: #fafaf8;        /* warm off-white page */
}

body { background: var(--shell-page-bg) !important; }

/* ============= TOP HEADER (fixed) ============= */
.t-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--shell-hairline);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  max-width: 1024px;
  margin: 0 auto;
}
.t-header .logo-wrap {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.t-header .logo {
  height: 30px;
  width: auto;
  display: block;
}
.t-header .share-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--shell-hairline);
  color: var(--shell-ink);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.12s, background 0.15s;
}
.t-header .share-btn:active { transform: scale(0.92); }
.t-header .share-btn:hover { background: var(--shell-soft); }

.t-share-toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.t-share-toast.show { opacity: 1; }

/* ============= MASTHEAD (legacy, used only on index.html for big logo+title hero) ============= */
.t-masthead {
  text-align: center;
  padding: 24px 24px 18px;
  background: #fff;
}
.t-masthead .logo {
  max-width: 240px;
  width: 70%;
  margin: 0 auto 14px;
  display: block;
}
.t-masthead h1 {
  font-size: 24px;
  font-weight: 900;
  color: var(--shell-ink);
  letter-spacing: -0.7px;
  line-height: 1.2;
}
@media (min-width: 640px) {
  .t-masthead { padding: 32px 24px 22px; }
  .t-masthead .logo { max-width: 300px; }
  .t-masthead h1 { font-size: 30px; }
}

/* ============= PAGE WRAPPER ============= */
.t-page {
  min-height: 100vh;
  padding-top: 52px;        /* leave space for fixed top header */
  padding-bottom: 88px;     /* floating nav: 58 height + 14 bottom + 16 gap */
  background: #fff;
}

/* PC: 콘텐츠를 모바일 폭 중앙 카드로 보이게 — 따뜻한 배경 + 헤더 폭을 카드(680)에 맞춤.
   index/clinic 템플릿이 .container 를 680 카드로 좁히므로 헤더도 같은 폭으로 정렬. */
@media (min-width: 768px) {
  .t-page { background: var(--shell-page-bg); }
  .t-header { max-width: 680px; }
}

/* ============= BOTTOM NAV ============= */
/* Floating pill nav — 화면 하단에서 살짝 띄움 + 둥근 캡슐 */
.t-bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 12px;
  right: 12px;
  z-index: 40;
  max-width: 460px;
  margin: 0 auto;
  height: 58px;
  border-radius: 999px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--shell-hairline);
  box-shadow: 0 10px 28px rgba(26,23,20,0.10), 0 2px 6px rgba(26,23,20,0.04);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;             /* children 의 fill 이 둥근 모서리 따라가게 */
}
.t-bottom-nav a, .t-bottom-nav button {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: none;
  color: var(--shell-muted);
  text-align: center;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: color 0.18s, background 0.18s;
  position: relative;
  height: 100%;
}
.t-bottom-nav .icon {
  width: 18px;
  height: 18px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.18s, transform 0.18s;
}
.t-bottom-nav a:active, .t-bottom-nav button:active {
  transform: scale(0.96);
}
.t-bottom-nav a.active {
  color: var(--shell-brand);
  font-weight: 700;
  background: var(--shell-brand-soft);
}
.t-bottom-nav a.active .icon {
  opacity: 1;
}

/* 예상키 측정 탭 — 항상 보라 강조 (CTA 역할). 마지막 자식이라 우측 모서리 자동 둥글림. */
.t-bottom-nav a.t-nav-highlight {
  color: #fff;
  background: var(--shell-brand);
  font-weight: 700;
}
.t-bottom-nav a.t-nav-highlight .icon {
  opacity: 1;
}
.t-bottom-nav a.t-nav-highlight.active {
  background: var(--shell-brand-deep);
  color: #fff;
}

/* ============= HEADER KAKAO PILL ============= */
.t-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.t-header-kakao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--shell-kakao);
  color: var(--shell-ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
}
.t-header-kakao:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.14);
}
.t-header-kakao:active { transform: scale(0.96); }
.t-header-kakao svg { flex-shrink: 0; }

/* ============= CALCULATOR MODAL (backdrop + iframe → React /calc-embed) ============= */
.t-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(26,23,20,0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.t-modal.is-open {
  display: flex;
}
.t-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.06);
  color: var(--shell-ink);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.t-modal-close:hover { background: rgba(0,0,0,0.12); }
.t-modal-close:active { transform: scale(0.92); }

/* ===== iframe frame (React /calc-embed 재사용) ===== */
/* 폼·결과·차트는 모두 iframe 안 React HeightCalculator 가 렌더. 여기선 모달 틀만. */
.t-calc-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  /* definite height so the flex iframe child can fill it (flex-basis:0 overrides iframe's own height) */
  height: calc(100dvh - 32px);
  max-height: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(26,23,20,0.30);
  display: flex;
  flex-direction: column;
}
/* 닫기(✕) 버튼이 iframe 안 React '?' 도움말 버튼과 안 겹치도록 상단 바 확보 */
.t-calc-frame-bar {
  position: relative;
  height: 44px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--shell-hairline);
}
.t-calc-frame .t-modal-close {
  top: 4px;
  right: 6px;
}
.t-calc-iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  display: block;
  background: #fff;
}
/* PC: iframe 안 React 계산기의 md: 반응형(텍스트 키움)이 켜지려면
   iframe 자체 뷰포트가 ≥768px 여야 함 (iframe 은 부모 화면폭이 아닌 자기 폭 기준).
   따라서 PC 모달 폭을 780px 로 키워 md breakpoint 를 활성화한다. */
@media (min-width: 820px) {
  .t-calc-frame { max-width: 780px; }
}

/* PC: 하단 플로팅 탭바 확대 (클릭 영역 + 가독성).
   .t-bottom-nav 기본 정의 뒤에 와야 동일 명시도에서 오버라이드가 적용됨. */
@media (min-width: 768px) {
  .t-bottom-nav { max-width: 560px; height: 66px; bottom: 18px; }
  .t-bottom-nav a, .t-bottom-nav button { font-size: 13px; gap: 5px; }
  .t-bottom-nav .icon { width: 22px; height: 22px; }
}
