/* ==========================================================================
   identity.css — 이식혈관외과 공통 디자인 정체성 (디자인-정체성.md 2·4·5절)

   - 클론 CSS 뒤에 링크한다: fonts.css → (클론 CSS) → identity.css
   - 선택자는 클래스 1개 수준으로 낮게 두었다. 하위 요소는 :where() 로 감싸 특이도를 올리지 않는다.
     클론 쪽 규칙이 더 강하면 클론이 이기므로, 덮어쓰기는 클론의 색 변수를 토큰으로 치환하는 쪽이 우선이다.
   - !important 없음, 외부 의존성 없음(그래픽은 data URI 로 내장, 원본 SVG 는 같은 폴더).
   ========================================================================== */

/* ---------- 1. 토큰 ---------- */
:root {
  /* 색 (사양 2절 표 그대로) */
  --tvs-navy-deep: #081F52;   /* 어두운 구역 배경(히어로·푸터) */
  --tvs-navy: #0A2B70;        /* 주색: 헤더·제목·표 머리글·주 버튼 */
  --tvs-navy-soft: #1E4189;   /* 호버·구분선(어두운 배경) */
  --tvs-blue: #1557B0;        /* 링크·보조 강조·포커스 */
  --tvs-sky: #8FD8FF;         /* 어두운 배경 위 포인트(혈관망 선) */
  --tvs-red: #C8102E;         /* 혈관 레드 포인트 — 면적 2% 이하, 한 화면 주역 1 */
  --tvs-red-deep: #9E0C25;    /* 레드 호버 · 예시 배지 글자 */
  --tvs-red-tint: #FBE9EC;    /* 예시 배지 배경 */
  --tvs-warm: #F7F3EE;        /* 따뜻한 밝은 배경(본문 구역) */
  --tvs-surface: #FFFFFF;     /* 카드 */
  --tvs-ink: #0A1F44;         /* 본문 글자 */
  --tvs-text: #33415A;        /* 설명 글자 */
  --tvs-muted: #5E6B82;       /* 보조 글자 */
  --tvs-line: #D6DEEA;        /* 구분선 */

  /* 어두운 배경 위 글자 · 상태색 (사양 2절 규칙) */
  --tvs-on-dark: #F4F8FE;
  --tvs-on-dark-muted: #BFD3F0;
  --tvs-error: #B42318;
  --tvs-success: #1B7F4C;

  /* 남색 안에서만 쓰는 그라데이션(2색) */
  --tvs-grad-navy: linear-gradient(160deg, var(--tvs-navy) 0%, var(--tvs-navy-deep) 100%);
  --tvs-grad-hero: radial-gradient(120% 90% at 78% 30%, var(--tvs-navy) 0%, var(--tvs-navy-deep) 70%);

  /* 모양 · 그림자 · 움직임 */
  --tvs-radius-btn: 4px;
  --tvs-radius-card: 6px;
  --tvs-radius-photo: 2px;
  --tvs-shadow: 0 8px 24px rgba(8, 31, 82, .08);
  --tvs-dur: 180ms;
  --tvs-ease: cubic-bezier(.22, 1, .36, 1);
  --tvs-focus-ring: var(--tvs-blue);

  /* 타이포 크기 */
  --tvs-fs-body: 16px;
  --tvs-lh-body: 1.6;
  --tvs-lh-title: 1.25;
}

/* ---------- 2. 포커스 (전역, 절대 제거하지 않음) ---------- */
:focus-visible {
  outline: 2px solid var(--tvs-focus-ring);
  outline-offset: 2px;
}

/* 어두운 구역: 배경·글자·포커스 링 색을 한 번에 */
.tvs-dark {
  --tvs-focus-ring: var(--tvs-sky);
  background: var(--tvs-navy-deep);
  color: var(--tvs-on-dark);
}

