/* ==========================================================================
   layout.css — コンテナ・ヘッダー・フッター・セクション・グリッド
   ========================================================================== */

.container {
  max-width: var(--container-max);
  width: calc(100% - 56px);
  margin: 0 auto;
}

.container-narrow {
  max-width: 800px;
  width: calc(100% - 56px);
  margin: 0 auto;
}

@media (min-width: 768px) {
  .container,
  .container-narrow {
    width: calc(100% - 80px);
  }
}

section {
  padding: var(--space-xl) 0;
}

@media (max-width: 767px) {
  section {
    padding: var(--space-lg) 0;
  }
}

/* ---------- ヘッダー ---------- */

#header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 500;
  height: 88px;
  display: flex;
  align-items: center;
  background: var(--color-white);
  transition: height 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

#header.is-scrolled {
  height: 64px;
  background: var(--color-white);
  box-shadow: 0 4px 20px rgba(0, 18, 94, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-brand__logo {
  height: 28px;
  width: auto;
}

.header-brand__divider {
  display: none;
  width: 1px;
  height: 24px;
  background: rgba(0, 18, 94, 0.15);
}

.header-brand__label {
  display: none;
  font-family: var(--font-mincho);
  font-size: 14px;
  color: var(--color-navy);
}

@media (min-width: 768px) {
  .header-brand__logo {
    height: 32px;
  }
  .header-brand__divider,
  .header-brand__label {
    display: block;
  }
}

#header-nav {
  display: none;
  align-items: center;
  gap: 28px;
}

#header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: rgba(0, 18, 94, 0.8);
  transition: color 0.3s ease;
}

#header-nav a.btn-primary {
  color: var(--color-white);
}

#header-nav a.btn-primary:hover {
  color: var(--color-white);
  transform: none;
}

#header-nav a:hover {
  color: var(--color-accent);
}

.menu-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-navy);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (min-width: 1100px) {
  #header-nav {
    display: flex;
  }
  .menu-toggle {
    display: none;
  }
}

#mobile-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--color-white);
  padding: var(--space-md) var(--space-md) var(--space-lg);
  box-shadow: 0 10px 30px rgba(0, 18, 94, 0.12);
}

#mobile-nav[hidden] {
  display: none;
}

#mobile-nav a {
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-navy);
}

#mobile-nav a.btn-primary {
  color: var(--color-white);
}

#mobile-nav a.btn-primary:hover {
  transform: none;
}

#mobile-nav a:hover {
  background: var(--color-sky-pale);
}

@media (min-width: 1100px) {
  #mobile-nav {
    display: none !important;
  }
}

/* ---------- フッター ---------- */

#footer {
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-xl) 0;
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.footer-logo {
  height: 84px;
  width: auto;
  padding: 8px 16px;
  background: var(--color-white);
}

#footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

#footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  padding-top: var(--space-sm);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.footer-contact {
  font-size: 12px;
  line-height: 1.9;
  color: var(--color-white);
}

.footer-tagline {
  font-weight: 700;
}

.footer-contact-email {
  margin-top: var(--space-sm);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-white);
}

.footer-contact-email a {
  color: var(--color-sky-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-contact-email a:hover {
  color: var(--color-white);
}

@media (min-width: 768px) {
  .footer-contact-email {
    font-size: 17px;
  }
}

#footer-nav a:hover {
  color: var(--color-white);
}

.footer-credit {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.footer-copyright {
  font-size: 11px;
  color: var(--color-white);
}

/* ---------- 汎用ユーティリティ ---------- */

.br-sp {
  display: none;
}

@media (max-width: 767px) {
  .br-sp {
    display: inline;
  }
}

.hide-sp {
  display: inline;
}

@media (max-width: 767px) {
  .hide-sp {
    display: none;
  }
}

/* ---------- 汎用グリッド／フレックス ---------- */

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid-2 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-lg);
}

.section-head--prize {
  position: relative;
}

.section-head__mascot {
  display: none;
  position: absolute;
  z-index: 5;
  top: 30%;
  left: 100%;
  transform: translateY(-50%);
  margin-left: 32px;
  width: 170px;
  height: auto;
}

@media (min-width: 1320px) {
  .section-head__mascot {
    display: block;
  }
}

.section-head p + h2 {
  margin-top: var(--space-sm);
}

.section-head__desc {
  margin-top: var(--space-sm);
  font-size: 14px;
  line-height: 1.9;
  color: var(--color-navy-soft);
}

@media (min-width: 768px) {
  .section-head--nowrap {
    max-width: none;
  }
  .section-head--nowrap .section-head__desc {
    white-space: nowrap;
  }
}

.section-head__credit {
  margin-top: var(--space-md);
  font-size: 12px;
  color: var(--color-navy-soft);
}

@media (min-width: 768px) {
  .section-head__desc {
    font-size: 15px;
  }
}
