/* ゴルフ数値の教科書 — ライト=方眼ノート / ダーク=黒板 */

:root {
  --paper: #F6F4EC;
  --panel: #FCFBF6;
  --grid-line: rgba(46, 125, 79, 0.07);
  --ink: #1C2B24;
  --muted: #5F6E64;
  --border: #E1DCC8;
  --turf: #2E7D4F;
  --turf-soft: rgba(46, 125, 79, 0.12);
  --redpen: #C93A22;
  --blue: #2B5FD9;
  --sand: #B07D10;
  --shadow: 0 10px 34px rgba(28, 43, 36, 0.14);
  --font-display: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
}

:root[data-theme="dark"] {
  --paper: #10291F;
  --panel: #163327;
  --grid-line: rgba(237, 244, 239, 0.05);
  --ink: #EDF4EF;
  --muted: #9DB3A6;
  --border: #2A4A3B;
  --turf: #7FC79E;
  --turf-soft: rgba(127, 199, 158, 0.14);
  --redpen: #F09B85;
  --blue: #9DB9F5;
  --sand: #E0B75C;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  line-height: 1.75;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 18px 90px; }

/* ===== ヘッダー ===== */
.site {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 14px; gap: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 9px; flex: none;
  background: var(--turf); color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
}
:root[data-theme="dark"] .brand .logo { color: #10291F; }
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .sub { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.22em; color: var(--muted); font-weight: 400; }
.header-right { display: flex; align-items: center; gap: 8px; flex: none; }
.nav-link {
  text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 700;
  padding: 7px 14px; border: 1.5px solid var(--border); border-radius: 999px; background: var(--panel);
}
.nav-link.active { background: var(--turf); border-color: var(--turf); color: #fff; }
:root[data-theme="dark"] .nav-link.active { color: #10291F; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--panel); color: var(--ink); font-size: 15px; cursor: pointer;
}

/* ===== ヒーロー ===== */
.hero { padding: 34px 0 10px; text-align: center; }
.eyebrow {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.34em;
  color: var(--turf); font-weight: 700;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(30px, 6.4vw, 46px); letter-spacing: 0.05em;
  margin: 10px 0 4px; line-height: 1.3;
  display: inline-block; position: relative;
}
/* 朱書き（赤ペン）のアンダーライン */
.hero h1::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -6px; height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M4 8 C 60 2, 150 10, 296 5' fill='none' stroke='%23C93A22' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 100% 100%; opacity: 0.85;
}
.hero p { max-width: 620px; margin: 16px auto 0; color: var(--muted); font-size: 14.5px; }
.hero .rh-note { font-size: 12px; margin-top: 8px; color: var(--muted); }
.hero .rh-note strong { color: var(--redpen); font-weight: 700; }

/* ===== 検索 ===== */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 22px auto 0;
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 12px 16px; box-shadow: 0 3px 14px rgba(28,43,36,0.06);
}
.searchbar:focus-within { border-color: var(--turf); }
.searchbar .glass { color: var(--muted); font-size: 17px; }
.searchbar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 16px; color: var(--ink);
}
.searchbar input::placeholder { color: var(--muted); opacity: 0.7; }

/* ===== カテゴリチップ ===== */
.chips {
  display: flex; gap: 8px; margin: 24px 0 6px;
  overflow-x: auto; padding-bottom: 8px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--panel); color: var(--ink);
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
}
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ===== セクション見出し ===== */
.section-head {
  display: flex; align-items: baseline; gap: 10px; margin: 26px 0 14px;
}
.section-head h2 { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: 0.04em; }
.section-head .en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--muted); }

/* ===== カードグリッド ===== */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  margin-top: 18px;
}
.card {
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 16px;
  padding: 18px 18px 16px; cursor: pointer; position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--turf); }
.card .meta { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.card .dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }
.card .cat-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.06em; }
.card .name { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.4; }
.card .en { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; margin-top: 1px; }
.card .role { font-size: 13.5px; color: var(--ink); margin-top: 9px; opacity: 0.92; }
.card .tap { position: absolute; right: 14px; bottom: 12px; font-size: 11px; color: var(--muted); }

/* 基本の5つ カード */
.card.basic { border-color: var(--turf); background: linear-gradient(160deg, var(--turf-soft), var(--panel) 55%); }
.card.basic .badge {
  position: absolute; top: -12px; left: 14px;
  background: var(--redpen); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(201,58,34,0.4);
}
.card.basic .must { font-size: 10.5px; color: var(--redpen); font-weight: 700; letter-spacing: 0.08em; }

.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 46px 0; font-size: 14px; }

/* ===== モーダル ===== */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(16, 30, 24, 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.18s ease;
}
.modal {
  background: var(--paper); width: 100%; max-width: 680px;
  max-height: 88dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-radius: 22px 22px 0 0; border: 1.5px solid var(--border); border-bottom: none;
  animation: slideUp 0.22s ease;
}
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 30px; }
  .modal { border-radius: 22px; border-bottom: 1.5px solid var(--border); max-height: 86vh; }
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0.6; } }

.modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 12px; background: var(--paper);
  border-bottom: 1.5px solid var(--border);
}
.modal-head .dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }
.modal-head .name { font-family: var(--font-display); font-size: 20px; font-weight: 800; flex: 1; line-height: 1.3; }
.modal-head .en-tag {
  font-family: var(--font-mono); font-size: 10px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; flex: none;
}
.modal-close {
  flex: none; width: 32px; height: 32px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--panel); color: var(--ink); font-size: 14px;
}
.modal-body { padding: 6px 20px 30px; }

.section-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.24em; color: var(--turf); margin: 20px 0 7px;
}
.modal-body .role { font-size: 16.5px; font-weight: 700; line-height: 1.65; }
.modal-body .desc { font-size: 14.5px; line-height: 1.9; }

.figure { margin-top: 6px; }
.figure img {
  width: 100%; height: auto; border-radius: 14px; display: block;
  border: 1.5px solid var(--border); background: #FCFBF6;
}
.figure .caption { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.6; }
.figure .caption a { color: var(--muted); }

.values { display: grid; gap: 8px; }
.values .row {
  display: flex; gap: 12px; align-items: baseline;
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 10px;
  padding: 9px 13px;
}
.values .k { font-size: 12px; font-weight: 700; color: var(--muted); flex: none; min-width: 92px; }
.values .v { font-size: 13.5px; font-weight: 700; font-feature-settings: "tnum"; }

.tipbox {
  margin-top: 20px; border-left: 4px solid var(--redpen);
  background: var(--panel); border-radius: 0 12px 12px 0;
  padding: 12px 15px; font-size: 13.5px; line-height: 1.85;
}
.tipbox .tipbox-label {
  display: block; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.2em; color: var(--redpen); margin-bottom: 4px;
}

.related { display: flex; flex-wrap: wrap; gap: 8px; }
.related button {
  border: 1.5px solid var(--border); background: var(--panel); color: var(--ink);
  font-family: var(--font-body); font-size: 12.5px; font-weight: 700;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
}
.related button:hover { border-color: var(--turf); color: var(--turf); }

.doclinks { display: flex; flex-direction: column; gap: 7px; }
.doclink {
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  border: 1.5px solid var(--border); background: var(--panel);
  border-radius: 10px; padding: 8px 13px; line-height: 1.5;
}
.doclink:hover { border-color: var(--turf); color: var(--turf); }

/* ===== 講座ページ ===== */
.toc {
  max-width: 620px; margin: 26px auto 0;
  background: var(--panel); border: 1.5px solid var(--border); border-radius: 16px;
  padding: 18px 22px;
}
.toc .toc-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.24em; color: var(--turf); font-weight: 700; margin-bottom: 8px; }
.toc a {
  display: block; color: var(--ink); text-decoration: none;
  padding: 7px 2px; font-size: 14px; font-weight: 700;
  border-bottom: 1px dashed var(--border);
}
.toc a:last-child { border-bottom: none; }
.toc a:hover { color: var(--turf); }
.toc a .ch-no { font-family: var(--font-mono); font-size: 11px; color: var(--redpen); margin-right: 9px; }

.chapter { margin-top: 54px; }
.chapter .ch-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; color: var(--redpen); font-weight: 700; }
.chapter h2 {
  font-family: var(--font-display); font-size: clamp(21px, 4.6vw, 27px);
  font-weight: 800; letter-spacing: 0.03em; margin: 8px 0 10px; line-height: 1.45;
}
.chapter .ch-lead { color: var(--muted); font-size: 14.5px; max-width: 640px; }
.chapter .figure { margin: 20px 0 4px; }
.step { margin-top: 26px; max-width: 660px; }
.step h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 7px; }
.step h3::before { content: "▸ "; color: var(--turf); }
.step p { font-size: 14.5px; line-height: 1.95; }
.pointbox {
  margin-top: 28px; max-width: 660px;
  border: 1.5px solid var(--turf); border-radius: 14px;
  background: var(--turf-soft); padding: 15px 18px;
}
.pointbox .p-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.22em; color: var(--turf); display: block; margin-bottom: 5px;
}
.pointbox p { font-size: 14px; line-height: 1.85; font-weight: 500; }

.outro {
  margin-top: 60px; text-align: center;
  border-top: 1.5px solid var(--border); padding-top: 40px;
}
.outro h2 { font-family: var(--font-display); font-size: 21px; font-weight: 800; margin-bottom: 12px; }
.outro p { max-width: 620px; margin: 0 auto; font-size: 14.5px; line-height: 2; text-align: left; }
.outro .to-dict {
  display: inline-block; margin-top: 24px; text-decoration: none;
  background: var(--turf); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 26px; border-radius: 999px;
}
:root[data-theme="dark"] .outro .to-dict { color: #10291F; }

/* ===== フッター ===== */
.footer {
  margin-top: 70px; border-top: 1.5px solid var(--border); padding-top: 22px;
  font-size: 11.5px; color: var(--muted); line-height: 1.9;
}
.footer a { color: var(--muted); }