/* 본문 기본(선택): 클론 body 에 붙이면 정체성 본문 규칙 적용 */
.tvs-body {
  font-family: var(--tvs-font-sans, system-ui, sans-serif);
  font-size: var(--tvs-fs-body);
  line-height: var(--tvs-lh-body);
  color: var(--tvs-ink);
  background: var(--tvs-warm);
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 세리프 제목(선택) */
.tvs-serif {
  font-family: var(--tvs-font-serif, serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: var(--tvs-lh-title);
}

/* ---------- 3. 버튼 ---------- */
.tvs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--tvs-radius-btn);
  background: var(--tvs-navy);
  color: #FFFFFF;
  font-family: var(--tvs-font-sans, system-ui, sans-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--tvs-dur) ease, border-color var(--tvs-dur) ease, color var(--tvs-dur) ease;
}
.tvs-btn:hover { background: var(--tvs-navy-soft); color: #FFFFFF; }

/* 레드: 진료 예약·상담처럼 가장 중요한 하나에만 */
.tvs-btn--red { background: var(--tvs-red); }
.tvs-btn--red:hover { background: var(--tvs-red-deep); }

/* 보조(테두리) — 밝은 배경 */
.tvs-btn--line { background: transparent; color: var(--tvs-navy); border-color: var(--tvs-navy); }
.tvs-btn--line:hover { background: var(--tvs-navy); color: #FFFFFF; }

/* 보조(테두리) — 어두운 배경 */
.tvs-btn--ghost { background: transparent; color: var(--tvs-on-dark); border-color: rgba(191, 211, 240, .55); }
.tvs-btn--ghost:hover { background: var(--tvs-navy-soft); color: #FFFFFF; border-color: var(--tvs-navy-soft); }

/* ---------- 4. 카드 ---------- */
.tvs-card {
  background: var(--tvs-surface);
  border: 1px solid var(--tvs-line);
  border-radius: var(--tvs-radius-card);
  box-shadow: var(--tvs-shadow);
  padding: 28px;
  color: var(--tvs-text);
}

/* ---------- 5. 구역 제목 (마크 + 세리프 + 한 줄 설명) ---------- */
/* <h2 class="tvs-section-title">진료 분야</h2> <p class="tvs-section-lead">한 줄 설명</p> */
.tvs-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-family: var(--tvs-font-serif, serif);
  font-weight: 600;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: var(--tvs-lh-title);
  letter-spacing: -0.01em;
  color: var(--tvs-navy);
  word-break: keep-all;
}
.tvs-section-title::before {
  content: "";
  flex: none;
  width: 24px;
  height: 24px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 6.5C8.5 6.5 9.5 12 14 12M3 17.5C8.5 17.5 9.5 12 14 12M14 12H21' stroke='%230A2B70' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='14' cy='12' r='2' fill='%23C8102E'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
}
/* 마크 대신 레드 짧은 선(24×2) */
.tvs-section-title--line::before {
  height: 2px;
  background: var(--tvs-red);
}
/* 어두운 구역용(가닥 하늘색) */
.tvs-section-title--on-dark { color: var(--tvs-on-dark); }
.tvs-section-title--on-dark::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 6.5C8.5 6.5 9.5 12 14 12M3 17.5C8.5 17.5 9.5 12 14 12M14 12H21' stroke='%238FD8FF' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='14' cy='12' r='2' fill='%23C8102E'/%3E%3C/svg%3E");
}
.tvs-section-lead {
  margin: 0 0 32px 36px;   /* 마크 폭(24)+간격(12) 만큼 들여 제목 글자와 정렬 */
  font-size: 16px;
  line-height: var(--tvs-lh-body);
  color: var(--tvs-text);
  word-break: keep-all;
}

/* ---------- 6. 수치 카운터 ---------- */
/* <div class="tvs-counter"><span class="tvs-counter__num">718<span class="tvs-counter__unit">례</span></span>
        <span class="tvs-counter__label">신장이식</span></div> */
.tvs-counter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--tvs-navy);
}
.tvs-counter__num {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding-left: 14px;
  font-family: var(--tvs-font-serif, serif);
  font-weight: 600;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums lining-nums;
}
.tvs-counter__num::before {          /* 숫자 앞 레드 점 4px */
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--tvs-red);
}
.tvs-counter__unit {
  font-family: var(--tvs-font-sans, system-ui, sans-serif);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0;
  color: var(--tvs-text);
}
.tvs-counter__label {
  padding-left: 14px;
  font-family: var(--tvs-font-sans, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--tvs-text);
}
.tvs-dark .tvs-counter__num { color: var(--tvs-on-dark); }

