@charset "utf-8";
/* =========================================
   Site Header / Global Navigation
   株式会社スリーエス
   ・PC（1920-1440）を基準に記述
   ・以降は 1439 / 1199 / 700 / 349 の4段のみ
========================================= */

:root {
  --header-h: 115px;            /* ヘッダー実高（各BPで上書き） */
  --header-pad-x: clamp(20px, 2vw, 40px);
}

/* =========================================
   ヘッダー本体
========================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  background: var(--color-white);
}

/* 固定ヘッダー分の高さ確保（body へグローバル指定しないため） */
.site-header-spacer {
  height: var(--header-h);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 40px;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 12px var(--header-pad-x) 0;
}

/* --- ロゴ --- */
.site-header__brand {
  grid-row: 1 / 3;
  min-width: 0;
}

.site-header__brand a {
  display: block;
}

.site-header__brand img {
  display: block;
  width: 100%;
  max-width: 255px;
  height: auto;
}

/* =========================================
   上段ユーティリティ（PC/small-pc）
========================================= */
.site-header__utility {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

/* 電話 */
.header-tel {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-strong);
}

.header-tel__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-navy);
  color: var(--color-white);
}

.header-tel__icon i {
  font-size: 14px;
  line-height: 1;
}

.header-tel__body {
  display: block;
  line-height: 1.2;
}

.header-tel__number {
  display: block;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.header-tel__hours {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-mute);
  white-space: nowrap;
}

/* LINE ボタン */
.header-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 6px;
  background: var(--color-line);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.header-line:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.header-line__badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  color: var(--color-white);
}

.header-line__badge i {
  font-size: 24px;
  line-height: 1;
}

/* お問い合わせ／資料請求 */
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 2px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-white);
}

.header-cta__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.header-cta__item i {
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
}

.header-cta__item--contact {
  background: var(--color-teal);
  color: var(--color-white);
}

.header-cta__item--contact:hover {
  opacity: 0.85;
}

.header-cta__item--document {
  background: var(--color-white);
  color: var(--color-text-strong);
}

.header-cta__item--document:hover {
  background: var(--color-surface);
}

/* =========================================
   グローバルナビ
========================================= */
.site-header__nav {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  min-width: 0;
}

.gnav__list {
  display: flex;
  align-items: stretch;
  gap: 34px;
}

.gnav__item {
  position: static; /* パネルは .site-header 基準で配置 */
}

.gnav__link {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 2px;
  color: var(--color-text-strong);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.gnav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-navy);
  opacity: 0;
  transform: scaleX(0.4);
  transform-origin: center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gnav__item:hover > .gnav__link,
.gnav__item:focus-within > .gnav__link,
.gnav__item.is-current > .gnav__link {
  color: var(--color-navy);
}

.gnav__item:hover > .gnav__link::after,
.gnav__item:focus-within > .gnav__link::after,
.gnav__item.is-current > .gnav__link::after {
  opacity: 1;
  transform: scaleX(1);
}

/* アコーディオン用トグル（タブレット以下でJSが挿入） */
.gnav__toggle {
  display: none;
}

