/*----------HEADER----------*/

:root {
    --color-text : #282828;
    --color-white : #ffffff;
    --color-cta : #e8801f;      /* 後援会ボタン（オレンジ） */
    --color-cta-hover : #ec6a00; /* 後援会ボタンのホバー時（鮮やかな濃いオレンジ） */
    --color-cta-en : #ffc68c;   /* 後援会ボタンの英字（薄いオレンジ） */
    --color-pink : #e0507e;     /* タイトル文字のピンク（スクロール時） */
    --color-pink-light : #fde3ec; /* ナビのホバー背景（薄いピンク） */
    --color-pink-soft : #f7a9c2;  /* 英字の薄いピンク（名前・ナビ） */
    --header-height : 100px;
    --box-height : 74px;        /* ナビ・ボタンの高さ */
    --box-pad-bottom : 0px;     /* ナビ・ボタンの下余白（英字がある時） */
    --box-height-compact : 52px; /* スクロール時のナビ・ボタンの高さ（英字を隠す） */
    --box-radius : 12px;        /* ハンバーガーボタンの角丸 */
    --box-shadow : 0 4px 16px rgba(0, 0, 0, .06);
    --page-top : 100px;         /* ページ上部の空き */
    --name-size : 24px;         /* タイトルの文字サイズ */
    --transition : .35s ease;
}

/* ヘッダーの高さ分、ページ上部を空ける */
body {
    padding-top : var(--page-top);
}

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

.site-header__logo,.global-nav__link {
    color : inherit;
    text-decoration : none;
}

.site-header ul {
    list-style : none;
    margin : 0;
}

/* ヘッダー本体（背景なし・位置は固定） */
.site-header {
    position : fixed;
    top : 0;
    left : 0;
    right : 0;
    z-index : 1000;
    height : var(--header-height);
    display : flex;
    align-items : center;
    justify-content : space-between;
    gap : 20px;
    padding : 0 30px;
    color : var(--color-text);
    line-height : 1.7;
}

/*---タイトル---*/
.site-header h1 {
    font-size : 100%;
    white-space : nowrap;
    transition : opacity .3s ease, transform .3s ease, visibility .3s;
}

.site-header__logo {
    display : grid;
    grid-template-columns : auto auto;   /* 「長野県議会議員」「竹内まさみ」を横に並べ、英字は下の段 */
    justify-content : start;
    align-items : baseline;
    column-gap : .3em;
    color : var(--color-white);           /* 通常は白 */
    transition : color var(--transition);
    font-size : var(--name-size);
    font-weight : 800;
    letter-spacing : 0;
}

/* 名前の英字（名前の下に小さく） */
.site-header__en {
    grid-column : 1 / -1;       /* 2列分の幅いっぱい */
    display : block;
    overflow : hidden;
    max-height : 1em;
    margin-top : 4px;           /* 名前との間隔 */
    color : var(--color-pink-soft);
    font-family : "Zen Kaku Gothic New", sans-serif;
    font-size : 15px;
    font-weight : 900;
    line-height : 1;
    letter-spacing : .6em;
    text-align : center;        /* PC：名前の中央にそろえる */
    padding-left : .6em;        /* 末尾の字間分を補正して中央に見せる（letter-spacingと同じ値） */
    transition : max-height .3s ease, opacity .25s ease, margin .3s ease;
}

/* スクロールしたら名前の英字を隠す */
.site-header.is-compact .site-header__en {
    max-height : 0;
    margin-top : 0;
    opacity : 0;
}

/* スクロールしてページタイトルを過ぎたらピンク */
.site-header.is-scrolled .site-header__logo {
    color : var(--color-pink);
}

/*---ナビ（白背景・角丸）＋後援会ボタン---*/
.global-nav {
    display : flex;
    align-items : center;
    gap : 15px;
}

.global-nav__list {
    display : flex;
    align-items : center;
    gap : 4px;
    height : var(--box-height);
    padding : 0 21px var(--box-pad-bottom) 21px;   /* 白背景の左右余白・下余白 */
    background : var(--color-white);
    border-radius : 999px;      /* 後援会ボタンと同じ角丸 */
    transition : height .3s ease, padding .3s ease;
}

.global-nav__link {
    position : relative;
    isolation : isolate;        /* 背景（::before）を文字の後ろに置く */
    display : flex;
    flex-direction : column;    /* 和文の下に英字 */
    align-items : center;       /* 英字を中央そろえ */
    padding : 4px 14px;
    font-weight : 700;
    line-height : 1.3;
    white-space : nowrap;
    transition : color .3s ease;
}

