/* =============================================================
   斜視手術件数 全国調査（2023–2025）
   Design tokens & base styles
   医療系の清潔感：白基調 + 淡いティール/セージ
   ============================================================= */

:root {
  /* --- Color: surfaces --- */
  --bg:            #f4f8f6;   /* page background, very soft sage-white */
  --surface:       #ffffff;   /* cards, panels */
  --surface-2:     #eef4f1;   /* subtle fill, hover */
  --surface-3:     #e3ede9;   /* deeper subtle fill */

  /* --- Color: brand teal/sage --- */
  --teal-900:      #1f4a40;   /* darkest, headings on light */
  --teal-700:      #2f6b5e;   /* primary text accent / links */
  --teal-600:      #3a7d6e;   /* primary action */
  --teal-500:      #4f9183;   /* hover */
  --teal-300:      #9cc6bb;   /* borders, dividers in brand */
  --teal-100:      #dcebe6;   /* tint backgrounds */
  --teal-50:       #eef5f2;

  /* --- Color: ink / text --- */
  --ink:           #20302c;   /* primary text */
  --ink-2:         #4b5b56;   /* secondary text */
  --ink-3:         #6f7e79;   /* tertiary / captions */
  --ink-on-teal:   #ffffff;

  /* --- Color: lines --- */
  --line:          #d7e3de;   /* default border */
  --line-strong:   #c2d3cc;

  /* --- Color: status (calm, non-ranking) --- */
  --has-bg:        #e6f1ec;   /* 実施有 tint */
  --has-ink:       #2f6b5e;
  --no-bg:         #f0f1f0;   /* 実施無 / 未回答 neutral */
  --no-ink:        #6f7e79;
  --warn-bg:       #fbf4e7;   /* notice band */
  --warn-ink:      #7a5a1e;
  --warn-line:     #ecd9b0;

  /* --- Range badge (uniform, NON-ranking) --- */
  --badge-bg:      #eef4f1;
  --badge-ink:     #355a51;
  --badge-line:    #cfe0d9;
  --badge-muted-bg:#f1f2f2;
  --badge-muted-ink:#7c8985;
  --badge-muted-line:#e0e4e2;

  /* --- Radius --- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  /* --- Shadow (soft, medical) --- */
  --shadow-sm: 0 1px 2px rgba(31,74,64,.05), 0 1px 3px rgba(31,74,64,.06);
  --shadow-md: 0 2px 8px rgba(31,74,64,.06), 0 6px 18px rgba(31,74,64,.07);
  --shadow-lg: 0 8px 30px rgba(31,74,64,.10);

  /* --- Type --- */
  --font: "Noto Sans JP", system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
          "Yu Gothic", Meiryo, sans-serif;

  /* --- Layout --- */
  --maxw: 1120px;
  --gap: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--teal-700); text-underline-offset: 2px; }
a:hover { color: var(--teal-600); }

/* Visible focus for accessibility */
:focus-visible {
  outline: 3px solid var(--teal-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--teal-700); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--r-md) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --- Layout helpers --- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: var(--gap); }

/* =============================================================
   Top utility band  (固定注記 短文)
   ============================================================= */
.topnote {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-line);
  color: var(--warn-ink);
  font-size: 13.5px;
}
.topnote .wrap {
  display: flex; align-items: flex-start; gap: 10px;
  padding-top: 9px; padding-bottom: 9px;
}
.topnote svg { flex: none; margin-top: 2px; }

/* =============================================================
   Header
   ============================================================= */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(150deg, var(--teal-600), var(--teal-500));
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: var(--shadow-sm);
}
.brand-text { line-height: 1.25; }
.brand-text b { color: var(--teal-900); font-size: 15px; font-weight: 700; display: block; }
.brand-text span { color: var(--ink-3); font-size: 11.5px; }
.header-nav { display: flex; gap: 6px; align-items: center; }
.header-nav a {
  font-size: 13.5px; color: var(--ink-2); text-decoration: none;
  padding: 7px 12px; border-radius: var(--r-pill); font-weight: 600;
}
.header-nav a:hover { background: var(--surface-2); color: var(--teal-700); }
.header-nav a[aria-current="page"] { background: var(--teal-100); color: var(--teal-700); }

