/* ==========================================================================
   トップページ — Phase 2
   ========================================================================== */

/* 共通: セクション見出し (24px / tracking広め) */
.section-heading {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--fw-heading-light);
  font-size: var(--fs-headline-md);
  line-height: 2.2;
  letter-spacing: 0.13em;
  color: var(--color-text-default);
}

/* --- Hero ---------------------------------------------------------------- */
.home-hero {
  --home-first-view-offset: 59px;
  /* sticky header height */
  position: relative;
  min-height: 864px;
  overflow: hidden;
  background: linear-gradient(90deg,
      #f2f9ed 0%,
      #f2faeb 33%,
      #e8f2e1 66%,
      #ecf1ec 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.home-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--canvas-width);
  margin-inline: auto;
  display: flex;
  justify-content: center;
}

.home-hero__title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
  font-family: var(--font-heading);
  font-weight: var(--fw-heading);
  /* Figma: YuGothic Medium(500) */
  font-size: 3.5em;
  line-height: 1em;
  letter-spacing: 0.5em;
  color: #858b90;
  /* Figma: color/text/subtle(#858b90)。プロジェクトの --color-text-subtle(#787f85)とは別値 */
  text-align: center;
}

/* --- Service (手掛けている事業) ------------------------------------------ */
.home-service {
  max-width: var(--canvas-width);
  margin-inline: auto;
  background: var(--color-bg-subtle);
  clip-path: inset(0 -100vmax);
  padding: var(--space-16) var(--space-16);
}

.home-service__inner {
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-inline: var(--space-6);
}

.home-service__card {
  display: flex;
  gap: var(--space-8);
  align-items: stretch;
}

.home-service__visual {
  flex: 0 0 581px;
  max-width: 581px;
  background: var(--color-bg-surface);
  padding: 62px var(--space-16);
  display: flex;
  justify-content: center;
}

.home-service__visual img {
  width: 380px;
  max-width: 100%;
  height: auto;
}

.home-service__body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.home-service__title {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--color-text-default);
}

.home-service__text {
  margin: 0;
  font-size: var(--fs-body-md);
  line-height: 28px;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-subtle);
}

.home-service__link {
  margin-top: auto;
  /* リンクをカード下端へ(Figma: タイトル上・リンク下) */
  text-align: right;
  padding-right: var(--space-8);
}

.home-service__link a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-brand);
  text-decoration: underline;
  letter-spacing: var(--tracking-wide);
}

/* --- News (お知らせ) ----------------------------------------------------- */
.home-news {
  max-width: var(--canvas-width);
  margin-inline: auto;
  background: var(--color-bg-surface);
  clip-path: inset(0 -100vmax);
  padding: var(--space-16) var(--space-16);
}

.home-news__inner {
  max-width: 1280px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.home-news__header {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding-inline: var(--space-6);
}

.home-news__see-all {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-brand);
  font-size: var(--fs-body-md);
  letter-spacing: var(--tracking-wide);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--color-border-subtle);
}

.news-list__item {
  border-bottom: 1px solid var(--color-border-subtle);
}

.news-list__link {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  padding: var(--space-6);
}

.news-list__meta {
  display: flex;
  align-items: center;
  /* Figma: タグ枠(60px)+gap32 で日付は左から92px。タグ実幅72pxのため兄弟間は20px */
  gap: var(--space-5);
  flex: 0 0 auto;
  width: 172px;
}

.news-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--color-brand-subtle);
  color: var(--color-text-brand);
  font-size: var(--fs-label-md);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Pick Up は緑枠(アウトライン) */
.news-tag--pickup {
  background: transparent;
  border: 1px solid var(--color-brand-primary);
}

/* Pick Up 行はやや広めのパディング(Figma: pinned item) */
.news-list__item--pinned .news-list__link {
  padding-block: var(--space-8);
}

.news-list__date {
  color: var(--color-text-subtle);
  font-size: var(--fs-body-md);
  letter-spacing: var(--tracking-wide);
  transition: color 0.2s ease;
}

.news-list__title {
  flex: 1 1 0;
  min-width: 0;
  color: var(--color-text-default);
  font-size: var(--fs-body-md);
  line-height: 28px;
  letter-spacing: var(--tracking-wide);
  transition: color 0.2s ease;
}

.news-list__link .icon-arrow {
  flex: 0 0 auto;
  color: var(--color-text-brand);
  /* 矢印付き遷移リンクは緑で統一 */
}

/* --- お知らせ各行ホバー(Figma: NewsItem Hovered 2329:12592) -------------- */
/* グローバルの a:hover{opacity:.7} による一瞬の減光を無効化(色変化だけを滑らかに見せる) */
.news-list__link:hover {
  opacity: 1;
}

/* 日付・タイトルが濃く、タグが濃いめの緑に変化 */
.news-list__link:hover .news-list__date,
.news-list__link:hover .news-list__title {
  color: #212629;
  /* Figma: text/default-hovered */
}

.news-list__link:hover .news-tag {
  color: #369535;
  /* Figma: brand/primary-hover */
}

.news-list__link:hover .news-tag:not(.news-tag--pickup) {
  background: #e3f2e2;
  /* Figma: green/75 */
}

.news-list__link:hover .news-tag--pickup {
  border-color: #369535;
}

.home-news__empty {
  padding: var(--space-8) var(--space-6);
  color: var(--color-text-subtle);
}

/* --- CTA blocks (ToAboutUs / ToCareer) ----------------------------------- */
/* Figma: 写真(全幅・高さ740) を上に、その下に見出し + 「読む」ボタンを右寄せで配置。
   2ブロックとも同じ縦構成(reverse は2ブロック目の上マージンのみ)。 */
