/* =========================================================
   layout.css
   ヘッダー・フッター・全体幅・共通レイアウト。
   通常の更新では変更しません。
========================================================= */
.shell {
  width: min(var(--site-width), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.reading-width { max-width: var(--reading-width); }

/* =========================================================
   Shared header
   ヘッダー本体は js/header.js で全ページ共通管理します。
========================================================= */
.site-header-mount:empty {
  min-height: 96px;
  display: block;
  border-top: 4px solid var(--cyan);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.site-header {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--cyan);
}

.site-header__inner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 1px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.25;
}

.brand::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  right: -15px;
  top: 5px;
  background: var(--pink);
}

.brand__call {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.075em;
}

.brand__name {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.nav-toggle { display: none; }

.global-nav {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  min-width: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}

.global-nav__list {
  display: flex;
  align-items: stretch;
  gap: clamp(15px, 1.8vw, 25px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.global-nav__item {
  position: relative;
  display: flex;
  align-items: stretch;
}

.global-nav__main {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 92px;
  color: var(--ink);
  text-decoration: none;
}

.global-nav__main::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 20px;
  height: 2px;
  background: var(--pink);
  transition: right 170ms ease;
}

.global-nav__item:hover > .global-nav__main::after,
.global-nav__item:focus-within > .global-nav__main::after,
.global-nav__item.is-current > .global-nav__main::after {
  right: 0;
}

.global-nav__item.is-current > .global-nav__main {
  font-weight: 600;
}

/* PC: hover / keyboard focus で下位ページを静かに表示 */
.global-nav__submenu {
  position: absolute;
  left: -18px;
  top: calc(100% - 1px);
  min-width: 218px;
  padding: 10px 18px 13px;
  background: #fff;
  border-top: 3px solid var(--cyan);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 150ms ease,
    transform 190ms ease,
    visibility 0s linear 190ms;
}

.global-nav__item:nth-last-child(-n + 2) > .global-nav__submenu {
  left: auto;
  right: -18px;
}

.global-nav__item:hover > .global-nav__submenu,
.global-nav__item:focus-within > .global-nav__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.global-nav__submenu a {
  display: block;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  line-height: 1.55;
}

.global-nav__submenu a:last-child { border-bottom: 0; }

.global-nav__submenu a:hover,
.global-nav__submenu a:focus-visible,
.global-nav__submenu a[aria-current="page"] {
  color: var(--cyan-dark);
}

.global-nav__submenu a[aria-current="page"] { font-weight: 600; }

/* =========================================================
   Common sections
========================================================= */
.section-block {
  padding: var(--section-space) 0;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.section-block--rule { border-top-color: var(--line-dark); }

.split-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.78fr) minmax(0, 2.22fr);
  gap: clamp(44px, 7vw, 92px);
  align-items: start;
}

.section-side__note {
  max-width: 18rem;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: var(--fs-small);
  line-height: 1.8;
}

/* =========================================================
   Footer
========================================================= */
.site-footer {
  position: relative;
  background: #fff;
  color: var(--ink);
  padding: 54px 0 44px;
  border-top: 1px solid var(--line-dark);
}

.site-footer__accent {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--cyan);
}

.site-footer__accent span {
  display: block;
  width: 110px;
  height: 4px;
  margin-left: max(var(--gutter), calc((100vw - var(--site-width)) / 2));
  background: var(--pink);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px 60px;
  align-items: end;
}

.site-footer__call {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.site-footer__name {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.site-footer__links {
  display: flex;
  gap: 24px;
  font-size: 0.84rem;
}

.site-footer__links a { color: var(--ink); }

.site-footer__copy {
  grid-column: 1 / -1;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.72rem;
}

/* =========================================================
   Tablet / smartphone header
   PC/スマホとも同じナビHTMLを使用します。
========================================================= */
@media (max-width: 880px) {
  .site-header-mount:empty { min-height: 82px; }

  .site-header__inner {
    min-height: 78px;
    gap: 18px;
  }

  .brand { min-width: 0; }
  .brand__call { font-size: 1.28rem; }
  .brand__name { font-size: 0.66rem; line-height: 1.35; }

  .brand::after {
    width: 7px;
    height: 7px;
    right: -12px;
    top: 4px;
  }

  .nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    min-width: 58px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 0;
    border-top: 2px solid var(--cyan);
    border-bottom: 1px solid var(--line-dark);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
  }

  .site-header.is-menu-open .nav-toggle { border-top-color: var(--pink); }

  .global-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100dvh - 79px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px var(--gutter) 18px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    white-space: normal;
  }

  .site-header.is-menu-open .global-nav { display: block; }

  .global-nav__list {
    width: min(var(--site-width), 100%);
    margin-inline: auto;
    display: block;
  }

  .global-nav__item {
    display: block;
    border-bottom: 1px solid var(--line);
  }

  .global-nav__main {
    min-height: 48px;
    font-size: 0.9rem;
    font-weight: 600;
  }

  .global-nav__main::after {
    left: 0;
    right: auto;
    bottom: 0;
    width: 0;
    height: 2px;
    transition: width 170ms ease;
  }

  .global-nav__item.is-current > .global-nav__main::after { width: 38px; }

  .global-nav__submenu {
    position: static;
    min-width: 0;
    padding: 0 0 8px 16px;
    border: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: none;
  }

  .global-nav__submenu a {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid #edf0f2;
    color: var(--ink-soft);
    font-size: 0.8rem;
  }

  .global-nav__submenu a:last-child { border-bottom: 0; }

  .split-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .section-side__note { margin-top: 10px; }
  .site-footer { padding: 42px 0 34px; }
}

@media (max-width: 640px) {
  .site-header-mount:empty { min-height: 76px; }

  .site-header__inner {
    min-height: 72px;
    gap: 12px;
  }

  .brand__call { font-size: 1.18rem; }
  .brand__name { max-width: 190px; font-size: 0.61rem; }

  .section-block { padding: 48px 0; }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .site-footer__call { font-size: 1.3rem; }
  .site-footer__links { flex-direction: column; gap: 8px; }

  .site-footer__links a {
    min-height: 40px;
    display: flex;
    align-items: center;
  }
}

@media (max-width: 380px) {
  .brand__name { max-width: 160px; font-size: 0.58rem; }
  .nav-toggle { min-width: 50px; padding-inline: 7px; font-size: 0.68rem; }
}
