/* MV：B案の静止背景に、薄い明暗のレイヤーだけを緩やかに重ねて動かす。 */
.main-visual {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  align-items: center;
  overflow: hidden;
  /* 横長の試作。内容が増える環境では最低高さを超えて自然に広がる。 */
  min-height: clamp(25rem, 31vw, 27.5rem);
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 4vw, 3rem);
  color: #fff;
  background-color: #213748;
  background-image:
    radial-gradient(
      ellipse at 80% 12%,
      rgb(228 216 153 / 8%) 0%,
      rgb(228 216 153 / 0%) 55%
    ),
    linear-gradient(120deg, #819298 -12%, #3c5966 42%, #213748 100%);
}

.main-visual::before {
  position: absolute;
  inset: -25% -30%;
  z-index: 0;
  content: "";
  pointer-events: none;
  /* 大きな楕円の明暗を重ね、輪郭を作らずに光の重心を左右へ移す。 */
  background-image:
    radial-gradient(
      ellipse 36% 110% at 50% 50%,
      rgb(129 146 152 / 82%) 0%,
      rgb(129 146 152 / 48%) 40%,
      rgb(129 146 152 / 12%) 75%,
      rgb(129 146 152 / 0%) 100%
    ),
    radial-gradient(
      ellipse 40% 120% at 95% 50%,
      rgb(33 55 72 / 30%) 0%,
      rgb(33 55 72 / 0%) 100%
    );
  /* 明暗レイヤーの不透明度は固定し、transformだけでゆっくり往復する。 */
  animation: main-visual-drift 36s ease-in-out infinite;
  will-change: transform;
}

.main-visual::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  /* 小さな白文字にも明るさが影響しないよう、固定の重ね色を置く。 */
  background: rgb(0 0 0 / 22%);
}

.main-visual__content {
  position: relative;
  z-index: 2;
  width: min(100%, 80rem);
  min-width: 0;
  text-align: center;
}

.main-visual__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  margin: 0 0 clamp(0.75rem, 2.2vw, 1.75rem);
  font-size: clamp(0.75rem, 1.3vw, 1.125rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.34em;
}

.main-visual__eyebrow-line {
  flex: 0 0 clamp(2rem, 5.5vw, 5rem);
  height: 1px;
  background: rgb(255 255 255 / 55%);
}

.main-visual__catchphrase {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: clamp(2rem, 5.8vw, 6rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.main-visual__dots {
  display: flex;
  justify-content: center;
  gap: clamp(0.75rem, 1.7vw, 1.5rem);
  margin-top: clamp(0.75rem, 2.2vw, 2rem);
}

.main-visual__dot {
  width: clamp(0.375rem, 0.8vw, 0.75rem);
  height: clamp(0.375rem, 0.8vw, 0.75rem);
  border-radius: 50%;
}

.main-visual__dot--red {
  background: #ff3333;
}

.main-visual__dot--pink {
  background: #ff66ff;
}

.main-visual__dot--blue {
  background: #0066ff;
}

@keyframes main-visual-drift {
  0%,
  100% {
    transform: translate3d(-16%, -1%, 0);
  }

  50% {
    transform: translate3d(16%, 1%, 0);
  }
}

@media (max-width: 767px) {
  .main-visual {
    min-height: clamp(17.5rem, 78vw, 21.25rem);
    padding: 2rem 1rem;
  }

  .main-visual__eyebrow {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
  }

  .main-visual__catchphrase {
    font-size: clamp(1.75rem, 7.2vw, 2.5rem);
  }

  .main-visual__dots {
    margin-top: 0.5rem;
  }

}

@media (prefers-reduced-motion: reduce) {
  .main-visual::before {
    animation: none;
    transform: none;
    will-change: auto;
  }
}

/* News以降の各セクションに共通する余白と見出し装飾。 */
.page-section {
  padding-block: 0 3rem;
}

.section-heading {
  background: #f1f1f1;
}

.section-heading h2 {
  /* 帯の高さを変えず、各セクションが指定した量だけ文字を下げる。 */
  position: relative;
  top: var(--section-heading-offset, 0px);
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.4;
}

/* グレー帯を持つ5セクションの見出し位置を一元管理する。Newsは対象外。 */
.message-section,
.service-section,
#id_access,
#id_recruit,
#id_company {
  --section-heading-offset: 28px;
}

.section-body {
  min-height: 8rem;
  /* 下へずらした見出しと本文の間に最低4pxの余白を確保する。 */
  padding-top: max(2rem, calc(var(--section-heading-offset, 0px) + 4px));
}

@media (max-width: 767px) {
  .page-section {
    padding-bottom: 2rem;
  }

  .section-heading h2 {
    font-size: 1.625rem;
  }

  .section-body {
    min-height: 6rem;
    padding-top: max(1.5rem, calc(var(--section-heading-offset, 0px) + 4px));
  }
}

/* News：直近5件を通常のテキストとして静的に表示する。 */
.news-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  color: #fff;
  background-color: #1e3344;
  /* 内側の1px線でヒーローと区切り、セクションの高さは変えない。 */
  box-shadow: inset 0 1px rgb(129 146 152 / 24%);
}

