/* ==========================================================================
   merit-rating.css — 評価制度
   Figmaノード: 6:1898
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Overview Cards (2 columns)
   Figma: 左カード x=150, y=513, 780×280 / 右カード x=990, y=513, 780×280
   コンテナ: 1920px基準, 左右150px余白 = 1620px幅
   カード間ギャップ: 60px（990 - 150 - 780 = 60）
   -------------------------------------------------------------------------- */
.mr-overview {
  padding: 60px 0 0;
}

/* コンテナ上書き: カード領域1620px幅（1920 - 150×2） */
.mr-overview .container {
  max-width: var(--container-wide);
  padding: 0 var(--site-padding);
}

.mr-overview__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 60px;
}

/* カード: ボーダータイプ（card-gradientを上書き） */
.mr-overview__card {
  padding: 48px 50px;
  min-height: 280px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.mr-overview__line {
  border: none;
  border-top: 1px solid #ddd;
  margin: 20px 0 24px;
}

.mr-overview__tags {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mr-overview__tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.mr-overview__tag-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mr-overview__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  height: 31px;
  border-radius: 4px;
  background-image: linear-gradient(88.3deg, #ea8b0f 16.6%, #f6b204 93.9%);
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  color: #fff;
  white-space: nowrap;
}

.mr-overview__badge-text {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 32px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  color: var(--color-base);
}

.mr-overview__text {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 32px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  color: var(--color-base);
}

/* --------------------------------------------------------------------------
   2. Description Text with Decorative Illustrations
   Figma: 1920px基準
   左装飾(階段): x=389, 150×148 — 左上
   右装飾(人物): x=1390, 231×249 — 右下
   全体幅: 389 〜 1621 = 1232px
   -------------------------------------------------------------------------- */
.mr-description {
  padding: 110px 0 88px;
}

.mr-description__inner {
  display: grid;
  max-width: calc(1221px + var(--site-padding) * 2);
  margin: 0 auto;
  padding: 0 var(--site-padding);
}

/* デコレイヤーとテキストレイヤーを同じセルに重ねる */
.mr-description__deco,
.mr-description__body {
  grid-area: 1 / 1;
}

/* デコレイヤー: 全体に広がり、中に2つの画像を左上/右下に配置 */
.mr-description__deco {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 0;
}

.mr-description__illust {
  display: block;
  height: auto;
  pointer-events: none;
}

/* 左デコ: 左上寄せ — 1200px以下でclamp縮小 */
.mr-description__illust--left {
  width: clamp(56px, 12.5vw, 150px);
  align-self: flex-start;
  margin-right: auto;
}

/* 右デコ: 右下寄せ — 1200px以下でclamp縮小 */
.mr-description__illust--right {
  width: clamp(72px, 17.5vw, 210px);
  align-self: flex-end;
  margin-left: auto;
  transform: translateX(48px);
}

/* テキストレイヤー: デコの上。上下paddingでデコの上下はみ出し分を確保 */
.mr-description__body {
  z-index: 1;
  text-align: center;
  padding: 48px 24px;
}

.mr-description__text {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 600;
  font-size: 30px;
  line-height: 60px;
  letter-spacing: 1.5px;
  font-feature-settings: "palt";
  color: var(--color-navy);
  text-align: center;
}

/* --------------------------------------------------------------------------
   3. Evaluation Flow
   Figma: Y=1327, h=456, content幅1200px (x=360〜1560, centered)
   ラベル64px + gap20px + ステップ1116px = 1200px
   期初216px(2step+16gap) + 20gap + 期中100px + 20gap + 期末100px = 456px
   -------------------------------------------------------------------------- */
.mr-flow {
  padding: 0 0 80px;
}

.mr-flow .container {
  max-width: calc(1200px + var(--site-padding) * 2);
  padding: 0 var(--site-padding);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- フェーズ --- */
.mr-flow__phase {
  display: flex;
  gap: 20px; /* ラベル → ステップ間 */
}

/* フェーズラベル（64px幅、高さはflex伸長で自動） */
.mr-flow__phase-label {
  width: 64px;
  flex-shrink: 0;
  background-color: var(--color-orange);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.mr-flow__phase-label span {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  writing-mode: vertical-rl;
  line-height: 1;
}

/* ステップ群（縦並び） */
.mr-flow__steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- 矢印（Figma: Noto Sans JP Medium 30px, lh 40px, #EA8B0F） --- */
.mr-flow__arrow {
  display: flex;
  align-items: center;
  padding-left: 247px;
  margin-top: -40px;
  margin-bottom: -16px;
  position: relative;
  z-index: 1;
}

.mr-flow__arrow span {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 40px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  color: var(--color-orange);
}

/* フェーズ内矢印（期初の2ステップ間） */
.mr-flow__arrow--inner {
  padding-left: 163px;
}

/* --- ステップバー --- */
.mr-flow__step {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 10px;
  min-height: 100px;
  padding: 16px 40px;
  gap: 40px;
}

.mr-flow__step-name {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 40px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  white-space: nowrap;
  flex-shrink: 0;
  width: 280px;
  text-align: center;
}

.mr-flow__step-desc {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 32px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  color: var(--color-base);
}

/* --------------------------------------------------------------------------
   4. Cards Section (01 / 02 / 03)
   Figma: 見出し Y=1948, h=74 / カード Y=2093, 440×440
   コンテナ: 1520px幅（200px左右余白）
   カード間gap: ~100px（3×440 + 2×100 = 1520）
   -------------------------------------------------------------------------- */
.mr-cards {
  padding: 0 0 120px;
}

/* コンテナ上書き: カード領域1520px幅（1920 - 200×2） */
.mr-cards .container {
  max-width: var(--container-wide);
  padding: 0 var(--site-padding);
}

.mr-cards__heading {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 60px;
  letter-spacing: 1.5px;
  font-feature-settings: "palt";
  color: var(--color-navy);
  text-align: center;
  margin-bottom: 71px; /* 見出し底(Y2022) → カード(Y2093) = 71px */
}

.mr-cards__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  justify-content: center;
}

/* 各カード（番号の配置基準） */
.mr-cards__item {
  position: relative;
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-fade-in > .mr-cards__item:hover,
.mr-cards__item:hover {
  transform: scale(1.05);
}

/* 番号（左上、absolute配置で円に重なる） */
.mr-cards__number {
  position: absolute;
  top: -10px;
  left: 0;
  z-index: 1;
  font-family: "Caveat", cursive;
  font-weight: 400;
  font-size: clamp(48px, 6.5vw, 100px);
  line-height: 0.75;
  color: var(--color-navy);
}

/* 白丸（正方形、イラスト+テキスト全て内包） */
.mr-cards__circle {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
}

/* イラスト */
.mr-cards__illust {
  width: 40%;
  height: auto;
  margin-bottom: 20px;
}

/* 説明テキスト（円の中） */
.mr-cards__text {
  font-family: "Noto Sans JP", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 32px;
  letter-spacing: 2px;
  font-feature-settings: "palt";
  color: var(--color-navy);
  text-align: center;
  max-width: 80%;
}

/* --------------------------------------------------------------------------
   5. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .mr-description__illust--right {
    transform: translateX(4dvw);
  }
}

@media (max-width: 1024px) {
  .mr-overview {
    padding: 48px 0 0;
  }

  .mr-overview__cards {
    gap: 32px;
  }

  .mr-overview__card {
    padding: 32px 28px;
    min-height: auto;
  }

  .mr-overview .heading-marker__text {
    font-size: 22px;
    line-height: 36px;
  }

  .mr-overview__badge {
    font-size: 16px;
    height: 30px;
  }

  .mr-overview__badge-text,
  .mr-overview__text {
    font-size: 16px;
    line-height: 30px;
  }

  .mr-description {
    padding: 72px 0 56px;
  }

  .mr-description__body {
    padding: 36px 16px;
  }

  .mr-description__text {
    font-size: 24px;
    line-height: 48px;
  }

  .mr-flow__step {
    gap: 24px;
    padding: 16px 24px;
  }

  .mr-flow {
    padding: 0 0 60px;
  }

  .mr-flow__step-name {
    font-size: 18px;
  }

  .mr-cards {
    padding: 0 0 80px;
  }

  .mr-cards__heading {
    font-size: 24px;
    line-height: 48px;
    margin-bottom: 48px;
  }

  .mr-cards__grid {
    gap: 32px;
  }

  .mr-cards__circle {
    padding: 24px;
  }

  .mr-cards__illust {
    width: 32%;
    margin-bottom: 12px;
  }

  .mr-cards__text {
    font-size: 14px;
    line-height: 24px;
    letter-spacing: 1px;
    max-width: 90%;
  }
}

@media (max-width: 768px) {
  .mr-overview {
    padding: 32px 0 0;
  }

  .mr-overview__cards {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 480px;
    margin: 0 auto;
  }

  .mr-overview__card {
    padding: 24px 20px;
  }

  .mr-overview .heading-marker__text {
    font-size: 18px;
    line-height: 32px;
  }

  .mr-overview__line {
    margin: 16px 0 20px;
  }

  .mr-overview__tags {
    gap: 16px;
  }

  .mr-overview__tag-group {
    gap: 16px;
  }

  .mr-overview__tag-row {
    gap: 12px;
  }

  .mr-overview__badge {
    font-size: 14px;
    padding: 0 12px;
    height: 28px;
    letter-spacing: 1px;
  }

  .mr-overview__badge-text,
  .mr-overview__text {
    font-size: 14px;
    line-height: 26px;
    letter-spacing: 1px;
  }

  /* Description */
  .mr-description {
    padding: 48px 0 40px;
  }

  .mr-description__body {
    padding: 24px 8px;
  }

  .mr-description__illust--right {
    transform: none;
  }

  .mr-description__text {
    font-size: 20px;
    line-height: 40px;
    letter-spacing: 1px;
  }

  /* Flow */
  .mr-flow {
    padding: 0 0 64px;
  }

  .mr-flow .container {
    gap: 0;
  }

  .mr-flow__phase {
    flex-direction: column;
    gap: 0;
  }

  .mr-flow__steps {
    gap: 0;
  }

  .mr-flow__phase-label {
    width: 100%;
    height: 48px;
    border-radius: 10px 10px 0 0;
  }

  .mr-flow__phase-label span {
    writing-mode: horizontal-tb;
  }

  .mr-flow__arrow {
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 0;
    justify-content: center;
    height: 32px;
  }

  .mr-flow__arrow span {
    transform: translateY(-16px);
  }

  .mr-flow__arrow--inner {
    padding-left: 0;
  }

  .mr-flow__step {
    flex-direction: column;
    min-height: auto;
    padding: 20px;
    gap: 8px;
    border-radius: 0 0 10px 10px;
    text-align: center;
  }

  .mr-flow__step-name {
    width: auto;
    font-size: 18px;
  }

  .mr-flow__step-desc {
    font-size: 14px;
    line-height: 26px;
  }

  .mr-flow__phase + .mr-flow__phase {
    margin-top: 16px;
  }

  /* Cards — 1列化後、PC基準サイズに戻してから調整 */
  .mr-cards {
    padding: 0 0 64px;
  }

  .mr-cards__heading {
    font-size: 21px;
    line-height: 36px;
    margin-bottom: 36px;
  }

  .mr-cards__grid {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 360px;
    margin: 0 auto;
  }

  .mr-cards__item {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .mr-cards__number {
    position: static;
    font-size: 64px;
    line-height: 0.75;
    margin-bottom: 12px;
  }

  .mr-cards__circle {
    max-width: 360px;
    padding: 36px;
  }

  .mr-cards__illust {
    width: 40%;
    margin-bottom: 20px;
  }

  .mr-cards__text {
    font-size: 16px;
    line-height: 28px;
    letter-spacing: 2px;
    max-width: 80%;
  }
}

@media (max-width: 480px) {
  .mr-description__text br {
    display: none;
  }

  .mr-flow__step-desc br {
    display: none;
  }

  .mr-flow__step {
    text-align: left;
  }
}