/* ナビの英字（和文の下に小さく） */
.global-nav__en {
    display : block;
    overflow : hidden;
    max-height : 1.5em;
    margin : 1px 0 -3px;        /* 和文との間隔（行の高さを広げた分を上下で差し引き、位置は今までどおり） */
    color : var(--color-pink-soft);
    font-family : "Zen Kaku Gothic New", sans-serif;
    font-size : 12px;
    font-weight : 900;
    line-height : 1.5;          /* iPad（Safari）で文字の下が切れないよう、行の高さに余裕を持たせる */
    letter-spacing : .12em;
    transition : max-height .3s ease, opacity .25s ease, margin .3s ease;
}

/* ホバー時の薄いピンク背景：中央からふわっと広がる */
.global-nav__link::before {
    content : "";
    position : absolute;
    top : 0;
    right : 0;
    bottom : 0;
    left : 0;
    z-index : -1;
    background : var(--color-pink-light);
    border-radius : 999px;
    opacity : 0;
    transform : scale(.85);
    transition : opacity .3s ease, transform .3s ease-out;
}

.global-nav__link:hover {
    color : var(--color-pink);
}

.global-nav__link:hover::before {
    opacity : 1;
    transform : scale(1);
}

/*---後援会のご案内（独立ボタン）---*/
.global-nav__cta {
    display : flex;
    flex-direction : column;    /* 和文の下に英字 */
    align-items : center;       /* 英字を中央そろえ */
    justify-content : center;
    line-height : 1.3;
    height : var(--box-height);
    padding : 0 30px var(--box-pad-bottom) 30px;
    background : var(--color-cta);
    border-radius : 999px;
    color : var(--color-white);
    font-weight : 700;
    white-space : nowrap;
    text-decoration : none;
    transition : background-color .3s, color .3s, height .3s ease, padding .3s ease;
}

.global-nav__cta:hover {
    background : var(--color-cta-hover);
}

.global-nav__cta .global-nav__en {
    color : var(--color-cta-en);   /* ボタンの英字は薄いオレンジ */
}

/* スクロールしたら英字を隠し、ナビを少し低くする（PCのみ） */
@media (min-width: 1200px) {
    /* 名前の上を少し空け、その分ヘッダーの領域とページタイトルを少し下げる */
    :root {
        --header-height : 110px;
        --page-top : 110px;
    }
    .site-header h1 {
        margin-top : 10px;
    }
    /* iPad（Safari）は文字が少し下寄りに表示されるため、ナビ・後援会ボタンの下余白を少し足して文字を上げる */
    .is-tablet {
        --box-pad-bottom : 4px;
    }
    /* ナビ全体を少し下げる（上マージン）※ヘッダーを高くした分を差し引いて、位置は今までどおり */
    .global-nav {
        position : relative;
        top : 1px;
    }
    .site-header.is-compact .global-nav__list,
    .site-header.is-compact .global-nav__cta {
        height : var(--box-height-compact);
        padding-bottom : 0;
    }
    .site-header.is-compact .global-nav__en {
        max-height : 0;
        margin-top : 0;
        margin-bottom : 0;
        opacity : 0;
    }
}

/* メニュー内の名前・SNSボタンはスマホのみ表示 */
.global-nav__name,
.global-nav__sns {
    display : none;
}

/*---ハンバーガー---*/
.menu-toggle {
    display : none;
    position : relative;
    width : 50px;
    height : 50px;
    padding : 0;
    border : none;
    background : var(--color-white);
    border-radius : 50%;        /* 正円 */
    box-shadow : var(--box-shadow);
    color : inherit;
    cursor : pointer;
}

.menu-toggle span {
    position : absolute;
    left : 13px;
    width : 24px;
    height : 3px;               /* 線の太さ */
    border-radius : 2px;
    background : currentColor;
    transition : transform .3s, opacity .3s, top .3s;
}

