@charset "utf-8";

/* =========================================================
   Daslight 5 マニュアル 統合版 スタイルシート
   構成: 共通スタイル → レイアウト(サイドバー/ドロワー) → 各章固有スタイル(下部でimport)
   画像拡大表示は GLightbox を使用（本ファイルにはGLightbox自体のスタイルは含まない）
   ========================================================= */

body {
  overflow:visible;
}

#globalMain, #globalContents{ overflow: visible; }

:root {
  --primary-color: #24231f;
  --accent-color: #1769aa;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #333333;
  --text-muted: #000000;
  --text-sub: #666666;   /* 旧ファイル互換エイリアス */
  --link-color: #1769aa; /* 旧ファイル互換エイリアス */
  --border-color: #adadad;
  --toolbar-h: 56px;
  --sidebar-w: 440px;
  --top: 63px;          /* サイトのナビ領域の高さ（この分だけ下にsticky） */
}
@media (max-width: 800px) {
  :root { --top: 0px; } /* スマホはTOP:0 */
}


/* ==================== ツールバー ==================== */
.das-toolbar {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--toolbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.das-toolbar strong { font-size: 16px; font-weight: 600; }
.das-toolbar span { font-size: 13px; color: #ccc; margin-left: auto; }

.das-menu-btn {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
  flex: 0 0 auto;
}
.das-menu-btn:hover { background: rgba(255,255,255,0.12); }
.das-menu-btn::before { content: "\2630"; }

.das-nav-toggle { display: none; }

.das-sidebar-overlay { display: none; }

/* ==================== レイアウト（サイドバー＋本文） ==================== */
.das-layout {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}

.das-sidebar {
  order: 2;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  position: sticky;
  top: calc(var(--toolbar-h) + 16px);
  max-height: calc(100vh - var(--toolbar-h) - 32px);
  overflow-y: auto;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 16px 14px;
}

.das-content { order: 1; }

.das-sidebar-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.das-sidebar-title:hover { text-decoration: underline; }

.das-toc, .das-toc ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.das-toc > li { margin-bottom: 2px; }

.das-toc a {
  display: block;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-main);
}
.das-toc a:hover { background: var(--bg-color); text-decoration: none; }

.das-toc > li > a { font-weight: 700; color: var(--primary-color); font-size: 14px; }

.das-toc ul {
  margin: 2px 0 6px 0;
}
.das-toc ul a {
  font-weight: 400;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 4px 0px 4px 0px;
}
.das-toc ul a:hover { color: var(--accent-color); }

.das-content {
  flex: 1 1 auto;
  min-width: 0;
}

.das-chapter {
  background: var(--card-bg);
  border-radius: 8px;
  /* padding: 40px; */
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  scroll-margin-top: calc(var(--toolbar-h) + 12px);
}

.das-chapter::before {
  content: "";
  display: block;
  height: 70px;
  margin-top: -70px;
}

.das-layout section[id] {/* scroll-padding-top: calc(var(--toolbar-h) + 12px); */padding-top: 70px;overflow: hidden;margin-top: -20px;}

.das-layout section[id][id]::before {
  /* content: ""; */
  display: block;
  height: 200px;
  margin-top: -200px;
}

/* ==================== 表紙 ==================== */
.das-cover {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}
.das-cover-header {
  display: flex;
  align-items: center;
  gap: 24px;
}
.das-cover-logo { width: 100px; height: 100px; object-fit: contain; flex: 0 0 auto; }
.das-cover-title { font-size: 30px; font-weight: 700; color: #111; }
.das-cover-subtitle { margin-top: 6px; font-size: 18px; color: var(--text-muted); }

/* ==================== 見出し・本文共通 ==================== */
h2.das-section-title {
  font-size: 28px;
  color: #111;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 8px;
  margin-bottom: 24px;
  margin-top: 20px;
  font-weight: bold;
}

.das-layout {

  line-height:1.7;

  h3 {
    font-size: 22px;
    color: var(--primary-color);
    /* margin-top: 36px; */
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
  }
  .das-chapter > section:first-of-type > h3 { margin-top: 0; }

  h4 {font-size: 16px;color: var(--text-muted);margin-top: 24px;margin-bottom: 10px;font-weight: bold;}
  h5 { font-size: 15px; color: #444; margin-top: 16px; margin-bottom: 8px; }

  p { margin-bottom: 12px; font-size: 15px; }

  a { color: var(--accent-color); text-decoration: none;}
  a[target] {display: inline;}
  
  a:hover { text-decoration: underline; }

  ul, ol {margin-bottom: 16px;padding-left: 1em;}
  li { margin-bottom: 6px; font-size: 15px; }
  ol li {
    list-style-type:decimal;
    margin-left:1.5em;
  }
}

.das-content {
  ul li {
    list-style-type:disc;;
    margin-left:1.5em;
  }  
}
/* ==================== 共通の画像/注記コンポーネント既定値 ==================== */
.das-doc-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  background-color: #f4f4f4;
  object-fit: contain;
  cursor: zoom-in;
  margin: 20px auto;
}

.das-image-wrapper { margin: 20px 0; text-align: center; }
.das-image-wrapper img { display: block; margin: 0 auto; }

.das-note-box {
  background-color: #f0f7ff;
  border-left: 4px solid var(--accent-color);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  border-radius: 0 4px 4px 0;
}

/* ==================== レスポンシブ（本文サイズ） ==================== */
@media (max-width: 768px) {
  .das-chapter, .das-cover { padding: 10px; }
  h2.das-section-title { font-size: 22px; }
  h3 { font-size: 18px; }
  h4 { font-size: 15px; }
  .das-cover-header { flex-direction: column; align-items: center; text-align: center;}
}

/* ==================== レスポンシブ（サイドバー→ドロワー化） ==================== */
@media (max-width: 880px) {
  .das-toolbar span { display: none; }
  .das-menu-btn { display: flex; order: 2; margin-left: auto; }

  .das-layout { display: block; padding: 16px 12px; }

  /* ドロワー：幅0・高さ0のstickyボックスを本文の先頭に置き、
     スクロール最上部ではツールバーの少し下、スクロールするとツールバーの下に追従する */
  .das-layout { overflow-x: clip; }

  .das-sidebar {
    position: sticky;
    top: calc(var(--top) + var(--toolbar-h));
    flex: none;
    width: auto;
    height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    z-index: 3;
  }

  .das-toc-panel {
    position: absolute;
    top: 0;
    right: -12px;               /* .das-layout の左右padding分を相殺して画面端に付ける */
    width: 260px;
    box-sizing: border-box;
    height: calc(100vh - var(--toolbar-h) - 16px);
    height: calc(100dvh - var(--toolbar-h) - 16px);
    overflow-y: auto;
    padding: 14px;
    background: var(--card-bg);
    box-shadow: -2px 2px 12px rgba(0,0,0,0.25);
    transform: translateX(110%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }

  .das-nav-toggle:checked ~ .das-layout .das-toc-panel {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
  }

  .das-nav-toggle:checked ~ .das-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 2;
  }

  .das-nav-toggle:checked ~ .das-toolbar .das-menu-btn::before { content: "\2715"; }

  .das-content { margin-top: 0; }
}
/* ===== ch1 (Daslight5_01_quick_start.html) 固有スタイル ===== */
.das-ch1 .das-doc-image {
  display: block;
  width: min(var(--pdf-image-width, 100%), 100%);
  max-width: none;
  height: auto;
  min-height: 0;
  margin: 20px auto;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  background-color: #f4f4f4;
  object-fit: contain;
}
.das-ch1 .das-doc-image {
  cursor: zoom-in;
}

/* ===== ch2 (Daslight5_02_introduction.html) 固有スタイル ===== */
.das-ch2 .das-image-wrapper { margin: 22px 0 28px; text-align: center; break-inside: avoid; }
.das-ch2 .das-doc-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 0;
  margin: 0 auto;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  background: #f4f4f4;
  object-fit: contain;
  cursor: zoom-in;
}
.das-ch2 .das-pdf-image {
  display: block;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  border: 0;
  border-radius: 5px;
  box-shadow: none;
  background: transparent;
  object-fit: contain;
  cursor: zoom-in;
}

/* ===== ch3 (Daslight5_03_setup.html) 固有スタイル ===== */
.das-ch3 .das-doc-image {
  display: block; width: 100%; max-width: 100%; height: 100%; min-height: 0;
  margin: 0; border: 0; border-radius: 5px; box-shadow: none;
  background: #f4f4f4; object-fit: contain; cursor: zoom-in;
}
.das-ch3 .das-image-placeholder {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  width: var(--placeholder-width); max-width: 100%; height: var(--placeholder-height);
  min-height: 0; margin: 22px auto 28px; padding: 0;
  border: 1px solid #c8c8c8; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); background: #f4f4f4;
  color: #888; text-align: center; overflow: hidden;
}
.das-ch3 .das-image-placeholder small {
  padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.88);
  color: #888; font-size: 11px;
}
.das-ch3 .das-image-row {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 30px; margin: 22px 0 28px;
}
.das-ch3 .das-image-row .das-image-placeholder { margin: 0; flex: 0 0 auto; }
@media (max-width: 768px) {
.das-ch3 .das-image-placeholder {
    width: min(100%, var(--placeholder-width)); height: auto;
    aspect-ratio: var(--placeholder-ratio);
  }
.das-ch3 .das-image-row { gap: 12px; flex-wrap: wrap; }
.das-ch3 .das-image-row .das-image-placeholder { max-width: calc(50% - 6px); }
}

