/* トレーニング種目（/exercise/・/exercise/<slug>/）。色は gs-shell.css の変数だけ。
   入口は白いカードの格子（トップと同じ密度）、種目ページは紙（body.gs-paper）の上に定義リストと節。 */
.ex { padding: 8px 0 32px; }
.ex-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 16px 0 14px; }
.ex-head h1 { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.ex-h1-n { margin-left: 10px; font-size: .95rem; font-weight: 700; color: var(--mute); }
.ex-search { display: flex; flex: 1 1 320px; max-width: 520px; margin-left: auto; overflow: hidden; border: 2px solid var(--g); border-radius: 999px; background: var(--card); }
.ex-search:focus-within { box-shadow: 0 0 0 3px rgba(15, 118, 110, .22); }
.ex-search input { flex: 1; min-width: 0; padding: 9px 16px; border: 0; outline: 0; font: inherit; font-size: 16px; background: transparent; color: var(--ink); }
.ex-search button { flex: 0 0 auto; padding: 0 20px; border: 0; background: var(--g); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.ex-search button:hover { background: var(--g-dark); }

.ex-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.ex-filters-eq { margin-bottom: 18px; }
.ex-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--tint); color: var(--g); font-size: .86rem; font-weight: 700; line-height: 1.6; text-decoration: none; border: 1px solid transparent; }
.ex-chip.is-plain { background: var(--card); border-color: var(--line); color: var(--ink); }
.ex-chip small { font-size: .72rem; font-weight: 500; color: var(--mute); }
.ex-chip:hover { border-color: var(--g); color: var(--g); }
.ex-chip.is-on { background: var(--g); border-color: var(--g); color: #fff; }
.ex-chip.is-on small { color: rgba(255, 255, 255, .85); }
.ex-count { margin: 0 0 12px; font-size: .9rem; color: var(--mute); }
.ex-empty { padding: 32px 0; text-align: center; color: var(--mute); }

.ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ex-card { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); text-decoration: none; transition: border-color .15s; min-width: 0; }
.ex-card:hover { border-color: var(--g); color: var(--ink); }
.ex-card-top { display: flex; flex-wrap: wrap; gap: 4px; min-height: 1.2em; }
.ex-tag { display: inline-block; padding: 0 7px; border-radius: 4px; background: var(--y-soft); color: var(--y-deep); font-size: .72rem; font-weight: 700; line-height: 1.7; white-space: nowrap; }
.ex-tag.is-plain { background: var(--soft); color: var(--mute); }
.ex-card-name { font-weight: 800; font-size: 1.02rem; line-height: 1.4; }
.ex-card-en { font-size: .76rem; color: var(--mute); }
.ex-card-row { font-size: .82rem; line-height: 1.5; color: var(--ink); }
.ex-card-row .k { display: inline-block; min-width: 3.2em; margin-right: 6px; font-size: .72rem; font-weight: 700; color: var(--g); }
@media (min-width: 640px) { .ex-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .ex-grid { grid-template-columns: repeat(4, 1fr); } }

/* ===== 種目ページ（紙の上） ===== */
.ex-detail { max-width: 900px; margin: 0 auto; padding: 20px 28px 40px; }
.ex-d-head h1 { margin: 6px 0 2px; font-size: 1.9rem; font-weight: 800; line-height: 1.3; color: var(--ink); }
.ex-d-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.ex-d-en { margin: 0 0 12px; font-size: .95rem; color: var(--mute); }
.ex-d-summary { margin: 0 0 18px; font-size: 1.05rem; line-height: 1.8; }
/* 動画（YouTube の埋め込み。最初はサムネイルだけ置き、クリックで youtube-nocookie の iframe に差し替える ＝ static/js/exercise.js） */
.ex-videos { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 0 22px; }
.ex-video { min-width: 0; }
.ex-video-play { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--ink); cursor: pointer; }
.ex-video-play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ex-video-ic { position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px; border-radius: 12px; background: rgba(16, 36, 43, .78); }
.ex-video-ic::after { content: ""; position: absolute; left: 26px; top: 12px; border-style: solid; border-width: 10px 0 10px 16px; border-color: transparent transparent transparent #fff; }
.ex-video-play:hover .ex-video-ic { background: var(--s-ink); }
.ex-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }
.ex-video-cap { display: flex; flex-wrap: wrap; gap: 2px 10px; margin: 6px 2px 0; font-size: .84rem; line-height: 1.5; }
.ex-video-title { font-weight: 700; color: var(--ink); }
.ex-video-ch { color: var(--mute); text-decoration: none; white-space: nowrap; }
.ex-video-ch:hover { color: var(--g); text-decoration: underline; }
.ex-chip.is-video, .ex-tag.is-video { background: var(--s-soft); color: var(--s-ink); }
.ex-chip.is-video.is-on { background: var(--s-ink); color: #fff; }
@media (min-width: 640px) {
  .ex-videos { grid-template-columns: 2fr 1fr; grid-auto-rows: min-content; }
  .ex-video.is-main { grid-row: span 2; }
  .ex-video:not(.is-main) .ex-video-cap { font-size: .78rem; }
  .ex-video:not(.is-main) .ex-video-ic { transform: scale(.7); }
}

.ex-facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--gs-card); overflow: hidden; }
.ex-facts > div { display: grid; grid-template-columns: 9.5em 1fr; gap: 8px 14px; align-items: baseline; padding: 10px 16px; border-top: 1px solid var(--line); }
.ex-facts > div:first-child { border-top: 0; }
.ex-facts dt { margin: 0; font-size: .82rem; font-weight: 700; color: var(--g); }
.ex-facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .95rem; }
.ex-sec { margin: 0 0 22px; }
.ex-sec h2 { margin: 0 0 8px; padding-left: 10px; border-left: 4px solid var(--brand); font-size: 1.1rem; font-weight: 800; color: var(--ink); }
.ex-cues { margin: 0; padding-left: 1.4em; line-height: 1.8; }
.ex-inline { margin: 0; line-height: 1.8; }
.ex-links { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ex-links li { display: inline-flex; align-items: baseline; gap: 6px; }
.ex-links a { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--tint); color: var(--g); font-size: .9rem; font-weight: 700; text-decoration: none; }
.ex-links a:hover { background: var(--g); color: #fff; }
.ex-links small { font-size: .74rem; color: var(--mute); }
.ex-sources ol { margin: 0; padding-left: 1.4em; font-size: .86rem; line-height: 1.8; color: var(--mute); }
.ex-sources a { color: var(--g); }
.ex-back { margin: 28px 0 0; font-weight: 700; }
@media (max-width: 767px) {
  .ex-head h1 { font-size: 1.3rem; }
  .ex-search { flex-basis: 100%; margin-left: 0; }
  .ex-detail { padding: 14px 16px 32px; }
  .ex-d-head h1 { font-size: 1.5rem; }
  .ex-facts > div { grid-template-columns: 1fr; gap: 4px; }
}
