/* ==========================================================================
   クチリピ /learn/ — 練習ページ専用スタイル
   LPのトークン（暖白 #FFF8EF / 朱赤 #A63828 / 墨 #24201F / 杏 #FFD09A）を継承。
   LPのstyle.cssは読み込まない。1ページ1ファイルで完結させ、読み込みを軽くする。
   主役は「赤シート」——英文が朱赤の板で隠れていて、押すと横に外れる。
   ========================================================================== */

:root {
  color-scheme: light;
  --red: #A63828;
  --paper: #FFF8EF;
  --ink: #24201F;
  --apricot: #FFD09A;

  --surface: var(--paper);
  --surface-2: #F6E7D6;
  --on-surface: var(--ink);
  --on-surface-variant: #5B504B;
  --outline: #7C6F68;
  --outline-variant: #E6D5C3;
  --accent: var(--red);
  --on-accent: var(--paper);
  --focus: var(--red);

  --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --font-en: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --measure: 34rem;
  --gutter: clamp(1.15rem, 5vw, 2.5rem);
  --shape-s: 8px;
  --shape-m: 14px;
  --shape-full: 999px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #1A1615;
    --surface-2: #231E1C;
    --on-surface: #F7EDE2;
    --on-surface-variant: #D2C3B8;
    --outline: #A29289;
    --outline-variant: #3D3431;
    --accent: #FF9E86;
    --on-accent: #24201F;
    --focus: #FFD09A;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1A1615;
  --surface-2: #231E1C;
  --on-surface: #F7EDE2;
  --on-surface-variant: #D2C3B8;
  --outline: #A29289;
  --outline-variant: #3D3431;
  --accent: #FF9E86;
  --on-accent: #24201F;
  --focus: #FFD09A;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* .btn の display が UA の [hidden] を打ち消すため、明示的に優先させる。
   JSが動かない環境では、練習のボタン類は出さずに答えをそのまま読ませる。 */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.9;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: from-font; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--apricot); color: var(--ink); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 20;
  background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: 0 0 var(--shape-s) 0;
}
.skip-link:focus { left: 0; }

.col { width: 100%; max-width: var(--measure); margin-inline: auto; padding-inline: var(--gutter); }
.col-wide { max-width: calc(var(--measure) + 8rem); }

/* ---------- masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface);
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; row-gap: .35rem;
  min-height: 3.75rem; padding-block: .5rem;
}
.masthead a { text-decoration: none; }
.masthead-brand { display: inline-flex; align-items: center; }
.masthead-brand img { width: 126px; height: 30px; display: block; }
.masthead-links { display: flex; gap: clamp(.9rem, 3vw, 1.5rem); font-size: .9375rem; }
.masthead-links a { white-space: nowrap; color: var(--on-surface-variant); text-decoration: underline; text-decoration-color: var(--outline-variant); }
.masthead-links a:hover { color: var(--on-surface); }

/* ---------- breadcrumb ---------- */
.crumb { font-size: .8125rem; color: var(--on-surface-variant); margin: 1.5rem auto .25rem; line-height: 1.7; }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.crumb li + li::before { content: "／"; margin-right: .4rem; color: var(--outline); }
.crumb a { color: inherit; }

/* ---------- headings ---------- */
h1 {
  font-size: clamp(1.9rem, 1.25rem + 2.6vw, 3rem);
  line-height: 1.24;
  letter-spacing: -.01em;
  font-weight: 800;
  margin: .6rem 0 1rem;
  text-wrap: balance;
}
h2 {
  font-size: clamp(1.3rem, 1.08rem + .9vw, 1.75rem);
  line-height: 1.45;
  font-weight: 800;
  letter-spacing: -.005em;
  margin: 3.25rem 0 1rem;
  padding-top: 1.1rem;
  border-top: 3px solid var(--accent);
}
h3 {
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 700;
  margin: 2rem 0 .5rem;
}
p { margin: 0 0 1.2rem; }

.lede {
  font-size: 1.125rem;
  color: var(--on-surface-variant);
  margin-bottom: 2rem;
}
.byline {
  font-size: .8125rem;
  color: var(--on-surface-variant);
  border-left: 3px solid var(--outline-variant);
  padding-left: .8rem;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

/* ---------- prose bits ---------- */
.prose ul, .prose ol { margin: 0 0 1.4rem; padding-left: 1.3rem; }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--accent); }

.steps { list-style: none; padding: 0; margin: 0 0 1.75rem; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 2.6rem 1fr; gap: .1rem .75rem;
  padding: .7rem 0; border-bottom: 1px solid var(--outline-variant);
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--font-en); font-size: 1.5rem; line-height: 1.3;
  color: var(--accent); font-weight: 700;
}
.steps b { font-weight: 700; }
.steps span { grid-column: 2; color: var(--on-surface-variant); font-size: .9375rem; line-height: 1.75; }

.note {
  background: var(--surface-2);
  border-radius: var(--shape-m);
  padding: 1.1rem 1.25rem;
  font-size: .9375rem;
  line-height: 1.8;
  margin: 0 0 1.75rem;
}
.note p:last-child { margin-bottom: 0; }
.note b { color: var(--accent); }

/* ---------- 練習：赤シート ---------- */
.drill-head { display: flex; align-items: flex-end; gap: 1rem; }
.drill-head h2 { flex: 1; }
.drill-head img { width: 84px; height: 84px; flex: none; margin-bottom: .4rem; }

