
/* ===== CSS VARIABLES ===== */
:root {
  /* Colors */
  --white: #ffffff;
  --off-white: #f7f8f9;
  --blue-gray-light: #eef1f5;
  --blue-gray: #d4dbe6;
  --charcoal: #2c3340;
  --charcoal-mid: #4a5568;
  --charcoal-light: #6b7a90;

  /* Accents */
  --clear-blue: #2b7cd3;
  --sky-blue: #a8c8e8;
  --coral: #e07060;
  --apricot: #f0a878;

  /* Logo green — small accents only */
  --green: #4a8c70;
  --green-light: #6aaa88;

  /* ===== デザインシステム改訂トークン（PHASE 2） ===== */
  --text-primary: #2C3340;
  --text-secondary: #4A5568;
  --text-muted: #5C6B82;
  --text-brand: #326D5A;
  --text-link: #1E6ABF;
  --text-on-dark: #FFFFFF;
  --brand: #4A8C70;
  --brand-strong: #326D5A;
  --accent-warm: #A15B30;
  --surface: #FFFFFF;
  --surface-muted: #F7F8F9;
  --surface-brand-tint: #EEF4F1;
  --border: #D4DBE6;
  --border-interactive: #748BAE;
  --focus-ring: #326D5A;

  /* Typography */
  --font-ja: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', sans-serif;
  --font-en: 'Georgia', 'Times New Roman', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --max-width: 1160px;
  --header-height: 84px;

  /* Assets — swap these paths when deploying */
  --logo-path: '../logo-header.jpg';
  --video-path: '../top-video.mp4';
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html,
body {
  min-height: 100%;
}
body {
  font-family: var(--font-ja);
  color: var(--charcoal);
  background: #f2f5f3;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
ul { list-style: none; }

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .branch-icon,
  .entry-link-icon,
  .news-all-icon,
  .common-link-cta-icon {
    transition: none !important;
    transform: none !important;
  }
}

/* ===== FOCUS ===== */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: #448167;
  color: white;
  padding: 0.5rem 1rem;
  z-index: 9999;
  border-radius: 4px;
  font-size: 0.875rem;
}
.skip-link:focus { top: 1rem; }

/* ===== VIEWS ===== */
.view { display: none; }
.view.active { display: block; min-height: 100svh; }

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--blue-gray);
  z-index: 100;
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.site-logo img {
  height: 48px;
  width: auto;
  display: block;
  object-fit: contain;
}
.site-logo-placeholder {
  display: flex;
  align-items: center;
  height: 48px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border: 1px dashed var(--blue-gray);
  padding: 0 0.75rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* ===== HEADER NAV ===== */
.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
}


/* Secondary nav links */
.header-nav-secondary {
  display: flex;
  align-items: center;
  gap: 0;
}
.header-nav-secondary a,
.header-nav-secondary button,
.header-nav-secondary .header-contact-link {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  height: var(--header-height);
  font-size: 0.8125rem;
  color: var(--charcoal-mid);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-ja);
}
.header-nav-secondary a:hover,
.header-nav-secondary button:hover {
  color: var(--charcoal);
  border-bottom-color: var(--green);
}
.header-search-btn {
  padding: 0 0.875rem !important;
  width: auto;
  min-width: 44px;
  gap: 6px;
}
.header-search-btn-label {
  white-space: nowrap;
}

/* ===== お問い合わせ：正式URL確定までの非リンク状態 =====
   見た目はCTAのまま維持しつつ、実体はリンクを持たないspan要素にする。
   正式URL確定後は、この要素をa要素へ差し替えるだけで有効なリンクになる。 */
.header-contact-link.is-disabled,
.footer-contact-link.is-disabled,
.btn-outline.is-disabled,
.btn-green.is-disabled {
  cursor: default;
  pointer-events: none;
}
.header-contact-link.is-disabled,
.footer-contact-link.is-disabled {
  color: var(--charcoal-light) !important;
  border-bottom-color: transparent !important;
}
.btn-outline.is-disabled,
.btn-green.is-disabled {
  opacity: 0.55;
}

