/**
 * Office PC Header One Line
 * ノートPC以上の幅で、サイト名「建設業許可申請フルサポート（愛知県・名古屋市）」を
 * 1行に収め、テーマ固定のヘッダー高さ150pxを64pxへ下げて本文の表示領域を広げます。
 *
 * 対象は 768px 以上だけです。767px 以下のスマホヘッダーは
 * Office Mobile Top Fix に任せ、ここでは上書きしません。
 * 価格・診断の文言は変えません。
 */

/* -------------------------------------------------
 * 768px以上共通：サイト名1行・ヘッダーを64pxに
 * ------------------------------------------------- */
@media (min-width: 768px) {
  html body #header_container.header_container,
  html body #header_container.header_container.pc,
  html body #header_container.header_container.float,
  html body #header_container.header_container.fixed,
  html body #header_container.header_container.scroll {
    height: 64px !important;
    min-height: 64px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: visible !important;
    transition-property: background-color, color, box-shadow, opacity, border-color !important;
  }

  html body #header_container .header_content {
    width: 100% !important;
    max-width: 100% !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    float: none !important;
  }

  html body #header_container .header_content .h_group {
    float: none !important;
    position: relative !important;
    margin: 0 12px 0 0 !important;
    max-width: none !important;
    flex: 0 1 auto !important;
    min-width: 0;
    height: auto !important;
    text-align: left !important;
    letter-spacing: 0.01em;
  }

  html body #header_container .header_content .h_group .hd_title.txt,
  html body #header_container .hd_title.txt {
    margin: 0 !important;
    max-width: 100% !important;
    text-align: left !important;
  }

  html body #header_container .header_content .h_group .hd_title.txt a,
  html body #header_container .hd_title.txt a {
    display: block !important;
    white-space: nowrap !important;
    text-wrap: nowrap !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.01em !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* サイト名と同じ文言のキャプションは、1行化のため表示しない */
  html body #header_container .header_content .h_group h2.caption {
    display: none !important;
  }

  /* 短いヘッダーに合わせて、本文・ヒーローの上余白も150pxから64pxへ */
  html body .header-banner-outer,
  html body #header-banner-outer {
    padding-top: 64px !important;
  }
  html body .dp-container.not-home,
  html body .dp-container.home.no-header,
  html body #container.dp-container.not-home,
  html body #container.dp-container.home.no-header {
    margin-top: 64px !important;
  }
}

/* -------------------------------------------------
 * 768–1024px：ハンバーガー表示。サイト名は1行のまま
 * ------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
  html body #header_container .header_content .h_group {
    padding-right: 96px !important;
    margin-right: 0 !important;
  }

  html body #header_container .header_content .h_group .hd_title.txt a,
  html body #header_container .hd_title.txt a {
    font-size: 18px !important;
  }

  html body #header_container .header_content .r_block {
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  html body #header_container #hd_misc_div,
  html body #header_container #hd_misc_div.min {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  /* 開いたメニューはヘッダー下から出す */
  html body #header_container #global_menu_nav,
  html body #header_container #global_menu_nav.min,
  html body #header_container #global_menu_nav.min.has-rcontent {
    margin-top: 64px !important;
  }
}

/* -------------------------------------------------
 * 1025px以上：サイト名とグローバルメニューを1行に
 * ------------------------------------------------- */
@media (min-width: 1025px) {
  html body #header_container .header_content .r_block {
    float: none !important;
    position: static !important;
    display: flex !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: auto !important;
    max-width: none !important;
    height: 64px !important;
    flex: 1 1 auto !important;
    min-width: 0;
  }

  html body #header_container #hd_misc_div,
  html body #header_container #hd_misc_div.min {
    margin: 0 0 0 4px !important;
    height: auto !important;
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
  }

  html body #header_container #global_menu_nav,
  html body #header_container #global_menu_nav.has-rcontent,
  html body #header_container #global_menu_nav.min,
  html body #header_container #global_menu_nav.min.has-rcontent {
    position: relative !important;
    margin: 0 !important;
    top: 0 !important;
    right: auto !important;
    flex: 1 1 auto !important;
    height: 64px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }

  html body #header_container #global_menu_ul,
  html body #header_container #global_menu_ul.min {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    margin: 0 !important;
    height: 64px !important;
  }

  html body #header_container #global_menu_ul > .menu-item,
  html body #header_container #global_menu_ul.min > .menu-item {
    line-height: 48px !important;
    height: 48px !important;
    font-size: 12px !important;
    flex: 0 0 auto !important;
    float: none !important;
    display: block !important;
  }

  html body #header_container #global_menu_ul > .menu-item > .menu-link {
    padding: 0 8px !important;
    line-height: 48px !important;
  }

  html body #header_container #global_menu_ul > .menu-item > .menu-link::after {
    top: auto !important;
    bottom: 6px !important;
  }

  html body #header_container #global_menu_ul > .menu-item > .sub-menu {
    top: 48px !important;
  }
}

/* 1025–1099：タイトル18pxを維持するため、メニュー間隔を詰める */
@media (min-width: 1025px) and (max-width: 1099px) {
  html body #header_container .header_content .h_group .hd_title.txt a,
  html body #header_container .hd_title.txt a {
    font-size: 18px !important;
  }
  html body #header_container #global_menu_ul > .menu-item {
    font-size: 11px !important;
  }
  html body #header_container #global_menu_ul > .menu-item > .menu-link {
    padding: 0 4px !important;
  }
}

/* 1100–1279 */
@media (min-width: 1100px) and (max-width: 1279px) {
  html body #header_container .header_content .h_group .hd_title.txt a,
  html body #header_container .hd_title.txt a {
    font-size: 18px !important;
  }
  html body #header_container #global_menu_ul > .menu-item > .menu-link {
    padding: 0 6px !important;
  }
}

/* 1280–1439：タイトル20px */
@media (min-width: 1280px) and (max-width: 1439px) {
  html body #header_container .header_content .h_group .hd_title.txt a,
  html body #header_container .hd_title.txt a {
    font-size: 20px !important;
  }
  html body #header_container #global_menu_ul > .menu-item > .menu-link {
    padding: 0 7px !important;
  }
}

/* 1440以上：元のタイトル22pxに戻す */
@media (min-width: 1440px) {
  html body #header_container .header_content .h_group .hd_title.txt a,
  html body #header_container .hd_title.txt a {
    font-size: 22px !important;
  }
  html body #header_container #global_menu_ul > .menu-item > .menu-link {
    padding: 0 10px !important;
  }
}
