#topPageSections,
[data-ship-period-notice] {
  --top-inner-width: 1000px;
  --top-gutter: 10px;
  --top-inner-edge: max(var(--top-gutter), calc((100% - var(--top-inner-width)) / 2 + var(--top-gutter)));
  --top-band-inset: min(2%, var(--top-inner-edge));
  --top-section-space: 32px;
  --top-group-space: 24px;
  --top-heading-space: 12px;
}
@media screen and (min-width: 992px) {
  #topPageSections,
  [data-ship-period-notice] {
    --top-band-inset: min(5%, var(--top-inner-edge));
    --top-section-space: 56px;
    --top-group-space: 32px;
    --top-heading-space: 16px;
  }
}

#topPageSections :is(.about, .topRenewalJInner, .topCampaign, .historyTop, .calendarStyleCont, .reasonsToChoose, .faqArea),
[data-ship-period-notice] {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--top-inner-width);
  margin-inline: auto;
  padding-inline: var(--top-gutter);
}

#topPageSections .about {
  margin-block: var(--top-section-space) 0;
}

#topPageSections .aboutText {
  margin-bottom: 0;
}

#topPageSections .topRenewalF {
  margin: 0;
  padding-block: var(--top-section-space);
  padding-inline: 0;
  overflow-x: clip;
}

#topPageSections .topCampaign {
  margin-block: 0;
}

#topPageSections .historyTop,
[data-ship-period-notice] {
  margin-block: var(--top-section-space);
}

#topPageSections .topRenewalF + .historyTop {
  margin-block-start: 0;
}

#topPageSections .historyShipping,
[data-ship-period-notice] .historyShipping {
  margin-block-end: var(--top-group-space);
}

#topPageSections .historyList .historyTitle {
  margin-block-end: var(--top-heading-space);
}

#topPageSections .calendarStyles {
  width: 100%;
  margin-inline: 0;
  padding-block: var(--top-group-space);
}

#topPageSections .calendarStyles + .calendarStyles {
  margin-block-start: var(--top-group-space);
}

#topPageSections .calendarStyleCont:not(:last-child) {
  margin-block-end: var(--top-group-space);
}

#topPageSections :is(.calenderCautionLabel, .calendarStyleTitle, .reasonsToChooseTitle, .faqTitle) {
  margin-block-end: var(--top-heading-space);
}

#topPageSections .calendarStyleLink a {
  color: #4d4a3f;
}

#topPageSections .calendarStyleLink a:is(:hover, :focus-visible) {
  text-decoration: underline;
  text-underline-offset: .3em;
}

#topPageSections .reasonsToChoose {
  margin-block: 0;
  padding-block: var(--top-section-space) 0;
}

#topPageSections .faqArea {
  padding-block: var(--top-section-space);
}

#topPageSections .reasonsToChoose + .faqArea {
  padding-block-start: calc(var(--top-section-space) + 16px);
}
.calendarStyles::before {
  inset-inline: var(--top-band-inset) 0;
  width: auto;
}

#goodsStyles::before {
  inset-inline: 0 var(--top-band-inset);
  border-radius: 0 32px 32px 0;
}

/* 説明文は2行で切らず全文を出し、価格は同じ段のカードで下端に揃える（並びの枠の nowrap はカード内で解く） */
#goodsStyles .calendarStyleBox {
  display: flex;
  flex-direction: column;
  white-space: normal;
}
#goodsStyles .calendarStyleInfo {
  display: flex;
  flex-direction: column;
  flex: 1;
}
#goodsStyles .calendarStyleInfoText p {
  display: block;
  overflow: visible;
  -webkit-line-clamp: none;
}
#goodsStyles .carendarStyleInfoPrice {
  margin-top: auto;
}

#topPageSections .faqList {
  display: grid;
  gap: 20px;
  padding-inline: 0;
}

#topPageSections .faqBox {
  margin: 0;
  padding: 0;
}

#topPageSections .faqBox::after {
  content: none;
}

#topPageSections .faqQuestion {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: max(44px, calc(2lh + 30px));
  padding: 15px 35px 15px 15px;
  text-align: start;
  font: inherit;
  overflow-wrap: anywhere;
  cursor: pointer;
}

#topPageSections .faqQuestion::after {
  position: absolute;
  inset: 0 13px 0 auto;
  margin-block: auto;
  width: 20px;
  height: 13px;
  background: url(../images/modalArrow.svg) no-repeat center;
  content: "";
}

#topPageSections .faqQuestion[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

