/* ===========================================================================
 * site-v2.css
 *
 * 共通の V2 ヘッダー・フッター・ナビ用スタイル。
 * ホーム以外のページ (news / privacy など) から読み込んで、
 * ホームと統一されたグラスヘッダー・センタリングフッターを得る。
 * (ホーム index.html は同等のスタイルをインラインで持つ)
 * =========================================================================== */

/* ---------------------------------------------------------------------------
 * Body theme — dark × gold to match home V2
 * ------------------------------------------------------------------------- */
body {
  background: var(--color-bg-default);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
}

/* ---------------------------------------------------------------------------
 * Ambient particles canvas (fixed behind everything, requires
 * <div id="particles-js" class="ambient-particles"></div> in body)
 * ------------------------------------------------------------------------- */
#particles-js.ambient-particles {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
 * Header (fixed glass)
 * ------------------------------------------------------------------------- */
.header {
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(15, 12, 10, 0.38) !important;
  -webkit-backdrop-filter: blur(22px) saturate(170%);
          backdrop-filter: blur(22px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) !important;
  transition: background var(--transition-normal, 0.3s ease),
              box-shadow var(--transition-normal, 0.3s ease);
}
.header__inner {
  transition: padding var(--transition-normal, 0.3s ease);
}
.header__logo {
  transition: transform var(--transition-normal, 0.3s ease);
  transform-origin: left center;
}

/* Compact state on scroll (main.js が scrollY > 100 で .is-scrolled を付与) */
.header.is-scrolled {
  background: rgba(15, 12, 10, 0.52) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
/* Vertical だけ縮める。左右パディングは元のまま維持して
   ロゴが「真ん中に向かって」縮む見え方を防ぐ。 */
.header.is-scrolled .header__inner {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.header.is-scrolled .header__logo {
  transform: scale(0.82);
  transform-origin: left center;
}
/* メニュー（ハンバーガー）も右上に向かって縮ませる */
.header__right {
  transition: transform var(--transition-normal, 0.3s ease);
  transform-origin: right center;
}
.header.is-scrolled .header__right {
  transform: scale(0.82);
}
@media (prefers-reduced-motion: reduce) {
  .header,
  .header__inner,
  .header__logo { transition: none; }
}

/* ---------------------------------------------------------------------------
 * Header logo — レスポンシブな縮小スケール
 * AYARI画像と日本語テキストの比率を保ったまま、ブレイクポイントごとに
 * 一様に縮小する。--logo-scale をメディアクエリで切り替える。
 * ------------------------------------------------------------------------- */
.header__logo {
  --logo-scale: 1;
  gap: calc(0.35rem * var(--logo-scale));
}
.header__logo-img {
  height: calc(28px * var(--logo-scale)) !important;
  width: auto !important;
}
.header__logo-text {
  font-size: calc(0.69rem * var(--logo-scale)) !important;
  white-space: nowrap !important;
  max-width: none !important;
  display: inline !important;
  line-height: 1.3 !important;
}
@media (max-width: 1024px) { .header__logo { --logo-scale: 0.90; } }
@media (max-width: 768px)  { .header__logo { --logo-scale: 0.78; } }
@media (max-width: 560px)  { .header__logo { --logo-scale: 0.62; } }
@media (max-width: 420px)  { .header__logo { --logo-scale: 0.50; } }
@media (max-width: 360px)  { .header__logo { --logo-scale: 0.42; } }

/* ---------------------------------------------------------------------------
 * Nav menu
 * ------------------------------------------------------------------------- */
.nav-menu a {
  letter-spacing: 0.16em;
  font-size: 0.78rem;
}
.nav-menu a.is-active {
  color: var(--color-primary) !important;
}
.nav-menu a.is-active::after {
  width: 100% !important;
}

/* ---------------------------------------------------------------------------
 * Scroll progress gauge — thin gold bar at the header bottom
 * ------------------------------------------------------------------------- */
.header__gauge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  pointer-events: none;
}
.header__gauge-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    var(--color-brand-primary) 0%,
    var(--color-brand-accent) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.08s linear;
}

/* ---------------------------------------------------------------------------
 * Footer (glass + centered identity)
 * ------------------------------------------------------------------------- */
.footer {
  position: relative;
  z-index: 10;
  background: rgba(10, 8, 6, 0.92) !important;
  -webkit-backdrop-filter: blur(26px) saturate(170%);
          backdrop-filter: blur(26px) saturate(170%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer__links a,
.footer__links h4 {
  letter-spacing: 0.16em;
}
.footer__identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0 var(--space-10);
  margin-bottom: var(--space-10);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}
.footer__identity-img {
  height: 36px;
  width: auto;
}
.footer__identity-text {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  color: var(--color-primary);
  font-weight: 500;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .footer__identity-img { height: 28px; }
  .footer__identity-text { font-size: 0.65rem; }
}

/* ---------------------------------------------------------------------------
 * Mobile / tablet: 本文系の lg サイズを base に下げて読みやすく
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .sec__lead,
  .yojo__body p,
  .news-head__lead,
  .article-head__lead {
    font-size: var(--font-size-base) !important;
  }
}

/* ---------------------------------------------------------------------------
 * Mobile: news / article wrappers should fill the viewport width
 * (sub-pages don't have particles, so no need to leave space on the right).
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .article__container,
  .news-archive,
  .news-head .container,
  .news-archive .container,
  .article .container {
    max-width: none !important;
  }
}
