/* =========================================================
   基礎から固める英文法 — page styles (extends kaishaku.css)
   ========================================================= */

/* ---- unit selector ---- */
.unit-bar { margin: 0 0 8px; }
.unit-bar-label { font-family: var(--jp); font-weight: 800; color: var(--ink-2); font-size: 14px; margin: 0 2px 10px; display: flex; align-items: center; gap: .5em; }
.unit-bar-label .tri { color: var(--camel); }

.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.unit-tile {
  text-align: left; cursor: pointer; border: 1.5px solid var(--line); background: var(--card);
  border-radius: var(--r); padding: 14px 16px; transition: all .16s; display: flex; flex-direction: column; gap: 6px;
}
.unit-tile:hover { border-color: var(--camel); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.unit-tile.on { border-color: var(--brown); background: #fff8ec; box-shadow: var(--shadow-sm); }
.unit-tile .ut-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.unit-tile .ut-num { font-family: var(--en); font-weight: 800; color: var(--camel); font-size: 13px; }
.unit-tile .ut-tag { font-family: var(--jp); font-weight: 800; font-size: 10.5px; border-radius: var(--r-pill); padding: .12em .7em; }
.unit-tile .ut-title { font-family: var(--jp); font-weight: 800; color: var(--ink); font-size: 16px; line-height: 1.35; }

/* ---- unit header ---- */
.unit-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  background: var(--card); border-radius: var(--r) var(--r) 0 0; box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 30px); margin-top: 22px; border-bottom: 2px solid var(--peach);
}
.unit-head-l { display: flex; align-items: flex-start; gap: 16px; }
.unit-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--peach-2); display: grid; place-items: center; font-size: 24px; flex: 0 0 auto; }
.unit-head h2 { font-family: var(--jp); font-weight: 900; color: var(--ink); font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 .25em; }
.unit-head .uh-num { font-family: var(--en); font-weight: 800; color: var(--camel); font-size: 13px; letter-spacing: .04em; }
.unit-head .uh-lead { margin: .4em 0 0; color: var(--body); font-size: 14.5px; line-height: 1.7; max-width: 42em; }
.unit-head .ut-tag { font-family: var(--jp); font-weight: 800; font-size: 12px; border-radius: var(--r-pill); padding: .25em .9em; white-space: nowrap; }

/* ---- section sub-tabs ---- */
.sec-tabs { display: flex; gap: 6px; background: var(--card); padding: 0 clamp(14px,3vw,24px) 0; box-shadow: var(--shadow); border-radius: 0; margin: 0; }
.sec-tab {
  font-family: var(--jp); font-weight: 800; font-size: 15px; cursor: pointer;
  border: none; background: transparent; color: var(--muted); padding: 16px 6px; position: relative;
  display: inline-flex; align-items: center; gap: .45em; transition: color .16s; margin-right: 18px;
}
.sec-tab .st-ico { font-size: 16px; }
.sec-tab:hover { color: var(--ink-2); }
.sec-tab.on { color: var(--brown); }
.sec-tab.on::after { content: ''; position: absolute; left: 0; right: 18px; bottom: 0; height: 3px; background: var(--brown); border-radius: 3px 3px 0 0; }
.sec-tab:last-child.on::after { right: 0; }

/* ---- section body ---- */
.sec-body { background: var(--card); border-radius: 0 0 var(--r) var(--r); box-shadow: var(--shadow); padding: clamp(22px, 4vw, 34px); }

/* explanation */
.expl-block { margin-bottom: 22px; }
.expl-block:last-child { margin-bottom: 0; }
.expl-h { font-family: var(--jp); font-weight: 800; color: var(--ink); font-size: 18px; margin: 0 0 .4em; }
.expl-p { margin: 0; color: var(--body); font-size: 15.5px; line-height: 1.85; }

.section-tag { display: inline-flex; align-items: center; gap: .5em; font-family: var(--jp); font-weight: 800; font-size: 13px; color: var(--brown); margin-bottom: 16px; }
.section-tag .stg-ico { font-size: 16px; }

/* KEY POINTS */
.keypoints { margin-top: 24px; background: var(--paper-2); border-radius: var(--r); padding: 22px 24px; }
.keypoints-label { font-family: var(--en); font-weight: 800; letter-spacing: .14em; color: var(--camel); font-size: 13px; margin: 0 0 16px; }
.kp-item { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.kp-item:first-of-type { border-top: none; padding-top: 0; }
.kp-mark { color: var(--camel); font-size: 18px; line-height: 1.5; flex: 0 0 auto; }
.kp-body { flex: 1; min-width: 0; }
.kp-h { font-family: var(--jp); font-weight: 800; color: var(--ink); font-size: 16px; margin: 0 0 .35em; }
.kp-lines { display: flex; flex-direction: column; gap: 4px; }
.kp-line { font-family: var(--jp); color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }

/* examples (例文で確認 — 色分け英文解釈) */
.ex-list { display: flex; flex-direction: column; gap: 18px; }
.ex-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); padding: clamp(18px,3vw,26px); }