/* =============================================================
   Breadcrumb
   ============================================================= */
.crumbs { font-size: 12.5px; color: var(--ink-3); padding: 14px 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li::after { content: "›"; margin-left: 6px; color: var(--line-strong); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { text-decoration: none; }

/* =============================================================
   Hero
   ============================================================= */
.hero { padding: 26px 0 8px; }
.hero h1 {
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.35; color: var(--teal-900);
  margin: 8px 0 10px; font-weight: 700; letter-spacing: .02em;
  text-wrap: balance;
}
.hero .lede { color: var(--ink-2); font-size: 15.5px; max-width: 47rem; margin: 0; line-height: 1.8; }
/* lede の改行制御：1文目は1行、注記は別行（広い画面）。狭い画面では自然に折り返す */
.lede .ld-br { display: none; }
@media (min-width: 680px) {
  .lede .ld-br { display: inline; }
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--teal-700); background: var(--teal-100);
  padding: 5px 12px; border-radius: var(--r-pill);
}
.hero-figure {
  margin-top: 18px; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.hero-figure img { width: 100%; height: auto; display: block; }

/* 画像をバナーにする場合（タイトル文字が画像内にある時） */
.hero-banner { padding-top: 20px; }
.hero-banner .hero-figure { margin-top: 0; background: #fff; }
.hero-banner .lede { margin-top: 18px; }

/* 16:9 placeholder figure */
.ph {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background:
    radial-gradient(120% 90% at 80% -10%, var(--teal-100), transparent 60%),
    linear-gradient(135deg, #eaf3ef, #dfece7);
  display: grid; place-items: center; color: var(--teal-700);
}
.ph .ph-inner { text-align: center; opacity: .85; }
.ph .ph-inner svg { margin: 0 auto 8px; display: block; }
.ph .ph-inner span { font-size: 12.5px; letter-spacing: .06em; font-weight: 600; }

/* =============================================================
   Section
   ============================================================= */
.section { padding: 22px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 {
  font-size: 19px; color: var(--teal-900); margin: 0; font-weight: 700;
  letter-spacing: .02em;
}
.section-head .sub { color: var(--ink-3); font-size: 13px; }

/* =============================================================
   Cards / Panels
   ============================================================= */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.panel-pad { padding: 18px; }

/* =============================================================
   Buttons
   ============================================================= */
.btn {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px;
  border-radius: var(--r-md); padding: 10px 16px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-500); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--teal-700); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* =============================================================
   Badges
   ============================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; line-height: 1;
  padding: 6px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--badge-line); background: var(--badge-bg); color: var(--badge-ink);
  white-space: nowrap;
}
.badge-muted { background: var(--badge-muted-bg); color: var(--badge-muted-ink); border-color: var(--badge-muted-line); }
.badge-type {
  background: var(--surface); border-color: var(--line-strong); color: var(--ink-2);
  font-weight: 600;
}
.tag-has {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--has-bg); color: var(--has-ink); white-space: nowrap;
}
.tag-has.is-no { background: var(--no-bg); color: var(--no-ink); }
.tag-has .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }

/* =============================================================
   DPC reference box
   ============================================================= */
.dpc {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal-300);
  background: var(--teal-50);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.dpc h3 { margin: 0 0 6px; font-size: 15px; color: var(--teal-900); font-weight: 700; }
.dpc p { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-2); }
.dpc .ext-link {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 700;
  font-size: 14px; text-decoration: none; color: var(--teal-700);
  border: 1px solid var(--teal-300); background: var(--surface);
  padding: 9px 14px; border-radius: var(--r-md);
}
.dpc .ext-link:hover { background: var(--teal-100); }
.dpc .ext-note { margin: 9px 0 0; font-size: 12px; color: var(--ink-3); }

/* =============================================================
   Footer notes (固定注記 詳細)
   ============================================================= */
.notes {
  background: var(--surface); border-top: 1px solid var(--line);
  margin-top: 32px;
}
.notes .wrap { padding: 26px 20px 40px; }
.notes h2 { font-size: 15px; color: var(--teal-900); margin: 0 0 12px; font-weight: 700; }
.notes ul { margin: 0; padding-left: 1.1em; color: var(--ink-2); font-size: 13.5px; }
.notes li + li { margin-top: 7px; }
.notes .meta { margin-top: 20px; font-size: 12px; color: var(--ink-3); border-top: 1px dashed var(--line); padding-top: 16px; }

