/* ==========================================
    会社概要ページ（company）
   ========================================== */

.post-name-company .site-body {
  margin-top: 0;
  padding: calc(20 / 16 * 1rem) 0 calc(10 / 16 * 1rem);
}

@media (min-width: 768px) {
  .post-name-company .site-body {
    padding: calc(30 / 16 * 1rem) 0 calc(100 / 16 * 1rem);
  }
}

.post-name-company .main-section {
  margin: 0;
  opacity: 1;
}

@media (min-width: 768px) {
  .w100vw {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
  }
}

/* ==========================================
    共通パーツ
   ========================================== */
.post-name-company .section-top-bg-gray {
  background-color: #f6f6f6;
  width: 100vw;
  max-width: initial !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: 0 !important;
  padding: calc(50 / 16 * 1rem) 0 calc(70 / 16 * 1rem);
  margin-bottom: calc(-50 / 16 * 1rem) !important;
}

.post-name-company .section-top-bg-gray h2 {
  font-size: calc(30 / 16 * 1rem);
  margin-bottom: calc(4 / 16 * 1rem) !important;
}

.post-name-company .section-top-bg-gray p.has-text-align-center {
  font-size: calc(18 / 16 * 1rem);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(20 / 16 * 1rem);
}

.post-name-company .section-top-bg-gray p.has-text-align-center::before,
.post-name-company .section-top-bg-gray p.has-text-align-center::after {
  content: "";
  display: block;
  width: calc(36 / 16 * 1rem);
  height: 0.0625rem;
  background-color: currentColor;
  flex-shrink: 0;
}

.post-name-company .section-top-bg-gray + div {
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .post-name-company .section-top-bg-gray + div.wp-block-columns,
  .post-name-company .section-top-bg-gray + div.wp-block-group,
  .post-name-company .section-top-bg-gray + ul.company-history {
    max-width: 1180px !important;
    margin-inline: auto;
    padding-inline: calc(30 / 16 * 1rem);
  }
  .post-name-company .section-top-bg-gray {
    padding: calc(100 / 16 * 1rem) 0 calc(150 / 16 * 1rem);
    margin-bottom: calc(-110 / 16 * 1rem) !important;
  }
  .post-name-company .section-top-bg-gray h2 {
    font-size: calc(33 / 16 * 1rem);
    margin-bottom: calc(5 / 16 * 1rem) !important;
  }
  .post-name-company .section-top-bg-gray p.has-text-align-center {
    font-size: calc(18 / 16 * 1rem);
  }
  .post-name-company .section-top-bg-gray p.has-text-align-center::before,
  .post-name-company .section-top-bg-gray p.has-text-align-center::after {
    width: calc(52 / 16 * 1rem);
  }
}

/* ==========================================
    代表挨拶セクション
   ========================================== */
.greeting-contents {
  flex-direction: column-reverse;
  padding-bottom: calc(30 / 16 * 1rem);
}

.greeting-contents p.mb0 {
  margin-bottom: 0 !important;
}

@media (min-width: 768px) {
  .greeting-contents {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    margin-left: calc(-30 / 16 * 1rem);
    margin-right: calc(-30 / 16 * 1rem);
    padding-left: calc(30 / 16 * 1rem);
    padding-right: calc(30 / 16 * 1rem);
    background-color: var(--color-white);
    gap: calc(35 / 16 * 1rem);
    align-items: center !important;
    padding-bottom: calc(50 / 16 * 1rem);
    margin-bottom: 0;
  }
  .greeting-contents .wp-block-column:first-of-type {
    padding-top: calc(50 / 16 * 1rem);
    width: 45%;
    flex: initial;
    flex-shrink: initial;
  }
  .greeting-contents .wp-block-column:last-of-type {
    margin-right: calc(-30 / 16 * 1rem);
    flex: 1;
    flex-shrink: initial;
    align-self: initial !important;
  }
  .greeting-contents h3 {
    font-size: calc(28 / 16 * 1rem) !important;
    margin-bottom: calc(30 / 16 * 1rem);
  }
  .greeting-contents p {
    font-size: calc(16 / 16 * 1rem) !important;
  }
  .greeting-contents p.mb0 {
    margin-bottom: 0 !important;
  }
}

@media (min-width: 1200px) {
  .greeting-contents {
    align-items: flex-start !important;
    padding-bottom: calc(120 / 16 * 1rem);
  }
  .greeting-contents .wp-block-column:first-of-type {
    padding-top: calc(50 / 16 * 1rem);
  }
  .greeting-contents .wp-block-column:last-of-type {
    align-self: flex-start !important;
  }
  .greeting-contents h3 {
    margin-bottom: calc(40 / 16 * 1rem);
  }
}