/* ---------- 7. 표 (외래 일정) ---------- */
.tvs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tvs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
  color: var(--tvs-ink);
  background: var(--tvs-surface);
}
.tvs-table :where(th, td) {
  padding: 12px 14px;
  border-bottom: 1px solid var(--tvs-line);
  text-align: center;
  white-space: nowrap;
}
.tvs-table :where(thead th) {
  background: var(--tvs-navy);
  color: var(--tvs-on-dark);
  font-weight: 500;
  border-bottom: 0;
}
.tvs-table :where(tbody th) { text-align: left; font-weight: 500; color: var(--tvs-navy); }
.tvs-table :where(tbody tr:nth-child(even)) { background: var(--tvs-warm); }
/* 오늘 요일: 레드 밑줄 */
.tvs-today {
  text-decoration: underline;
  text-decoration-color: var(--tvs-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ---------- 8. 예시 배지 ---------- */
.tvs-example {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--tvs-radius-btn);
  background: var(--tvs-red-tint);
  color: var(--tvs-red-deep);
  font-family: var(--tvs-font-sans, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .02em;
  vertical-align: middle;
  white-space: nowrap;
}

/* ---------- 9. 사진 (교수 사진·자리표시) ---------- */
/* <img class="tvs-photo" src="..."> — 남색 틀 + 2px 모서리, 채도 -10%·세피아 5% */
.tvs-photo {
  display: block;
  max-width: 100%;
  height: auto;
  border: 3px solid var(--tvs-navy);
  border-radius: var(--tvs-radius-photo);
  background: var(--tvs-navy);
  filter: saturate(.9) sepia(.05);
  object-fit: cover;
}

/* ---------- 10. 모티프 그래픽 ---------- */
/* 구분선: <div class="tvs-divider" role="presentation"></div> (또는 vessel-divider.svg 인라인) */
.tvs-divider {
  display: block;
  height: 24px;
  margin: 0;
  border: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' fill='none'%3E%3Cg stroke='%231E4189' stroke-width='1.2' stroke-linecap='round' stroke-opacity='.45'%3E%3Cpath d='M0 12C120 12 240 7 360 7S480 12 520 12'/%3E%3Cpath d='M520 12C555 12 570 5 600 5S645 12 680 12'/%3E%3Cpath d='M520 12C555 12 570 19 600 19S645 12 680 12'/%3E%3Cpath d='M680 12C760 12 860 17 980 17S1140 12 1200 12'/%3E%3C/g%3E%3Cg fill='%231E4189' fill-opacity='.7'%3E%3Ccircle cx='520' cy='12' r='2.2'/%3E%3Ccircle cx='680' cy='12' r='2.2'/%3E%3C/g%3E%3C/svg%3E") center / 1200px 24px no-repeat;
}
/* 아주 옅은 반복 패턴: 카드 배경·푸터 상단 */
.tvs-pattern {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240' fill='none'%3E%3Cg stroke='%23D6DEEA' stroke-width='1.2' stroke-linecap='round' stroke-opacity='.5'%3E%3Cpath d='M0 90C50 90 80 130 130 140S200 90 240 90'/%3E%3Cpath d='M170 0C170 40 140 70 130 140C120 190 170 200 170 240'/%3E%3Cpath d='M65 111C65 160 30 200 30 240'/%3E%3Cpath d='M30 0C30 25 25 45 10 60'/%3E%3C/g%3E%3Cg fill='%23D6DEEA' fill-opacity='.5'%3E%3Ccircle cx='130' cy='140' r='2.2'/%3E%3Ccircle cx='65' cy='111' r='1.8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 240px 240px;
  background-repeat: repeat;
}
/* 인라인 마크(글자 옆): <svg class="tvs-mark">…vessel-mark…</svg> */
.tvs-mark { width: 24px; height: 24px; flex: none; color: var(--tvs-navy); vertical-align: middle; }

/* ---------- 11. 혈관선 그리기 (한 번만, 1.2s ease-out) ---------- */
/* 인라인 SVG 에 class="tvs-draw" — path 는 pathLength="1" 이어야 한다.
   줄기(tvs-v0) 0→1.2s, 1차 분지(tvs-v1) .3→1.2s, 가는 분지(tvs-v2) .55→1.2s 로 모두 1.2s 에 끝나고,
   분기점(circle)은 그 뒤 0.3s 페이드. */
@keyframes tvs-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@keyframes tvs-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.tvs-draw :where(path[pathLength]) {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: tvs-draw var(--tvs-draw-dur, 1.2s) ease-out var(--tvs-draw-delay, 0s) forwards;
}
.tvs-draw :where(.tvs-v1) { --tvs-draw-delay: .3s;  --tvs-draw-dur: .9s; }
.tvs-draw :where(.tvs-v2) { --tvs-draw-delay: .55s; --tvs-draw-dur: .65s; }
.tvs-draw :where(circle) {
  opacity: 0;
  animation: tvs-fade .3s ease-out 1.2s forwards;
}

@media (prefers-reduced-motion: reduce) {
  .tvs-draw :where(path[pathLength]) { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .tvs-draw :where(circle) { opacity: 1; animation: none; }
  .tvs-btn { transition: none; }
}

/* ---------- 12. 모달 (클론 동작 유지, 색만) ---------- */
/* <dialog class="tvs-modal"><div class="tvs-modal__head"><h2>…</h2><button class="tvs-modal__close">…</button></div>
     <div class="tvs-modal__body">…</div></dialog> */
.tvs-modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--tvs-radius-card);
  background: var(--tvs-surface);
  color: var(--tvs-ink);
  box-shadow: 0 24px 64px rgba(8, 31, 82, .28);
}
.tvs-modal::backdrop { background: rgba(8, 31, 82, .55); }
.tvs-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 24px;
  background: var(--tvs-navy);
  color: var(--tvs-on-dark);
  --tvs-focus-ring: var(--tvs-sky);
}
.tvs-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--tvs-radius-btn);
  background: transparent;
  color: var(--tvs-on-dark);
  cursor: pointer;
  transition: background-color var(--tvs-dur) ease;
}
.tvs-modal__close:hover { background: var(--tvs-navy-soft); }
.tvs-modal__body { padding: 24px; line-height: var(--tvs-lh-body); color: var(--tvs-text); }

