/* バラストチェッカーの日英製品ページ・LP専用。共通ブランドの層を維持する。 */
@layer components {
  .ballast-shell {
    width: 100%;
    max-width: calc(var(--max-width) + 2 * var(--page-gutter));
    margin-inline: auto;
    padding-inline: var(--page-gutter);
  }

  .ballast-page main { padding-bottom: 0; }
  .ballast-page img[data-zoomable] { pointer-events: auto; }
  .ballast-page .medium-zoom-image--opened { object-fit: contain; }
  .ballast-page .section { scroll-margin-top: 24px; }
  .ballast-page h3 { color: var(--color-primary-dark); font-size: 21px; line-height: 1.6; }
  .ballast-page main p { line-height: 1.9; }
  .ballast-page .section > p { max-width: 58em; margin-bottom: 24px; }
  .ballast-copy > * + * { margin-top: 20px; }
  .ballast-copy > h3:not(:first-child) { margin-top: 36px; }
  .ballast-kicker { margin-bottom: 16px; font-size: 14px; font-weight: 500; color: var(--color-primary); letter-spacing: .08em; }
  .ballast-note { font-size: 14px; color: var(--color-text-muted); line-height: 1.8; }
  .ballast-page a:not(.site-button):hover { text-decoration: underline; text-underline-offset: 4px; }
  .ballast-copy a, .ballast-note a { text-decoration: underline; text-underline-offset: 4px; }
  .ballast-text-link { display: inline-flex; align-items: center; margin-top: 24px; min-height: 44px; font-weight: 500; text-decoration: underline; text-underline-offset: 5px; }
  .ballast-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; align-items: center; }
  /* 測定原理: 寸法（330 mm・100 mm）を読めるよう、図を本文の下に大きく置く。 */
  .ballast-principle { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .ballast-principle > .ballast-copy { max-width: 58em; }
  .ballast-principle > .ballast-figure { width: 100%; max-width: 880px; margin-inline: auto; }
  .ballast-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  .ballast-figure { min-width: 0; }
  .ballast-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius-md); }
  .ballast-figure figcaption { margin-top: 12px; font-size: 14px; color: var(--color-text-muted); }

  /* LP: 写真と余白で導入を見せ、説明・画面例・相談へ進む。 */
  .ballast-lp-hero { gap: 48px; padding-block: 44px 36px; }
  .ballast-lp-hero h1 { font-size: clamp(30px, 3.35vw, 44px); line-height: 1.6; letter-spacing: .025em; }
  .ballast-lp-hero .hero__lead { margin-top: 24px; }
  .ballast-lp-hero .hero__product { margin-top: 24px; font-size: 13px; }
  .ballast-lp-hero .hero__product strong { font-size: 19px; font-weight: 500; color: var(--color-primary-dark); }
  .ballast-lp-hero .hero__actions { margin-top: 28px; }
  .ballast-lp-hero .site-button { padding-inline: 24px; }
  .ballast-hero-photo { min-width: 0; }
  .ballast-hero-photo > img { display: block; width: 100%; height: 400px; border-radius: var(--radius-hero); object-fit: cover; object-position: 48% center; }
  .ballast-hero-photo figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-top: 16px; color: var(--color-primary-dark); font-size: 14px; }
  .ballast-hero-photo small { font-size: 12px; color: var(--color-text-muted); }
  .ballast-origin { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-block: 16px; border-block: 1px solid var(--color-border); font-size: 13px; color: var(--color-text-muted); }
  .ballast-origin a { margin-left: auto; min-height: 44px; display: inline-flex; gap: 12px; align-items: center; text-decoration: underline; text-underline-offset: 4px; }
  .ballast-market-note { display: flex; align-items: center; gap: 12px; margin-top: 24px; color: var(--color-primary-dark); font-size: 15px; }
  .ballast-market-note .icon-svg { width: 22px; height: 22px; flex: 0 0 auto; }
  .ballast-challenges .section-title { line-height: 1.65; }
  .ballast-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .ballast-benefits > div { padding-top: 24px; border-top: 1px solid var(--color-border); }
  .ballast-benefits .icon-svg { width: 28px; height: 28px; margin-bottom: 16px; color: var(--color-primary); }
  .ballast-benefits h3 { margin-bottom: 12px; }
  .ballast-benefits p { color: var(--color-text-light); }
  .ballast-video-intro { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 48px; }
  .ballast-video-intro .video-trigger { max-width: none; }
  .ballast-video-intro .section-title { margin-bottom: 24px; }
  .ballast-video-intro .video-trigger__label { text-decoration: underline; text-underline-offset: 4px; }
  .video-trigger.ballast-video-link { display: inline-flex; align-items: center; gap: 8px; width: auto; max-width: 100%; min-height: 44px; margin: 16px 0 0; text-align: left; color: var(--color-primary-dark); font: inherit; font-size: 15px; }
  .ballast-video-link svg { flex-shrink: 0; }
  .ballast-video-link span { text-decoration: underline; text-underline-offset: 4px; }
  .ballast-intro { align-items: start; margin-bottom: 32px; }
  .ballast-intro .section-title { margin-bottom: 0; }
  .ballast-intro .ballast-copy { padding-top: 36px; }
  .ballast-mechanism { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 48px; padding: 40px; border: 1px solid var(--color-border); border-radius: var(--radius-hero); }
  .ballast-sound { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-family-base); }
  .ballast-sound__pulse { opacity: 0; }
  .ballast-mechanism__drawing { text-align: center; min-width: 0; }
  .ballast-diagram-trigger { display: block; color: var(--color-primary-dark); cursor: zoom-in; }
  .ballast-diagram-trigger > span { display: inline-block; margin-block: 12px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
  .ballast-diagram-dialog { width: min(1100px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 20px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-white); color: var(--color-text); }
  .ballast-diagram-dialog::backdrop { background: rgba(255, 255, 255, .95); }
  .ballast-diagram-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
  .ballast-diagram-dialog__header h2 { font-size: 18px; color: var(--color-primary-dark); }
  .ballast-diagram-dialog__close { flex-shrink: 0; min-height: 44px; padding: 8px 16px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-button); background: white; color: var(--color-primary-dark); font: inherit; cursor: pointer; }
  /* 見出し・注記と合わせて画面の高さに収め、図の下端の寸法をスクロールなしで見せる。 */
  .ballast-diagram-dialog img { display: block; width: 100%; height: auto; max-height: max(200px, calc(100dvh - 260px)); object-fit: contain; }
  .ballast-diagram-dialog .ballast-note { margin-top: 16px; }
  .ballast-replay { display: inline-flex; justify-content: center; align-items: center; gap: 16px; min-height: 44px; margin-top: 12px; padding: 8px 20px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-button); color: var(--color-primary-dark); background: var(--color-white); font: inherit; font-size: 14px; cursor: pointer; }
  .ballast-replay:hover { border-color: var(--color-primary); background: var(--color-primary-50); }
  .ballast-flow { counter-reset: ballast-step; }
  .ballast-flow li { position: relative; counter-increment: ballast-step; margin-left: 15px; padding: 0 0 24px 34px; border-left: 1px solid var(--color-border-strong); }
  .ballast-flow li:last-child { border-color: transparent; padding-bottom: 12px; }
  .ballast-flow li::before { content: counter(ballast-step); position: absolute; left: -15px; top: 0; width: 30px; height: 30px; border: 1px solid var(--color-primary-100); border-radius: 50%; background: white; color: var(--color-primary); text-align: center; line-height: 28px; font-size: 13px; }
  .ballast-flow__label { display: block; margin-bottom: 8px; color: var(--color-primary-dark); font-weight: 700; }
  .ballast-flow p { font-size: 15px; color: var(--color-text-light); }
  .ballast-mechanism__text > .ballast-note { padding-top: 16px; border-top: 1px solid var(--color-border); }

  .ballast-data { border-block: 1px solid var(--color-border); }
  .ballast-data__tabs { display: flex; gap: 12px; padding-block: 24px; }
  .ballast-data__tabs button { flex: 1; max-width: 260px; min-height: 52px; padding: 12px 20px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-button); background: white; color: var(--color-primary-dark); font: inherit; font-weight: 500; cursor: pointer; }
  .ballast-data__tabs button[aria-selected="true"] { background: var(--color-primary); color: white; border-color: var(--color-primary); }
  .ballast-data__tabs button:hover { border-color: var(--color-primary); }
  .ballast-data__panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 64px; padding: 24px 40px 40px; }
  .ballast-data__copy h3 { margin-bottom: 24px; font-size: 30px; line-height: 1.65; }
  .ballast-data__copy > p:not(.ballast-kicker) { margin-bottom: 20px; }
  .ballast-data__copy > .ballast-text-link { margin-top: 8px; }
  .ballast-screen { padding: 24px; background: var(--color-bg-cool); border-radius: var(--radius-md); text-align: center; }
  .ballast-screen img { width: auto; height: 440px; max-width: 100%; object-fit: contain; margin-inline: auto; border-radius: 4px; }
  .ballast-screen figcaption { max-width: 30em; margin-inline: auto; text-align: left; }
  .ballast-field-photo img { aspect-ratio: 4 / 3; object-fit: cover; }
  .ballast-fit .section-title { margin-bottom: 28px; }
  .ballast-list { padding-left: 1.25em; list-style: disc; }
  .ballast-list li + li { margin-top: 12px; }
  .ballast-faq__list { max-width: 1000px; }
  .ballast-faq .dads-accordion { border-top: 1px solid var(--color-border); }
  .ballast-faq .dads-accordion:last-child { border-bottom: 1px solid var(--color-border); }
  .ballast-faq .dads-accordion__summary { font-size: 17px; padding-block: 24px; }
  .ballast-faq .dads-accordion__content { padding-bottom: 24px; }
  .ballast-product-link { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-block: 40px 0; margin-top: 40px; border-top: 1px solid var(--color-border); }
  .ballast-product-link h3 { margin-bottom: 8px; }
  .ballast-product-link .site-button { flex: 0 0 auto; }
  .ballast-contact { margin-top: var(--section-gap); padding-block: 64px; background: var(--color-bg-cool); border-top: 1px solid var(--color-border); }
  .ballast-contact__inner { display: flex; align-items: center; justify-content: space-between; gap: 48px; }
  .ballast-contact h2 { margin-bottom: 20px; font-size: 32px; line-height: 1.6; color: var(--color-primary-dark); }
  .ballast-contact__actions { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; gap: 16px; }
  .ballast-contact__actions > a:not(.site-button) { min-height: 44px; display: inline-flex; align-items: center; text-decoration: underline; text-underline-offset: 4px; }

  /* 製品ページ: 目次、構成一覧、仕様表を中心に必要な情報を探せる構成。 */
  .ballast-product-hero { padding-block: 40px; }
  .ballast-product-hero h1 { font-size: clamp(28px, 3.2vw, 42px); letter-spacing: .015em; }
  .ballast-product-hero__image img { aspect-ratio: 16 / 10; object-fit: cover; }
  .ballast-summary { margin-top: 24px; font-size: 14px; }
  .ballast-summary > div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 16px; padding-block: 10px; border-bottom: 1px solid var(--color-border); }
  .ballast-summary dt { font-weight: 500; color: var(--color-primary-dark); }
  .ballast-index { display: flex; flex-wrap: wrap; gap: 8px 32px; padding-block: 16px; border-block: 1px solid var(--color-border); }
  .ballast-index a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
  .ballast-components { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
  .ballast-components img { aspect-ratio: 4 / 3; object-fit: contain; background: var(--color-bg-cool); }
  .ballast-components figcaption { color: var(--color-primary-dark); font-weight: 500; }
  .ballast-option { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 48px; margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--color-border); }
  .ballast-option img { width: 100%; height: 220px; object-fit: contain; }
  .ballast-table-wrap { margin-block: 32px; }
  .ballast-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 16px; }
  .ballast-table + .ballast-table { margin-top: 40px; }
  .ballast-table caption { padding-bottom: 16px; color: var(--color-primary-dark); font-weight: 700; font-size: 18px; }
  .ballast-table :is(th, td) { padding: 16px 24px; border: 1px solid var(--color-border); line-height: 1.8; text-align: left; vertical-align: top; }
  .ballast-table th { background: var(--color-bg-cool); color: var(--color-primary-dark); font-weight: 500; }
  .ballast-table th[scope="row"] { width: 28%; }
  .ballast-table thead th:nth-child(1) { width: 24%; }
  .ballast-table thead th:nth-child(2) { width: 54%; }
  .ballast-table thead th:nth-child(3) { width: 22%; }
  .ballast-conditions { padding: 28px 32px; border-left: 3px solid var(--color-primary); background: var(--color-bg-cool); }
  .ballast-conditions h3 { margin-bottom: 16px; }
  .ballast-procedure { counter-reset: procedure; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; margin-block: 40px; }
  .ballast-procedure li { counter-increment: procedure; padding-left: 40px; position: relative; }
  .ballast-procedure li::before { content: counter(procedure) "."; position: absolute; top: 0; left: 0; font-size: 21px; color: var(--color-primary); }
  .ballast-procedure h3 { margin-bottom: 12px; }
  .ballast-product #operation > .ballast-note { margin-top: 24px; }
  .ballast-result-pair { gap: 64px; margin-bottom: 40px; }
  .ballast-result-item .ballast-figure { padding: 24px; background: var(--color-bg-cool); border-radius: var(--radius-md); margin-bottom: 24px; }
  .ballast-result-item img { width: auto; height: 420px; max-width: 100%; object-fit: contain; margin-inline: auto; }
  .ballast-result-item h3 { margin-bottom: 12px; }
  .ballast-document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .ballast-document { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 28px; border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); color: var(--color-primary-dark); }
  .ballast-document:hover { border-color: var(--color-primary); }
  .ballast-document > span:first-child { font-size: 18px; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
  .ballast-document > small { font-size: 14px; color: var(--color-text-muted); }
  .ballast-development { margin-top: 40px; font-size: 14px; }

  @media (max-width: 1023px) {
    .ballast-page .hero { grid-template-columns: 1fr; gap: 32px; }
    .ballast-hero-photo > img { height: auto; aspect-ratio: 16 / 9; }
    .ballast-page .hero__lead { max-width: none; }
    .ballast-product-hero__image { max-width: 700px; }
    .ballast-split { gap: 32px; }
    .ballast-mechanism { grid-template-columns: 1fr; gap: 32px; }
    .ballast-mechanism__drawing { max-width: 680px; width: 100%; margin-inline: auto; }
    .ballast-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
    .ballast-flow li { margin-left: 0; padding: 0; border: 0; }
    .ballast-flow li::before { position: static; display: block; margin-bottom: 12px; }
    .ballast-benefits { gap: 24px; }
    .ballast-data__panel { gap: 32px; padding-inline: 0; }
    .ballast-data__copy h3 { font-size: 26px; }
    .ballast-option { grid-template-columns: 1fr; gap: 24px; }
    .ballast-contact__inner { align-items: start; flex-direction: column; gap: 32px; }
    .ballast-video-intro { grid-template-columns: 1fr; gap: 28px; }
  }

  @media (max-width: 767px) {
    .ballast-page .hero { padding-top: 24px; }
    .ballast-lp-hero h1 { font-size: clamp(26px, 7.7vw, 36px); line-height: 1.65; }
    .ballast-product-hero h1 { font-size: clamp(26px, 7.3vw, 36px); }
    .ballast-page .section-title { font-size: 27px; line-height: 1.65; }
    .ballast-page .hero__actions { gap: 12px; }
    .ballast-page .hero__actions .site-button { width: 100%; }
    .ballast-origin { gap: 8px 20px; }
    .ballast-origin a { margin-left: 0; width: 100%; }
    .ballast-split, .ballast-benefits, .ballast-data__panel, .ballast-document-grid, .ballast-video-intro { grid-template-columns: 1fr; }
    .ballast-video-intro { gap: 28px; }
    .ballast-benefits { gap: 28px; }
    .ballast-benefits > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px 16px; }
    .ballast-benefits .icon-svg, .ballast-benefits h3 { margin-bottom: 0; }
    .ballast-benefits p { grid-column: 2; }
    .ballast-intro .ballast-copy { padding-top: 0; }
    .ballast-mechanism { padding: 24px 16px; gap: 24px; }
    .ballast-sound { min-width: 0; }
    .ballast-flow { display: block; }
    .ballast-flow li { margin-left: 15px; padding: 0 0 24px 30px; border-left: 1px solid var(--color-border-strong); }
    .ballast-flow li::before { position: absolute; }
    .ballast-data__tabs { gap: 8px; }
    .ballast-data__tabs button { padding-inline: 12px; font-size: 14px; }
    .ballast-data__panel { gap: 24px; padding-top: 8px; }
    .ballast-data__copy h3 { font-size: 25px; }
    .ballast-screen { padding: 20px; }
    .ballast-screen img { width: 100%; max-width: 280px; height: auto; }
    .ballast-fit .ballast-field-photo { order: 2; }
    .ballast-fit .ballast-copy { order: 1; }
    .ballast-field-photo img { aspect-ratio: 16 / 9; }
    .ballast-product-link { align-items: start; flex-direction: column; gap: 24px; }
    .ballast-contact { padding-block: 40px; }
    .ballast-contact h2 { font-size: 26px; }
    .ballast-contact__actions { width: 100%; }
    .ballast-contact__actions .site-button { width: 100%; }
    .ballast-components { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
    .ballast-index { gap: 8px 24px; }
    .ballast-pair { gap: 20px; }
    .ballast-option .ballast-pair { grid-template-columns: 1fr; }
    .ballast-option img { height: auto; max-height: 280px; }
    .ballast-table { font-size: 14px; }
    .ballast-table :is(th, td) { padding: 12px; }
    .ballast-table th[scope="row"] { width: 34%; }
    html[lang="en"] .ballast-table :is(th, td) { padding: 10px; }
    html[lang="en"] .ballast-table th[scope="row"] { width: 42%; }
    html[lang="en"] .ballast-table thead th:nth-child(1) { width: 32%; }
    html[lang="en"] .ballast-table thead th:nth-child(2) { width: 44%; }
    html[lang="en"] .ballast-table thead th:nth-child(3) { width: 24%; }
    .ballast-conditions { padding: 20px; }
    .ballast-procedure, .ballast-result-pair { grid-template-columns: 1fr; }
    .ballast-result-item img { width: 100%; max-width: 280px; height: auto; }
    .ballast-document { padding: 24px 20px; }
  }
  /* このCSSを読むバラストチェッカーのページ（日英4ページ）だけ、縦持ち端末で字幕と操作バーの余白を確保する（構造物モニタの smon.css と同じ）。
     字幕の字は 3.1vw（ほかの製品と同じ。2026-10-26 に 3.6vw から下げた）。日本語の字幕は 1 行が最大 30 字あり、3.6vw では 390px 幅で
     約 420px になって動画の窓（画面の幅 − 18px）からはみ出し、行の両端が切れたため。3.1vw なら 320px 幅でも 30 字が窓に収まる。
     英語の字幕は 1 行が最大 66 字あり、3.1vw でも窓からはみ出して切れるので、英語のページだけ窓の幅で折り返す（2026-10-27、依頼者の選択）。
     pre-line は字幕の改行の位置（句の切れ目。build_timeline.py の BREAKS_EN）を保ち、窓に収まらない行だけを折り返す。
     日本語のページの字幕は 3.1vw で窓に収まるので付けない。 */
  @media (max-width: 767px) and (min-height: 500px) {
    .video-modal .video-modal__frame { aspect-ratio: 1; }
    .video-modal .video-modal__video { object-fit: contain; object-position: center top; background: #fff; }
    .video-modal__video::cue { font-size: 3.1vw; }
    html[lang="en"] .video-modal__video::cue { white-space: pre-line; }
  }
}