/* =========================================
   ドロップダウンパネル（PC/small-pc）
========================================= */
.gnav__panel {
  /* 1項目あたりの幅。パネル全体はこの幅×項目数に自動で決まります */
  --gnav-col-w: clamp(240px, 20vw, 380px);
  --gnav-col-gap: 30px;
  --gnav-thumb-w: clamp(120px, 10vw, 190px);
  --gnav-panel-bg: rgba(255, 255, 255, 0.9);

  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  /* 中身の幅ぶんだけ広がる（項目が3つなら狭く、4つなら広く） */
  width: fit-content;
  max-width: calc(100vw - 80px);
  /* --gnav-panel-left は header.js が親メニューに合わせて設定します。
     未設定（JS無効時）は auto で中央寄せになります。 */
  margin-inline: var(--gnav-panel-left, auto) auto;
  padding-top: 14px;
  transform: translateY(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.gnav__item:hover > .gnav__panel,
.gnav__item:focus-within > .gnav__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.gnav__panel-inner {
  position: relative;
  padding: 30px 40px;
  border-radius: 10px;
  background: var(--gnav-panel-bg);
  box-shadow: 0 18px 40px rgba(23, 55, 85, 0.24);
}

/* 三角（JSが --arrow-x に親メニュー中心を渡す） */
.gnav__panel-inner::before {
  content: "";
  position: absolute;
  top: -11px;
  left: var(--arrow-x, 50%);
  width: 26px;
  height: 13px;
  transform: translateX(-50%);
  background: var(--gnav-panel-bg);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.gnav__sub {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--gnav-col-gap);
}

.gnav__sub-item {
  flex: 0 1 var(--gnav-col-w);
  min-width: 0;
}

.gnav__sub-link {
  display: grid;
  /* アイキャッチは項目数に関わらず同じ大きさ */
  grid-template-columns: var(--gnav-thumb-w) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gnav__sub-link:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.gnav__sub-thumb {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-surface);
  aspect-ratio: 16 / 10;
}

.gnav__sub-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gnav__sub-body {
  display: block;
  min-width: 0;
}

.gnav__sub-title {
  display: block;
  color: var(--color-text-strong);
  font-size: clamp(0.875rem, 0.5rem + 0.5vw, 1rem);
  font-weight: 700;
  line-height: 1.5;
}

.gnav__sub-desc {
  display: block;
  margin-top: 6px;
  color: var(--color-text-mute);
  font-size: clamp(0.75rem, 0.55rem + 0.25vw, 0.8125rem);
  font-weight: 500;
  line-height: 1.6;
}

/* =========================================
   SP用アクション・ハンバーガー（1199px以下で表示）
========================================= */
.site-header__sp-actions {
  display: none;
}

.site-header__drawer-head,
.gnav__drawer-utility {
  display: none;
}

.site-header__overlay {
  display: none;
}

/* =========================================
   1439px以下：small-pc
========================================= */
@media screen and (max-width: 1439px) {
  :root {
    --header-h: 124px;
  }

  .site-header__inner {
    column-gap: 24px;
    padding-top: 10px;
  }

  .site-header__brand img {
    max-width: 220px;
  }

  .site-header__utility {
    gap: 14px;
  }

  .header-tel__number {
    font-size: 23px;
  }

  .header-cta__item {
    padding: 8px 18px;
    font-size: 13px;
  }

  .gnav__list {
    gap: 24px;
  }

  .gnav__link {
    height: 52px;
    font-size: 15px;
  }

  .gnav__panel {
    --gnav-col-gap: 20px;
    max-width: calc(100vw - 48px);
  }

  .gnav__panel-inner {
    padding: 26px 24px;
  }

  .gnav__sub-link {
    gap: 10px;
  }

  .gnav__sub-desc {
    margin-top: 4px;
  }
}

/* =========================================
   1199px以下：タブレット（ドロワー化）
========================================= */
@media screen and (max-width: 1199px) {
  :root {
    --header-h: 76px;
    --header-pad-x: 20px;
  }

  .site-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    column-gap: 16px;
    height: var(--header-h);
    padding-top: 0;
  }

  .site-header__brand {
    grid-row: 1;
  }

  .site-header__brand img {
    max-width: 180px;
  }

  /* PC用ユーティリティは隠す */
  .site-header__utility {
    display: none;
  }

  /* SP用アクション */
  .site-header__sp-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    justify-self: end;
  }

  .header-action {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text-strong);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    cursor: pointer;
  }

  .header-action__icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
  }

  .header-action__icon i {
    font-size: 24px;
    line-height: 1;
  }

  .header-action--line .header-action__icon {
    color: var(--color-line);
  }

  /* ハンバーガー → ドロワーが開いたら × に差し替え */
  .site-header.is-drawer-open .header-action--menu .fa-bars::before {
    content: "\f00d";
  }

  /* オーバーレイ */
  .site-header__overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 98;
    background: rgba(17, 17, 17, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .site-header.is-drawer-open .site-header__overlay {
    opacity: 1;
    visibility: visible;
  }

  /* ドロワー本体 */
  .site-header__nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    width: min(420px, 88vw);
    height: 100dvh;
    padding: 0 0 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-white);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s ease, visibility 0.35s ease;
  }

  .site-header.is-drawer-open .site-header__nav {
    transform: translateX(0);
    visibility: visible;
  }

  .site-header__drawer-head {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: var(--header-h);
    padding: 0 20px;
    border-bottom: 1px solid var(--color-border);
  }

  .drawer-close {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-text-strong);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
  }

  .drawer-close__icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
  }

  .drawer-close__icon i {
    font-size: 24px;
    line-height: 1;
  }

  /* ナビリスト（アコーディオン） */
  .gnav__list {
    display: block;
    padding: 8px 20px 0;
  }

  .gnav__item {
    position: relative;
    border-bottom: 1px solid var(--color-border);
  }

  .gnav__link {
    height: auto;
    padding: 16px 44px 16px 0;
    font-size: 16px;
  }

  .gnav__link::after {
    content: none;
  }

  .gnav__toggle {
    position: absolute;
    top: 8px;
    right: 0;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .gnav__toggle i {
    color: var(--color-navy);
    font-size: 15px;
    line-height: 1;
  }

  /* 開いているときは − に差し替え */
  .gnav__toggle[aria-expanded="true"] .fa-plus::before {
    content: "\f068";
  }

  /* パネル → アコーディオン */
  .gnav__panel {
    position: static;
    width: auto;
    padding-top: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
  }

  .gnav__item.is-open > .gnav__panel {
    grid-template-rows: 1fr;
  }

  .gnav__item:hover > .gnav__panel,
  .gnav__item:focus-within > .gnav__panel {
    transform: none;
  }

  .gnav__panel-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .gnav__panel-inner::before {
    content: none;
  }

  .gnav__sub {
    display: block;
    padding: 0 0 12px;
  }

  .gnav__sub-item {
    flex: none;
  }

  .gnav__sub-item + .gnav__sub-item {
    border-top: 1px dashed var(--color-border);
  }

  .gnav__sub-link {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 0;
  }

  .gnav__sub-title {
    font-size: 15px;
  }

  .gnav__sub-desc {
    margin-top: 4px;
    font-size: 12px;
  }

  /* ドロワー下部のCTA */
  .gnav__drawer-utility {
    display: grid;
    gap: 12px;
    margin-top: 28px;
    padding: 0 20px;
  }

  .gnav__drawer-utility .header-tel {
    justify-content: center;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
  }

  .gnav__drawer-utility .header-line {
    justify-content: center;
    padding: 14px;
  }

  .gnav__drawer-utility .header-cta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  .gnav__drawer-utility .header-cta__item {
    justify-content: center;
    padding: 14px 10px;
  }

  .gnav__drawer-utility .header-cta__item--document {
    border: 1px solid var(--color-border-strong);
  }
}

