/* ==========================================================================
   benefits.css — 福利厚生（働く環境）
   Figmaノード: 6:2019
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Workplace Section (拠点2枚 + Remote Work = 逆三角形配置)
   Figma: 東京 x=292,y=533 / 松山 x=1030,y=533 / Remote x=660,y=1144
   各円: 600×600, 上段gap=138px, 六角形装飾 y=1542
   -------------------------------------------------------------------------- */
.bf-workplace {
  position: relative;
  padding: 80px 0 80px;
}

/* コンテナ上書き */
.bf-workplace .container {
  max-width: 1460px;
  padding: 0 var(--site-padding);
  position: relative;
}

/* 三角形装飾（3つの円カードの中心を結ぶ逆三角形） */
.bf-workplace__triangle {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bf-workplace__triangle svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- 上段: 拠点カード2枚 --- */
.bf-workplace__row-top {
  display: flex;
  justify-content: center;
  gap: clamp(40px, calc(-69.5px + 10.95vw), 138px);
  position: relative;
  z-index: 1;
}

/* --- 下段: Remote Work中央 --- */
.bf-workplace__row-bottom {
  display: flex;
  justify-content: center;
  margin-top: clamp(0px, calc(-12.6px + 1.23vw), 11px);
  position: relative;
  z-index: 1;
}

/* --- 共通円カード --- */
.bf-workplace__circle {
  width: clamp(420px, calc(213.9px + 20.11vw), 600px);
  height: clamp(420px, calc(213.9px + 20.11vw), 600px);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  padding: 0 3%;
  gap: 1vw;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bf-workplace__circle:hover {
  transform: scale(1.05);
}

/* 拠点カード: 白背景 */
.bf-workplace__circle--location {
  background-color: #fff;
}

/* Remote Workカード: 背景色・画像・透過度はインラインstyle（ACF管理） */
.bf-workplace__circle--remote {
  position: relative;
  overflow: hidden;
  justify-content: center;
}

.bf-workplace__circle--remote .bf-workplace__bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}

/* --- 拠点カード内部 --- */
.bf-workplace__illust {
  width: clamp(180px, calc(82.8px + 9.49vw), 265px);
  height: clamp(160px, calc(88.8px + 6.93vw), 222px);
  margin-top: clamp(20px, calc(-8.7px + 2.79vw), 45px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bf-workplace__illust img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.bf-workplace__name {
  font-family: "Arimo", "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, calc(12.8px + 0.89vw), 30px);
  line-height: 1.6;
  color: var(--color-navy);
  font-feature-settings: "palt";
  margin-top: clamp(12px, calc(-10.9px + 2.23vw), 32px);
}

.bf-workplace__address {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(13px, calc(9.6px + 0.34vw), 16px);
  line-height: 1.8;
  letter-spacing: 0.8px;
  font-feature-settings: "palt";
  color: var(--color-base);
  text-align: center;
}

.bf-workplace__access {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(13px, calc(9.6px + 0.34vw), 16px);
  line-height: 1.8;
  letter-spacing: 0.8px;
  font-feature-settings: "palt";
  color: var(--color-base);
  text-align: center;
}

.bf-workplace__access-marker {
  color: var(--color-orange);
}

.bf-workplace__map-link {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(13px, calc(9.6px + 0.34vw), 16px);
  line-height: 1.8;
  letter-spacing: 0.8px;
  font-feature-settings: "palt";
  color: var(--color-navy);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  transition: opacity 0.2s ease;
}

.bf-workplace__map-link:hover {
  opacity: 0.7;
}

.bf-workplace__link-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* --- Remote Work内部 --- */
.bf-workplace__remote-en {
  font-family: "Caveat", cursive;
  font-weight: 400;
  font-size: clamp(56px, calc(28.4px + 2.68vw), 80px);
  line-height: 1;
  color: var(--color-base);
  position: relative;
  z-index: 1;
}

.bf-workplace__remote-ja {
  font-family: "Arimo", "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, calc(12.8px + 0.89vw), 30px);
  line-height: 1.6;
  color: var(--color-navy);
  font-feature-settings: "palt";
  position: relative;
  z-index: 1;
}

.bf-workplace__remote-body {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  text-align: left;
}

.bf-workplace__remote-text {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(14px, calc(11.7px + 0.22vw), 16px);
  line-height: 1.8;
  letter-spacing: 0.8px;
  font-feature-settings: "palt";
  color: var(--color-base);
}

.bf-workplace__remote-note {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.6;
  font-feature-settings: "palt";
  color: var(--color-base);
}

/* --------------------------------------------------------------------------
   3. Benefits Card Grid
   Figma: 見出し Y=1844 / Row1 Y=2054 / コンテナ 1620px（x=150〜1770）
   カード幅500px / gap 60px水平 / 80px垂直
   -------------------------------------------------------------------------- */
.bf-list {
  padding: 0 0 120px;
}

.bf-list .container {
  max-width: 1740px; /* 1620 + 60×2 = Figma準拠 */
  padding: 0 var(--site-padding);
}

.bf-list .section-heading {
  margin-bottom: clamp(36px, calc(-21.3px + 5.59vw), 76px);
}

/* グリッドラッパー */
.bf-list__grid {
  --bf-gap: clamp(24px, calc(-27.6px + 5.03vw), 60px);
  --bf-card-w: calc((100% - 2 * var(--bf-gap)) / 3);
}

/* 行コンテナ共通 */
.bf-list__row {
  display: grid;
  column-gap: var(--bf-gap);
  row-gap: 0;
  justify-content: center;
  margin-bottom: clamp(40px, calc(-17.3px + 5.59vw), 80px);
}

.bf-list__row:last-child {
  margin-bottom: 0;
}

/* 3列行 */
.bf-list__row--3 {
  grid-template-columns: repeat(3, var(--bf-card-w));
}

/* 2列行: 同じカード幅で中央寄せ */
.bf-list__row--2 {
  grid-template-columns: repeat(2, var(--bf-card-w));
}

/* カード: subgridで行内の4要素の高さを揃える */
.bf-card {
  grid-row: span 4;
  display: grid;
  grid-template-rows: subgrid;
}

/* --------------------------------------------------------------------------
   4. Benefits Card
   Figma: 500px幅、padding 40px 50px、card-gradient + radius 20px
   見出し: heading-marker共通クラス（common.css）
   -------------------------------------------------------------------------- */
.bf-card {
  width: 100%;
  padding: clamp(20px, calc(-8.7px + 2.8vw), 40px) clamp(24px, calc(-13.3px + 3.64vw), 50px);
  justify-self: center;
}

.stagger-fade-in > .bf-card:hover,
.bf-card:hover {
  transform: scale(1.03);
}

.bf-card .heading-marker__text {
  font-size: clamp(18px, calc(11.8px + 0.52vw), 26px);
  line-height: 1.5;
}

.bf-list .section-heading__en {
  font-size: clamp(24px, calc(16.6px + 0.63vw), 36px);
}

.bf-list .section-heading__ja {
  font-size: clamp(28px, calc(14.4px + 1.15vw), 50px);
  line-height: 1.2;
}

.bf-card__line {
  border: none;
  border-top: 1px solid var(--color-orange);
  margin: 16px 0 0;
  width: 100%;
}

.bf-card__illust {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, calc(-5.2px + 1.68vw), 24px) 0;
}

.bf-card__illust img {
  max-width: 80%;
  max-height: 195px;
  width: auto;
  height: auto;
}

.bf-card__text {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: clamp(14px, calc(6.9px + 0.57vw), 18px);
  line-height: 1.8;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  color: var(--color-base);
  text-align: center;
}

.bf-card__text pre {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}

/* --------------------------------------------------------------------------
   5. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .bf-workplace {
    padding: 60px 0 60px;
  }

  .bf-list {
    padding: 0 0 80px;
  }

  .bf-workplace__row-top {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  .bf-workplace__circle {
    width: 600px;
    height: 600px;
  }

  .bf-workplace__illust {
    width: 265px;
    height: 222px;
    margin-top: 45px;
  }

  .bf-workplace__name {
    font-size: 30px;
    line-height: 1.6;
    margin-top: 32px;
  }

  .bf-workplace__address,
  .bf-workplace__access {
    font-size: 16px;
    line-height: 32px;
  }

  .bf-workplace__map-link {
    font-size: 16px;
  }

  .bf-workplace__link-icon {
    width: 18px;
    height: 18px;
  }

  .bf-workplace__remote-en {
    font-size: 80px;
    line-height: 75.216px;
  }

  .bf-workplace__remote-ja {
    font-size: 30px;
    line-height: 62.674px;
  }

  .bf-workplace__remote-text {
    font-size: 16px;
    line-height: 32px;
  }

  .bf-workplace__remote-note {
    font-size: 12px;
  }

  .bf-workplace__triangle {
    display: none;
  }

  .bf-workplace__row-bottom {
    margin-top: 32px;
  }

  /* Benefits Grid: 2列化 */
  .bf-list .section-heading {
    margin-bottom: 48px;
  }

  .bf-list__row {
    display: contents;
  }

  .bf-list__row.stagger-fade-in > *:not(.fade-in-up) {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .bf-list__row.stagger-fade-in > .fade-in-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.9s ease, transform 0.9s ease;
  }

  .bf-list__row.stagger-fade-in > .fade-in-up.is-visible {
    opacity: 1;
    transform: none;
  }

  .bf-list__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 40px;
    row-gap: 0;
  }

  .bf-card {
    margin-bottom: 40px;
  }

  .bf-card:last-child,
  .bf-card:nth-last-child(2):nth-child(odd) {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  /* Workplace */
  .bf-workplace {
    padding: 48px 0 48px;
  }

  .bf-workplace__row-top {
    flex-direction: column;
    align-items: center;
    gap: 32px;
  }

  /* Workplace — 768px〜481px: clamp(600→420) */
  .bf-workplace__circle {
    width: clamp(420px, calc(120px + 62.5vw), 600px);
    height: clamp(420px, calc(120px + 62.5vw), 600px);
  }

  .bf-workplace__illust {
    width: clamp(180px, calc(38.4px + 29.51vw), 265px);
    height: clamp(160px, calc(56.7px + 21.53vw), 222px);
    margin-top: clamp(20px, calc(-21.7px + 8.68vw), 45px);
  }

  .bf-workplace__name {
    font-size: clamp(22px, calc(8.7px + 2.78vw), 30px);
    margin-top: clamp(12px, calc(-21.3px + 6.94vw), 32px);
  }

  .bf-workplace__address,
  .bf-workplace__access {
    font-size: clamp(13px, calc(8px + 1.04vw), 16px);
  }

  .bf-workplace__map-link {
    font-size: clamp(13px, calc(8px + 1.04vw), 16px);
  }

  .bf-workplace__link-icon {
    width: clamp(14px, calc(7.3px + 1.39vw), 18px);
    height: clamp(14px, calc(7.3px + 1.39vw), 18px);
  }

  .bf-workplace__remote-en {
    font-size: clamp(52px, calc(5.3px + 9.72vw), 80px);
  }

  .bf-workplace__remote-ja {
    font-size: clamp(22px, calc(8.7px + 2.78vw), 30px);
  }

  .bf-workplace__remote-text {
    font-size: clamp(14px, calc(10.7px + 0.69vw), 16px);
  }

  .bf-workplace__remote-note {
    font-size: clamp(11px, calc(8.6px + 0.49vw), 12px);
  }

  /* Benefits Grid: 1列化 */
  .bf-list {
    padding: 0 0 64px;
  }

  .bf-list .section-heading {
    margin-bottom: 32px;
  }

  .bf-list__row {
    display: contents;
  }

  /* stagger-fade-in が contents で無効化 → 子カードの fade-in-up に委譲 */
  .bf-list__row.stagger-fade-in > *:not(.fade-in-up) {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* stagger由来のopacity:0を打ち消し、fade-in-upのopacity:0は維持 */
  .bf-list__row.stagger-fade-in > .fade-in-up {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.9s ease, transform 0.9s ease;
  }

  .bf-list__row.stagger-fade-in > .fade-in-up.is-visible {
    opacity: 1;
    transform: none;
  }

  .bf-list__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .bf-card {
    grid-row: auto;
    grid-template-rows: auto;
    padding: 28px 24px;
    margin-bottom: 0;
  }

  .bf-card__illust img {
    max-width: 180px;
    max-height: 160px;
  }

  .bf-card__text {
    font-size: 16px;
    line-height: 28px;
  }
}

/* 480px以下: 幅100%の通常円 */
@media (max-width: 480px) {
  .bf-workplace__circle {
    width: 100%;
    height: unset;
    aspect-ratio: 1 / 1;
    padding: 0 8%;
    justify-content: center;
  }

  .bf-workplace__illust {
    width: 50%;
    height: auto;
    margin-top: 0;
  }

  .bf-workplace__name {
    font-size: 20px;
    margin-top: 12px;
  }

  .bf-workplace__address,
  .bf-workplace__access {
    font-size: 12px;
    line-height: 22px;
  }

  .bf-workplace__map-link {
    font-size: 12px;
    margin-top: 4px;
  }

  .bf-workplace__link-icon {
    width: 14px;
    height: 14px;
  }

  .bf-workplace__remote-en {
    font-size: 36px;
    line-height: 1.2;
    padding: 0.1em;
  }

  .bf-workplace__remote-ja {
    font-size: 18px;
    line-height: 1.4;
  }

  .bf-workplace__remote-text {
    font-size: 13px;
    line-height: 1.6;
  }

  .bf-workplace__remote-note {
    font-size: 11px;
  }
}