/* 상태 표시(오류·성공) — 레드 포인트와 구분, 아이콘과 함께 */
.tvs-status--error { color: var(--tvs-error); }
.tvs-status--success { color: var(--tvs-success); }

/* ==========================================================================
   추가 자산 유틸 (2026-10-31 3단계) — 위 1~12번 규칙은 그대로 두고 아래에 덧붙였다.
   ========================================================================== */

/* ---------- 13. 아이콘 (icons/*.svg: 24×24 · stroke 1.5 · currentColor · 둥근 끝) ---------- */
/* 인라인 SVG 에 class="tvs-icon" → 글자 크기(1em) 정사각, 주변 글자색을 따른다.
   파일 루트의 color="#0A2B70" 은 <img> 로 쓸 때의 기본값이고, 인라인에서는 아래 color: inherit 가 이긴다.
   <svg class="tvs-icon" viewBox="0 0 24 24" …>…</svg>  (크기는 font-size 또는 width/height 로) */
.tvs-icon {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  color: inherit;
  vertical-align: -0.125em;
  overflow: visible;
}

/* ---------- 14. 클리닉 카드 (아이콘 + 영문 소제목 + 세리프 제목 + 본문 + 자세히 보기) ---------- */
/* 평소엔 선만, 호버·포커스 시 그림자(--tvs-shadow) 하나. 아이콘은 남색 선만 — 레드 점을 붙이지 않는다
   (레드는 화면당 주역 1 규칙에 남겨 둔다). 마크업은 README "추가 자산" 절. */
