/* unlike the offset sections on the 企業情報 page, the 会社概要 layout is a
   1200px column centred with even 156px gutters */
.content-section.profile,
.content-section.profile-related {
  width: min(var(--content-width), calc(100% - 2 * var(--gutter)));
  margin: 40px auto 0;
}

/* the first section has no heading, so the panel is offset with padding
   instead of a margin to keep the ring anchored to the section top */
.content-section.profile {
  padding-top: 128px;
}

.content-section.profile .section-ring.red {
  top: 0;
  right: -64px;
}

.content-section.profile-related .section-ring.orange {
  top: 0;
  left: -64px;
}

.section-panel.profile-panel {
  margin-top: 0;
}

.profile-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: var(--inner-width);
}

.profile-content .tab {
  width: 160px;
}

/* definition table */

.profile-table {
  border: 1px solid #e4e6ea;
  border-radius: 8px;
  overflow: hidden;
}

.profile-row {
  display: grid;
  grid-template-columns: 200px 1fr;
}

.profile-row + .profile-row {
  border-top: 1px solid #f4f5f7;
}

.profile-label,
.profile-value {
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.7;
}

.profile-label {
  background: rgba(244, 245, 247, 0.6);
  font-weight: 700;
}

.profile-value {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.profile-value p {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.value-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.value-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.value-list li {
  position: relative;
  padding-left: 16px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.value-list li::before {
  content: "\2022";
  position: absolute;
  left: 4px;
}

/* 主要取引先・取引銀行の外部リンク。共通CSSの a はテキストと同じ見た目になるため、
   リンクと分かるよう下線を敷き、ホバー・フォーカスでコーポレートカラーに転じる */
.value-list a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.25);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.value-list a:hover,
.value-list a:focus-visible {
  color: var(--red);
  text-decoration-color: currentColor;
}

.value-note {
  color: #808080;
  font-weight: 700;
}

/* history */

.history-lead {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-lead p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}

/* Figma(994:2745) では説明文ブロックの下端279pxに対しリストの上端が311px = 32px空き */
.history-list {
  position: relative;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

/* 縦線は行ごとではなくリスト全体で1本引く。SPで行間を空けても途切れない */
.history-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5.5px;
  width: 1px;
  background: #e4e6ea;
}

.history-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 56px;
}

.history-marker {
  position: relative;
  flex: 0 0 23px;
}

.history-marker::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 7.5px;
  width: 16px;
  height: 1px;
  background: #e4e6ea;
}

.history-dot {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 0;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  border: 1.72px solid #fff;
  border-radius: 50%;
  background: #e60012;
}

.history-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-date {
  flex: 0 0 120px;
  margin: 0;
  color: #16181d;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.35px;
  white-space: nowrap;
}

.history-text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #4a4f57;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
}

/* organization */

.org-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.org-block + .org-block {
  margin-top: 32px;
}

.org-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.org-heading-ja {
  margin: 0;
  color: #16181d;
  font-size: 22px;
  font-weight: 700;
  line-height: 26px;
  white-space: nowrap;
}

.org-heading-en {
  padding-top: 2px;
  color: #878d96;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.org-heading-line {
  flex: 1 1 auto;
  min-width: 0;
  height: 1px;
  margin-left: 4px;
  background: #e4e6ea;
}

.org-chart {
  min-height: 360px;
  padding-top: 20px;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.org-chart-image {
  width: 640px;
  max-width: 100%;
  height: auto;
}

/* related pages */

.content-section.profile-related .section-heading {
  padding-top: 64px;
  padding-left: 16px;
}

.section-panel.related-panel {
  margin-top: -28px;
  padding: var(--panel-padding-y) var(--panel-padding-x);
}

.profile-related .related-cards {
  grid-template-columns: minmax(0, 346px);
}

.profile-related .related-card {
  height: auto;
  padding: 16px 24px;
  gap: 16px;
}

.profile-related .related-card-title {
  line-height: 1.7;
}

.site-footer {
  margin-top: 40px;
}

@media (max-width: 767px) {
  .content-section.profile,
  .content-section.profile-related {
    width: 100%;
    margin: 40px auto 0;
  }

  .content-section.profile .section-ring.red {
    right: -64px;
  }

  .content-section.profile-related .section-ring.orange {
    left: -64px;
  }

  .content-section.profile {
    padding-top: 92px;
  }

  .section-panel.profile-panel {
    padding: 40px 20px;
  }

  .profile-content {
    gap: 16px;
  }

  .profile-content .tab {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
  }

  .profile-content .tab-title {
    min-height: 0;
    line-height: 1.8;
  }

  .profile-row {
    grid-template-columns: 88px 1fr;
  }

  .profile-label {
    padding: 12px 16px;
  }

  /* 沿革（Figma 1003:3527）: 横並び（日付120px + 本文）はPCと同じで、
     行の高さは内容なり、行間は16pxのスペーサー。説明文との間は16px */
  .history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
  }

  .history-item {
    min-height: 0;
  }

  .org-chart {
    min-height: 0;
    padding-top: 0;
  }

  .org-chart-image {
    width: 100%;
  }

  .content-section.profile-related .section-heading {
    padding-top: 48px;
    padding-left: 0;
  }

  /* Figma では「Related pages」は1行。共通の width: 295px だと折り返すので
     幅の制限を外す。375px を数px はみ出すが .site の overflow: hidden で収まる */
  .profile-related .section-title-en {
    width: auto;
    white-space: nowrap;
  }

  /* Figma（995:4389）: パネル上端は見出し箱の下端（120px）、カードの頭は +56px */
  .section-panel.related-panel {
    margin-top: 0;
    padding: 56px 20px 40px;
  }

  .profile-related .related-cards {
    grid-template-columns: 1fr;
  }

  .profile-related .related-card {
    min-height: 0;
  }
}
