/* ==========================================================================
   UNLITD CAREER ヘッダー（メディア側）  2026-09-04
   読み込み: functions.php unlitd_media_header_assets() ― コーポレートTOP以外の全ページ
   目的: スマホで「ロゴ／検索窓／メニュー」が縦に3段積みになるのをやめ、
         1行のヘッダー＋ハンバーガーで開く縦メニュー（検索付き）にする。
   PC(901px〜)は .header-panel を display:contents にして従来のレイアウトを一切変えない。
   style.css の同名セレクタは !important が多いので、こちらも !important で後勝ちさせる。
   ========================================================================== */

/* ---- 共通（PC）: パネルは透明な入れ物、トグルは非表示 ---- */
.header-panel { display: contents; }
.mh-toggle { display: none; }

/* ---- スマホ・タブレット ---- */
@media (max-width: 900px) {
  .site-header { position: sticky !important; top: 0 !important; z-index: 100 !important; background: rgba(255,255,255,.97) !important; height: auto !important; }
  .site-header .header-inner {
    display: flex !important; flex-wrap: nowrap !important; align-items: center !important; justify-content: space-between !important;
    height: 60px !important; min-height: 0 !important; gap: 12px !important; padding: 0 !important;
  }
  .site-header .logo { flex: 0 0 auto !important; justify-self: auto !important; }
  .site-header .logo.logo--brand img { height: 22px !important; }

  /* ハンバーガー */
  .mh-toggle {
    display: inline-flex !important; flex-direction: column !important; justify-content: center !important; gap: 5px !important;
    width: 44px !important; height: 44px !important; padding: 0 10px !important; margin: 0 -6px 0 0 !important;
    border: 0 !important; border-radius: 10px !important; background: transparent !important; cursor: pointer !important;
  }
  .mh-toggle__bar { display: block !important; height: 2px !important; width: 100% !important; background: #17150f !important; border-radius: 2px !important; transition: transform .25s ease, opacity .2s ease !important; }
  .mh-toggle[aria-expanded="true"] .mh-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg) !important; }
  .mh-toggle[aria-expanded="true"] .mh-toggle__bar:nth-child(2) { opacity: 0 !important; }
  .mh-toggle[aria-expanded="true"] .mh-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg) !important; }

  /* 開閉パネル */
  .header-panel {
    display: none !important; position: absolute !important; left: 0 !important; right: 0 !important; top: 100% !important;
    background: #fff !important; border-top: 1px solid #e9e6dc !important; border-bottom: 1px solid #e9e6dc !important;
    box-shadow: 0 18px 40px rgba(6,0,1,.08) !important; padding: 12px 20px 18px !important;
  }
  .site-header.is-open .header-panel { display: block !important; }

  /* 検索窓（パネル内・全幅） */
  .site-header .header-panel .search-mini {
    display: flex !important; order: 0 !important; width: 100% !important; height: 48px !important; margin: 4px 0 8px !important;
    border: 1px solid #e9e6dc !important; border-radius: 999px !important; background: #f8f6ef !important; padding: 0 12px 0 16px !important; box-shadow: none !important;
  }
  .site-header .header-panel .search-mini input { font-size: 15px !important; }

  /* メニュー（縦） */
  .site-header .header-panel .nav { display: block !important; width: 100% !important; order: 0 !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
  .site-header .header-panel .primary-menu,
  .site-header .header-panel .primary-menu-fallback { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 0 !important; white-space: normal !important; }
  .site-header .header-panel .primary-menu li { width: 100% !important; }
  .site-header .header-panel .primary-menu a,
  .site-header .header-panel .primary-menu-fallback a {
    display: flex !important; align-items: center !important; justify-content: space-between !important; height: auto !important;
    padding: 13px 4px !important; border-bottom: 1px solid #f1eee5 !important; font-size: 15px !important; font-weight: 700 !important; color: #17150f !important;
  }
  .site-header .header-panel .primary-menu li:last-child a,
  .site-header .header-panel .primary-menu-fallback a:last-child { border-bottom: 0 !important; }
  .site-header .header-panel .nav a::after { content: "→" !important; position: static !important; transform: none !important; height: auto !important; background: none !important; color: #8a6d08 !important; font-size: 13px !important; }
  /* 開いている間は背面をスクロールさせない */
  body.mh-menu-open { overflow: hidden !important; }
}

/* ---- スマホの左右余白（メディア側全ページ共通） ----
   style.css は ≤900px で width:calc(100% - 32px) と padding:0 24px を両方掛けるため、
   本文幅が 375px 端末で 295px しかなかった。20px の余白 1 段にそろえる。 */
@media (max-width: 900px) {
  body:not(.uco) .container { width: auto !important; max-width: none !important; padding: 0 20px !important; margin: 0 !important; }
}