/* 現在地表示：色だけでなく下線・太字を併用 */
.header-nav-secondary a[aria-current="page"] {
  color: var(--charcoal);
  font-weight: 600;
  border-bottom-color: var(--green);
}

/* ===== 新着情報ナビ（PC）：シンプルなCTAボタン ===== */
.header-nav-secondary a.nav-news {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  margin: 0 12px 0 4px;
  padding: 0 16px;
  background: #326d5a;
  border: 1px solid #326d5a;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease;
}
.header-nav-secondary a.nav-news .nav-news-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-nav-secondary a.nav-news:hover,
.header-nav-secondary a.nav-news:focus-visible {
  background: #274a3d;
  border-color: #274a3d;
  color: #ffffff;
}
.header-nav-secondary a.nav-news[aria-current="page"] {
  background: #326d5a;
  border-color: #326d5a;
  color: #ffffff;
}

/* ===== SP：ヘッダー右側のアクション群（新着ショートカット＋ハンバーガー） ===== */
.header-sp-actions {
  display: none;
  align-items: center;
  gap: 8px;
}
.header-news-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 0.9rem;
  background: #326d5a;
  border: 1px solid #326d5a;
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.header-news-shortcut .nav-news-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-news-shortcut:hover,
.header-news-shortcut:focus-visible {
  background: #274a3d;
  border-color: #274a3d;
}
@media (max-width: 359px) {
  .news-shortcut-full { display: none; }
  .news-shortcut-short { display: inline; }
}
@media (min-width: 360px) {
  .news-shortcut-short { display: none; }
}

/* ===== HAMBURGER ===== */
.hamburger {
  display: none;
}
.hamburger__icon span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--green);
  transition: transform 0.25s;
}

/* ===== MOBILE NAV ===== */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--blue-gray);
  z-index: 99;
  padding: 0;
}
.mobile-nav.open { display: block; }