@media (min-width: 1240px) {
  .greeting-contents {
    margin-left: calc(-50 / 16 * 1rem);
    margin-right: calc(-50 / 16 * 1rem);
    padding-left: calc(50 / 16 * 1rem);
    padding-right: calc(50 / 16 * 1rem);
    gap: calc(55 / 16 * 1rem);
  }
}

/* ==========================================
    会社概要
   ========================================== */
.c-company-profile .wp-block-group:has(.company-profile-table) {
  padding: calc(32 / 16 * 1rem) calc(16 / 16 * 1rem) !important;
  margin-bottom: calc(18 / 16 * 1rem);
}

.company-profile-table td {
  font-size: calc(16 / 16 * 1rem);
}

.company-profile-table td:first-of-type {
  width: calc(105 / 16 * 1rem) !important;
}

@media (min-width: 768px) {
  .wp-block-group:has(.company-profile-table) {
    padding: calc(32 / 16 * 1rem) !important;
    margin-bottom: calc(48 / 16 * 1rem);
  }
  .company-profile-table td {
    font-size: calc(16 / 16 * 1rem);
  }
  .company-profile-table td:first-of-type {
    width: initial !important;
  }
}

/* ==========================================
    会社沿革タイムライン [company_history]
   ========================================== */
.company-history {
  list-style: none;
  padding: calc(32 / 16 * 1rem) calc(24 / 16 * 1rem) calc(64 / 16 * 1rem);
  margin: 0;
  position: relative;
  background-color: var(--color-white);
}

/* 縦線（旧実装: ul全体に線を引く方式）
.company-history::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(32 / 16 * 1rem);
  width: 0.1875rem;
  background-color: rgba(0, 0, 0, 0.15);
}
*/

/* 縦線（各アイテムの::afterで引く方式 */
.company-history__item::after {
  content: "";
  position: absolute;
  top: calc(24 / 16 * 1rem);
  left: calc(5 / 16 * 1rem);
  bottom: calc(-8 / 16 * 1rem);
  width: calc(3 / 16 * 1rem);
  background-color: rgba(0, 0, 0, 0.15);
}

.company-history__item {
  position: relative;
  padding-left: calc(32 / 16 * 1rem);
  padding-bottom: calc(40 / 16 * 1rem);
}

/* ドット */
.company-history__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(6 / 16 * 1rem);
  width: calc(14 / 16 * 1rem);
  height: calc(14 / 16 * 1rem);
  border-radius: 50%;
  border: 0.1875rem solid var(--color-red);
  background-color: var(--color-white);
  box-sizing: border-box;
}

/* 最初のアイテムは塗りつぶし */
.company-history__item:first-child::before {
  background-color: var(--color-red);
}

.company-history__year {
  margin: 0 0 calc(4 / 16 * 1rem);
  font-size: calc(16 / 16 * 1rem);
  color: #666;
  line-height: 1.4;
  position: relative;
  top: calc(2 / 16 * 1rem);
}

.company-history__title {
  margin: 0;
  font-size: calc(20 / 16 * 1rem);
  font-weight: var(--fw-700);
  line-height: 1.6;
}

@media (min-width: 768px) {
  .company-history {
    padding: calc(64 / 16 * 1rem) calc(32 / 16 * 1rem) calc(100 / 16 * 1rem);
  }
  /* .company-history::before {
    top: calc(80 / 16 * 1rem);
    left: calc(38 / 16 * 1rem);
    height: 85%;
  } */
  .company-history__item::before {
    width: calc(14 / 16 * 1rem);
    height: calc(14 / 16 * 1rem);
  }
  .company-history__item::after {
    top: calc(26 / 16 * 1rem);
    left: calc(5.5 / 16 * 1rem);
    bottom: calc(-8 / 16 * 1rem);
    width: calc(3 / 16 * 1rem);
  }
  .company-history__year {
    position: relative;
    top: calc(1 / 16 * 1rem);
    margin: 0;
    font-size: calc(16 / 16 * 1rem);
  }
  .company-history__title {
    margin: calc(24 / 16 * 1rem) 0 0;
    font-size: calc(21 / 16 * 1rem);
  }
}

/* ==========================================
    アクセス
   ========================================== */
.c-access .wp-block-group:has(.by-train) {
  padding: calc(32 / 16 * 1rem) calc(24 / 16 * 1rem) !important;
}

.post-name-company .by-train .vk_heading-style-plain {
  margin-bottom: calc(20 / 16 * 1rem) !important;
}