/* 静止した装飾を左カラム内に収め、文字の操作や読み上げを妨げない。 */
.news-network {
  position: absolute;
  inset-block: 0;
  left: 0;
  z-index: 0;
  width: min(48%, 40rem);
  height: 100%;
  pointer-events: none;
}

.news-network__lines {
  stroke: #819298;
  stroke-width: 1;
  stroke-opacity: 0.24;
}

.news-network__nodes {
  fill: #d9e7ed;
  fill-opacity: 0.45;
}

.news-section__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem clamp(2rem, 4vw, 5rem);
  padding: 3rem clamp(1rem, 2.5vw, 3rem);
}

.news-section h2 {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 400;
  line-height: 1.4;
}

.news-list {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.news-item {
  border-top: 1px solid #819298;
}

.news-item:last-child {
  border-bottom: 1px solid #819298;
}

.news-entry {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 0.125rem 0.5rem;
  min-height: 44px;
  padding-block: 0.4rem;
}

.news-entry time {
  color: #e6edf0;
  font-variant-numeric: tabular-nums;
}

.news-content {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  min-width: 0;
}

.news-title {
  min-width: 0;
  color: #FFFFFF;
  overflow-wrap: anywhere;
}

/* 既存の1カラム表示では装飾を隠し、お知らせ本文の可読性を優先する。 */
@media (max-width: 900px) {
  .news-network {
    display: none;
  }
}

/* Message：文章・段落を保持し、PCの改行とモバイルの自然な折り返しを切り替える。 */
.message-section {
  padding-bottom: 4rem;
}

.message-section__body {
  max-width: 54rem;
  padding-top: 3rem;
  /* PCでは旧空白段落分の末尾余白をCSSで保持する。 */
  padding-bottom: calc(1.5rem + 1.85em);
  color: #46405f;
  font-size: 1rem;
  line-height: 1.85;
  text-align: center;
}

.message-section__body p {
  margin: 0;
}

.message-section__body p + p {
  margin-top: 1.5rem;
}

@media (max-width: 767px) {
  .news-section__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding-block: 2.5rem;
  }

  .news-section h2 {
    font-size: 1.75rem;
    text-align: center;
  }

  .news-entry {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 0.625rem;
  }

  .message-section {
    padding-bottom: 3rem;
  }

  .message-section__body {
    padding-top: 2rem;
    padding-bottom: 0;
    line-height: 1.85;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .message-section__body .message-desktop-break {
    display: none;
  }

  .message-section__body p + p {
    margin-top: 1.25rem;
  }
}

/* Service：3項目を広い画面では左右交互、900px以下では写真から縦に並べる。 */
.service-section {
  padding-bottom: 5rem;
}

.service-section__body {
  padding-top: 3.5rem;
}

.service-section__subtitle {
  margin: 0 0 3.5rem;
  font-size: 1.5rem;
  line-height: 1.5;
}

.service-list {
  display: grid;
  gap: 2.5rem;
  padding-inline: 0.625rem;
}

.service-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "image content";
  align-items: start;
  gap: 1.25rem;
}

.service-item:nth-child(even) {
  grid-template-areas: "content image";
}

.service-item__image {
  grid-area: image;
  width: 100%;
  height: auto;
}

.service-item__content {
  grid-area: content;
  min-width: 0;
  padding-top: 0.25rem;
  color: #46405f;
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.service-item__content h4 {
  margin: 0 0 3rem;
  color: var(--color-text);
  font-size: 1.5rem;
  line-height: 1.5;
}

.service-item__content p {
  margin: 0;
}

.service-item__content p + p {
  margin-top: 1.5rem;
}

@media (max-width: 767px) {
  .service-section {
    padding-bottom: 3.5rem;
  }

  .service-section__body {
    padding-top: 2.5rem;
  }

  .service-section__subtitle {
    margin-bottom: 2.5rem;
    font-size: 1.375rem;
  }

  .service-list {
    gap: 3rem;
    padding-inline: 0;
  }

  .service-item,
  .service-item:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "image" "content";
    gap: 1.5rem;
  }

  .service-item__content {
    padding-top: 0;
  }

  .service-item__content h4 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
  }

  .service-item__content .service-desktop-break {
    display: none;
  }
}