/* Secondary links in mobile nav: 編集的なサイト案内リスト */
.mobile-nav-guide-head {
  padding: 4px 4px 20px;
  border-bottom: 2px solid var(--green);
  margin-bottom: 4px;
}
.mobile-nav-guide-en {
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #326D5A;
  margin: 0 0 6px;
}
.mobile-nav-guide-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2C3340;
  margin: 0 0 10px;
  line-height: 1.4;
}
.mobile-nav-guide-desc {
  font-size: 0.8125rem;
  color: #4A5568;
  line-height: 1.7;
  margin: 0;
}
.mobile-nav-secondary {
  display: flex;
  flex-direction: column;
}
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 4px;
  border-bottom: 1px solid var(--blue-gray-light);
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}
.mobile-nav-item:last-of-type { border-bottom: none; }
.mobile-nav-item__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav-item__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.4;
}
.mobile-nav-item__en {
  font-family: var(--font-en);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5C6B82;
}
.mobile-nav-item__desc {
  font-size: 0.8125rem;
  color: var(--charcoal-mid);
  line-height: 1.5;
}
.mobile-nav-item__arrow {
  flex: 0 0 auto;
  font-size: 1.125rem;
  color: #5C6B82;
  transition: transform 0.18s, color 0.18s;
}
.mobile-nav-item:hover,
.mobile-nav-item:focus-visible {
  background: var(--off-white);
}
.mobile-nav-item:hover .mobile-nav-item__arrow,
.mobile-nav-item:focus-visible .mobile-nav-item__arrow {
  transform: translateX(3px);
  color: var(--green);
}
.mobile-nav-item[aria-current="page"] {
  background: var(--off-white);
}
.mobile-nav-item[aria-current="page"] .mobile-nav-item__title {
  color: #326D5A;
}

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
}
.search-overlay.open { display: flex; }
.search-box {
  background: white;
  padding: var(--space-lg);
  width: min(560px, 90vw);
  border-radius: 6px;
}
.search-box label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.search-box input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border-interactive);
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--font-ja);
}
.search-box input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-color: var(--border-interactive); }
.search-close {
  display: block;
  margin-top: var(--space-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  background: none;
  border: none;
  padding: 0.5rem 0;
}

/* ===== SECTION WRAPPER ===== */
.section-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ===== SECTION LABEL ===== */
.section-label {
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: var(--font-en);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-label::after {
  content: '';
  display: block;
  flex: 1;
  max-width: 48px;
  height: 1px;
  background: var(--blue-gray);
}

/* ===== BUTTON STYLES ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--text-link);
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 0.9375rem;
  font-family: var(--font-ja);
  min-height: 44px;
  transition: background 0.2s;
}
.btn-primary:hover { background: #17529a; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--charcoal);
  border: 1px solid var(--border-interactive);
  border-radius: 3px;
  font-size: 0.9375rem;
  font-family: var(--font-ja);
  min-height: 44px;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--text-link); color: var(--text-link); }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  color: var(--text-link);
  font-size: 0.9375rem;
  font-family: var(--font-ja);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
  min-height: 44px;
}
.btn-text:hover { border-bottom-color: var(--text-link); }
.btn-text::after { content: '→'; font-size: 0.875rem; }

/* ===== ARROW ===== */
.arrow { display: inline-block; font-style: normal; }

/* ===== FOOTER（他のFIX済みページと共通の仕様に統一） ===== */
.site-footer {
  /* トップページはコンテンツが動画のみで短いため、
     bodyのflexレイアウトに合わせてフッターを画面下まで伸ばす
     （sticky-footer挙動）。共通フッターの見た目・構造自体は他ページと同一。 */
  flex: 1 0 auto;
  background: #F5F7F6;
  color: #4A5568;
  border-top: 1px solid #D8E0DC;
  padding: 40px 0;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.footer-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.footer-logo-link {
  display: inline-block;
  width: 100%;
  max-width: 220px;
}
.footer-logo-image {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  object-fit: contain;
  object-position: left top;
}
.footer-logo-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: 2px;
}

/* 施設情報（住所・電話・FAX）：削除はせず、動画直下ではなくフッター内に
   控えめな情報として整理。電話番号は文字サイズ・色とも強調しない。 */
.footer-facility {
  font-size: 0.875rem;
  line-height: 1.8;
  color: #5C6B82;
}
.footer-facility-name {
  font-weight: 700;
  color: #4A5568;
  margin: 0 0 4px;
}
.footer-facility address {
  font-style: normal;
}
.footer-facility p {
  margin: 0;
}
.footer-facility a {
  color: inherit;
  text-decoration: none;
}
.footer-facility a:hover,
.footer-facility a:focus-visible {
  color: #326D5A;
}
.footer-dcnet {
  font-size: 0.875rem;
  line-height: 1.8;
  color: #5C6B82;
}
.footer-dcnet-link {
  color: inherit;
  text-decoration: none;
}
.footer-dcnet-line {
  display: block;
}
.footer-dcnet-link:hover,
.footer-dcnet-link:focus-visible {
  color: #326D5A;
}

.footer-nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-heading {
  font-size: 1.125rem;
  font-weight: 700;
  color: #2C3340;
  margin: 0 0 0.875rem;
  line-height: 1.4;
}
.footer-nav-group li {
  margin-bottom: 0.125rem;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
  color: #4A5568;
  text-decoration: none;
  transition: color 0.18s;
}
a.footer-link:hover {
  color: #326D5A;
}
a.footer-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}
.footer-link[aria-current="page"] {
  color: #2C3340;
  font-weight: 700;
}
.footer-bottom {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #D8E0DC;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.footer-legal .footer-link {
  font-size: 0.9375rem;
  font-weight: 600;
}
.footer-copyright {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #326D5A;
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .site-footer {
    padding: 52px 0;
  }
  .footer-main {
    grid-template-columns: 1fr 1fr;
    column-gap: 48px;
    row-gap: 36px;
  }
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
  .footer-legal {
    flex-direction: row;
    gap: 24px;
  }
}

@media (min-width: 1024px) {
  .footer-main {
    grid-template-columns: 1.6fr 1fr 1.2fr 1.2fr;
    column-gap: 56px;
    row-gap: 0;
  }
}

/* ===========================
   固定ヘッダー分のオフセット（一箇所で管理）
   =========================== */
#main-content {
  padding-top: var(--header-height);
}

/* ===========================
   VIEW 1: VIDEO TOP
   =========================== */