.post-name-company .map-wrapper {
  width: fit-content;
  margin-inline: auto;
}

.post-name-company iframe {
  aspect-ratio: 600/450;
  height: auto;
  width: 100%;
}

@media (min-width: 768px) {
  .post-name-company .by-train .vk_heading-style-plain {
    margin-bottom: calc(39 / 16 * 1rem) !important;
  }
  .post-name-company iframe {
    width: calc(600 / 16 * 1rem);
  }
}

/* ==========================================
    スクロールアニメーション（.c-greeting）
    JS 無効時は通常表示
   ========================================== */

/* --- セクションヘッダー：h2 / GREETING --- */
.js .c-greeting .section-top-bg-gray h2,
.js .c-greeting .section-top-bg-gray .has-text-align-center {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .c-greeting .section-top-bg-gray .has-text-align-center {
  transition-delay: 0.18s;
}

.js .c-greeting .section-top-bg-gray.is-visible h2,
.js .c-greeting .section-top-bg-gray.is-visible .has-text-align-center {
  opacity: 1;
  transform: translateY(0);
}

/* --- コンテンツカラム：SP は上から、PC は左右から --- */
.js .c-greeting .greeting-contents .wp-block-column {
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .c-greeting .greeting-contents .wp-block-column:last-of-type {
  transition-delay: 0.15s;
}

@media (min-width: 768px) {
  .js .c-greeting .greeting-contents .wp-block-column:first-of-type {
    transform: translateX(-2rem);
  }
  .js .c-greeting .greeting-contents .wp-block-column:last-of-type {
    transform: translateX(2rem);
    transition-delay: 0.2s;
  }
}

.js .c-greeting .greeting-contents.is-visible .wp-block-column {
  opacity: 1;
  transform: translate(0);
}

/* --- c-company-profile：セクションヘッダー（c-greeting と共通ルール） --- */
.js .c-company-profile .section-top-bg-gray h2,
.js .c-company-profile .section-top-bg-gray .has-text-align-center {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .c-company-profile .section-top-bg-gray .has-text-align-center {
  transition-delay: 0.18s;
}

.js .c-company-profile .section-top-bg-gray.is-visible h2,
.js .c-company-profile .section-top-bg-gray.is-visible .has-text-align-center {
  opacity: 1;
  transform: translateY(0);
}

/* --- c-company-profile：テーブルカード --- */
.js .c-company-profile .wp-block-group:has(.company-profile-table) {
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.1s;
}

.js .c-company-profile .wp-block-group:has(.company-profile-table).is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- c-history：セクションヘッダー（共通） --- */
.js .c-history .section-top-bg-gray h2,
.js .c-history .section-top-bg-gray .has-text-align-center {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .c-history .section-top-bg-gray .has-text-align-center {
  transition-delay: 0.18s;
}

.js .c-history .section-top-bg-gray.is-visible h2,
.js .c-history .section-top-bg-gray.is-visible .has-text-align-center {
  opacity: 1;
  transform: translateY(0);
}

/* --- c-history：タイムライン各アイテムを左からスタッガー --- */
.js .c-history .company-history .company-history__item {
  opacity: 0;
  transform: translateX(-1.5rem);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .c-history .company-history.is-visible .company-history__item {
  opacity: 1;
  transform: translateX(0);
}

.js .c-history .company-history.is-visible .company-history__item:nth-child(1) { transition-delay: 0.00s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(2) { transition-delay: 0.08s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(3) { transition-delay: 0.16s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(4) { transition-delay: 0.24s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(5) { transition-delay: 0.32s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(6) { transition-delay: 0.40s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(7) { transition-delay: 0.48s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(8) { transition-delay: 0.56s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(9) { transition-delay: 0.64s; }
.js .c-history .company-history.is-visible .company-history__item:nth-child(10){ transition-delay: 0.72s; }

/* --- c-access：セクションヘッダー（共通） --- */
.js .c-access .section-top-bg-gray h2,
.js .c-access .section-top-bg-gray .has-text-align-center {
  opacity: 0;
  transform: translateY(1.5rem);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.js .c-access .section-top-bg-gray .has-text-align-center {
  transition-delay: 0.18s;
}

.js .c-access .section-top-bg-gray.is-visible h2,
.js .c-access .section-top-bg-gray.is-visible .has-text-align-center {
  opacity: 1;
  transform: translateY(0);
}

/* --- c-access：アクセスカード --- */
.js .c-access .wp-block-group:has(.by-train) {
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: 0.1s;
}

.js .c-access .wp-block-group:has(.by-train).is-visible {
  opacity: 1;
  transform: translateY(0);
}
