/* レイアウト（ui-ux-pro-max の「ミニマル・スイス」の方針。2026-10-23 に入れた）。
   用語ドリルの各サイトで同じファイルを使う。色は各サイトの style.css の --mark などをそのまま使う。
   style.css のあとに読み込み、上書きする。 */
:root {
  --f-display: "Noto Sans JP", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic", sans-serif;
  --f-body: "Noto Sans JP", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic", "Meiryo", sans-serif;
  --wrap: 1120px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 42, 46, .06), 0 4px 16px rgba(29, 42, 46, .05);
  --head-h: 60px;
}
@media (prefers-color-scheme: dark) { :root { --shadow: 0 1px 2px rgba(0, 0, 0, .4); } }
body { font-size: 16px; line-height: 1.75; letter-spacing: .01em; }
h1, h2, h3 { letter-spacing: 0; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }

/* 本文へ移動（キーボードのときだけ見える） */
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* ---------- ヘッダー: 上に貼りつく・今いる場所に下線 ---------- */
.site-head { display: block; position: sticky; top: 0; z-index: 30; max-width: none; padding: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.site-nav { min-width: 0; }
.site-head-in { min-width: 0; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; min-height: var(--head-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 900; white-space: nowrap; }
.brand img { border-radius: 7px; }
.site-nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: nowrap; }
.site-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; font-size: .92rem; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color .15s, background .15s; }
.site-nav a:hover { color: var(--ink); background: var(--paper); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.site-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 1px; background: var(--mark); }

