﻿/* ============================================================
   RoadSafe — คู่มือการใช้งานออนไลน์ (Help/*.aspx)
   หน้าเหล่านี้สร้างด้วย Tools/Manual/build_help.py — แก้รูปแบบที่ไฟล์นี้ แก้เนื้อหาที่ docs/manual/*.md
   ============================================================ */

.rs-help {
  max-width: 72rem;
  margin: 0 auto;
  font-family: var(--rs-font-body);
  color: var(--rs-text-body);
  line-height: 1.75;
}
.rs-help h1, .rs-help h2, .rs-help h3, .rs-help h4 { font-family: var(--rs-font-heading); color: var(--rs-text); scroll-margin-top: calc(var(--rs-header-height) + 1rem); }
.rs-help h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
.rs-help h1 .bi { color: var(--rs-accent); }
.rs-help-crumb { margin-bottom: .75rem; font-size: .9rem; color: var(--rs-text-muted); }
.rs-help-crumb a { color: var(--rs-accent); text-decoration: none; }
.rs-help-crumb span { margin: 0 .35rem; }
.rs-help-head { margin-bottom: 1.25rem; }
.rs-help-sub { margin: 0 0 .5rem; color: var(--rs-text-muted); }
.rs-help-meta { font-size: .85rem; color: var(--rs-text-muted); }
.rs-help-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

.rs-help-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.rs-help-toc {
  position: sticky;
  top: calc(var(--rs-header-height) + 1rem);
  max-height: calc(100vh - var(--rs-header-height) - 2rem);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--rs-border-soft);
  border-radius: var(--rs-radius-md);
  background: var(--rs-surface);
  font-size: .9rem;
}
.rs-help-toc ol { margin: .5rem 0 1rem; padding-left: 1.2rem; }
.rs-help-toc li { margin-bottom: .3rem; }
.rs-help-toc a { color: var(--rs-text-body); text-decoration: none; }
.rs-help-toc a:hover, .rs-help-toc a.is-active { color: var(--rs-accent); font-weight: 600; }
.rs-help-other { display: flex; flex-direction: column; gap: .3rem; padding-top: .75rem; border-top: 1px solid var(--rs-border-soft); }
.rs-help-other a { color: var(--rs-accent); text-decoration: none; }

.rs-help-body {
  min-width: 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rs-border-soft);
  border-radius: var(--rs-radius-lg);
  background: var(--rs-surface);
  box-shadow: var(--rs-shadow-sm);
}
.rs-help-body h2 { margin: 2rem 0 .75rem; padding-bottom: .35rem; border-bottom: 2px solid var(--rs-accent-soft); font-size: 1.3rem; }
.rs-help-body h2:first-child { margin-top: 0; }
.rs-help-body h3 { margin: 1.5rem 0 .5rem; font-size: 1.1rem; }
.rs-help-body h4 { margin: 1.25rem 0 .4rem; font-size: 1rem; }
.rs-help-anchor { margin-left: .25rem; color: var(--rs-text-faint); text-decoration: none; opacity: 0; transition: opacity .15s; }
.rs-help-body h2:hover .rs-help-anchor,
.rs-help-body h3:hover .rs-help-anchor,
.rs-help-body h4:hover .rs-help-anchor,
.rs-help-anchor:focus { opacity: 1; }
.rs-help-body code { padding: .05rem .3rem; border-radius: .3rem; background: var(--rs-surface-soft); font-size: .88em; }
.rs-help-body ul, .rs-help-body ol { padding-left: 1.4rem; }

.rs-help-fig { margin: 1rem 0 .5rem; text-align: center; }
.rs-help-fig img { max-width: 100%; height: auto; border: 1px solid var(--rs-border); border-radius: var(--rs-radius-sm); box-shadow: var(--rs-shadow-sm); }
.rs-help-fig figcaption { margin-top: .4rem; font-size: .9rem; color: var(--rs-text-muted); }

/* หมายเลขสีชมพูให้ตรงกับหมุดบนภาพ (สีเดียวกับ Tools/Manual/shoot_help.ps1) */
.rs-help-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: .15rem;
  border-radius: 50%;
  background: #e11d74;
  color: #fff;
  font-family: var(--rs-font-heading);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
  vertical-align: .1em;
}
ul.rs-help-legend { list-style: none; padding-left: .25rem; }
ul.rs-help-legend > li { margin-bottom: .3rem; }