.drill {
  border: 1px solid var(--outline-variant);
  border-left: 6px solid var(--accent);
  border-radius: 0 var(--shape-m) var(--shape-m) 0;
  padding: 1.15rem 1.15rem 1rem;
  margin: 0 0 1.25rem;
  background: var(--surface);
}
.drill__ja {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.75;
  margin: 0 0 .25rem;
}
.drill__scene {
  font-size: .8125rem;
  color: var(--on-surface-variant);
  margin: 0 0 .9rem;
  line-height: 1.7;
}
.drill__slot { position: relative; }
.drill__slot::after {
  content: "";
  position: absolute; inset: -.35rem -.5rem;
  border-radius: var(--shape-s);
  background:
    repeating-linear-gradient(135deg, rgb(255 255 255 / .07) 0 6px, transparent 6px 12px),
    var(--red);
  transform: translateX(calc(-100% - 1.5rem));
  opacity: 0;
  pointer-events: none;
  transition: transform .34s cubic-bezier(.2, 0, 0, 1), opacity .16s linear .18s;
}
.drill.is-covered .drill__slot::after {
  transform: translateX(0);
  opacity: 1;
  transition: transform .34s cubic-bezier(.2, 0, 0, 1), opacity .01s linear;
}
.drill.is-covered .drill__reveal { visibility: hidden; }

.drill__en {
  font-family: var(--font-en);
  font-size: 1.3125rem;
  line-height: 1.55;
  margin: 0 0 .5rem;
}
.drill__why {
  font-size: .9375rem;
  line-height: 1.8;
  color: var(--on-surface-variant);
  margin: 0;
}
.drill__why b { color: var(--on-surface); font-weight: 700; }
.drill__why code {
  font-family: var(--font-en);
  font-size: 1em;
  background: var(--surface-2);
  padding: 0 .25em;
  border-radius: 4px;
}

.drill__bar { margin-top: .9rem; }
.drill__reset { margin: 1.75rem 0 0; }
/* 1つのボタンで2つの状態。ラベルはHTML側に置き、表示だけCSSで切り替える */
button[aria-expanded="false"] .lbl-hide,
button[aria-expanded="true"] .lbl-show { display: none; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-size: .9375rem; font-weight: 700; line-height: 1.4;
  padding: .6rem 1.1rem;
  min-height: 44px;
  border-radius: var(--shape-full);
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .14s linear, color .14s linear;
}
.btn:hover { background: var(--accent); color: var(--on-accent); }
.btn-solid { background: var(--accent); color: var(--on-accent); }
.btn-solid:hover { filter: brightness(1.08); }
.btn-quiet { border-color: var(--outline-variant); color: var(--on-surface-variant); }
.btn-quiet:hover { background: var(--surface-2); color: var(--on-surface); }
.btn-lg { font-size: 1.0625rem; padding: .85rem 1.5rem; }

/* ---------- 申し込み ---------- */
.offer {
  border: 2px solid var(--accent);
  border-radius: var(--shape-m);
  padding: 1.4rem 1.25rem;
  margin: 2.5rem 0;
}
.offer h2 { margin-top: 0; border-top: 0; padding-top: 0; font-size: 1.25rem; }
.offer p { margin-bottom: .9rem; }
.offer .price { font-size: 1.0625rem; font-weight: 700; }
.offer .fine { font-size: .8125rem; color: var(--on-surface-variant); line-height: 1.75; margin-bottom: 0; }
.offer .btn { margin-bottom: .9rem; }

/* ---------- 次に読むもの ---------- */
.next { list-style: none; padding: 0; margin: 0 0 2rem; }
.next li { border-bottom: 1px solid var(--outline-variant); }
.next a { display: block; padding: 1rem 0; text-decoration: none; }
.next a:hover .next__t { text-decoration: underline; text-decoration-color: var(--accent); }
.next__t { display: block; font-weight: 700; line-height: 1.6; }
.next__d { display: block; font-size: .875rem; color: var(--on-surface-variant); line-height: 1.75; }

/* ---------- 出典 ---------- */
.refs { font-size: .875rem; line-height: 1.8; color: var(--on-surface-variant); }
.refs ol { padding-left: 1.2rem; }
.refs li { margin-bottom: .6rem; }

/* ---------- footer ---------- */
.learn-footer {
  margin-top: 4rem;
  padding: 2.25rem 0 3rem;
  border-top: 1px solid var(--outline-variant);
  font-size: .875rem;
  color: var(--on-surface-variant);
}
.learn-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; padding: 0; margin: 0 0 1rem; }
.learn-footer a { color: inherit; }
.learn-footer p { margin: 0; line-height: 1.8; }

/* ---------- hub ---------- */
.hub-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.hub-list > li { border-top: 3px solid var(--accent); padding: 1.25rem 0 1.5rem; }
.hub-list h3 { margin: 0 0 .4rem; border-top: 0; padding-top: 0; font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); }
.hub-list h3 a { text-decoration: none; }
.hub-list h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.hub-list p { margin: 0 0 .65rem; font-size: .9375rem; line-height: 1.8; color: var(--on-surface-variant); }
.hub-list .tag { font-size: .8125rem; color: var(--on-surface-variant); }
.hub-intro { display: flex; gap: 1.25rem; align-items: flex-start; }
.hub-intro img { width: 104px; height: 104px; flex: none; }

@media (max-width: 30rem) {
  .masthead-brand img { width: 104px; height: 25px; }
  .masthead-links { width: 100%; font-size: .875rem; }
  .drill-head { display: block; }
  .drill-head img { width: 64px; height: 64px; margin: 0 0 .25rem; }
  .hub-intro img { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .masthead-links, .drill__bar, .drill__reset, .offer .btn { display: none; }
  .drill.is-covered .drill__slot::after { display: none; }
  .drill.is-covered .drill__reveal { visibility: visible; }
}