/* ===== ch4 (Daslight5_04_control_programing.html) 固有スタイル ===== */
.das-ch4 .das-image-wrapper { margin: 22px 0 28px; text-align: center; }
.das-ch4 .das-image-wrapper img {
  display: block; width: auto; max-width: 100%; height: auto; min-height: 0;
  margin: 0 auto; border: 1px solid #c8c8c8; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); background-color: #f4f4f4; object-fit: contain;
}
.das-ch4 .das-image-row {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 30px; margin: 22px 0 28px;
}
.das-ch4 .das-image-row .das-image-wrapper { margin: 0; flex: 0 0 auto; }
@media (max-width: 768px) {
.das-ch4 .das-image-row { gap: 12px; flex-wrap: wrap; }
.das-ch4 .das-image-row .das-image-wrapper { max-width: calc(33.333% - 8px); }
}
.das-ch4 .das-sublist { margin-top: 8px; }
.das-ch4 .das-doc-image {
  display: block; width: 100%; max-width: 100%; height: auto;
  margin: 0; border: 0; border-radius: 5px; box-shadow: none;
  background: #f4f4f4; object-fit: contain; cursor: zoom-in;
}
.das-ch4 .das-pdf-image { display:block; height:auto; max-width:100%; margin:0 auto; border:0; border-radius:5px; box-shadow:none; background:transparent; object-fit:contain; cursor:zoom-in; }
.das-ch4 .das-pdf-image-position { clear: both; }
.das-ch4 .das-image-wrapper { break-inside: avoid; }
.das-ch4 .das-pdf-page-43-row {display:flex;align-items:flex-start;justify-content:center;gap:40px;margin:22px 0 28px;}
.das-ch4 .das-pdf-page-43-row .das-image-wrapper {margin:0;flex:0 0 auto;width:176px;}
.das-ch4 .das-pdf-page-43-row .das-image-wrapper:nth-child(2), .das-ch4 .das-pdf-page-43-row .das-image-wrapper:nth-child(3) {width:179px;}
.das-ch4 .das-pdf-page-43-row img {display:block;width:100%;height:auto;margin:0;}
@media(max-width:768px) {
.das-ch4 .das-pdf-page-43-row {gap:12px;flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start;padding-bottom:8px}
.das-ch4 .das-pdf-page-43-row .das-image-wrapper {min-width:150px;width:150px}
.das-ch4 .das-pdf-page-43-row .das-image-wrapper:nth-child(2), .das-ch4 .das-pdf-page-43-row .das-image-wrapper:nth-child(3) {width:153px;min-width:153px}
}