#topPageSections .faqQuestion:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -3px;
  border-radius: inherit;
}

#topPageSections .faqAnswer {
  padding: 0 35px 15px 15px;
}

.reasonsToChoose .swiper {
  --orange-size: 202px;
  --yellow-size: 120px;
  --aqua-size: min(40vw, 282px);
  --yellow-position: 18% 2.5em;
  height: auto;
  background:
    radial-gradient(circle closest-side, #ffecdf 99%, transparent) left top / var(--orange-size) var(--orange-size) no-repeat,
    radial-gradient(circle closest-side, #fcfbd7 99%, transparent) var(--yellow-position) / var(--yellow-size) var(--yellow-size) no-repeat,
    radial-gradient(circle closest-side, #eff9f8 99%, transparent) right top / var(--aqua-size) var(--aqua-size) no-repeat;
}

.reasonsToChoose .swiper:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

#topPageSections .reasonsToChooseSlider {
  align-items: stretch;
  height: auto;
}

#topPageSections .reasonsToChooseBox {
  width: 100%;
  height: auto;
}

#topPageSections :is(.reasonsToChooseBoxText, .reasonsToChooseBoxImage) {
  margin-inline: 0;
  padding-inline: 0;
}

.reasonsSubtitle {
  display: block;
  width: fit-content;
  margin-block-end: var(--top-heading-space);
  font-size: 1.6rem;
  line-height: 1.3;
  text-wrap: balance;
  text-align: end;
}

.reasonsToChoose .reasonsToChooseBoxTitle {
  width: fit-content;
  max-width: 100%;
  margin-block-end: var(--top-heading-space);
  text-align: end;
}

@media screen and (width < 992px) {
  #topPageSections,
  #topPageSections + .policyList,
  [data-ship-period-notice] {
    --top-gutter: clamp(16px, 4.5vw, 24px);
  }

  #topPageSections + .policyList {
    padding-inline: var(--top-gutter);
  }

  #topPageSections .calendarStyleBox {
    width: min(280px, calc(100vw - 2 * var(--top-gutter) - 48px));
  }

  #topPageSections .reasonsToChoose {
    max-width: calc(510px + 2 * var(--top-gutter));
  }

  #topPageSections .reasonsToChooseTitle {
    text-align: start;
    text-wrap: balance;
    font-size: clamp(2rem, 5.6vw, 2.4rem);
  }

  .reasonsToChoose .reasonsToChooseBoxTitle {
    display: none;
  }

  .reasonsToChoose .swiper {
    --orange-size: 40px;
    --yellow-size: 24px;
    --yellow-position: 6em 1.4em;
  }

  .reasonsToChoose .reasonsToChooseBoxInfo {
    display: grid;
    gap: var(--top-heading-space);
  }

  .reasonsToChoose .reasonsToChooseBoxImage {
    margin-block: 0;
  }

  .reasonsToChooseBoxImage img {
    display: block;
    width: 100%;
    height: auto;
  }

  .reasonsToChooseBoxText p {
    text-wrap: pretty;
    word-break: auto-phrase;
  }

  #topPageSections .reasonsToChoose + .faqArea {
    padding-block-start: var(--top-section-space);
  }
}

@media screen and (min-width: 992px) {
  .reasonsSubtitle {
    display: none;
  }

  .reasonsToChoose .reasonsToChooseBoxInfo {
    align-items: start;
  }

  .reasonsToChoose .reasonsToChooseBoxImage {
    grid-area: 1 / 2;
  }

  .reasonsToChoose .reasonsToChooseBoxTitle {
    margin-inline-start: 5%;
  }

  #topPageSections .faqList {
    gap: 0 16px;
  }

  #topPageSections .faqList > :nth-child(n + 4) {
    margin-block-start: 16px;
  }

  /* 質問と回答で行を分け、同じ横列の質問だけが高さを共有する。 */
  #topPageSections .faqItem {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
  }

  #topPageSections .faqBox {
    display: grid;
  }

  #topPageSections .faqBox:has(.faqAnswer:not([hidden])) {
    grid-row: span 2;
    grid-template-rows: subgrid;
  }

  /* PCでは紹介文が非表示になり、この枠に高さが残らない。 */
  #topPageSections .about {
    margin-block: 0;
  }

  #topPageSections .calendarStyleRow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 3rem;
    padding-inline: 0;
    white-space: normal;
  }
  #topPageSections .calendarStyleBox {
    width: 100%;
  }
  #topPageSections .calendarStyleImage img {
    width: 100%;
    height: auto;
  }
}