.home-cta {
  max-width: var(--canvas-width);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-surface);
  box-shadow: 0 0 0 100vmax var(--color-bg-surface);
  clip-path: inset(0 -100vmax);
  overflow: hidden;
}

.home-cta--reverse {
  margin-top: 40px;
}

.home-cta__text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  min-height: 190px;
  padding: var(--space-8) var(--space-8) var(--space-8) 0;
  text-align: right;
}

.home-cta__heading {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--fw-heading-light);
  font-size: 28px;
  line-height: 2.2;
  letter-spacing: 0.06em;
  color: var(--color-text-default);
}

/* 見出し+ボタンをクリック領域にする(ホバーで薄くせず濃く保つ)。
   親(.home-cta__text)が flex column のため align-self:flex-end で
   文字幅に切り詰めて右寄せ(リンクが文字の上だけになる)。 */
.home-cta__link {
  display: block;
  align-self: flex-end;
  text-decoration: none;
  color: inherit;
}

.home-cta__link:hover {
  opacity: 1;
}

.home-cta__button {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  color: var(--color-text-brand);
  /* 矢印付き遷移リンクは緑で統一 */
  letter-spacing: var(--tracking-wide);
}

.home-cta__image {
  width: 100%;
  height: 740px;
  overflow: hidden;
}

.home-cta__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Responsive: tablet (intermediate) ----------------------------------- */
@media (max-width: 900px) and (min-width: 769px) {
  .home-hero {
    min-height: 560px;
  }

  .home-hero__title {
    font-size: 30px;
    letter-spacing: 0.2em;
  }

  .home-service__card {
    flex-direction: column;
    align-items: stretch;
  }

  .home-service__visual {
    flex-basis: auto;
    max-width: none;
  }

  .home-cta,
  .home-cta--reverse {
    flex-direction: column;
  }

  .home-cta__text,
  .home-cta__image {
    flex-basis: auto;
    max-width: none;
    width: 100%;
  }

  .news-list__link {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
}

/* --- Responsive: mobile (Figma node 2874:22436 / 375幅) ------------------- */
@media (max-width: 768px) {

  /* 共通: 横スクロール防止 */
  .home-hero,
  .home-service,
  .home-news,
  .home-cta {
    overflow-x: hidden;
  }

  .section-heading {
    font-size: 16px;
    line-height: 2.2;
    letter-spacing: 0.06em;
  }

  .home-hero {
    min-height: 712px;
    align-items: center;
  }

  .home-hero__inner {
    padding: 0 var(--space-6);
  }

  .home-hero__title {
    gap: var(--space-2);
    font-size: 24px;
    line-height: 2;
    letter-spacing: 0.32em;
    text-align: center;
  }

  /* --- Service: 縦積み (Figma: pad 40/20, gap 24) ----------------------- */
  .home-service {
    padding: var(--space-8) var(--space-5);
  }

  .home-service__inner {
    gap: var(--space-6);
  }

  .home-service__card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-6);
    padding-inline: 0;
  }

  .home-service__visual {
    flex-basis: auto;
    max-width: none;
    padding: var(--space-8) var(--space-6);
  }

  .home-service__visual img {
    width: 100%;
    max-width: 296px;
  }

  .home-service__body {
    gap: var(--space-3);
  }

  .home-service__title {
    font-size: 16px;
    line-height: 1.8;
  }

  .home-service__text {
    font-size: var(--fs-body-sm);
    line-height: 24px;
  }

  .home-service__link {
    padding-right: 0;
  }

  .home-service__link a {
    font-size: var(--fs-label-md);
  }

  /* --- News: 縦積み・各行はメタ上/タイトル下の2段 (Figma) ----------------- */
  .home-news {
    padding: var(--space-8) var(--space-5);
  }

  .home-news__inner {
    gap: var(--space-4);
  }

  .home-news__header {
    padding-inline: 0;
  }

  .home-news__see-all {
    font-size: var(--fs-label-md);
  }

  .news-list__link {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-4) 0;
  }

  .news-list__item--pinned .news-list__link {
    padding-block: var(--space-4);
  }

  .news-list__meta {
    width: auto;
    gap: var(--space-5);
  }

  .news-list__date {
    font-size: var(--fs-body-sm);
  }

  /* タイトル行: タイトル + 矢印を横並びにし、矢印を右端へ */
  .news-list__title {
    flex: 1 1 auto;
    font-size: var(--fs-body-sm);
    line-height: 24px;
  }

  .news-list__link .icon-arrow {
    align-self: flex-end;
    margin-top: -28px;
    /* タイトル行の右端に矢印を寄せる */
  }

  /* --- CTA blocks: 写真上 → 見出し → 全幅ボタン (Figma) ------------------ */
  .home-cta,
  .home-cta--reverse {
    flex-direction: column;
    min-height: 0;
    padding: var(--space-8) var(--space-5);
    gap: var(--space-8);
  }

  /* Figma mobile: 写真上 → 見出し → ボタン(reverse でも同じ縦順) */
  .home-cta__image {
    order: 0;
    flex-basis: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
  }

  .home-cta--reverse .home-cta__image img {
    transform: none;
  }

  .home-cta__text {
    order: 1;
    flex-basis: auto;
    width: 100%;
    align-items: stretch;
    gap: var(--space-8);
    padding: 0;
    text-align: center;
  }

  .home-cta__heading {
    font-size: 16px;
    line-height: 2.2;
    letter-spacing: 0.06em;
    text-align: center;
  }

  .home-cta__button {
    width: 100%;
    max-width: none;
    height: 80px;
    justify-content: flex-start;
    padding-inline: var(--space-8);
  }
}