/* ===== ch5 (Daslight5_05_control_live.html) 固有スタイル ===== */
.das-ch5 .das-image-wrapper { margin: 20px 0; text-align: center; }
.das-ch5 .das-image-wrapper img {
  display: block; width: 100%; max-width: 100%; height: auto; min-height: 0;
  margin: 0 auto; border: 1px solid #c8c8c8; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); background-color: #f4f4f4; object-fit: contain;
}
.das-ch5 .das-note-box {
  background-color: #fffbe6;
  border-left: 4px solid #ffe58f;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  border-radius: 0 4px 4px 0;
}
@media (max-width: 768px) {
.das-ch5 .das-image-wrapper img { min-height: 140px; }
}
.das-ch5 .das-doc-image {cursor:zoom-in;}

/* ===== ch6 (Daslight5_06_touch.html) 固有スタイル ===== */
.das-ch6 .das-image-wrapper { margin: 20px 0; text-align: center; }
.das-ch6 .das-image-wrapper img {
  display: block; width: 100%; height: auto; cursor: zoom-in;
  margin: 0 auto; border: 1px solid #c8c8c8; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); background-color: #f4f4f4; object-fit: contain;
}

/* ===== ch7 (Daslight5_07_other_infomation.html) 固有スタイル ===== */
.das-ch7 .das-image-wrapper { margin: 20px 0; text-align: center; }
.das-ch7 .das-image-wrapper img {
  display: block; width: 100%; max-width: 560px; height: auto;
  margin: 0 auto; border: 1px solid #c8c8c8; border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); background-color: #f4f4f4; object-fit: contain;
}
.das-ch7 .das-note-box {
  background-color: #f0f7ff;
  border-left: 4px solid var(--accent-color);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  border-radius: 0 4px 4px 0;
}
@media (max-width: 768px) {
.das-ch7 .das-image-placeholder {
    width: min(100%, var(--placeholder-width)); height: auto;
    aspect-ratio: var(--placeholder-ratio);
  }
.das-ch7 .das-image-row { gap: 12px; flex-wrap: wrap; }
.das-ch7 .das-image-row .das-image-placeholder { max-width: calc(50% - 6px); }
}