/* VIEW 1: VIDEO TOP removed #view-top rule (element not present in HTML) */
.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1920 / 816;
  background: #000000;
  overflow: hidden;
}
.video-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}
#video-placeholder[hidden] {
  display: none !important;
}
#video-placeholder:not([hidden]) {
  display: flex;
}
.video-controls {
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: 0.5rem;
}
.video-ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #2c3340;
  color: #ffffff;
  border: 1px solid #2c3340;
  border-radius: 3px;
  font-size: 1rem;
  opacity: 1;
  transition: background 0.2s, border-color 0.2s;
}
.video-ctrl-btn:hover,
.video-ctrl-btn:focus-visible {
  background: #1f252e;
  border-color: #1f252e;
}
.video-ctrl-btn:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Mute button — wider to show icon + text label */
.mute-btn {
  width: auto;
  gap: 6px;
  padding: 0 12px;
  font-size: 0.8125rem;
  font-family: var(--font-ja);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Show/hide states based on aria-pressed */
/* display:contents は hover/focus-visible の再描画時に
   一部ブラウザでラベル文字が消える不具合があるため使用しない。
   display:inline-flex で通常のボックスとして切り替える。 */
/* Default (muted): show mute-state-off and label-off */
.mute-btn .mute-state-on,
.mute-btn .mute-label-on { display: none; }
.mute-btn .mute-state-off,
.mute-btn .mute-label-off { display: inline-flex; align-items: center; }

/* When unmuted (aria-pressed="true"): show on-state */
.mute-btn[aria-pressed="true"] .mute-state-off,
.mute-btn[aria-pressed="true"] .mute-label-off { display: none; }
.mute-btn[aria-pressed="true"] .mute-state-on,
.mute-btn[aria-pressed="true"] .mute-label-on { display: inline-flex; align-items: center; }
.video-ctrl-btn[aria-pressed="true"] .icon-play { display: none; }
.video-ctrl-btn[aria-pressed="false"] .icon-pause { display: none; }

/* Mobile auxiliary nav under video — smartphones only */
/* mobile-aux-nav removed */


/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
  :root {
    --space-xl: 2.5rem;
    --space-2xl: 4rem;
  }
  .site-logo img { height: 32px; }
  .header-nav { display: none; }
}

@media (max-width: 480px) {
  .elearn-user-tabs { flex-direction: column; border-bottom: none; }
  .elearn-tab {
    border-bottom: none;
    border-left: 2px solid transparent;
    margin-bottom: 0;
  }
  .elearn-tab[aria-selected="true"] {
    border-left-color: var(--clear-blue);
    border-bottom: none;
  }
}
/* ===== COPYRIGHT: moved into .site-footer .footer-bottom ===== */


