/* =========================================================
   電柱広告.jp 共通ヘッダー
   添付「ヘッダー01.png」準拠 / 最大幅 1500px
   Reference: 1920 x 164px
   ========================================================= */

:root {
  --header-blue: #078ba6;
  --header-white: #fff;
  --header-black: #000;
  --header-max: 1500px;
  --header-height: 164px;
}

.site-header *,
.site-header *::before,
.site-header *::after { box-sizing: border-box; }

.site-header {
  position: relative;
  z-index: 1000;
  width: 100%;
  height: var(--header-height);
  background: var(--header-blue);
  color: var(--header-white);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Yu Gothic", YuGothic,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}

.site-header a { color: inherit; text-decoration: none; }

/* 1920px画面では左右210pxずつ空く = 1500px中央配置 */
.site-header__inner {
  width: calc(100% - 40px);
  max-width: var(--header-max);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

/* 左ロゴ */
.site-header__brand {
  display: flex;
  align-items: center;
  padding: 24px 0 18px 0;
}

.site-header__brand-link { display: inline-flex; align-items: center; }

.site-header__logo {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
    margin-top: 30px;
    margin-left: 10px;
}

/* 右側 */
.site-header__right,
.site-header__main {
  position: relative;
  min-width: 0;
  height: 100%;
  padding-top: 25px;
}

/* 関西電力グループロゴ */
.site-header__group-logo {
  height: 42px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.site-header__group-logo img {
    display: block;
    width: 270px;
    max-width: 32vw;
    height: auto;
    margin-top: 11px;
}

/* ナビ + お問い合わせ */
.site-header__nav-area {
  height: 97px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.global-nav {
  flex: 1 1 auto;
  min-width: 0;
  height: 90px;
}

.global-nav__list {
  list-style: none;
  margin: 0;
  padding: 0 28px 0 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 30px;
}

.global-nav__item { position: relative; flex: 0 0 auto; }

.global-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .01em;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .18s ease;
}

.global-nav__link:hover,
.global-nav__link:focus-visible { opacity: .75; }

.global-nav__link--button { gap: 7px; }

.global-nav__arrow {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}

/* お問い合わせ */
.header-contact {
  width: 150px;
  height: 90px;
  flex: 0 0 150px;
  background: var(--header-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background .18s ease;
}

.header-contact:hover,
.header-contact:focus-visible { background: #1b1b1b; }

.header-contact__icon { width: 27px; height: 21px; }
.header-contact__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-contact__text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* メガメニュー */
.mega-menu {
  position: absolute;
  top: 70px;
  left: 50%;
  width: 680px;
  max-width: calc(100vw - 40px);
  padding-top: 8px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.mega-menu__inner {
  padding: 22px 26px;
  color: #111;
  background: #fff;
  border-top: 3px solid var(--header-blue);
  box-shadow: 0 12px 30px rgba(0,0,0,.14);
}

.mega-menu__title { display: none; }

.mega-menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 0 28px;
}

.mega-menu__list li { border-bottom: 1px solid #ddd; }

.mega-menu__list a {
  position: relative;
  display: block;
  padding: 13px 24px 13px 2px;
  color: #111;
  font-size: 14px;
  font-weight: 700;
}

.mega-menu__list a::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  color: var(--header-blue);
}

.global-nav__item--has-sub:hover .mega-menu,
.global-nav__item--has-sub:focus-within .mega-menu,
.global-nav__item--has-sub.is-open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.global-nav__item--has-sub.is-open .global-nav__arrow {
  transform: translateY(2px) rotate(225deg);
}

.nav-toggle { display: none; }

/* 1001〜1360px：デザインを崩さない範囲で圧縮 */
@media (max-width: 1360px) and (min-width: 1001px) {
  .site-header__inner { grid-template-columns: 270px minmax(0,1fr); }
  .site-header__logo {
    width: 200px;
}
  .site-header__group-logo img { width: 280px; }
  .global-nav__list { gap: 18px; padding-right: 16px; }
  .global-nav__link { font-size: 13px; }
  .header-contact { width: 136px; flex-basis: 136px; }
  .header-contact__text { font-size: 14px; }
}

/* タブレット / スマホ */
@media (max-width: 1000px) {
  body.is-nav-open { overflow: hidden; }

  .site-header { height: 72px; }

  .site-header__inner {
    width: 100%;
    max-width: none;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .site-header__brand {
    position: relative;
    z-index: 1003;
    height: 72px;
    padding: 7px 16px;
  }

  .site-header__logo {
    width: 205px;
    max-height: 56px;
    object-fit: contain;
    object-position: left center;
  }

  .site-header__right,
  .site-header__main {
    position: static;
    height: 72px;
    padding: 0;
  }

  .site-header__group-logo { display: none; }

  .nav-toggle {
    position: relative;
    z-index: 1003;
    width: 64px;
    height: 72px;
    margin: 0;
    padding: 0 19px;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
  }

  .nav-toggle span,
  .nav-toggle__line {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: transform .25s ease, opacity .25s ease;
  }

  .nav-toggle[aria-expanded="true"] span:nth-child(1),
  .nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2),
  .nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3),
  .nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .site-header__nav-area {
    position: fixed;
    inset: 72px 0 0;
    z-index: 1002;
    height: auto;
    margin: 0;
    display: block;
    overflow-y: auto;
    background: var(--header-blue);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
  }

  .site-header__nav-area.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .global-nav { height: auto; }
  .global-nav__list { display: block; height: auto; padding: 0 18px; }
  .global-nav__item { border-bottom: 1px solid rgba(255,255,255,.24); }

  .global-nav__link {
    width: 100%;
    min-height: 58px;
    padding: 16px 3px;
    justify-content: space-between;
    font-size: 15px;
  }

  .mega-menu {
    position: static;
    width: auto;
    max-width: none;
    padding: 0;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }

  .global-nav__item--has-sub.is-open .mega-menu { display: block; }
  .mega-menu__inner { padding: 0 0 14px; color: #fff; background: transparent; border: 0; box-shadow: none; }
  .mega-menu__list { display: block; padding: 4px 14px 8px; background: rgba(0,0,0,.08); }
  .mega-menu__list li { border-bottom-color: rgba(255,255,255,.17); }
  .mega-menu__list a { padding: 13px 24px 13px 1px; color: #fff; font-size: 14px; font-weight: 600; }
  .mega-menu__list a::after { color: #fff; }

  .header-contact {
    width: auto;
    height: 66px;
    margin: 18px 18px 28px;
    flex: none;
    flex-direction: row;
    gap: 11px;
    border: 1px solid rgba(255,255,255,.45);
  }
  .header-contact__text { font-size: 15px; }
}

@media (max-width: 600px) {
  .site-header,
  .site-header__inner,
  .site-header__brand,
  .site-header__right,
  .site-header__main,
  .nav-toggle { height: 64px; }

  .site-header__brand { padding: 6px 12px; }
  .site-header__logo { width: 176px; max-height: 48px; }
  .nav-toggle { width: 58px; padding-inline: 17px; }
  .site-header__nav-area { inset: 64px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header *, .site-header *::before, .site-header *::after { transition: none !important; }
}
