@charset 'Shift_JIS';

@page {
  margin: 5pc 4pc;
}

@page :left {
  margin-right: 5pc;
}

@page :right {
  margin-left: 5pc;
}

/* 全般 */
@media print {
  body {
    font-family: serif;
    font-size: 10pt;
  }
  p,dl,ul,ol,td {
    text-align: justify;
  }
}

@media screen {
  body {
    font-family: sans-serif;
    font-size: 12pt;
  }
}

p,dl,ul,ol {
  margin-left: 2em;
}

p {
  margin-top: 0;
  margin-bottom: 0;
  text-indent: 1em;
}

dt {
  font-weight: bold;
}

/* 表紙 */
@media all {
  div.first-page .title:before {
    content: '- ';
  }
  div.first-page .title:after {
    content: ' -';
  }
  div.first-page .title {
    font-family: sans-serif;
    font-size: xx-large;
  }
}

@media screen {
  .for-print {
    display: none;
  }
}

@media print {
  .for-screen {
    display: none;
  }
  div.first-page {
    text-align: center;
    padding-top: 5pc;
    page-break-after: always;
  }
  div.first-page .title {
    font-size: 40pt;
    font-weight: bold;
    margin-bottom: 5pc;
  }
  :first #footer {
    -cssj-regeneratable: footer;
    display: block;
    text-align: left;
    bottom: 0;
    margin: 0 auto;
  }
}

/* フッタ */
@media print {
  :left #page-number {
    text-align: left;
  }
  :right #page-number {
    text-align: right;
  }
  #page-number {
    -cssj-regeneratable: footer;
    bottom: -1cm;
    font-family: sans-serif;
    border-top: 1pt solid;
    padding-top: 0.2em;
    width: 100%;
  }
  #page-number:before {
    counter-increment: page;
    content: counter(page);
  }
}

/* 見出し */
h1 {
  page-break-before: always;
}
h1:before {
  content: counter(chapter) '.';
  counter-increment: chapter;
  counter-reset: section subsection example table;
}

h2 {
  padding: 5pt;
  background-color: LightGray;
}
h2:before {
  content: counter(chapter) '.' counter(section) '\A0';
  counter-increment: section;
  counter-reset: subsection;
}

h3 {
  margin-left: 2em;
  border-bottom: 2pt solid Black;
}
h3:before {
  content: counter(chapter) '.' counter(section) '.' counter(subsection) '\A0';
  counter-increment: subsection;
}

h3,h4,h5,h6 {
  margin-left: 2em;
}

/* 例 */
div.example:after {
  display: block;
  page-break-before: avoid;
  margin-bottom: 1em;
  font-weight: bold;
  text-align: center;
  counter-increment: example;
  content: '例 ' counter(chapter) '.' counter(example) ' ' attr(title);
}
div.example pre,div.example plaintext,div.example xmp {
  white-space: pre-wrap;
  margin: 1em 1em 0.2em 2em;
  padding: 0.5em;
  border: 1pt solid Gray;
  background-color: LightGray;
  windows: 10;
  orphans: 10;
}

/* テーブル */
caption {
  font-weight: bold;
  padding: 4pt;
  padding-top: 1em;
  text-align: left;
}
caption:before {
  counter-increment: table;
  content: '表 ' counter(chapter) '.' counter(table) ' ';
}
table {
  border-collapse: collapse;
  margin-bottom: 1em;
}
table,caption {
  margin-left: auto;
  margin-right: auto;
}
th, td {
  padding: 4pt;
  font-size: 10pt;
}
th {
  border-style: solid dashed;
  border-width: 2pt 1pt;
  border-color: Black;
  white-space: nowrap;
}
td {
  border-style: solid dashed;
  border-width: 1pt;
  border-color: Black;
}

/* 注意 */
.note {
  font-style: italic;
  padding: 1em;
}