/* ===== PC HEADER ADJUSTMENT (min-width: 1220px) ===== */
@media (min-width: 1220px) {
  :root {
    --pc-header-height: 88px;
    --pc-header-max-width: 1380px;
    --pc-header-logo-height: 56px;
    --pc-header-side-padding: 24px;
    --pc-header-nav-font-size: 15px;
    --pc-header-nav-font-weight: 600;
    --pc-header-nav-padding-x: 9px;
    /* ヘッダー高を88pxに統一（固定ヘッダー追従要素はこれを参照）*/
    --header-height: 88px;
  }
  .site-header {
    height: var(--pc-header-height);
  }
  .header-inner {
    max-width: var(--pc-header-max-width);
    padding-left: var(--pc-header-side-padding);
    padding-right: var(--pc-header-side-padding);
    gap: 0;
  }
  .site-logo img {
    height: var(--pc-header-logo-height);
    max-width: 340px;
  }
  /* PC ナビ：二次リンク */
  .header-nav-secondary a,
  .header-nav-secondary button,
  .header-nav-secondary .header-contact-link {
    height: var(--pc-header-height);
    padding-left: var(--pc-header-nav-padding-x);
    padding-right: var(--pc-header-nav-padding-x);
    font-size: var(--pc-header-nav-font-size);
    font-weight: var(--pc-header-nav-font-weight);
    line-height: 1;
  }
  /* 検索ボタン：可視テキスト付きのため幅は可変、タップ領域は44px以上を確保 */
  .header-search-btn {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.75rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
}

/* 1220px〜1279px：少し縮小 */
@media (min-width: 1220px) and (max-width: 1279px) {
  :root {
    --pc-header-logo-height: 52px;
    --pc-header-nav-font-size: 14px;
    --pc-header-nav-padding-x: 7px;
    --pc-header-side-padding: 16px;
  }
}

/* ===== PC HEADER NAV GAPS ===== */
/* 1280px以上：ナビ項目間24px */
@media (min-width: 1280px) {
  .header-nav-secondary {
    gap: 24px;
  }
  .header-nav-secondary a,
  .header-nav-secondary button,
  .header-nav-secondary .header-contact-link {
    padding-left: 0;
    padding-right: 0;
  }
  .header-search-btn {
    width: auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.75rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }
}

/* 1220px〜1279px：ナビ項目間14px */
@media (min-width: 1220px) and (max-width: 1279px) {
  .header-nav-secondary {
    gap: 14px;
  }
  .header-nav-secondary a,
  .header-nav-secondary button,
  .header-nav-secondary .header-contact-link {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ===== SP HEADER & MOBILE NAV (max-width: 1219px) ===== */
@media (max-width: 1219px) {

  /* ロゴ：40px */
  .site-logo img {
    height: 40px;
  }

  /* --- フルスクリーンモバイルナビ --- */
  .mobile-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    background: #ffffff;
    z-index: 99;
    overflow-y: auto;
    border-bottom: none;
    padding: 0;
    /* 閉じているときは非表示 */
    display: none;
  }
  .mobile-nav.open {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  /* ナビコンテンツの内側ラッパー */
  .mobile-nav-inner {
    width: min(calc(100% - 48px), 560px);
    margin: auto;
    padding-top: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
  }

  /* --- 検索導線（6項目とは分離） --- */
  .mobile-nav-search {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin-top: 20px;
    padding: 0 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: #2C3340;
    background: transparent;
    border: 1.5px solid #748BAE;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    font-family: var(--font-ja);
    transition: color 0.18s, border-color 0.18s;
  }
  .mobile-nav-search:hover {
    color: #326D5A;
    border-color: #326D5A;
  }
  .mobile-nav-search:focus-visible {
    outline: 2px solid #3F876F;
    outline-offset: 2px;
    border-radius: 2px;
  }
  .mobile-nav-search-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #566273;
  }

  /* bodyスクロール制御 */
  body.mobile-nav-open {
    overflow: hidden;
  }

  /* 560px以下：ロゴ幅を制限し、新ハンバーガーの表示幅を優先確保 */
  @media (max-width: 560px) {
    .header-inner {
      gap: 0.5rem;
    }
    .site-logo {
      flex-shrink: 1;
      min-width: 0;
      overflow: hidden;
    }
    .site-logo img {
      max-width: 180px;
      width: auto;
    }
    .header-news-shortcut {
      display: none;
    }
  }

  /* 340px以下：さらに狭い端末向けにハンバーガー表示をコンパクト化 */
  @media (max-width: 340px) {
    .site-logo img {
      max-width: 140px;
    }
    .hamburger__label-sub {
      display: none;
    }
  }
}

/* ===== HAMBURGER × ANIMATION ===== */
.hamburger {
  position: relative;
  display: none; /* SP: display:flex は max-width:1219px で設定 */
  align-items: center;
  gap: 8px;
  min-width: 48px;
  min-height: 48px;
  padding: 5px 10px 5px 8px;
  background: #F5F9F7;
  border: 1px solid #DCE8E1;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.18s, border-color 0.18s;
}
.hamburger:hover,
.hamburger:focus-visible {
  background: #EAF2EE;
  border-color: #B9D2C4;
}
.hamburger__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.hamburger__icon span {
  position: absolute;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--green);
  transform-origin: center;
  transition:
    transform 220ms ease,
    opacity 180ms ease,
    background-color 0.18s;
}
.hamburger__icon span:nth-child(1) { transform: translate(-50%, -6px); }
.hamburger__icon span:nth-child(2) { transform: translate(-50%, 0); }
.hamburger__icon span:nth-child(3) { transform: translate(-50%, 6px); }
.hamburger[aria-expanded="true"] .hamburger__icon span:nth-child(1) {
  transform: translate(-50%, 0) rotate(45deg);
}
.hamburger[aria-expanded="true"] .hamburger__icon span:nth-child(2) {
  opacity: 0;
  transform: translate(-50%, 0) scaleX(0.6);
}
.hamburger[aria-expanded="true"] .hamburger__icon span:nth-child(3) {
  transform: translate(-50%, 0) rotate(-45deg);
}
.hamburger__label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  text-align: left;
}
.hamburger__label-closed {
  display: flex;
  flex-direction: column;
}
.hamburger__label-open {
  display: none;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #2C3340;
}
.hamburger[aria-expanded="true"] .hamburger__label-closed { display: none; }
.hamburger[aria-expanded="true"] .hamburger__label-open { display: block; }
.hamburger__label-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #2C3340;
  white-space: nowrap;
}
.hamburger__label-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #4A5568;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .hamburger,
  .hamburger__icon span {
    transition: none;
  }
}