.tvs-clinic-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px 28px 16px;
  background: var(--tvs-surface);
  border: 1px solid var(--tvs-line);
  border-radius: var(--tvs-radius-card);
  color: var(--tvs-text);
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: box-shadow var(--tvs-dur) ease;
}
.tvs-clinic-card:hover,
.tvs-clinic-card:focus-within { box-shadow: var(--tvs-shadow); }
.tvs-clinic-card__icon {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  margin: 0 0 20px;
  color: var(--tvs-navy);
}
.tvs-clinic-card__en {
  margin: 0 0 6px;
  font-family: var(--tvs-font-sans, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tvs-muted);
}
.tvs-clinic-card__title {
  margin: 0 0 10px;
  font-family: var(--tvs-font-serif, serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--tvs-navy);
}
.tvs-clinic-card__text {
  flex: 1 1 auto;
  margin: 0 0 12px;
  font-size: 16px;
  line-height: var(--tvs-lh-body);
  color: var(--tvs-text);
}
.tvs-clinic-card__link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  min-height: 44px;
  font-family: var(--tvs-font-sans, system-ui, sans-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--tvs-blue);
  text-decoration: none;
}
.tvs-clinic-card__link::after {          /* 오른쪽 꺾쇠(글자색) */
  content: "";
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--tvs-dur) var(--tvs-ease);
}
.tvs-clinic-card__link:hover { text-decoration: underline; text-underline-offset: 4px; }
.tvs-clinic-card:hover .tvs-clinic-card__link::after { transform: translateX(3px); }

/* ---------- 15. 썸네일 상자 (16:9 + thumbs/*.svg 배경) ---------- */
/* <div class="tvs-thumb tvs-thumb--clinic"></div>  — 사진이 오면 안에 <img> 를 넣으면 위를 덮는다.
   사진 틀과 함께: class="tvs-thumb tvs-photo tvs-thumb--clinic" (남색 틀·톤 필터가 같이 걸린다).
   url() 은 이 파일(공통/identity.css) 기준이라 버전 폴더 어디서 링크해도 공통/thumbs/ 를 가리킨다. */
.tvs-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--tvs-radius-photo);
  background-color: var(--tvs-navy);
  background-image: var(--tvs-grad-navy);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.tvs-thumb > :where(img, picture, video, iframe) {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}
.tvs-thumb--clinic     { background-image: url("thumbs/clinic.svg"); }      /* 외래 */
.tvs-thumb--surgery    { background-image: url("thumbs/surgery.svg"); }     /* 수술실 */
.tvs-thumb--research   { background-image: url("thumbs/research.svg"); }    /* 연구 */
.tvs-thumb--education  { background-image: url("thumbs/education.svg"); }   /* 교육 */
.tvs-thumb--video      { background-image: url("thumbs/video.svg"); }       /* 영상 */
.tvs-thumb--hospital   { background-image: url("thumbs/hospital.svg"); }    /* 병원 */
.tvs-thumb--transplant { background-image: url("thumbs/transplant.svg"); }  /* 이식 */
.tvs-thumb--vessel     { background-image: url("thumbs/vessel.svg"); }      /* 혈관 */

@media (prefers-reduced-motion: reduce) {
  .tvs-clinic-card,
  .tvs-clinic-card__link::after { transition: none; }
  .tvs-clinic-card:hover .tvs-clinic-card__link::after { transform: none; }
}