.rs-help-note { margin: 1rem 0; padding: .75rem 1rem; border-left: 4px solid var(--rs-accent); border-radius: 0 var(--rs-radius-sm) var(--rs-radius-sm) 0; background: var(--rs-primary-soft); }
.rs-help-scroll { overflow-x: auto; margin: 1rem 0; }
.rs-help-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rs-help-table th, .rs-help-table td { padding: .45rem .6rem; border: 1px solid var(--rs-border-soft); vertical-align: top; }
.rs-help-table th { background: var(--rs-surface-soft); color: var(--rs-text); text-align: left; }

.rs-help-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.rs-help-role {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--rs-border-soft);
  border-radius: var(--rs-radius-lg);
  background: var(--rs-surface);
  box-shadow: var(--rs-shadow-sm);
  color: var(--rs-text-body);
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.rs-help-role:hover { border-color: var(--rs-accent); box-shadow: var(--rs-shadow-md); color: var(--rs-text-body); }
.rs-help-role .bi { font-size: 1.8rem; color: var(--rs-accent); }
.rs-help-role > b { font-family: var(--rs-font-heading); font-size: 1.15rem; color: var(--rs-text); }
.rs-help-role span { font-size: .9rem; }
.rs-help-intro { padding: 1rem 1.25rem; border-radius: var(--rs-radius-md); background: var(--rs-surface-muted); }
.rs-help-intro p { margin: 0 0 .5rem; }
.rs-help-updated { color: var(--rs-text-muted); font-size: .85rem; }

/* ---- คลิปสอนใช้งาน (24 ต.ค. 2569 · Tools/Clips) — กล่องในหัวข้อคู่มือ + หน้ารวม Clips.aspx ---- */
.rs-help-clip { max-width: 45rem; margin: 1rem auto 1.25rem; }
.rs-help-clip video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--rs-radius-md); background: #0f1b33; box-shadow: var(--rs-shadow-sm); }
.rs-help-clip.is-portrait { max-width: 20rem; }
.rs-help-clip.is-portrait video { aspect-ratio: 390 / 844; }
.rs-help-clip figcaption { margin-top: .45rem; font-size: .88rem; color: var(--rs-text-muted); line-height: 1.6; }
.rs-help-clip figcaption b { color: var(--rs-text); }
.rs-help-clip figcaption .bi { color: var(--rs-accent); }
.rs-help-clip figcaption a { color: var(--rs-accent); }

.rs-help-role-clips { border-color: var(--rs-accent); background: var(--rs-primary-soft); }

.rs-help-clipset { margin-bottom: 1.75rem; }
.rs-help-clipset h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .75rem; font-size: 1.25rem; }
.rs-help-clipset h2 .bi { color: var(--rs-accent); }
.rs-help-clipset h2 span { font-family: var(--rs-font-body); font-size: .85rem; font-weight: 400; color: var(--rs-text-muted); }
.rs-help-clipgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.rs-help-clipcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--rs-border-soft);
  border-radius: var(--rs-radius-lg);
  background: var(--rs-surface);
  box-shadow: var(--rs-shadow-sm);
  scroll-margin-top: calc(var(--rs-header-height) + 1rem);
}
.rs-help-clipcard-play { position: relative; display: block; padding: 0; border: 0; background: #0f1b33; cursor: pointer; }
.rs-help-clipcard-play img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: opacity .15s; }
.rs-help-clipcard.is-portrait .rs-help-clipcard-play img { object-fit: contain; }
.rs-help-clipcard-play span {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: rgba(15, 27, 51, .85);
  color: #fff;
  font-size: .85rem;
}
.rs-help-clipcard-play:hover img, .rs-help-clipcard-play:focus-visible img { opacity: .85; }
.rs-help-clipcard-play:focus-visible { outline: 3px solid var(--rs-accent); outline-offset: -3px; }
.rs-help-clipcard-body { display: flex; flex-direction: column; gap: .2rem; padding: .75rem 1rem 1rem; }
.rs-help-clipcard-body small { color: var(--rs-accent); font-weight: 600; }
.rs-help-clipcard-body b { font-family: var(--rs-font-heading); font-size: 1.05rem; color: var(--rs-text); }
.rs-help-clipcard-body span { font-size: .88rem; line-height: 1.55; }
.rs-help-clipcard-body a { margin-top: .35rem; font-size: .88rem; color: var(--rs-accent); text-decoration: none; }