/* 運営者情報 */
.operator { margin-top: 16px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.operator .op-name { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.operator .op-meta { font-size: 12px; color: var(--ink-3); }

/* =============================================================
   調査概要
   ============================================================= */
.overview-grid { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr); gap: 16px; align-items: stretch; }
.ov-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: var(--teal-50); }
.ov-stat { display: flex; flex-direction: column; gap: 2px; }
.ov-n { font-size: 38px; font-weight: 700; color: var(--ink-2); line-height: 1; }
.ov-stat-accent .ov-n { color: var(--teal-700); }
.ov-l { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.ov-arrow { color: var(--teal-300); display: inline-grid; place-items: center; }
.ov-arrow svg { transform: none; }
.ov-stats-note { flex-basis: 100%; margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }

.ov-dl { margin: 0; }
.ov-row { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.ov-row:last-child { border-bottom: 0; }
.ov-row dt { font-size: 13px; font-weight: 700; color: var(--teal-800, var(--teal-700)); margin: 0; }
.ov-row dd { font-size: 13.5px; color: var(--ink); margin: 0; }

/* =============================================================
   この調査について（背景）
   ============================================================= */
.about-body p { margin: 0 0 14px; font-size: 14.5px; color: var(--ink); line-height: 1.85; text-wrap: pretty; }
.about-body p:last-child { margin-bottom: 0; }

/* 調査フロー図（16:9） */
.flow-figure { margin: 0 0 16px; }
.flow-figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  background: #fff;
}
.flow-cap { margin: 10px 2px 0; font-size: 12.5px; color: var(--ink-3); text-wrap: pretty; }
.survey-types-figure { margin-top: 20px; }

/* =============================================================
   参考情報グリッド（DPC + エビデンス）
   ============================================================= */
.reference-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.evidence {
  border: 1px solid var(--line); border-left: 4px solid var(--teal-300);
  background: var(--surface); border-radius: var(--r-md); padding: 16px 18px;
}
.evidence h3 { margin: 0 0 6px; font-size: 15px; color: var(--teal-900); font-weight: 700; }
.evidence-lede { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.evidence-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.evidence-list a {
  display: inline-flex; align-items: flex-start; gap: 7px; font-size: 13.5px; font-weight: 600;
  text-decoration: none; color: var(--teal-700); line-height: 1.5;
}
.evidence-list a:hover { text-decoration: underline; }
.evidence-list a svg { flex: none; margin-top: 3px; }
.evidence-note { margin: 0; font-size: 12px; color: var(--ink-3); }

@media (max-width: 820px) {
  .overview-grid { grid-template-columns: 1fr; }
  .reference-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   専門家コメント枠
   ============================================================= */
.expert-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.expert-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 22px 20px 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.expert-card.is-pending { background: var(--surface); border-style: dashed; border-color: var(--line-strong); }
.expert-quote-mark { color: var(--teal-300); }
.expert-quote { margin: 0; font-size: 14.5px; color: var(--ink); line-height: 1.85; text-wrap: pretty; flex: 1; }
.expert-placeholder { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.75; flex: 1; }
.expert-pending-badge {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--teal-700);
  background: var(--teal-100); padding: 3px 9px; border-radius: var(--r-pill);
  margin-right: 8px; vertical-align: middle;
}
.expert-person { display: flex; align-items: center; gap: 11px; border-top: 1px dashed var(--line); padding-top: 14px; }
.expert-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--teal-50); border: 1px solid var(--line); color: var(--teal-500);
  display: grid; place-items: center;
}
.expert-id { display: flex; flex-direction: column; line-height: 1.4; }
.expert-name { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.expert-title { font-size: 11.5px; color: var(--ink-3); }
.expert-note { margin: 16px 2px 0; font-size: 12px; color: var(--ink-3); }

@media (max-width: 820px) {
  .expert-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .header-nav a { padding: 6px 9px; font-size: 12.5px; }
  .brand-text span { display: none; }
}
