/* ==========================================================================
   site.css — gitea.jp 固有のデザイン(cms.css の上に重ねる)
   配色は theme.css のトークンのみ参照する。
   ========================================================================== */

/* ── ヘッダー ───────────────────────────────────────────── */
.site-header {
  background: linear-gradient(90deg, var(--color-term-1), var(--color-term-2));
  border-bottom: 2px solid var(--color-signal);
}
.site-logo {
  display: inline-flex; align-items: center; gap: .55rem;
  color: #fff; font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; letter-spacing: .02em;
}
.site-logo:hover { color: var(--color-signal); text-decoration: none; }
.site-logo__mark { width: 30px; height: 30px; flex-shrink: 0; }
.site-logo__tld { color: var(--color-signal); }
.site-nav__item > a { color: #dcefdd; font-size: .95rem; }
.site-nav__item > a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.site-nav__item.is-active > a { color: var(--color-signal); }
.nav-toggle { border-color: rgba(255, 255, 255, .4); }
.nav-toggle__bar { background: #fff; }
.site-nav__submenu { background: var(--color-surface); min-width: 14rem; max-width: 22rem; }
.site-nav__submenu a { color: var(--color-text-muted); white-space: normal; font-size: .88rem; line-height: 1.5; }
@media (max-width: 820px) {
  .site-nav { background: var(--color-term-1); }
  .site-nav__submenu { background: transparent; border-left-color: rgba(255, 255, 255, .3); }
  .site-nav__submenu a { color: #bfd9c4; }
}

/* ── 見出し・本文 ───────────────────────────────────────── */
.page h1 { line-height: 1.4; }
.page__body h2 {
  border-bottom: 0; padding: .1rem 0 .1rem .9rem;
  border-left: 5px solid var(--color-signal);
  margin-top: 2.6rem;
}
.page__body h3 { color: var(--color-accent-strong); }
.lede { font-size: 1.1rem; }
.page__body > p:first-of-type { font-size: 1.04rem; }
.toc { border-left: 4px solid var(--color-signal); max-width: 26rem; padding: .65rem .95rem; margin: 1.1rem 0; font-size: .85rem; }
.toc__title { font-size: .85rem; margin: 0 0 .35rem; }
.toc ol { padding-left: 1.1rem; }
.toc li { margin: .15rem 0; line-height: 1.5; }
.toc a { font-size: .82rem; }
pre { background: var(--color-term-1); color: #e4f3e6; border-color: #24382a; }
pre code { background: none; padding: 0; color: inherit; }
table.data-table thead th { background: var(--color-term-2); color: #fff; }

/* ── ヒーロー(トップ) ──────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; color: #fff;
  margin: 0 0 2.5rem; padding: clamp(2.2rem, 6vw, 4rem) clamp(1.25rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(rgba(124, 194, 74, .08) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(124, 194, 74, .08) 1px, transparent 1px) 0 0 / 28px 100%,
    linear-gradient(160deg, var(--color-term-1) 0%, var(--color-term-2) 100%);
  box-shadow: var(--shadow-md);
}
.hero__eyebrow { margin: 0 0 .6rem; color: var(--color-signal); font-weight: 700; letter-spacing: .12em; font-size: .85rem; font-family: var(--font-mono); }
.hero__title { font-size: clamp(1.7rem, 1rem + 3.2vw, 2.8rem); line-height: 1.35; margin: 0 0 1rem; color: #fff; font-weight: 800; }
.hero__lead { max-width: 38em; margin: 0 0 1.5rem; color: #d3e8d6; font-size: 1.04rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.hero__btn { display: inline-block; padding: .7rem 1.4rem; border-radius: 999px; font-weight: 700; background: var(--color-signal); color: #0d1a04; }
.hero__btn:hover { background: #a3e46f; color: #0d1a04; text-decoration: none; }
.hero__btn--ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .6); }
.hero__btn--ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.hero__term {
  margin: 0; padding: .9rem 1.1rem; max-width: 34rem; border-radius: var(--radius-md);
  background: rgba(0, 0, 0, .35); border: 1px solid #24382a;
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.7; color: #d6ecd9; overflow-x: auto;
}
.hero__term p { margin: 0; }
.hero__term .t-prompt { color: var(--color-term-green); }
.hero__term .t-code { color: var(--color-signal); font-weight: 700; }
.hero__term .t-dim { color: #9bb8a2; }

/* ── ステータスコードのバッジ ─────────────────────────── */
.status {
  display: inline-block; padding: .05em .55em; border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: .88em; font-weight: 700; white-space: nowrap;
  background: var(--color-term-2); color: #fff; border-left: 4px solid var(--color-signal);
}
.status--perm { border-left-color: var(--color-accent); }
.status--err { border-left-color: var(--callout-caution); }
.status--ok { border-left-color: var(--callout-tip); }

/* ── リクエスト/レスポンスの流れ図(:::flow) ──────────── */
.flow {
  margin: 1.75rem 0; padding: 1rem 1.1rem; border-radius: var(--radius-md);
  background: var(--color-term-1); border: 1px solid #24382a; color: #e4f3e6;
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.6; overflow-x: auto;
}
.flow__head { display: flex; justify-content: space-between; margin: 0 0 .6rem; padding-bottom: .5rem; border-bottom: 1px dashed #355140; color: #9bb8a2; font-size: .8rem; letter-spacing: .06em; }
.flow__row { display: flex; align-items: baseline; gap: .6rem; margin: .35rem 0; }
.flow__row::before { flex-shrink: 0; font-weight: 700; width: 1.6em; }
.flow__row--req::before { content: "\2192"; color: var(--color-term-green); }
.flow__row--res::before { content: "\2190"; color: var(--color-signal); }
.flow__row--note { color: #9bb8a2; padding-left: 2.2em; font-family: var(--font-sans); font-size: .85rem; }
.flow__row--note::before { content: none; }
.flow__row--res .flow__text { color: #d6f5b8; }
.flow__text { white-space: pre-wrap; word-break: break-all; }

/* ── 比較(:::vs) ──────────────────────────────────────── */
.vs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 1.75rem 0; }
.vs__col {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 1rem 1.2rem 1.1rem; box-shadow: var(--shadow-sm);
}
.vs__col:nth-child(odd) { border-top: 4px solid var(--color-accent); }
.vs__col:nth-child(even) { border-top: 4px solid var(--color-signal); }
.vs__title { margin: 0 0 .5rem; font-weight: 800; font-size: 1.05rem; }
.vs__col ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.vs__col li { margin: .4rem 0; }

/* ── カード・一覧 ──────────────────────────────────────── */
.card { box-shadow: var(--shadow-sm); border-top: 3px solid var(--color-signal); }
.child-list a { box-shadow: var(--shadow-sm); }
.child-list a:hover { border-color: var(--color-signal); }
.cms-btn { background: var(--color-accent); border-radius: 999px; }

/* ── フッター ───────────────────────────────────────────── */
.site-footer { background: var(--color-term-1); border-top: 3px solid var(--color-signal); color: #bfd9c4; }
.site-footer__logo, .site-footer__heading a { color: #fff; }
.site-footer__logo { font-family: var(--font-mono); font-size: 1.1rem; }
.site-footer__desc, .site-footer__col a, .site-footer__bottom p { color: #9fb2dc; }
.site-footer__col a:hover { color: var(--color-signal); }
.site-footer__bottom { border-top-color: rgba(255, 255, 255, .18); }

/* ── アイコン・要点ボックス ───────────────────────────── */
.page__icon { display: block; width: 2.4rem; height: 2.4rem; margin: 0 0 .5rem; color: var(--color-signal); }
.page__body h2 .icon { color: var(--color-signal); width: 1.05em; height: 1.05em; margin-right: .35em; vertical-align: -.12em; }
.page__body h3 .icon { color: var(--color-signal); margin-right: .3em; }
.glance { display: grid; gap: .75rem; margin: 1.5rem 0 2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.glance__item {
  display: flex; gap: .7rem; align-items: flex-start;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-signal); border-radius: var(--radius-md);
  padding: .8rem .9rem; box-shadow: var(--shadow-sm);
}
.glance__item > .icon { flex-shrink: 0; width: 1.7rem; height: 1.7rem; margin: .1rem 0 0; color: var(--color-accent); }
.glance__label { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .06em; color: var(--color-text-muted); }
.glance__text { margin: .1rem 0 0; font-size: .95rem; line-height: 1.55; }
.glance__text p { margin: 0; }

.callout { position: relative; padding-left: 3rem; }
.callout::before {
  content: ""; position: absolute; left: 1rem; top: 1rem; width: 1.3rem; height: 1.3rem;
  background-color: var(--c);
  -webkit-mask: var(--i-info) no-repeat center / contain; mask: var(--i-info) no-repeat center / contain;
}
.callout--tip::before { -webkit-mask-image: var(--i-sparkle); mask-image: var(--i-sparkle); }
.callout--important::before { -webkit-mask-image: var(--i-star); mask-image: var(--i-star); }
.callout--warning::before, .callout--caution::before { -webkit-mask-image: var(--i-warning); mask-image: var(--i-warning); }

/* ── 404 ────────────────────────────────────────────────── */
.stage404 { text-align: center; padding: 3rem 1rem 4rem; }
.stage404__code { font-family: var(--font-mono); font-size: clamp(4rem, 18vw, 8rem); font-weight: 800; line-height: 1; margin: 0; color: var(--color-term-2); }
.stage404__code span { color: var(--color-signal); }
@media (prefers-color-scheme: dark) { .stage404__code { color: var(--color-text); } }
.stage404 .flow { max-width: 30rem; margin-inline: auto; text-align: left; }

/* ── メニューの型くずれ防止 ───────────────────────────── */
.site-header__inner { gap: .75rem; }
.site-logo { flex-shrink: 0; }
.site-nav__item > a { white-space: nowrap; padding-inline: .6rem; font-size: .9rem; }
.site-nav__submenu { width: max-content; min-width: 12rem; max-width: min(20rem, 90vw); }
.site-nav__submenu a { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .site-nav__item > a { white-space: normal; }
  .site-nav__submenu { width: auto; max-width: none; }
}
@media (min-width: 821px) {
  .site-nav__list > .site-nav__item:nth-last-child(-n+2) > .site-nav__submenu { left: auto; right: 0; }
}

/* ── フッター: 段組みとシルエット ─────────────────────── */
.site-footer { position: relative; overflow: hidden; padding: 2.5rem 0 1.5rem; }
.site-footer::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 170px; pointer-events: none;
}
.site-footer > .container { position: relative; }
.site-footer__inner {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.25rem 1.5rem;
}
.site-footer__brand { grid-column: 1 / -1; max-width: 40rem; }
.site-footer__col ul { columns: 1; }
.site-footer__col li { margin: .2rem 0; }
.site-footer__bottom { margin-top: 1.25rem; padding-top: .9rem; }
@media (min-width: 821px) {
  .site-footer__brand { grid-column: auto; grid-row: span 1; }
  .site-footer__inner { grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)); }
}