/* ---------- ボタン: 押しやすい高さ・アイコン ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 10px; transition: transform .1s, background .15s, border-color .15s; }
.btn:active { transform: translateY(1px); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sec-title { font-size: 1.35rem; font-weight: 900; margin: 0; display: flex; align-items: center; gap: 10px; }
.sec-title::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--mark); }

/* ---------- トップ: 何のサイトかを最初の画面で ---------- */
.hero { max-width: var(--wrap); margin: 0 auto; padding: 48px 24px 32px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.hero-eyebrow { margin: 0 0 10px; font-size: .85rem; font-weight: 700; color: var(--mark); letter-spacing: .06em; }
.hero h1 { margin: 0; font-size: clamp(1.75rem, 3.8vw, 2.7rem); font-weight: 900; line-height: 1.35; }
.hero h1 span { display: inline-block; }   /* 言葉のまとまりの途中で折り返さない */
.hero-lead { margin: 18px 0 0; font-size: 1.05rem; color: var(--muted); max-width: 36em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-cta .btn { padding-inline: 22px; }
.hero-stats { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 32px; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats b { font-size: 1.9rem; line-height: 1.1; color: var(--ink); }
.hero-stats span { font-size: .82rem; color: var(--muted); }
.hero-progress { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 22px 16px; }
.hero-progress h2 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.hero-progress-sub { margin: 2px 0 14px; font-size: .82rem; color: var(--muted); }
.hero-progress .fields { grid-template-columns: 1fr; gap: 4px; }
.hero-progress .frow { min-height: 48px; padding: 10px 12px; }
.hero-progress .frow .top { font-size: .95rem; }
.hero-progress .save-note { margin-top: 10px; }
/* 分野が多いサイト（「すべて」を入れて7行以上）は2列にして、縦に長くなりすぎないようにする */
.hero-progress .fields:has(.frow:nth-child(7)) { grid-template-columns: 1fr 1fr; }
.hero-progress .fields:has(.frow:nth-child(7)) .frow:first-child { grid-column: 1 / -1; }
.hero-progress .fields:has(.frow:nth-child(7)) .frow .top { font-size: .85rem; }

/* 学習する: 学び方はタブ、カードは中央に */
.study { max-width: var(--wrap); margin: 0 auto; padding: 24px 24px 8px; scroll-margin-top: calc(var(--head-h) + 8px); }
.study-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.study-body { max-width: 820px; margin: 0 auto; padding-top: 20px; display: flex; flex-direction: column; gap: 18px; }
.study-body .toolbar { border-bottom: 0; padding-bottom: 0; min-height: 0; }
.card { border-radius: var(--radius); box-shadow: var(--shadow); }
.choice { min-height: 52px; border-radius: 10px; }
@media (min-width: 860px) {
  .modes { flex-direction: row; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
  .mode { grid-template-columns: 22px auto; column-gap: 8px; padding: 6px 14px 6px 10px; min-height: 48px; border-radius: 9px; }
  .mode .bub { width: 22px; height: 13px; }
  .mode small { display: none; }
  .mode[aria-selected="true"] { background: var(--mark-soft); }
}

/* できること: 同じ大きさのカードを並べる */
.features { max-width: var(--wrap); margin: 0 auto; padding: 48px 24px 8px; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 18px; }
.feat { display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.feat:hover { border-color: var(--mark); box-shadow: var(--shadow); transform: translateY(-2px); }
.feat .ico { width: 28px; height: 28px; color: var(--mark); margin-bottom: 4px; }
.feat b { font-size: 1.05rem; }
.feat span { font-size: .9rem; color: var(--muted); flex: 1; }
.feat em { font-style: normal; font-size: .88rem; font-weight: 700; color: var(--mark); margin-top: 6px; }
.home-intro { margin-top: 56px; border-top: 1px solid var(--line); }
.intro-title { font-size: 1.5rem !important; border: 0 !important; margin-top: 32px !important; }
.intro-title small { display: block; font-size: .9rem; color: var(--muted); font-weight: 500; margin-top: 4px; }

/* ---------- 用語ページ: 本文と、右に「練習する」の欄 ---------- */
.term-wrap { max-width: var(--wrap); margin: 0 auto; padding: 24px 24px 0; }
.term-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; margin-top: 12px; }
.term-grid .prose { max-width: none; margin: 0; padding: 0; }
.term-main h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 900; margin: 6px 0 18px; }
.term-main .lead { font-size: 1.15rem; line-height: 1.8; border-radius: var(--radius); border-left: 4px solid var(--mark); }
.term-no { margin-left: 10px; color: var(--muted); font-size: .78rem; }
.term-side { position: sticky; top: calc(var(--head-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.side-card h2 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; }
.side-card .btn { width: 100%; justify-content: flex-start; padding-inline: 16px; }
.side-card .related li { padding: 8px 0; }
.side-card .related p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .82rem; }
.term-main .mini-quiz { margin-top: 32px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.term-main .mini-quiz h2 { margin-top: 0; }

/* スマホだけ、説明のすぐ下に練習のボタンを出す（右の欄は下に回るため） */
.cta-mobile { display: none; }
@media (max-width: 999px) {
  .cta-mobile { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
  .term-side .side-card:first-child { display: none; }
}

/* ---------- フッター ---------- */
.site-foot { max-width: var(--wrap); }
.site-foot nav a, .save-note button { display: inline-flex; align-items: center; min-height: 32px; }

/* ---------- スマホ ---------- */
@media (max-width: 999px) {
  .term-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .term-side { position: static; }
}
@media (max-width: 859px) {
  :root { --head-h: 56px; }
  .site-head-in { padding: 0 12px 0 16px; gap: 8px; flex-wrap: wrap; }
  .brand { min-height: var(--head-h); }
  /* メニューは横にすべらせる（ページ全体は横にはみ出さない） */
  .site-nav { margin: 0 -12px 0 -16px; width: calc(100% + 28px); padding: 0 8px 6px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-head { position: static; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 28px 16px 16px; gap: 24px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-stats { gap: 24px; }
  .study, .features, .term-wrap { padding-inline: 16px; }
  .study-head { border-bottom: 0; padding-bottom: 0; }
  .features { padding-top: 32px; }
}
@media (prefers-reduced-motion: reduce) { .feat, .btn, .site-nav a { transition: none; } .feat:hover { transform: none; } }