/* ==================== 目次の開閉（PC表示：本文の上に重ねて表示）==================== */
.das-toc-open { display: none; }
.das-toc-fold, .das-toc-backdrop { display: none; }

@media (min-width: 881px) {
  /* ツールバーは追従させない（モバイルは従来どおり追従：ハンバーガーを常に使えるように） */
  .das-toolbar { position: static; }

  /* 追従するのは目次だけ。サイトのナビ領域（--top）の下に張り付く */
  .das-sidebar { top: var(--top); }

  /* 目次の列は確保せず（幅0）、本文の幅は常に一定 */
  .das-sidebar {
    flex: 0 0 0;
    width: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
    max-height: none;
    z-index: 160;
  }

  /* 常に見える「目次 ▼」ボタン（開閉で幅は変えない） */
  .das-toc-fold {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 0;
    right: 0;
    width: var(--sidebar-w);
    box-sizing: border-box;
    padding: 9px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    user-select: none;
  }
  .das-toc-fold::after { content: "\25BC"; font-size: 12px; }   /* ▼ 閉じている */
  .das-toc-fold:hover { color: var(--accent-color); }
  .das-toc-open:checked ~ .das-layout .das-toc-fold::after { content: "\25B2"; } /* ▲ 開いている */

  /* 目次本体：ボタンの下に重ねて表示 */
  .das-toc-panel {
    display: none;
    position: absolute;
    top: 46px;
    right: 0;
    width: var(--sidebar-w);
    box-sizing: border-box;
    max-height: calc(100vh - var(--top) - 80px);
    overflow-y: auto;
    padding: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  }
  .das-toc-open:checked ~ .das-layout .das-toc-panel { display: block; }

  /* 目次の外側をクリックしたら閉じる */
  .das-toc-open:checked ~ .das-toc-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 140;
  }
}

a.glightbox {
  pointer-events: none;
}
a.glightbox img {
  pointer-events: auto;
}