/* =========================================================
   layout.css
   どのセクションでも使う枠と部品。
   クラス名の頭文字: l- 枠 / c- 部品 / p- セクション / u- 補助
   ========================================================= */

/* ---------- ヘッダー ----------
   PC: 右上に縦書きのメニュー、右端に縦長の「申し込む」(画面に固定)。
   タブレットとスマホ: メニューは開閉式。スマホの「申し込む」は画面の下に固定。 */
.l-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
  height: 0;
  color: var(--white);
}
.l-header__nav {
  position: absolute;
  right: calc(var(--tab-w) + 20px);
  top: env(safe-area-inset-top, 0px);
}
.l-header__nav ul { display: flex; flex-direction: row-reverse; list-style: none; }
.l-header__nav a {
  display: block;
  writing-mode: vertical-rl;
  font-feature-settings: normal;   /* 横組み用の字詰め(palt)は縦書きでは字が左右にずれるので外す */
  padding: 24px 9px 20px;
  font-family: var(--ff-shippori);
  font-size: calc(13px * var(--fs-scale));
  letter-spacing: .12em;
  line-height: 1;
  text-decoration: none;
  border-right: 1px solid rgb(255 255 255 / .35);
}
.l-header__nav li:last-child a { border-left: 1px solid rgb(255 255 255 / .35); }
.l-header__nav a:hover { color: var(--yellow); }

.l-header__entry {
  position: fixed;
  right: 0;
  top: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  width: var(--tab-w);
  height: 200px;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--yellow);
  color: var(--purple);
  writing-mode: vertical-rl;
  font-feature-settings: normal;   /* 上と同じ理由 */
  font-family: var(--ff-shippori);
  font-size: calc(16px * var(--fs-scale));
  letter-spacing: .3em;
  text-decoration: none;
}
.l-header__entry:hover { background: var(--white); }

.l-header__menu { display: none; }

@media (max-width: 1023px) {
  .l-header__nav { display: none; }
  .l-header__menu {
    position: absolute;
    right: calc(var(--tab-w) + 12px);
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    display: inline-grid;
    place-content: center;
    gap: 6px;
    width: 48px; height: 48px;
    background: none;
    border: 1px solid rgb(255 255 255 / .5);
    cursor: pointer;
  }
  .l-header__menu span:not(.u-visually-hidden) { display: block; width: 18px; height: 1.5px; background: currentColor; }
  .l-header__menu[aria-expanded="true"] { z-index: 26; }
  .l-header__menu[aria-expanded="true"] + .l-header__nav {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: var(--purple);
    padding: 96px 24px 40px;
  }
  .l-header__menu[aria-expanded="true"] + .l-header__nav ul { flex-direction: column; }
  .l-header__menu[aria-expanded="true"] + .l-header__nav a {
    writing-mode: horizontal-tb;
    font-feature-settings: "palt" 1;   /* 横組みに戻るので、字詰めも戻す */
    font-size: calc(22px * var(--fs-scale));
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid rgb(255 255 255 / .2);
  }
}
@media (max-width: 767px) {
  .l-header__menu { right: 16px; }
  .l-header__entry {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    writing-mode: horizontal-tb;
    font-feature-settings: "palt" 1;
    letter-spacing: .2em;
  }
}

/* ---------- セクションの枠 ----------
   上下 80px、左右 200px。中身は幅 1040px で、見出しとのあいだは 64px(Figma の指定) */
.l-sec {
  padding: calc(80 * var(--u)) var(--side);
  background: var(--white);
  color: var(--purple);
}
.l-sec.is-purple { background: var(--purple); color: var(--white); }
.l-sec.is-yellow { background: var(--yellow); color: var(--purple); }
.l-sec__inner {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(64 * var(--u));
}
@media (max-width: 767px) {
  .l-sec { padding-block: 64px; }
  .l-sec__inner { gap: 40px; }
}

/* ---------- セクションの見出し(下に 4px の線) ---------- */
.c-title {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  font-family: var(--ff-shippori);
  font-size: var(--fs-64);
  line-height: calc(62 / 64);
  letter-spacing: var(--ls-shippori);
  text-align: center;
}
.c-title::after {
  content: "";
  height: max(3px, calc(4 * var(--u)));
  background: currentColor;
}
.c-titles { display: flex; flex-direction: column; align-items: center; gap: calc(8 * var(--u)); }

/* 40px の小見出し */
.c-h40 {
  width: 100%;
  font-family: var(--ff-shippori);
  font-size: var(--fs-40);
  line-height: normal;
  letter-spacing: var(--ls-shippori);
  text-align: center;
}

/* 24px の文(行送り 42px) */
.c-t24 {
  font-family: var(--ff-shippori);
  font-size: var(--fs-24);
  line-height: 1.75;
  letter-spacing: var(--ls-shippori);
}

/* 点の付いた一覧(Noto Sans JP 16px、項目のあいだ 20px) */
.c-ul {
  width: 100%;
  font-family: var(--ff-noto);
  font-size: var(--fs-16);
  line-height: var(--lh-noto);
  list-style: disc;
}
.c-ul li { margin-left: calc(24 * var(--u)); margin-bottom: calc(20 * var(--u)); padding-left: 0; }
.c-ul li:last-child { margin-bottom: 0; }
@media (max-width: 767px) {
  .c-ul li { margin-left: 20px; margin-bottom: 14px; line-height: 1.7; }
}

/* スマホとタブレットで見出しが折り返すときは、言葉の切れ目で、行の長さをそろえて折り返す
   (1字だけが次の行に落ちないように) */
@media (max-width: 1199px) {
  .c-title,
  .c-h40,
  h3 {
    word-break: auto-phrase;
    text-wrap: balance;
  }
}
@media (max-width: 767px) {
  /* 最後の行に1字だけ残らないように(文と一覧、FAQ の質問) */
  p, li, .p-faq__q span { text-wrap: pretty; }
  .p-faq__q span { word-break: auto-phrase; }
  /* 中央ぞろえの文も、言葉の切れ目で折り返す */
  .p-about__text,
  .p-ent__body .c-t24,
  .p-ent__type .c-t24,
  .p-mv__sub {
    word-break: auto-phrase;
  }
}