.menu-toggle span:nth-child(1) { top: 16px; }
.menu-toggle span:nth-child(2) { top: 23.5px; }
.menu-toggle span:nth-child(3) { top: 31px; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { top: 23.5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { top: 23.5px; transform: rotate(-45deg); }

/* レスポンシブ */
@media (min-width: 1200px) and (max-width: 1299px) {
    .global-nav__list {gap:0;}
    .global-nav__link {padding:4px 12px;}
    .global-nav__link,.global-nav__cta {font-size:14px;}
}

@media (max-width: 1199px) {
    :root { --header-height:90px; --box-height:46px; --page-top:90px; --name-size:19px;}   /* ヘッダーの領域を少し広げる */
    .site-header h1 {margin-top:8px;}   /* 名前の上を少し空ける */
    /* スマホはスクロールしたらタイトルを隠す（ハンバーガーのみ残す） */
    .site-header.is-compact h1 {opacity:0; visibility:hidden; transform:translateY(-10px); pointer-events:none;}
    /* iPhone（Safari）でも確実に消えるよう、和文・英文それぞれにも指定 */
    .site-header.is-compact .site-header__logo,
    .site-header.is-compact .site-header__en {opacity:0; visibility:hidden;}
    .site-header__en {font-size:13px; margin-top:3px; letter-spacing:.4em; text-align:left; padding-left:0;}   /* スマホ：名前の左端にそろえる */
    .site-header {padding:0 15px 0 24px;}   /* 名前を少し右へ */
    .menu-toggle {display:block; flex-shrink:0; z-index: 2; color: var(--color-pink);}   /* 名前が長くてもボタンをつぶさない */   /* ハンバーガーの線をヘッダーと同じピンクに */

  .global-nav {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
    background: var(--color-pink);   /* ヘッダー（ページタイトル）と同じピンクのベタ塗り */
    opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
  }
  .global-nav.is-open { opacity: 1; visibility: visible; }
  /* スマホ横向きなど、画面の高さに収まらないときはメニュー内をスクロールできるようにする
     （収まるときはこれまでどおり上下中央に配置） */
  .global-nav {
    justify-content: flex-start;
    padding: 90px 0 40px;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .global-nav > :first-child { margin-top: auto; }
  .global-nav > :last-child { margin-bottom: auto; }
  .global-nav__list { flex-direction: column; align-items: stretch; gap: 0; width: calc(100% - 60px); max-width: 340px; height: auto; padding: 0; background: none; }
  /* 各項目の下に罫線（一番上の項目のみ上にも） */
  .global-nav__list li { border-bottom: solid 1px rgba(255, 255, 255, .35); }
  .global-nav__list li:first-child { border-top: solid 1px rgba(255, 255, 255, .35); }
  /* 和文は左寄せ・英字は右寄せ（1行に並べる） */
  .global-nav__link { flex-direction: row; justify-content: flex-start; align-items: center; padding: 16px 6px; }
  .global-nav__link .global-nav__en { margin-left: auto; color: var(--color-pink-soft); font-size: 13px; }   /* 英字を右へ・名前の英字と同じ色（後援会ボタンには影響させない） */
  /* 英字の隣に正円で囲んだ矢印 */
  /* 英字の隣の矢印（sparrow.svg） */
  .global-nav__link::after {
    content: "";
    flex: 0 0 24px; width: 24px; height: 24px;
    margin-left: 10px;
    background: url(sparrow.svg) no-repeat center / contain;
  }
  .global-nav__link,
  .global-nav__link:hover { font-size: 18px; color: var(--color-white); }
  .global-nav__en { color: inherit; font-size: 11px; margin-top: 0; margin-bottom: 0; line-height: 1; max-height: 1em; }   /* スマホは今までどおり */
  .global-nav__link::before { background: rgba(255, 255, 255, .12); border-radius: 0; }
  .global-nav__cta { height: auto; padding: 10px 30px; font-size: 18px; }
  .global-nav__cta .global-nav__en { margin-top: 5px; }   /* 後援会ボタンの和文と英字の間を少し空ける */
  .global-nav__list { padding-bottom: 0; }
  .site-header.menu-open .menu-toggle { color: var(--color-white); background: transparent; box-shadow: none; }
  /* メニュー内のSNSボタン（後援会ボタンの下） */
  .global-nav__sns { display: flex; justify-content: center; gap: 14px; margin-top: -10px; }
  .global-nav__sns a { display: block; width: 42px; height: 42px; }
  .global-nav__sns img { display: block; width: 100%; height: 100%; }
  /* メニュー内の名前（ナビの上・中央） */
  .global-nav__name {
    display: grid; grid-template-columns: auto auto; justify-content: center; align-items: baseline; column-gap: .3em;
    margin-bottom: -6px;
    color: var(--color-white); font-size: 22px; font-weight: 800; line-height: 1.4; white-space: nowrap;
    text-decoration: none;   /* トップページへのリンク（下線なし） */
  }
  .global-nav__name-en {
    grid-column: 1 / -1; display: block; margin-top: 6px;
    color: var(--color-pink-soft);
    font-family: "Zen Kaku Gothic New", sans-serif; font-size: 13px; font-weight: 900; line-height: 1;
    letter-spacing: .4em; padding-left: .4em; text-align: center;
  }
}

/* 幅の狭いスマホ（初代iPhone SE など幅320px）では名前を少し小さくして、ハンバーガーと重ならないようにする */
@media (max-width: 359px) {
    :root { --name-size:16px; }
    .site-header {padding:0 12px 0 16px;}
}
