/* History: base table and photo grid layout */
.page-content .history-photo-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* History page: shared hero sizing and image-based lower navigation */
@media (min-width: 1024px) {
  body.page-id-218 .page-title-banner--about .about-pagehero {
    height: 411px;
    overflow: hidden;
    background: #0079c4;
  }

  body.page-id-218 .page-title-banner--about .about-pagehero__img {
    width: 1967px !important;
    max-width: none !important;
    height: 411px !important;
    margin-left: calc(50% + 580px - 1588px) !important;
    object-fit: fill;
    transform: none !important;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav {
    height: 100px;
    background-image: url("../../img/about/menu2.png") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: 100% 100% !important;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav ul {
    height: 100%;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a {
    min-height: 100px;
    border: 0 !important;
    background: transparent !important;
    background-image: none !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    text-indent: -9999px;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a:hover,
  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a:focus-visible,
  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a.is-current {
    background: transparent !important;
    background-image: none !important;
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
  }
}

.page-content .history-photo-grid figure {
  margin: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e6edf6;
  padding: 12px;
  text-align: center;
}

.page-content .history-photo-grid img {
  width: 100%;
  height: auto;
  display: block;
}

.page-content .history-photo-grid figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: #5d6f86;
}

body.page-id-218 .page-content .wp-block-table.company-table.history-table,
body.page-id-218 .page-content .history-photo-grid {
  position: relative;
  overflow: visible;
  max-width: var(--company-banner-max-width, 1080px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--company-msrt-inset, 84px);
  padding-right: 20px;
  --msk-history-msrt-label: "";
  --msk-history-msrt-color: #4a78b4;
  --msk-history-msrt-left: 0;
  --msk-history-msrt-top: 0;
  --msk-history-msrt-scale: 0.45;
  --msk-history-msrt-width-base: 52px;
  --msk-history-msrt-height-base: 236px;
  --msk-history-msrt-font-size: 18px;
  --msrt-history-core-rect-cut-offset: calc(var(--msk-history-msrt-width-base) * var(--msk-history-msrt-scale));
}

body.page-id-218 .page-content .wp-block-table.company-table.history-table {
  --msk-history-msrt-label: "会社沿革";
}

body.page-id-218 .page-content .history-photo-grid {
  --msk-history-msrt-label: "写真";
  margin-top: 48px;
}

body.page-id-218 .page-content .wp-block-table.company-table.history-table::before,
body.page-id-218 .page-content .history-photo-grid::before {
  content: "";
  position: absolute;
  left: var(--msk-history-msrt-left);
  top: var(--msk-history-msrt-top);
  bottom: 0;
  width: 1px;
  background: var(--msk-history-msrt-color);
}

body.page-id-218 .page-content .wp-block-table.company-table.history-table::after,
body.page-id-218 .page-content .history-photo-grid::after {
  content: var(--msk-history-msrt-label);
  position: absolute;
  left: var(--msk-history-msrt-left);
  top: var(--msk-history-msrt-top);
  width: calc(var(--msk-history-msrt-width-base) * var(--msk-history-msrt-scale));
  min-height: calc(var(--msk-history-msrt-height-base) * var(--msk-history-msrt-scale));
  padding: 0 0 var(--msrt-history-core-rect-cut-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--msk-history-msrt-color);
  color: #fff;
  font-size: var(--msk-history-msrt-font-size);
  font-weight: 100;
  line-height: 1;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 0 100%);
}

body.page-id-218 .page-content .wp-block-table.company-table.history-table::before,
body.page-id-218 .page-content .wp-block-table.company-table.history-table::after {
  content: none !important;
  display: none !important;
}

body.page-id-218 .page-content .wp-block-table.company-table.history-table th,
body.page-id-218 .page-content .wp-block-table.company-table.history-table td,
body.page-id-218 .page-content .wp-block-table.company-table.history-table th *,
body.page-id-218 .page-content .wp-block-table.company-table.history-table td * {
  font-size: 16px;
  font-weight: 400;
}

@media (min-width: 881px) {
  body.page-id-218 .page-content .wp-block-table.company-table.history-table th {
    width: 32%;
    padding-right: 56px;
    white-space: nowrap;
  }

  body.page-id-218 .page-content .wp-block-table.company-table.history-table th * {
    white-space: nowrap;
  }

  body.page-id-218 .page-content .wp-block-table.company-table.history-table td {
    padding-left: 20px;
  }
}

/* History: compact table rows and design photo grid */
body.page-id-218 .page-content .wp-block-table.company-table.history-table th,
body.page-id-218 .page-content .wp-block-table.company-table.history-table td {
  padding-top: 7px;
  padding-bottom: 7px;
  line-height: 1.5;
}

body.page-id-218 .page-content .history-photo-grid {
  margin-top: 56px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1080px;
}

body.page-id-218 .page-content .history-photo-grid figure {
  border: 0;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
}

body.page-id-218 .page-content .history-photo-grid img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* History: certification logos */
body.page-id-218 .page-content--about > .history-photo-grid.history-certification-grid,
body.page-id-218 .page-content .history-photo-grid.history-certification-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 36px);
  align-items: stretch;
}

