/* ==========================================================================
   Hero Switcher（新トップページ：2職種タブ切替）
   front-page.php でのみ読み込み（functions.phpでis_front_page()時のみenqueue）
   ========================================================================== */

:root {
  --hero-color-shuttle: #ce3e2f;
  --hero-color-shuttle-dark: #b8341f;
  --hero-color-local: #0073bc;
  --hero-color-local-dark: #165991;
  --hero-transition-duration: 1500ms;
}

.hero-switcher {
  position: relative;
  isolation: isolate;
  margin-top: 3rem;
}

/* ---------- タブ ---------- */

.hero-tabs {
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 2;
  padding-right: 5vw;
}

.hero-tab {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75em 2em;
  color: #fff;
  opacity: 1;
  transition:
    background-color var(--hero-transition-duration) ease,
    opacity var(--hero-transition-duration) ease;
  border-radius: 10px 10px 0 0;
  margin-right: 3px;
  border-bottom: 3px solid #e9e1d7;
}

.hero-tab--shuttle { background-color: var(--hero-color-shuttle-dark); }
.hero-tab--local   { background-color: var(--hero-color-local-dark); }

.hero-tab.is-active { opacity: 1; }
.hero-tab--shuttle.is-active {
  background-color: var(--hero-color-shuttle);
  border-bottom-color: var(--hero-color-shuttle);
}
.hero-tab--local.is-active {
  background-color: var(--hero-color-local);
  border-bottom-color: var(--hero-color-local);
}

.hero-tab:hover { opacity: 1; }

.hero-tab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -4px;
}

/* ---------- パネル ---------- */

.hero-panels {
  position: relative;
  display: grid;
}

.hero-panel {
  grid-area: 1 / 1;
  padding: clamp(2rem, 5vw, 5rem) 0 clamp(2rem, 5vw, 5rem) clamp(1.5rem, 5vw, 6rem);
  color: #fff;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  transition:
    opacity var(--hero-transition-duration) ease,
    background-color var(--hero-transition-duration) ease;
}

.hero-panel.is-active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}

.hero-panel--shuttle { background-color: var(--hero-color-shuttle); }
.hero-panel--local   { background-color: var(--hero-color-local); }

.hero-panel-inner {
  max-width: 1920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 1rem;
  min-height: 480px;
}

.hero-eyebrow {
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 0.75em;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 0.6em;
}

.hero-lead {
  line-height: 1.85;
  margin: 0 0 1.5em;
}

.hero-points {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em 2em;
  margin: 0 0 2em;
  padding: 0;
  font-size: 0.9rem;
}

.hero-points li::before {
  content: "■ ";
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.hero-btn {
  display: inline-block;
  padding: 0.9em 1.7em;
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.hero-btn:hover {
  text-decoration: none;
}

.hero-btn--primary {
  background: #fff;
}
.hero-btn--primary._bl {
  background: var(--hero-color-local);
  color: #fff;
}
.hero-panel--shuttle .hero-btn--primary { color: var(--hero-color-shuttle); }
.hero-panel--local   .hero-btn--primary { color: var(--hero-color-local); }
.hero-btn--primary:hover { opacity: 0.85; }

.hero-btn--outline {
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
}
.hero-btn--outline._bk {
  border: 1px solid #000;
  color: #000;
}
.hero-btn--outline:hover { background: rgba(255, 255, 255, 0.12); }

.hero-panel-visual {
  height: 100%;
}
.hero-panel-visual img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- SP ---------- */

@media (max-width: 768px) {

  :root {
    --hero-mobile-image-height: 62vw;
    --hero-mobile-tab-height: 48px;
  }

  .hero-switcher {
    margin-top: 0;
  }


  .hero-tabs {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--hero-mobile-image-height) - var(--hero-mobile-tab-height));
    height: var(--hero-mobile-tab-height);
    align-items: stretch;
    justify-content: stretch;
    padding: 0 12px;
    z-index: 3;
  }
  .hero-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 0.5em;
    font-size: 0.8rem;
    border-bottom-width: 1px;
  }
  .hero-tab--local {
    margin-right: 0;
  }

  .hero-panels {
    position: relative;
    z-index: 1;
  }

  .hero-panel {
    padding: 0 24px 1.5rem;
  }

  .hero-panel-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 0;
  }

  .hero-panel-visual {
    order: -1;
    height: var(--hero-mobile-image-height);
    margin: 0 -24px;
  }

  .hero-panel-text {
    padding-top: 1.5rem;
  }

  .hero-eyebrow {
    font-size: 0.88rem;
  }
}

@media (max-width: 425px) {
  :root {
    --hero-mobile-image-height: 320px;
    --hero-mobile-tab-height: 48px;
  }
}


/* ---------- 動きを抑える設定への配慮 ---------- */

@media (prefers-reduced-motion: reduce) {
  .hero-tab,
  .hero-panel {
    transition: none;
  }
}
