/* 会社案内 印刷用スタイル（画面プレビューと印刷/PDF書き出しの両方で使用） */

/* ここで指定した余白は、ブラウザの「印刷」からPDF保存する場合の既定値。
   tools/pdf-export のスクリプトから書き出す場合は、この値と揃えたPlaywrightの
   margin指定が優先されるため、両方を変更する場合は値を揃えること。 */
@page {
  size: A4;
  margin: 18mm 16mm 20mm;
}

:root {
  --ink: #202629;
  --muted: #58646a;
  --blue: #007fa9;
  --line: #d4dfe3;
  --paper: #fff;
}

* {
  box-sizing: border-box;
}

html {
  background: #e9edef;
}

body {
  margin: 0 auto;
  max-width: 210mm;
  background: var(--paper);
  color: var(--ink);
  font-family: "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  line-height: 1.9;
  font-size: 14px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

dl,
dt,
dd,
p,
h1,
h2,
h3,
table {
  margin: 0;
}

/* 画面プレビュー専用の案内（印刷時は非表示） */
.screen-only.p-note {
  background: #fff6dc;
  border-bottom: 1px solid #e7d9a8;
  color: #5a4a1a;
  font-size: 13px;
  padding: 12px 18px;
  text-align: center;
}
.screen-only.p-note a {
  color: var(--blue);
  text-decoration: underline;
}
@media print {
  .screen-only {
    display: none !important;
  }
  body {
    max-width: none;
  }
  html {
    background: var(--paper);
  }
}

/* ---- 表紙（会社案内パンフレット 260729-2 の表紙を再現） ---- */
.p-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 210 / 297;
  break-after: page;
  page-break-after: always;
}
@media print {
  /* @page 余白（上18mm・下20mm）内の高さ259mmに収め、2ページ目へのはみ出しを防ぐ */
  .p-cover {
    aspect-ratio: auto;
    height: 257mm;
  }
}
.p-cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.p-cover-type {
  fill: #4d555a;
}
.p-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- 目次 ---- */
.p-toc {
  padding: 0 0 10mm;
  break-after: page;
  page-break-after: always;
}
.p-toc-title {
  font: 400 12px/1.6 Arial, sans-serif;
  letter-spacing: 0.24em;
  color: var(--blue);
  margin-bottom: 18px;
}
.p-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.p-toc li {
  counter-increment: toc;
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 16px;
  letter-spacing: 0.06em;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.p-toc li::before {
  content: "0" counter(toc);
  font: 12px/1 Arial, sans-serif;
  color: var(--blue);
  min-width: 1.6em;
}

/* ---- 本文セクション ---- */
main {
  padding: 0;
}

.p-section {
  padding: 10mm 0 14mm;
  break-after: page;
  page-break-after: always;
}
.p-section:last-of-type {
  break-after: auto;
  page-break-after: auto;
}

.p-section-no {
  font: 12px/1.6 Arial, sans-serif;
  letter-spacing: 0.2em;
  color: var(--blue);
  margin-bottom: 6px;
}
.p-section-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  margin-bottom: 20px;
  break-after: avoid;
  page-break-after: avoid;
}

.p-section h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.7;
  margin: 22px 0 10px;
  break-after: avoid;
  page-break-after: avoid;
}
.p-section h3:first-of-type {
  margin-top: 4px;
}
.p-section > p,
.p-section h3 + p {
  font-size: 13.5px;
  line-height: 2;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.p-message-policy {
  font-weight: 500;
  letter-spacing: 0.08em;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin: 16px 0 !important;
}

.p-message-hero-copy {
  margin: 16px 0 22px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--blue);
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-message-hero-copy h3 {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 24px;
  line-height: 1.6;
  letter-spacing: 0.04em;
}
.p-message-hero-copy p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.04em;
}
/* 事業内容のリード文（business.html 冒頭と同文） */
.p-lead-copy p {
  font-size: 13.5px;
  line-height: 1.9;
}