/* ===== PC 二次ナビ文字色 #2C3340 ===== */
@media (min-width: 1220px) {
  .header-nav-secondary a,
  .header-nav-secondary button,
  .header-nav-secondary .header-contact-link {
    color: #2C3340;
  }
  .header-nav-secondary a:hover,
  .header-nav-secondary a:focus-visible,
  .header-nav-secondary button:hover,
  .header-nav-secondary button:focus-visible {
    color: #326D5A;
    border-bottom-color: var(--green);
  }
  .header-search-btn {
    color: #2C3340;
  }
  .header-search-btn svg {
    stroke: currentColor;
  }
}

/* ===== HAMBURGER VISIBILITY CONTROL ===== */
/* 1220px以上：PCナビ表示、ハンバーガー非表示 */
@media (min-width: 1220px) {
  .header-nav {
    display: flex;
  }
  .header-sp-actions {
    display: none;
  }
  .hamburger {
    display: none;
  }
  .mobile-nav {
    display: none !important; /* リサイズ時に開いた状態が残らないよう */
  }
}
/* 1219px以下：PCナビ非表示、ハンバーガー表示 */
@media (max-width: 1219px) {
  .header-inner {
    width: 100%;
  }
  .site-logo {
    flex-shrink: 0;
  }
  .header-nav {
    display: none;
  }
  .header-sp-actions {
    display: flex;
    margin-left: auto;
    flex: 0 0 auto;
  }
  .hamburger {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
  }
}

/* ===== SP・タブレット動画レイアウト（通常フロー、16:9固定） ===== */
@media (max-width: 1023px) {
  /* 動画セクション：ヘッダー直下の通常フローに配置。中央寄せや100vh埋めはしない */
  .top-video-viewport {
    width: 100%;
    padding: 16px 16px 12px;
    background: #FAF7F0;
    box-sizing: border-box;
  }

  /* 動画+コントロールのラッパー：幅管理をここで行う */
  .top-video-unit {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
  }

  /* 動画ステージ：SP・タブレットはSP版動画（16:9）の実寸比率に合わせる */
  .video-stage {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
  }
  .video-stage video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
  }

  /* コントロール：動画の外側・直下・右揃え・通常フロー */
  .video-controls {
    position: static;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding: 0;
  }
}

/* ===== SP横向き：通常フローのまま16:9を維持。上部・コントロール余白だけ調整 ===== */
@media (max-width: 1023px) and (orientation: landscape) {
  .top-video-viewport {
    padding: 0 16px 12px;
  }

  .video-controls {
    margin-top: 8px;
  }
}

/* PC：コントロールを動画の外側・直下へ配置（既存位置・機能を維持） */
@media (min-width: 1024px) {
  .top-video-unit {
    position: static;
    width: 100%;
    max-width: 1920px;
    margin-inline: auto;
    padding-bottom: 16px;
  }
  .video-controls {
    position: static;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding: 0 24px;
  }
}

/* ===== IVORY BACKGROUND（メインコンテンツ領域のみ明示） ===== */
:root { --top-ivory: #FAF7F0; }
#main-content,
.top-video-viewport {
  background-color: var(--top-ivory);
}



.sr-only {
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