body.page-id-218 .page-content--about > .history-photo-grid.history-certification-grid figure,
body.page-id-218 .page-content .history-photo-grid.history-certification-grid figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 24px 18px;
  border: 1px solid #d8e0ea;
  border-radius: 0;
  background: #ffffff;
  overflow: visible;
  box-sizing: border-box;
}

body.page-id-218 .page-content--about > .history-photo-grid.history-certification-grid img,
body.page-id-218 .page-content .history-photo-grid.history-certification-grid img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 128px;
  aspect-ratio: auto;
  object-fit: contain;
}

body.page-id-218 .page-content .history-certification-grid .history-cert-logo--sdgs img {
  max-height: 82px;
}

body.page-id-218 .page-content .history-certification-grid .history-cert-logo--diversity img {
  max-height: 148px;
}

body.page-id-218 .page-content .history-certification-grid figcaption {
  margin-top: 16px;
  color: #000000;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}

body.page-id-218 .page-content .history-certification-grid .history-cert-logo--sports-yell {
  gap: 8px;
  color: #005a9c;
  text-align: center;
}

body.page-id-218 .page-content .history-certification-grid .history-cert-logo--sports-yell .history-cert-logo__mark {
  display: block;
  color: #005a9c;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(24px, 2vw, 34px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.02em;
}

body.page-id-218 .page-content .history-certification-grid .history-cert-logo--sports-yell .history-cert-logo__year {
  display: block;
  color: #005a9c;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(28px, 2.4vw, 42px);
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 900px) {
  body.page-id-218 .page-content--about > .history-photo-grid.history-certification-grid,
  body.page-id-218 .page-content .history-photo-grid.history-certification-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body.page-id-218 .page-content--about > .history-photo-grid.history-certification-grid,
  body.page-id-218 .page-content .history-photo-grid.history-certification-grid {
    grid-template-columns: 1fr;
  }
}

/* History page: company-lower spacing and mobile safeguards */
body.page-id-218 .page-content {
  --msk-section-gap: 64px;
}

.page-id-218 .page-content .wp-block-table.company-table.history-table {
  margin-top: var(--msk-section-gap);
  border-top: 0;
  border-bottom: 0;
}

.page-id-218 .page-content .wp-block-table.company-table.history-table table {
  border-top: 1px solid #b8c3d2;
  border-bottom: 1px solid #b8c3d2;
}

.page-id-218 .page-content .history-photo-grid {
  margin-top: var(--msk-section-gap);
}

@media (max-width: 980px) {
  body.page-id-218 .page-content {
    --msk-section-gap: 40px;
  }
}

@media (max-width: 880px) {
  body.page-id-218 .page-content .wp-block-table.company-table.history-table::before,
  body.page-id-218 .page-content .wp-block-table.company-table.history-table::after,
  body.page-id-218 .page-content .history-photo-grid::before,
  body.page-id-218 .page-content .history-photo-grid::after {
    content: none !important;
    display: none !important;
  }

  body.page-id-218 .page-content .wp-block-table.company-table.history-table,
  body.page-id-218 .page-content .history-photo-grid {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
}

/* History page: desktop company-lower layout */
@media (min-width: 1024px) {
  body.page-id-218 .page-article--with-title-banner {
    padding-bottom: 0;
  }

  body.page-id-218 .page-title-banner--about {
    padding: 0 !important;
    background: transparent;
  }

  body.page-id-218 .page-title-banner--about .about-pagehero {
    overflow: hidden;
    background: #0079c4;
  }

  body.page-id-218 .page-title-banner--about .about-pagehero__img {
    display: block;
    width: 100%;
    height: auto;
  }

  body.page-id-218.page-article--with-company-nav-banner .page-title-banner--about .page-title-banner__inner,
  body.page-id-218 .page-article--with-company-nav-banner .page-title-banner--about .page-title-banner__inner,
  body.page-id-218 .page-title-banner--about .page-title-banner__inner {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 100px 0;
    background: #dff0f7;
    box-sizing: border-box;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav {
    width: min(calc(100% - 80px), 1160px);
    max-width: 1160px;
    margin: 0 auto;
    padding: 0;
    border: 0 !important;
    background: transparent;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav ul {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav li {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0 !important;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav li::before,
  body.page-id-218 .page-title-banner--about .company-nav.quality-nav li::after {
    content: none !important;
    display: none !important;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a {
    position: relative;
    min-height: 100px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #0079c4;
    border-left-width: 0;
    border-radius: 0;
    background:
      linear-gradient(135deg, transparent 0 72%, rgba(0, 126, 200, 0.12) 72% 100%),
      #ffffff;
    color: #0079c4;
    font-size: 28px;
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: 0.02em;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    box-sizing: border-box;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav li:first-child a {
    border-left-width: 3px;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a::before,
  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a::after {
    content: none !important;
    display: none !important;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a:hover,
  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a:focus-visible {
    background:
      linear-gradient(135deg, transparent 0 72%, rgba(0, 126, 200, 0.12) 72% 100%),
      #ffffff;
    color: #0079c4;
  }

  body.page-id-218 .page-title-banner--about .company-nav.quality-nav a.is-current {
    background: #0079c4;
    color: #ffffff;
  }

  body.page-id-218 .page-content--about {
    position: relative;
    padding-top: 90px;
    padding-bottom: 100px;
  }

  body.page-id-218 .page-content--about::before {
    content: "";
    position: absolute;
    top: 90px;
    bottom: 100px;
    left: max(40px, calc(50% - 580px));
    width: 4px;
    background: #0079c4;
    pointer-events: none;
  }

  body.page-id-218 .page-content--about::after {
    content: "沿革・歴史";
    position: absolute;
    top: 90px;
    left: max(40px, calc(50% - 580px - 50px));
    color: #0079c4;
    font-size: 34px;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0.04em;
    writing-mode: vertical-rl;
    text-orientation: upright;
    pointer-events: none;
  }

  body.page-id-218 .about-sidetitle {
    display: none !important;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table {
    width: min(calc(100% - 80px), 1160px);
    max-width: 1160px;
    margin: 0 auto !important;
    padding-left: 100px;
    padding-right: 0;
    border: 0;
    box-sizing: border-box;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table::before,
  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table::after {
    content: none !important;
    display: none !important;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table table {
    width: 100%;
    border-top: 1px solid #b8c3d2;
    border-bottom: 1px solid #b8c3d2;
    border-collapse: collapse;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table tr {
    border-bottom: 1px solid #b8c3d2;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table tr:last-child {
    border-bottom: 0;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table th,
  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table td,
  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table th *,
  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table td * {
    color: #000000;
    font-size: 15px !important;
    font-weight: 400;
    line-height: 1.48 !important;
    letter-spacing: 0.02em !important;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table th {
    width: 220px;
    padding: 6px 0 !important;
    white-space: nowrap;
    text-align: left;
  }

  body.page-id-218 .page-content--about > .wp-block-table.company-table.history-table td {
    padding: 6px 0 !important;
  }

  body.page-id-218 .page-content--about > .history-photo-grid {
    width: min(calc(100% - 80px), 1160px);
    max-width: 1160px;
    margin: 70px auto 0 !important;
    padding-left: 100px;
    padding-right: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 64px;
    box-sizing: border-box;
  }

  body.page-id-218 .page-content--about > .history-photo-grid::before,
  body.page-id-218 .page-content--about > .history-photo-grid::after {
    content: none !important;
    display: none !important;
  }

  body.page-id-218 .page-content--about > .history-photo-grid figure {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: transparent;
  }

  body.page-id-218 .page-content--about > .history-photo-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 1.42 / 1;
    object-fit: cover;
  }
}

/* Header menu hero baseline: match /products/. */
@media (min-width: 1024px) {
  body.page-id-218 .page-title-banner--about {
    position: relative !important;
    height: 385px !important;
    margin-top: var(--header-h, 110px) !important;
    margin-bottom: 300px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.page-id-218 .page-title-banner--about .about-pagehero {
    width: calc(100vw - var(--sbw, 0px)) !important;
    height: 385px !important;
    max-width: none !important;
    margin-left: calc(50% - (50vw - (var(--sbw, 0px) / 2))) !important;
    margin-right: calc(50% - (50vw - (var(--sbw, 0px) / 2))) !important;
    overflow: hidden !important;
  }

  body.page-id-218 .page-title-banner--about .about-pagehero__img {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    margin-left: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
  }

  body.page-id-218 .page-title-banner--about .page-title-banner__inner {
    position: absolute !important;
    top: 385px !important;
    left: 0 !important;
    right: 0 !important;
  }
}

/* SP history: make the date column read like subheadings. */
@media (max-width: 880px) {
  body.page-id-218 .page-content .wp-block-table.company-table.history-table th,
  body.page-id-218 .page-content .wp-block-table.company-table.history-table th * {
    font-weight: 800 !important;
  }
}

/* JP SP company pages: unified content heading layout. */
@media (max-width: 880px) {
  body:not(.language-page-body).page-id-218 .page-content--about > .about-sidetitle {
    position: static !important;
    display: block !important;
    width: min(calc(100vw - 72px), 720px) !important;
    max-width: calc(100% - 32px) !important;
    margin: 38px auto 38px !important;
    padding: 0 0 10px !important;
    border: 0 !important;
    border-bottom: 3px solid #0079c4 !important;
    color: #0079c4 !important;
    font-family: "Noto Sans CJK JP", "Noto Sans JP", sans-serif !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1.12 !important;
    letter-spacing: 0.08em !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    text-align: left !important;
    -webkit-text-fill-color: #0079c4 !important;
    box-sizing: border-box !important;
    white-space: normal !important;
  }
}

/* JP SP only: match the company overview hero image with /aboutus/. */
@media (max-width: 880px) {
  body:not(.language-page-body):not(.language-page-body--en):not(.language-page-body--zh).page-id-218 .page-title-banner--about .about-pagehero {
    height: 170px !important;
    min-height: 170px !important;
    background: url("../../img/about/about-hero-sp-20260623.jpg") center center / cover no-repeat !important;
  }

  body:not(.language-page-body):not(.language-page-body--en):not(.language-page-body--zh).page-id-218 .page-title-banner--about .about-pagehero__img {
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    opacity: 0 !important;
  }
}