/* legend */
.intp-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.intp-leg-item { display: inline-flex; align-items: center; gap: .45em; }
.intp-leg-dot { width: 22px; height: 22px; border-radius: 6px; color: #fff; font-family: var(--en); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.intp-leg-jp { font-family: var(--jp); font-weight: 700; font-size: 13px; color: var(--ink-2); }

/* full sentence */
.intp-full { font-family: var(--en); font-weight: 500; color: var(--ink); font-size: clamp(17px, 2.4vw, 22px); line-height: 1.5; margin: 0 0 16px; }

/* chunk line with role labels below */
.intp-en { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 8px; margin-bottom: 14px; }
.intp-chunk { display: inline-flex; flex-direction: column; align-items: center; gap: 5px; }
.intp-word {
  position: relative; display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--en); font-weight: 700; font-size: clamp(16px, 2.2vw, 20px);
  border-radius: 8px; padding: 5px 10px 6px; line-height: 1.3;
}
.intp-tag { font-family: var(--en); font-weight: 800; font-size: 10px; color: #fff; border-radius: 4px; padding: 1px 5px; }
.intp-role { font-family: var(--jp); font-weight: 800; font-size: 11.5px; }

/* shorthand note */
.intp-note { font-family: var(--jp); color: var(--muted); font-size: 13px; margin: 0 0 14px; line-height: 1.6; }

/* translation */
.intp-jp { background: var(--peach-2); border-left: 5px solid var(--camel); border-radius: var(--r-sm); padding: 12px 16px; color: var(--ink); font-weight: 700; font-size: 15.5px; line-height: 1.6; margin-bottom: 14px; }

/* 📌 pin (yellow) */
.intp-pin { display: flex; gap: 10px; background: #fdf6e3; border-left: 4px solid #e0a93f; border-radius: var(--r-sm); padding: 13px 16px; margin-bottom: 12px; }
.intp-pin .pin-ico { flex: 0 0 auto; }
.intp-pin span:last-child { font-family: var(--jp); font-weight: 700; color: var(--ink); font-size: 14px; line-height: 1.7; }

/* 📐 struct (purple, nested) */
.intp-struct { margin-bottom: 12px; }
.struct-head { display: flex; align-items: center; gap: .5em; font-family: var(--jp); font-weight: 800; color: #7a5aa6; font-size: 13.5px; margin-bottom: 8px; }
.struct-box { background: #f4eefb; border-left: 4px solid #9b7bc4; border-radius: var(--r-sm); padding: 14px 16px; }
.struct-label { font-family: var(--jp); font-weight: 800; color: #5d3f88; font-size: 14px; margin-bottom: 8px; }
.struct-rows { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.struct-row { font-family: var(--en); color: var(--ink-2); font-size: 14px; }
.struct-row b { font-family: var(--en); color: #7a5aa6; font-weight: 800; }
.struct-jp { font-family: var(--jp); color: #5d3f88; font-weight: 700; font-size: 14px; }

/* 🎯 point (blue) */
.intp-point { display: flex; gap: 10px; background: #e9f1f8; border-left: 4px solid #5b8fc9; border-radius: var(--r-sm); padding: 13px 16px; }
.intp-point .pt-ico { flex: 0 0 auto; }
.intp-point span:last-child { font-family: var(--jp); font-weight: 700; color: var(--ink); font-size: 14px; line-height: 1.7; }

/* practice quiz */
.gq-stem { font-family: var(--en); font-weight: 600; font-size: clamp(18px, 2.8vw, 24px); color: #43301f; line-height: 1.5; margin-bottom: 18px; }
.gq-blank { font-weight: 800; color: var(--brown); border-bottom: 3px solid var(--camel); padding: 0 .3em; }
.choice.en-choice .ch-word { font-family: var(--en); font-size: 18px; }

/* nav between units */
.unit-foot-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.ufn-btn { font-family: var(--jp); font-weight: 700; font-size: 14px; cursor: pointer; border: 1.5px solid var(--camel-soft); background: var(--card); color: var(--ink-2); border-radius: var(--r-pill); padding: .65em 1.4em; transition: all .15s; }
.ufn-btn:hover { background: var(--peach-2); }
.ufn-btn:disabled { opacity: .4; cursor: default; }
.ufn-btn.next { background: var(--brown); color: #fff; border-color: var(--brown); }

@media (max-width: 560px) {
  .unit-grid { grid-template-columns: repeat(2, 1fr); }
  .unit-head { flex-direction: column; }
  .sec-tab { font-size: 14px; margin-right: 12px; }
}