/* =========================================
   700px以下：スマートフォン
========================================= */
@media screen and (max-width: 700px) {
  :root {
    --header-h: 64px;
    --header-pad-x: 16px;
  }

  .site-header__brand img {
    max-width: 148px;
  }

  .site-header__sp-actions {
    gap: 14px;
  }

  .site-header__nav {
    width: min(380px, 92vw);
  }

  .gnav__list {
    padding: 4px 16px 0;
  }

  .gnav__link {
    padding: 14px 44px 14px 0;
    font-size: 15px;
  }

  .gnav__sub-link {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
  }

  .gnav__sub-title {
    font-size: 14px;
  }

  .gnav__drawer-utility {
    padding: 0 16px;
  }
}

/* =========================================
   349px以下：mini SP
========================================= */
@media screen and (max-width: 349px) {
  :root {
    --header-h: 58px;
    --header-pad-x: 12px;
  }

  .site-header__brand img {
    max-width: 118px;
  }

  .site-header__sp-actions {
    gap: 10px;
  }

  .header-action {
    font-size: 9px;
  }

  .site-header__nav {
    width: 100vw;
  }

  .gnav__sub-link {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }

  .gnav__sub-desc {
    display: none;
  }

  .gnav__drawer-utility .header-cta {
    grid-template-columns: minmax(0, 1fr);
  }
}
