/* ==========================================================================
   common.css — 全4ページ共通スタイル（Header 等）
   読み込み順: style.css → common.css → page-specific css
   ========================================================================== */

@media (min-width: 768px) {

  /* ---------- Nav (PC) ----------
     Layout locked via CSS Grid with 3 fixed columns:
     [brand | links (center) | vol (right)]
     Widths/heights are explicit so font/image loads never shift layout.
     ------------------------------------------------------------------ */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 64px;
    padding: 0 80px 0 80px;
    line-height: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    z-index: 900;
    background: rgba(238, 241, 246, 0.82);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-bottom: 1px solid rgba(22, 32, 46, 0.08);
    color: #16202e;
  }
  .nav-brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
    color: #16202e;
    pointer-events: auto;
    transition: opacity 0.3s ease;
  }
  .nav-brand:hover {
    opacity: 0.6;
  }
  .nav-brand-logo {
    height: 56px;
    width: auto;
    display: block;
    aspect-ratio: 3 / 2;
  }
  .nav-links {
    justify-self: center;
    display: flex;
    gap: 32px;
    pointer-events: auto;
  }
  .nav-links a {
    color: #16202e;
    text-decoration: none;
    font-family: 'Manrope', 'Noto Sans JP', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    position: relative;
    padding: 0 0 4px 0;
    font-synthesis: none;
  }
  .nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #16202e;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .nav-links a:hover::after {
    transform: scaleX(1);
  }
  .nav > .t-caption {
    justify-self: end;
    font-family: 'Manrope', 'Noto Sans JP', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-synthesis: none;
  }
  .nav > .t-caption.text-muted {
    color: #6e7b8c;
  }
}

@media (max-width: 767px) {

  /* Prevent horizontal scrollbar from varying viewport width between pages.
     Any overflow is clipped rather than producing a scrollbar that would
     change the nav's effective inner width. */
  html,
  body {
    overflow-x: hidden;
  }

  /* ---------- Nav (SP) ----------
     Layout locked via CSS Grid — Vol is hidden on SP, so the grid has
     2 columns: [brand | links (right)]
     Explicit widths on logo and grid tracks prevent any shift from
     image or font load.
     ------------------------------------------------------------------ */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    padding: 0 16px 0 16px;
    line-height: 1;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
    z-index: 900;
    background: rgba(238, 241, 246, 0.82);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    border-bottom: 1px solid rgba(22, 32, 46, 0.08);
    color: #16202e;
  }
  .nav > .t-caption.text-muted {
    display: none;
  }
  .nav-brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
    color: #16202e;
    pointer-events: auto;
    transition: opacity 0.3s ease;
  }
  .nav-brand:hover {
    opacity: 0.6;
  }
  .nav-brand-logo {
    height: 40px;
    width: auto;
    display: block;
    aspect-ratio: 3 / 2;
  }
  .nav-links {
    justify-self: end;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    pointer-events: auto;
  }
  .nav-links a {
    color: #16202e;
    text-decoration: none;
    font-family: 'Manrope', 'Noto Sans JP', sans-serif;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    position: relative;
    padding: 0 0 4px 0;
    font-synthesis: none;
  }
  .nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #16202e;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .nav-links a:hover::after {
    transform: scaleX(1);
  }

  /* Anchor-link landing offset so section headings clear the fixed nav. */
  section[id].section {
    scroll-margin-top: 56px;
  }
}

/* ---------- Nav scroll state (applies at all widths) ----------
   At the top the nav keeps its frosted bar; once scrolled it fades to
   fully transparent (no background / blur / border). */
.nav {
  transition: background 0.4s ease, border-color 0.4s ease,
    backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}
.nav.is-scrolled {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: transparent;
}
