/* =====================================================================
   総合型選抜・学習伴走コース：LP とブログで共通の見た目
   （ヘッダー・ハンバーガーメニュー・フッター・ボタン・基本の文字組み）
   build.py が LP の index.html に埋め込み、ブログ用には assets/sg-common.css として書き出す。
   ===================================================================== */
:root {
  --blue: #159edf;          /* メインカラー（画像のボタン色） */
  --blue-hover: #1189c5;
  --blue-ink: #1172b0;      /* 白地の小さな文字・リンク用（コントラスト確保） */
  --blue-deep: #1478b8;     /* 小さなボタンの地色 */
  --blue-soft: #eef7fd;     /* セクションの区切り */
  --blue-line: #d3eaf8;
  --navy: #0f1b2d;          /* 見出し */
  --ink: #3a4660;           /* 本文 */
  --ink-light: #66718a;
  --line: #e3ebf3;
  --yellow: #f2d35b;
  --yellow-soft: #fdf6d8;
  --line-green: #06c755;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(15, 27, 45, .06);
  --shadow-lg: 0 18px 44px rgba(15, 27, 45, .10);
  --header-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0; overflow-x: clip;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  color: var(--ink); background: #fff; line-height: 1.9; letter-spacing: .04em;
  font-feature-settings: 'palt' 0;
}
img, svg { max-width: 100%; }
a { color: var(--blue-ink); }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.5; letter-spacing: .03em; margin: 0; }
p { margin: 0; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid rgba(21, 158, 223, .5); outline-offset: 3px; border-radius: 6px; }
[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i { width: 22px; height: 22px; flex-shrink: 0; display: inline-block; vertical-align: middle; stroke-width: 1.75; }
body.is-locked { overflow: hidden; }

/* ---------- ボタン ---------- */
.sg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 60px; padding: 0 34px; border-radius: 14px; border: 0;
  background: var(--blue); color: #fff; text-decoration: none; cursor: pointer;
  font-size: 1.1rem; font-weight: 700; letter-spacing: .06em;
  box-shadow: 0 10px 24px rgba(21, 158, 223, .28);
  transition: background .25s, box-shadow .25s, transform .25s var(--ease);
}
.sg-btn .i { transition: transform .25s var(--ease); }
.sg-btn:hover { background: var(--blue-hover); box-shadow: 0 12px 28px rgba(21, 158, 223, .34); }
.sg-btn:hover .i { transform: translateX(4px); }
.sg-btn--line { background: #fff; color: var(--navy); border: 1.5px solid var(--line); box-shadow: none; }
.sg-btn--line .i { color: var(--line-green); }
.sg-btn--line:hover { background: #f6fbf8; border-color: #bfe8cf; box-shadow: none; }
.sg-link {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 2px;
  color: var(--navy); font-weight: 700; text-decoration: none;
  border-bottom: 1.5px solid rgba(15, 27, 45, .35); transition: color .2s, border-color .2s;
}
.sg-link .i { width: 20px; height: 20px; transition: transform .25s var(--ease); }
.sg-link:hover { color: var(--blue-ink); border-color: var(--blue-ink); }
.sg-link:hover .i { transform: translateX(4px); }

/* ---------- ヘッダー ---------- */
.sg-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.sg-header.is-scrolled {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 24px rgba(15, 27, 45, .07);
}
.sg-header__in {
  max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 14px;
}
.sg-brand { display: block; line-height: 0; flex-shrink: 0; }
.sg-brand img { height: 38px; width: auto; }
.sg-brand__sep { width: 1px; height: 26px; background: #b7c3d1; flex-shrink: 0; }
.sg-brand__course { font-size: .82rem; font-weight: 500; color: var(--ink); text-decoration: none; letter-spacing: .05em; white-space: nowrap; }
.sg-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .92);
  border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: 0 8px 30px rgba(15, 27, 45, .08); }
.sg-header.is-scrolled .sg-nav { box-shadow: none; background: transparent; }
.sg-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.sg-nav ul a {
  position: relative; display: block; padding: 8px 16px; border-radius: 999px;
  font-size: .9rem; font-weight: 700; color: var(--navy); text-decoration: none; transition: color .2s;
}
.sg-nav ul a::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 3px; height: 2px; border-radius: 2px;
  background: var(--blue); transform: scaleX(0); transition: transform .3s var(--ease);
}
.sg-nav ul a:hover { color: var(--blue-ink); }
.sg-nav ul a.is-current, .sg-nav ul a[aria-current] { color: var(--blue-ink); }
.sg-nav ul a.is-current::after, .sg-nav ul a[aria-current]::after { transform: scaleX(1); }
.sg-nav__cta {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 26px; margin-left: 8px; border-radius: 999px;
  background: var(--blue-deep); color: #fff; font-weight: 700; font-size: .92rem; text-decoration: none; transition: background .2s;
}
.sg-nav__cta:hover { background: #0f659c; }
.sg-burger {
  display: none; margin-left: auto; width: 50px; height: 50px; border-radius: 50%; border: 0; background: #fff; cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 27, 45, .12); position: relative; z-index: 61; flex-shrink: 0;
}
.sg-burger span {
  position: absolute; left: 15px; right: 15px; height: 2px; border-radius: 2px; background: var(--navy);
  transition: transform .35s var(--ease), opacity .2s, top .35s var(--ease);
}
.sg-burger span:nth-child(1) { top: 18px; }
.sg-burger span:nth-child(2) { top: 24px; }
.sg-burger span:nth-child(3) { top: 30px; }
.sg-burger[aria-expanded="true"] span:nth-child(1) { top: 24px; transform: rotate(45deg); }
.sg-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
.sg-burger[aria-expanded="true"] span:nth-child(3) { top: 24px; transform: rotate(-45deg); }

@media (max-width: 1180px) {
  .sg-nav ul a { padding: 8px 11px; font-size: .86rem; }
  .sg-nav ul a::after { left: 11px; right: 11px; }
}
@media (max-width: 1023px) {
  :root { --header-h: 66px; }
  .sg-nav { display: none; }
  .sg-burger { display: block; }
  .sg-header__in { padding: 0 16px 0 20px; }
}
@media (max-width: 767px) {
  :root { --header-h: 62px; }
  .sg-brand img { height: 30px; }
  .sg-brand__sep { height: 20px; }
  .sg-brand__course { font-size: .72rem; letter-spacing: .02em; }
  .sg-header__in { gap: 10px; padding: 0 12px 0 16px; }
  .sg-burger { width: 46px; height: 46px; }
  .sg-burger span { left: 14px; right: 14px; }
  .sg-burger span:nth-child(1) { top: 16px; } .sg-burger span:nth-child(2) { top: 22px; } .sg-burger span:nth-child(3) { top: 28px; }
  .sg-burger[aria-expanded="true"] span:nth-child(1), .sg-burger[aria-expanded="true"] span:nth-child(3) { top: 22px; }
}
@media (max-width: 359px) { .sg-brand__course { display: none; } .sg-brand__sep { display: none; } }

/* ---------- ハンバーガーメニュー（右からスライドする全画面パネル） ---------- */
.sg-menu { position: fixed; inset: 0; z-index: 60; visibility: hidden; }
.sg-menu.is-open { visibility: visible; }
.sg-menu__backdrop { position: absolute; inset: 0; background: rgba(15, 27, 45, .35); opacity: 0; transition: opacity .35s; }
.sg-menu.is-open .sg-menu__backdrop { opacity: 1; }
.sg-menu__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(100%, 460px); overflow-y: auto; overscroll-behavior: contain;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(21, 158, 223, .14), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(242, 211, 91, .16), transparent 65%),
    linear-gradient(180deg, #fff 0%, #f4faff 100%);
  padding: 14px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(100%); transition: transform .45s var(--ease);
  display: flex; flex-direction: column; gap: 18px;
}
.sg-menu.is-open .sg-menu__panel { transform: none; }
.sg-menu__top { display: flex; align-items: center; gap: 10px; min-height: 48px; padding-right: 58px; }
.sg-menu__top img { height: 30px; width: auto; }
.sg-menu__top span { font-size: .74rem; color: var(--ink); white-space: nowrap; }
.sg-menu__close {
  position: absolute; top: 14px; right: 16px; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: #fff; color: var(--navy); box-shadow: 0 6px 20px rgba(15, 27, 45, .12); display: flex; align-items: center; justify-content: center;
}
.sg-menu__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sg-menu__list a {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: 16px; text-decoration: none;
  background: rgba(255, 255, 255, .9); border: 1px solid var(--line); color: var(--navy);
  box-shadow: 0 4px 16px rgba(15, 27, 45, .04); transition: border-color .2s, background .2s;
}
.sg-menu__list a:hover { border-color: var(--blue-line); background: #fff; }
.sg-menu__list a[aria-current] { border-color: var(--blue); }
.sg-menu__num { font-size: .78rem; font-weight: 700; color: var(--blue-ink); letter-spacing: .08em; width: 1.6em; }
.sg-menu__ico { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sg-menu__ico .i { width: 20px; height: 20px; }
.sg-menu__txt { flex: 1; min-width: 0; line-height: 1.5; }
.sg-menu__txt b { display: block; font-size: .98rem; }
.sg-menu__txt small { display: block; font-size: .74rem; color: var(--ink-light); letter-spacing: .02em; }
.sg-menu__list a > .i { width: 18px; height: 18px; color: #9aa7b8; }
.sg-menu__diag {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; border-radius: 999px;
  background: var(--yellow-soft); color: var(--navy); font-size: .88rem; font-weight: 700; text-decoration: none; border: 1px solid #f1e3a6;
}
.sg-menu__diag .i { width: 18px; height: 18px; color: #b8901a; }
.sg-menu__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sg-menu__chips li { font-size: .76rem; font-weight: 700; color: var(--blue-ink); background: #fff; border: 1px solid var(--blue-line); border-radius: 999px; padding: 5px 12px; }
.sg-menu__cta { display: grid; gap: 10px; }
.sg-menu__cta .sg-btn { min-height: 56px; font-size: 1.02rem; width: 100%; }
.sg-menu__foot { display: flex; justify-content: center; gap: 22px; font-size: .84rem; }
.sg-menu__foot a { color: var(--ink); }
.sg-menu__leaves { margin-top: auto; height: 70px; opacity: .55; pointer-events: none; }
/* 項目を上から順に少しずつ遅らせて表示 */
.sg-menu [data-stagger] { opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.sg-menu.is-open [data-stagger] { opacity: 1; transform: none; transition-delay: calc(.12s + var(--i, 0) * .05s); }

/* ---------- フッター ---------- */
.sg-footer { background: var(--navy); color: rgba(255, 255, 255, .72); font-size: .84rem; }
.sg-footer__quick { background: #0b1524; text-align: center; padding: 12px 16px; display: flex; justify-content: center; gap: 28px; font-size: .82rem; }
.sg-footer__quick a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.sg-footer__quick a:hover { text-decoration: underline; }
.sg-footer__in { max-width: 1120px; margin: 0 auto; padding: 48px 24px 28px; }
.sg-footer__top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 28px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.sg-footer__logo { height: 42px; width: auto; filter: brightness(0) invert(1); margin-bottom: 10px; display: block; }
.sg-footer__sub { font-size: .8rem; color: rgba(255, 255, 255, .6); line-height: 1.8; }
.sg-footer__nav { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 28px; align-content: start; }
.sg-footer__nav a { color: rgba(255, 255, 255, .8); text-decoration: none; font-size: .84rem; }
.sg-footer__nav a:hover { color: #fff; text-decoration: underline; }
.sg-footer__bottom { padding-top: 20px; font-size: .76rem; line-height: 2; color: rgba(255, 255, 255, .55); text-align: center; }
.sg-footer__bottom a { color: rgba(255, 255, 255, .7); }
@media (max-width: 767px) {
  .sg-footer__nav { grid-template-columns: repeat(2, auto); }
  .sg-footer__in { padding: 40px 20px 24px; }
}

/* ---------- 画面に入ったらフェードイン（既存サイトと同じ .fade-up / .visible） ---------- */
/* JSが動かない環境では最初から表示する（head の小さなスクリプトが html に .js を付ける） */
.js .fade-up { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--d, 0) * .08s); }
.js .fade-up.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .fade-up { transform: none; transition: opacity .4s linear; }
  .sg-menu__panel, .sg-menu [data-stagger], .sg-burger span { transition-duration: .01s !important; transition-delay: 0s !important; }
}
