
/* 下層ページ共通：赤背景の上部メニュー＋ヒーロー */

.subpage-top-shell {
  --subpage-wave-fill: #fff4f4;
  background: var(--red);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding-top: 20px;
}

.subpage-top-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: var(--wave-height);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 100' preserveAspectRatio='none'%3E%3Cpath d='M0 50 Q37.5 0 75 50 T150 50 T225 50 T300 50 T375 50 T450 50 T525 50 T600 50 T675 50 T750 50 T825 50 T900 50 T975 50 T1050 50 T1125 50 T1200 50 V100 H0 Z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center bottom;
}

.subpage-top-shell > * {
  position: relative;
  z-index: 1;
}

.subpage-top-shell .subpage-top-inner {
  width: min(1350px, calc(100% - 40px));
  margin: 0 auto;
}

.subpage-quick-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 8px 0 26px;
}

.subpage-quick-links a {
  background: #ffffff;
  min-height: 125px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  position: relative;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}

.subpage-quick-links a:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(0,0,0,.12);
}

.subpage-quick-links a[aria-current='page'] {
  outline: 3px solid rgba(255,255,255,.5);
  box-shadow: 0 14px 30px rgba(0,0,0,.14);
}

.subpage-quick-links img {
  width: auto;
  height: 94px;
  object-fit: contain;
}

.subpage-quick-links span {
  font-weight: 900;
  font-size: 17px;
  color: var(--navy);
  line-height: 1.35;
}

.subpage-quick-links small {
  display: block;
  color: var(--red);
  font-size: 11px;
  margin-top: 6px;
}

.subpage-quick-links i {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-style: normal;
  color: #fff;
  background: var(--red);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.subpage-hero-block {
  text-align: center;
  padding: 36px 20px 110px;
}

.subpage-hero-block h1 {
  font-size: clamp(32px, 5vw, 58px);
  margin: 0;
  font-weight: 900;
  letter-spacing: .02em;
  text-shadow: 0 2px 0 rgba(0,0,0,.06);
}

.subpage-hero-block .en {
  margin-top: 10px;
  font-size: 15px;
  letter-spacing: .08em;
  font-weight: 900;
}

.subpage-hero-block p {
  margin: 24px 0 0;
  line-height: 1.9;
  font-weight: 700;
  font-size: 16px;
}

@media (max-width: 1024px) {
  .subpage-quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .subpage-top-shell {
    padding-top: 14px;
  }

  .subpage-top-shell .subpage-top-inner {
    width: min(100%, calc(100% - 24px));
  }

  .subpage-quick-links {
    gap: 12px;
    padding: 4px 0 22px;
  }

  .subpage-quick-links a {
    min-height: 104px;
    border-radius: 18px;
    padding: 10px 14px;
  }

  .subpage-quick-links img {
    height: 72px;
  }

  .subpage-quick-links span {
    font-size: 15px;
  }

  .subpage-quick-links i {
    width: 34px;
    height: 34px;
    font-size: 18px;
    right: 10px;
    bottom: 10px;
  }

  .subpage-hero-block {
    padding: 28px 16px 66px;
  }

  .subpage-hero-block .en {
    font-size: 13px;
  }

  .subpage-hero-block p {
    font-size: 14px;
    margin-top: 18px;
  }
}

@media (max-width: 520px) {
  .subpage-quick-links {
    grid-template-columns: 1fr;
  }
}

/* 下層ページ左上のトップページリンク */
.subpage-home-logo {
  display: block;
  width: fit-content;
  max-width: 230px;
  margin: 4px 0 20px;
  line-height: 0;
}
.subpage-home-logo img {
  display: block;
  width: 210px;
  max-width: 100%;
  height: auto;
}
.subpage-home-logo:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 5px;
  border-radius: 4px;
}
@media (max-width: 760px) {
  .subpage-home-logo { margin: 2px 0 16px; }
  .subpage-home-logo img { width: 160px; }
}

/* ロゴだけを画面左端側へ。ナビボタンの配置は変えない */
.subpage-home-logo {
  margin-left: min(0px, calc((1390px - 100vw) / 2));
}
@media (max-width: 760px) {
  .subpage-home-logo {
    margin-left: 0;
  }
}

/* 下層ページ：ロゴと4つのメニューボタンを横並びに */
@media (min-width: 1101px) {
  .subpage-top-shell .subpage-top-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    width: min(1405px, calc(100% - 40px));
  }
  .subpage-home-logo {
    flex: 0 0 225px;
    max-width: 225px;
    margin: 0;
  }
  .subpage-home-logo img { width: 225px; }
  .subpage-quick-links {
    flex: 1 1 0;
    max-width: 1160px;
    min-width: 0;
    gap: 12px;
    padding: 8px 0;
  }
  .subpage-quick-links a {
    min-height: 104px;
    padding: 10px 12px;
    gap: 8px;
  }
  .subpage-quick-links img { height: 77px; }
  .subpage-quick-links span { font-size: 14px; }
  .subpage-quick-links i {
    width: 34px;
    height: 34px;
    font-size: 18px;
    right: 9px;
    bottom: 9px;
  }
}

/* 横幅が限られるPCではナビの可読性を優先 */
@media (min-width: 1101px) and (max-width: 1399px) {
  .subpage-home-logo { flex-basis: 200px; max-width: 200px; }
  .subpage-home-logo img { width: 200px; }
}

/* スマートフォン：4つのページリンクを2列×2行のコンパクト表示に */
@media (max-width: 760px) {
  .subpage-quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 4px 0 18px;
  }

  .subpage-quick-links a {
    min-width: 0;
    min-height: 92px;
    border-radius: 15px;
    padding: 10px 8px;
    gap: 6px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .08);
  }

  .subpage-quick-links img {
    width: 48px;
    height: 55px;
    flex: 0 0 48px;
    object-fit: contain;
  }

  .subpage-quick-links span {
    min-width: 0;
    font-size: 12px;
    line-height: 1.3;
    padding-bottom: 19px;
    overflow-wrap: anywhere;
  }

  .subpage-quick-links small {
    font-size: 9px;
    margin-top: 3px;
  }

  .subpage-quick-links i {
    width: 25px;
    height: 25px;
    right: 8px;
    bottom: 8px;
    font-size: 15px;
  }
}

/* スマホのみ：下層ページの赤い境界波を2周期の滑らかな波に統一 */
@media (max-width: 760px) {
  .subpage-top-shell::after {
    height: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 42' preserveAspectRatio='none'%3E%3Cpath d='M0 18 C33 -4 67 -4 100 18 C133 40 167 40 200 18 C233 -4 267 -4 300 18 C333 40 367 40 400 18 V42 H0 Z' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center bottom;
  }
}