/* Keep the expanded top message and its signature together on one A4 page. */
main .p-section:first-child {
  padding-bottom: 8mm;
}
main .p-section:first-child h3 {
  font-size: 15px;
  margin: 15px 0 6px;
}
/* キャッチ「すべてはお客様のためだけに。」は縮小対象外（事業内容のリード見出しと同サイズ） */
main .p-section:first-child .p-message-hero-copy h3 {
  font-size: 24px;
  margin: 0 0 9px;
}
main .p-section:first-child > p {
  font-size: 12.8px;
  line-height: 1.85;
  margin-bottom: 8px;
}
main .p-section:first-child .p-message-policy {
  margin: 10px 0 !important;
  padding: 9px 0;
}
/* ---- 定義リスト（dl） ---- */
.p-dl {
  border-top: 1px solid var(--line);
  margin: 12px 0 18px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-dl > div {
  display: grid;
  grid-template-columns: 34mm 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-dl dt {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.p-dl dd {
  font-size: 13.5px;
  letter-spacing: 0.02em;
  line-height: 1.7;
}

.p-dl-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 0;
  column-gap: 20px;
}
.p-dl-columns > div {
  border-top: 1px solid var(--line);
  grid-template-columns: 30mm 1fr;
}

.p-dl-officers {
  grid-template-columns: 1fr 1fr 1fr;
}
.p-dl-officers > div {
  grid-template-columns: 24mm 1fr;
}

.p-dl-history > div {
  grid-template-columns: 20mm 1fr;
}

/* ---- 画像・図版 ---- */
.p-photo {
  margin: 14px 0;
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-photo img {
  width: 100%;
  border: 1px solid var(--line);
}
.p-photo figcaption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.p-photo-wide img {
  max-height: 78mm;
  object-fit: cover;
}
.p-photo-model {
  position: relative;
  height: 78mm;
  background: #b1f4f7;
  overflow: hidden;
}
.p-photo-model img {
  position: absolute;
  left: 50%;
  /* business.html と同じ比率（表示高140%・下端-48.2%＝画像上端から約65.6%で下部トリミング） */
  bottom: -48.2%;
  width: auto;
  height: 140%;
  border: 0;
  max-height: none;
  object-fit: contain;
  transform: translateX(-50%);
}
.p-photo-medium {
  max-width: 90mm;
}
.p-photo-message {
  height: 70mm;
  overflow: hidden;
}
.p-photo-message img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.p-message-continuation {
  break-before: page;
  page-break-before: always;
}
.p-photo-small {
  max-width: 80mm;
}
.p-photo-diagram img {
  border: 0;
  background: #f6f8f9;
  padding: 10px;
  border: 1px solid var(--line);
}

.p-ec-devices {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 0.8fr);
  align-items: end;
  gap: 18px;
  margin: 14px 0 20px;
  padding: 14px 20px 10px;
  background: #f2f8fa;
  border: 1px solid var(--line);
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-ec-devices img {
  width: 100%;
  max-height: 60mm;
  object-fit: contain;
}
.p-ec-devices figcaption {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---- ブランド／商品カード ---- */
.p-brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 8px;
}
.p-brand-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}
.p-brand {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin: 0 auto 10px;
}
.p-brand-name {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 6px !important;
}
.p-brand-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---- サステナビリティの見出しラベル ---- */
.p-initiative-label {
  font: 11px/1.6 Arial, sans-serif;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin: 14px 0 6px !important;
}

/* ---- 数値メトリクス ---- */
.p-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 18px;
}
.p-metric {
  border: 1px solid var(--line);
  padding: 14px 10px;
  text-align: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-metric-value {
  font-size: 24px;
  font-weight: 500;
  color: var(--blue);
  margin-bottom: 8px !important;
}
.p-metric-label {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---- 表 ---- */
.p-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 6px;
  font-size: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-table caption {
  caption-side: top;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.p-table th,
.p-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: right;
}
.p-table thead th {
  background: #f2f6f7;
  text-align: center;
}
.p-table th[scope="row"] {
  text-align: left;
  background: #f9fafb;
}

.p-data-note {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 16px !important;
}

/* ---- 業績グラフ ---- */
.p-result-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 12px 0 18px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-result-chart {
  margin: 0;
  padding: 12px 10px 9px;
  background: #f3f8fa;
  border: 1px solid var(--line);
}
.p-result-chart figcaption {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.p-print-bars {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  position: relative;
}
.p-print-bar {
  flex: 1;
  min-width: 0;
  position: relative;
  text-align: center;
}
.p-print-track {
  height: 34mm;
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid #9badb3;
  background: repeating-linear-gradient(to top, #dce7eb 0 1px, transparent 1px 20%);
}
.p-print-track i {
  display: block;
  position: relative;
  width: 68%;
  margin: auto auto 0;
  background: #7bbcd0;
  font-style: normal;
}
.p-print-track b {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  color: #1c7fa3;
  font: 8.5px Arial, sans-serif;
  white-space: nowrap;
}
.p-print-bar > span {
  display: block;
  margin-top: 5px;
  font-size: 8px;
  line-height: 1.35;
}
.p-print-bars-ratio svg {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  width: 100%;
  height: 34mm;
  pointer-events: none;
}
.p-print-bars-ratio svg polyline {
  fill: none;
  stroke: #333;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}
.p-print-bars-ratio .p-print-bar > em {
  position: absolute;
  z-index: 3;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 2px;
  background: #f3f8fa;
  font: 8px Arial, sans-serif;
}
.p-chart-legend {
  margin: 5px 0 0 !important;
  font-size: 9px !important;
  color: var(--muted);
}

.p-contact-line {
  font-size: 13.5px;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  padding: 10px 14px;
  margin-top: 10px;
}

.p-access-block {
  break-inside: avoid;
  page-break-inside: avoid;
}

/* ---- フッター ---- */
.p-footer {
  padding: 10mm 0 0;
  border-top: 2px solid var(--ink);
  text-align: center;
  /* フッターが2ページに分かれないようにする */
  break-inside: avoid;
  page-break-inside: avoid;
}
.p-footer-logo {
  width: 110px;
  margin: 0 auto 14px;
}
.p-footer p {
  font-size: 12px;
  line-height: 1.9;
  margin-bottom: 10px !important;
}
.p-footer-note {
  font-size: 10.5px;
  color: var(--muted);
}

/* ---- スマートフォンでの画面表示（印刷・PDFには影響しない） ---- */
@media screen and (max-width: 600px) {
  body {
    padding: 0 16px;
  }
  /* 表紙は画面端まで広げる */
  .p-cover {
    margin: 0 -16px;
  }
  /* 2列・3列の段組みを1列に */
  .p-dl-columns,
  .p-dl-officers {
    grid-template-columns: 1fr;
  }
  .p-dl > div,
  .p-dl-columns > div,
  .p-dl-officers > div {
    grid-template-columns: 7.5em minmax(0, 1fr);
  }
  /* 沿革は年を上、内容を下に */
  .p-dl-history > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  /* ブランドカードはロゴ左・テキスト右の1列 */
  .p-brand-grid,
  .p-brand-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .p-brand {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
    text-align: left;
  }
  .p-brand img {
    grid-row: span 2;
    margin: 0;
  }
  .p-brand-name {
    margin-bottom: 2px !important;
  }
  /* トップメッセージの写真は人物が右寄りのため、切り抜かず全体を表示 */
  .p-photo-message {
    height: auto;
  }
  .p-photo-message img {
    height: auto;
  }
  .p-ec-devices {
    padding: 12px;
    gap: 10px;
  }
}