/* =====================================================
   layout.css — Global layout & site skeleton
   Depends on: variables.css, base.css, utilities.css
   ===================================================== */

/* -------- Site Wrapper -------- */
.site-header {
  position: relative;                 /* メガメニューの基準にする */
  z-index: var(--z-sticky);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--space-4);
  height: 64px;
}

.site-logo a {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--c-brand-blue);
  text-decoration: none;
}

/* -------- Main nav -------- */
.main-nav .nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-item {
  position: relative;                 /* hover時に子をabsoluteで展開 */
}

/* メガメニューの共通骨格 */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  background: var(--c-bg);
  box-shadow: var(--shadow-lg);
}

/* PC幅でのメガメニュー最大幅を中央寄せ */
.mega-inner {
  width: min(var(--container-max), 100% - (var(--container-gutter) * 2));
  margin-inline: auto;
  display: flex;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-4);
}

/* -------- Main Content -------- */
.site-content {
  width: 100%;
  padding-block: 1px;
}

/* -------- Footer -------- */
.site-footer {
  background: var(--c-surface);
  color: var(--c-fg-muted);
  text-align: center;
  padding: var(--space-6) var(--space-4);
  font-size: var(--fs-sm);
}

/* -------- Mobile bottom nav -------- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mnav-h);
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  z-index: var(--z-fixed);
}

.mbnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--c-fg);
  padding-block: var(--space-2);
}
.mbnav-item i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

/* -------- Mobile sheet (menu/search) -------- */
.mnav-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease);
  z-index: calc(var(--z-fixed) + 100);
  overflow: auto;
}
.mnav-sheet[aria-hidden="false"] {
  transform: translateY(0);
}

/* 暗幕 */
.mnav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: var(--z-overlay);
}

/* -------- Responsive -------- */
@media (min-width: 768px) {
  .mobile-bottom-nav,
  .mnav-sheet,
  .mnav-overlay {
    display: none;
  }
}

/* PCのコンテンツ最大幅を広げる（例: 1320px） */
@media (min-width: 1024px){
  :root{
    --container-max: 1320px; /* 好みで 1280 / 1360 / 1440 に調整OK */
  }
}