.rs-help-clipdlg { width: min(64rem, 94vw); max-height: 94vh; padding: 0; border: 0; border-radius: var(--rs-radius-lg); background: #0f1b33; color: #fff; }
.rs-help-clipdlg::backdrop { background: rgba(10, 18, 32, .75); }
.rs-help-clipdlg.is-portrait { width: min(24rem, 94vw); }
.rs-help-clipdlg-head, .rs-help-clipdlg-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 1rem; }
.rs-help-clipdlg-head b { font-family: var(--rs-font-heading); }
.rs-help-clipdlg-close { padding: .2rem .5rem; border: 0; border-radius: var(--rs-radius-sm); background: transparent; color: #fff; font-size: 1.1rem; }
.rs-help-clipdlg-close:hover { background: rgba(255, 255, 255, .12); }
.rs-help-clipdlg video { display: block; width: 100%; max-height: calc(94vh - 6rem); background: #000; }
.rs-help-clipdlg-foot a { color: #9cc2ff; font-size: .9rem; text-decoration: none; }

@media (max-width: 991.98px) {
  .rs-help-layout { grid-template-columns: minmax(0, 1fr); }
  .rs-help-toc { position: static; max-height: none; }
}
@media (max-width: 575.98px) {
  .rs-help-body { padding: 1rem; }
  .rs-help h1 { font-size: 1.35rem; }
}
@media print {
  .rs-help-noprint, .rs-help-anchor { display: none !important; }
  .rs-help-layout { display: block; }
  .rs-help-body { border: 0; box-shadow: none; padding: 0; }
  .rs-help-fig { break-inside: avoid; }
  .rs-help-body h2 { break-after: avoid; }
  /* กระดาษเล่นคลิปไม่ได้ — เหลือคำบรรยายบอกว่ามีคลิปตอนไหน */
  .rs-help-clip video { display: none; }
  .rs-help-clip { break-inside: avoid; }
}

/* ---- หน้าฐานบทความวิจัย (Officer/Research/ArticleBasis.aspx · 11 ต.ค. 2569) — ใช้โครงเดียวกับคู่มือ ---- */
.rs-article .rs-article-title { margin: 0 0 .25rem; font-size: 1.35rem; }
.rs-article .rs-article-note { font-size: .85rem; color: var(--rs-text-muted); line-height: 1.5; }

/* ---- มีอะไรใหม่ (Help/WhatsNew.aspx · 25 ต.ค. 2569 · docs/RoadSafe_ReleaseNotice_Plan_v0.1.0.md) ---- */
.rs-whatsnew-ver {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--rs-border-soft);
  border-radius: var(--rs-radius-lg);
  background: var(--rs-surface);
  box-shadow: var(--rs-shadow-sm);
  scroll-margin-top: calc(var(--rs-header-height) + 1rem);
}
.rs-whatsnew-ver.is-latest { border-color: var(--rs-accent); }
.rs-whatsnew-ver h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin: 0 0 .75rem; font-size: 1.25rem; }
.rs-whatsnew-ver h2 span { font-family: var(--rs-font-body); font-size: .9rem; font-weight: 400; color: var(--rs-text-muted); }
.rs-whatsnew-ver h2 em { font-style: normal; font-size: .75rem; padding: 0 .55rem; border-radius: 999px; background: var(--rs-accent); color: #fff; }
.rs-whatsnew-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem 1.5rem; }
.rs-whatsnew-col h3 { margin: 0 0 .4rem; font-size: 1rem; }
.rs-whatsnew-col h3 .bi { color: var(--rs-accent); }
.rs-whatsnew-col ul { margin: 0; padding-left: 1.2rem; }
.rs-whatsnew-col li { margin-bottom: .35rem; }
.rs-whatsnew-col a { color: var(--rs-accent); }
@media print { .rs-whatsnew-ver { break-inside: avoid; box-shadow: none; } }
