/* Recruitment header mirrors the corporate website's current header design.
 * Keep these tokens and header styles aligned with www.miraiweb.co.jp.
 */
:root {
  --color-white: #fff;
  --color-gray-10: #f4f4f4;
  --color-gray-20: #e0e0e0;
  --color-gray-30: #c6c6c6;
  --color-gray-70: #525252;
  --color-gray-100: #161616;
  --color-blue-60: #0f62fe;
  --color-blue-hover: #0043ce;
  --space-01: 8px;
  --space-02: 16px;
  --space-03: 24px;
  --space-04: 32px;
  --space-05: 48px;
  --font-weight-regular: 400;
  --text-small: .875rem;
  --text-body: 1rem;
  --line-height-ui: 1.5;
  --border-subtle: 1px solid var(--color-gray-20);
  --motion-ui: 160ms ease;
  --header-height: 72px;
  --page-gutter: 32px;
}
body.google-font { padding-top: var(--header-height); }
.mw-recruit-skip-link {
  position: fixed;
  z-index: 200;
  left: 16px;
  top: -100px;
  padding: 10px 16px;
  background: var(--color-white);
  color: var(--color-gray-100);
  border: var(--border-subtle);
}
.mw-recruit-skip-link:focus { top: calc(var(--header-height) + 8px); }
.mw-header .mw-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
@media (max-width: 1055px) {
  :root { --page-gutter: 24px; --header-height: 64px; }
}
@media (max-width: 671px) {
  :root { --page-gutter: 16px; --text-body: .875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mw-header, .mw-header *, .mw-header *::before, .mw-header *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Copied from corporate site's assets/css/common-header.css (master). */
.mw-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  background: var(--color-white);
  border-bottom: var(--border-subtle);
  color: var(--color-gray-100);
}

.admin-bar .mw-header {
  top: 32px;
}

.mw-header__inner {
  display: flex;
  align-items: center;
  min-height: var(--header-height);
  max-width: 1600px;
  margin-inline: auto;
  padding-left: var(--space-04);
}

.mw-header__logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: auto;
}

.mw-header__logo img {
  display: block;
  width: 176px;
  height: auto;
}

.mw-header__nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  margin-left: var(--space-04);
}

.mw-header__nav a {
  display: flex;
  align-items: center;
  padding-inline: var(--space-02);
  color: inherit;
  font-size: var(--text-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-ui);
  text-decoration: none;
}

.mw-header__nav .mw-header__mobile-contact,
.mw-header__nav > a > .mw-icon {
  display: none;
}

.mw-header__nav a:hover,
.mw-header__nav a[aria-current] {
  background: var(--color-gray-10);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

.mw-header__contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-04);
  align-self: stretch;
  padding: var(--space-02) var(--space-03);
  background: var(--color-blue-60);
  color: var(--color-white);
  font-size: var(--text-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-ui);
  text-decoration: none;
  transition: background-color var(--motion-ui);
}

.mw-header__contact:hover {
  background: var(--color-blue-hover);
}

.mw-header__contact:focus-visible {
  outline-offset: -6px;
  outline-color: var(--color-white);
}

.mw-header__toggle {
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 48px;
  padding: var(--space-01);
  border: 1px solid var(--color-gray-30);
  background: var(--color-white);
  font: inherit;
  font-size: var(--text-small);
  font-weight: var(--font-weight-regular);
  cursor: pointer;
}

.mw-header__toggle > span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 2px auto;
  background: var(--color-gray-100);
  transition: transform var(--motion-ui), opacity var(--motion-ui);
}

.mw-header__toggle[aria-expanded="true"] > span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

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

.mw-header__toggle[aria-expanded="true"] > span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mw-header [hidden] {
  display: none !important;
}

.mw-header__mobile-search {
  display: none;
}

.mw-header__search {
  align-self: stretch;
}

.mw-header__search summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 100%;
  min-height: var(--header-height);
  cursor: pointer;
  list-style: none;
}

.mw-header__search summary::-webkit-details-marker {
  display: none;
}

.mw-header__search summary:hover,
.mw-header__search[open] summary {
  background: var(--color-gray-10);
}

.mw-header__search-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: min(480px, 100%);
  padding: var(--space-03);
  background: var(--color-white);
  border: var(--border-subtle);
}

.mw-search-form label {
  display: block;
  margin-bottom: var(--space-02);
  font-size: var(--text-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-ui);
}

.mw-search-form__controls {
  display: flex;
  gap: var(--space-02);
}

.mw-search-form input {
  width: 100%;
  min-width: 0;
  border-bottom: 1px solid var(--color-gray-70);
  border-radius: 0;
  background: var(--color-gray-10);
  padding: var(--space-02);
  font: inherit;
  color: var(--color-gray-100);
}

.mw-search-form input::placeholder {
  color: var(--color-gray-70);
}

.mw-search-form button {
  flex-shrink: 0;
  cursor: pointer;
}

/* Search controls: omit the global blue outer focus ring on all viewports.
   Keep a neutral, visible focus indication for keyboard navigation. */
.mw-search-form input:focus {
  outline: none;
  border-bottom: 2px solid var(--color-gray-100);
}

.mw-search-form button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-white);
}

.mw-header__search summary:focus-visible {
  outline: none;
  background: var(--color-gray-10);
  box-shadow: inset 0 0 0 2px var(--color-gray-30);
}