/* Access：保存HTMLのAPIキー不要の埋め込みURLを使用する。 */
.access-map {
  display: block;
  width: 100%;
  height: 597px;
  border: 0;
}

@media (max-width: 767px) {
  .access-map {
    height: clamp(24rem, 140vw, 597px);
  }
}

/* Recruit案内：紹介文はPCで中央揃え、モバイルで左揃え。写真とMOREは中央配置。 */
.recruit-section {
  padding-bottom: 6rem;
}

.recruit-section__body {
  padding-top: max(3.5rem, calc(var(--section-heading-offset) + 1rem));
}

.recruit-section__image {
  width: 100%;
  height: auto;
}

.recruit-copy {
  max-width: 48rem;
  margin: 5.5rem auto 0;
  color: #46405f;
  font-size: 1rem;
  line-height: 1.85;
  text-align: center;
  overflow-wrap: anywhere;
}

.recruit-copy p {
  margin: 0;
}

.recruit-copy p + p {
  margin-top: 4rem;
}

.recruit-copy p:nth-child(2) {
  margin-top: 2rem;
}

.recruit-section__action {
  margin-top: 5rem;
  text-align: center;
}

.recruit-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 2.25rem;
  color: #fff;
  background: #000;
  text-decoration: none;
}

.recruit-more:focus-visible {
  color: #fff;
  background: #E60039;
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .recruit-more:hover {
    color: #fff;
    background: #E60039;
  }
}

/* 会社概要：見出しとの間隔を保ち、装飾用背景に重ね色を加える。 */
.company-section {
  padding-bottom: 0;
}

.company-section__surface {
  color: #fff;
  background-color: #213748;
  background-image:
    linear-gradient(rgb(33 55 72 / 72%), rgb(33 55 72 / 72%)),
    url("../assets/images/Yokosuka_park_2.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 3rem;
  padding-block: 3rem;
  font-size: 1rem;
  line-height: 1.8;
}

.company-details {
  min-width: 0;
  margin: 0;
}

.company-details__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 4fr);
  gap: 1rem;
  padding-block: 1rem;
}

.company-details__row:first-child {
  padding-top: 0;
}

.company-details__row + .company-details__row {
  border-top: 1px dotted rgb(255 255 255 / 55%);
}

.company-details dt {
  text-align: center;
  overflow-wrap: anywhere;
}

.company-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.company-details p {
  margin: 0;
}

.company-partners {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 4fr);
  align-content: start;
  gap: 0 1rem;
  min-width: 0;
}

.company-partners h3 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  text-align: center;
}

.company-partners__list {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-wrap: anywhere;
}

.company-partners__note {
  grid-column: 2;
  margin: 1.5rem 0 0;
}

@media (max-width: 767px) {
  .recruit-section {
    padding-bottom: 4rem;
  }

  .recruit-section__body {
    padding-top: max(2.5rem, calc(var(--section-heading-offset) + 0.5rem));
  }

  .recruit-copy {
    margin-top: 3rem;
    text-align: left;
    line-height: 1.85;
  }

  .recruit-copy .recruit-desktop-break {
    display: none;
  }

  .recruit-copy p + p {
    margin-top: 2.5rem;
  }

  .recruit-copy p:nth-child(2) {
    margin-top: 1.5rem;
  }

  .recruit-section__action {
    margin-top: 3rem;
  }

  .company-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-block: 2.5rem;
  }

  .company-details__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .company-details .company-permit-label {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
  }

  .company-permit-label span {
    display: inline-block;
    white-space: nowrap;
  }

  .company-partners {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .company-partners h3,
  .company-partners__list,
  .company-partners__note {
    grid-column: 1;
  }

  .company-partners__note {
    margin-top: 0;
  }
}

/* 768〜900pxは段組みだけを調整し、767px以下の確定済み表示を維持する。 */
@media (min-width: 768px) and (max-width: 900px) {
  .news-section__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .news-section h2 {
    text-align: center;
  }

  .service-item,
  .service-item:nth-child(even) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "image" "content";
    gap: 1.5rem;
  }

  .service-item__content {
    padding-top: 0;
  }

  .service-item__content .service-desktop-break {
    display: none;
  }

  .company-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .company-details__row,
  .company-partners {
    grid-template-columns: 10rem minmax(0, 1fr);
  }
}