/* Compact search popup in the desktop/tablet header; leave other search forms unchanged. */
.mw-header__search-panel .mw-search-form label {
  margin-bottom: var(--space-01);
}

.mw-header__search-panel .mw-search-form__controls {
  gap: var(--space-01);
}

.mw-header__search-panel .mw-search-form input {
  min-height: 48px;
  padding: var(--space-01) 12px;
  line-height: var(--line-height-ui);
}

.mw-header__search-panel .mw-search-form button {
  min-height: 48px;
  padding-block: var(--space-01);
}

@media (max-width: 1055px) {
  .mw-header__inner {
    flex-wrap: wrap;
    padding-left: var(--page-gutter);
  }

  .mw-header__logo img {
    width: 152px;
  }

  .mw-header__toggle:not([hidden]) {
    display: flex;
  }

  .mw-header__nav {
    order: 5;
    flex-basis: 100%;
    flex-direction: column;
    margin-left: calc(-1 * var(--page-gutter));
    padding: var(--space-02) var(--page-gutter);
    border-top: var(--border-subtle);
    background: var(--color-white);
  }

  .mw-header__nav a {
    min-height: 56px;
    padding-inline: var(--space-02);
  }

  .mw-header.is-enhanced .mw-header__nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    margin: 0;
    max-height: calc(100dvh - var(--header-height) - 48px);
    overflow-y: auto;
    border-bottom: var(--border-subtle);
  }

  .mw-header:not(.is-enhanced) {
    position: relative;
  }

  .mw-header__contact {
    padding-inline: var(--space-02);
    gap: var(--space-02);
  }

  .mw-header__search summary {
    width: 48px;
  }
}

@media (max-width: 782px) {
  .admin-bar .mw-header {
    top: 46px;
  }
}

@media (max-width: 600px) {
  .admin-bar .mw-header {
    position: absolute;
  }
}

@media (max-width: 671px) {
  body.mw-menu-open {
    overflow: hidden;
  }

  .mw-header__inner {
    min-height: var(--header-height);
    padding-left: var(--page-gutter);
  }

  .mw-header__logo {
    order: 0;
  }

  .mw-header__logo img {
    width: 136px;
  }

  .mw-header__search {
    display: none;
  }

  /* Contact is a navigation item on smartphones, not a separate header button. */
  .mw-header__contact {
    display: none;
  }

  .mw-header__nav .mw-header__mobile-contact {
    display: flex;
  }

  .mw-header__toggle {
    order: 3;
    display: flex;
    width: 54px;
    margin-left: 0;
    margin-right: var(--page-gutter);
    min-width: 54px;
    height: 48px;
    min-height: 48px;
    flex-direction: column;
    gap: 0;
    padding: 5px 5px 4px;
    border: 0;
    background: transparent;
  }

  .mw-header__toggle > span {
    width: 22px;
    height: 2px;
    margin: 2px auto;
    background: var(--color-gray-100);
    transition: transform var(--motion-ui), opacity var(--motion-ui);
  }

  .mw-header__toggle[aria-expanded="true"] > span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

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

  .mw-header__toggle[aria-expanded="true"] > span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .mw-header__toggle::after {
    margin-top: 5px;
    color: var(--color-gray-100);
    content: "メニュー";
    font-size: .4375rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }

  .mw-header__toggle[aria-expanded="true"]::after {
    content: "閉じる";
  }

  .mw-header__search summary {
    width: 40px;
    min-height: var(--header-height);
  }

  .mw-header.is-enhanced .mw-header__nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    max-height: none;
    padding: var(--space-02) var(--page-gutter) var(--space-05);
    overflow-y: auto;
    border-top: var(--border-subtle);
    border-bottom: 0;
    background: var(--color-white);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 240ms ease, transform 240ms ease, visibility 0s linear 240ms;
  }

  .mw-header.is-enhanced .mw-header__nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 240ms ease, transform 240ms ease, visibility 0s;
  }

  .admin-bar .mw-header.is-enhanced .mw-header__nav {
    top: calc(var(--header-height) + 46px);
  }

  .mw-header__nav a {
    min-height: 64px;
    padding-inline: 0;
    border-bottom: var(--border-subtle);
    font-size: var(--text-body);
  }

  /* Navigation arrows sit at the far right; recruitment retains its external-link icon. */
  .mw-header__nav > a > .mw-icon {
    display: block;
    flex-shrink: 0;
    margin-left: auto;
  }

  .mw-header__nav a:hover,
  .mw-header__nav a[aria-current] {
    background: transparent;
    text-underline-offset: 5px;
  }

  .mw-header__mobile-search {
    display: block;
    padding-top: var(--space-04);
  }

  .mw-header__mobile-search .mw-search-form {
    padding-top: var(--space-03);
  }

  .mw-header__mobile-search .mw-search-form label {
    margin-bottom: var(--space-01);
  }

  .mw-header__mobile-search .mw-search-form__controls {
    flex-direction: column;
    gap: var(--space-01);
  }

  .mw-header__mobile-search .mw-search-form button {
    width: 100%;
  }

  .mw-header__search-panel {
    padding: var(--space-03) var(--space-02);
  }

  .mw-header__search-panel .mw-search-form__controls {
    flex-direction: column;
    gap: var(--space-01);
  }

  .mw-header__search-panel .mw-search-form button {
    width: 100%;
  }
}

