/*
 * Neco 共通スタイル：色の決まり・共通ヘッダー・共通フッター・Cookieの案内
 *
 * 総合トップ（index.html）・医師向け（doctor.html）・看護師向け（nurse.html）・医療機関向け（for-medical.html）で読み込む。
 * 各ページの古いCSS（header・footer などの要素指定）と混ざらないよう、クラス名は sh-（ヘッダー）・sf-（フッター）で始め、
 * 位置や余白などの見た目はここで明示的に指定する。
 * 仕様：docs/specs/SITE_IA_REDESIGN_20261106.md
 */

/* ===== 色・文字の決まり ===== */
:root {
    --n-ink: #24262E;          /* 本文の文字 */
    --n-ink-2: #474C59;        /* 補足の文字 */
    --n-muted: #666B78;        /* 注記（白地でコントラスト比 約5.3） */
    --n-rule: #E7E2DD;         /* 罫線 */
    --n-paper: #FFFFFF;
    --n-paper-warm: #FAF7F3;   /* 区切りの背景（温かみのある白） */
    --n-pink: #FF6B9D;         /* ブランドの差し色（線・印など） */
    --n-pink-ink: #C2416F;     /* 文字やボタンに使う濃いピンク（白地でコントラスト比 約4.9） */
    --n-pink-soft: #FFE1EA;    /* 見出しの蛍光ペン */
    --n-line: #06C755;         /* LINEの緑（ボタンの地） */
    --n-line-dark: #05A648;
    --n-line-text: #04803A;    /* 白地に置く緑の文字 */
    --n-font: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', YuGothic, Meiryo, sans-serif;
    /* キャッチコピー・見出し用の明朝体（看護師・医療機関ページと同じ Noto Serif JP。読み込み前はOS標準の明朝体） */
    --n-font-serif: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, 'BIZ UDPMincho', serif;
    --n-header-h: 64px;
}

/* ===== 共通ヘッダー ===== */
header.sh {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    z-index: 1000;
    width: 100%;
    margin: 0;
    padding: 0;
    padding-top: env(safe-area-inset-top);
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--n-rule);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    font-family: var(--n-font);
    transform: none;
}

.sh-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    /* 本文の幅（lp.css の .wrap：1080px）と左右の位置をそろえる */
    max-width: 1080px;
    height: var(--n-header-h);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sh-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    text-decoration: none;
}

.sh-logo svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* ロゴの文字はブランドのグラデーションをそのまま使う（サイトでグラデーションを使うのはロゴだけ） */
.sh-logo-text {
    font-family: 'Zen Kaku Gothic New', var(--n-font);
    font-size: 1.65rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #FF6B9D, #A78BFA);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #FF6B9D;
}

.sh-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0;
    background: none;
    position: static;
    box-shadow: none;
    max-width: none;
}

.sh-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: var(--n-header-h);
    padding: 0 0.8rem;
    color: var(--n-ink-2);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

/* 読み物（Neco Journal）の入口：相談の3つの入口と混ざらないよう、縦線で区切り、文字を小さく・薄くする */
.sh-read {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: var(--n-header-h);
    margin-left: 0.7rem;
    padding: 0 0.6rem 0 1.3rem;
    color: var(--n-muted);
    font-family: var(--n-font-serif);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    white-space: nowrap;
}

.sh-read::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 1.1rem;
    background: var(--n-rule);
    transform: translateY(-50%);
}

.sh-read:hover {
    color: var(--n-ink);
}

.sh-link:hover {
    color: var(--n-ink);
}

/* 今いるページ：下に細い線を引いて示す */
.sh-link[aria-current="page"] {
    color: var(--n-ink);
    font-weight: 700;
}

.sh-link[aria-current="page"]::after {
    content: '';
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0;
    height: 3px;
    background: var(--n-pink);
}

/* 右側の相談ボタン（ページごとに行き先と色が変わる） */
.sh-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 1rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    background: var(--n-ink);
    color: #FFFFFF;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.sh-cta:hover {
    background: #3A3D48;
    color: #FFFFFF;
}

.sh-cta--line {
    background: var(--n-line);
}

.sh-cta--line:hover {
    background: var(--n-line-dark);
}

.sh-cta svg {
    flex-shrink: 0;
}

/* メニューボタン（狭い画面だけ表示） */
.sh-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 -0.5rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--n-ink);
    cursor: pointer;
}

.sh-menu-btn:focus-visible,
.sh-link:focus-visible,
.sh-read:focus-visible,
.sh-cta:focus-visible,
.sh-logo:focus-visible {
    outline: 3px solid var(--n-pink-ink);
    outline-offset: 2px;
}

.sh-menu-btn .sh-icon-close {
    display: none;
}

.sh-menu-btn[aria-expanded="true"] .sh-icon-open {
    display: none;
}

.sh-menu-btn[aria-expanded="true"] .sh-icon-close {
    display: block;
}

/* ページ内のメニュー（看護師・医療機関ページ。PC 幅だけ。狭い幅ではメニューの中に同じリンクがある） */
.sh-subnav {
    border-top: 1px solid var(--n-rule);
    background: #FFFFFF;
}

.sh-subnav-inner {
    display: flex;
    align-items: center;
    gap: 0.25rem 1.5rem;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 40px;
}

.sh-subnav a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: var(--n-ink-2);
    font-size: 0.85rem;
    text-decoration: none;
}

.sh-subnav a:hover {
    color: var(--n-pink-ink);
    text-decoration: underline;
}

.sh-subnav a:focus-visible {
    outline: 3px solid var(--n-pink-ink);
    outline-offset: 2px;
}

@media (max-width: 960px) {
    .sh-subnav {
        display: none;
    }
}

/* スマホのメニュー（ヘッダーの下に開く） */
.sh-drawer {
    border-top: 1px solid var(--n-rule);
    background: #FFFFFF;
    max-height: calc(100vh - var(--n-header-h));
    /* iPhone でアドレスバーの分だけメニューの下が隠れないよう、対応ブラウザでは表示中の高さを使う */
    max-height: calc(100dvh - var(--n-header-h));
    overflow-y: auto;
}

.sh-drawer[hidden] {
    display: none;
}

.sh-drawer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem 1.25rem;
}

/* メニューの先頭の LINE の相談（医師・看護師ページ。スマホではヘッダーの相談ボタンを出さないため） */
.sh-drawer-line {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin: 0.75rem 0 0.5rem;
    border-radius: 8px;
    background: var(--n-line);
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
}

.sh-drawer-line:hover {
    background: var(--n-line-dark);
    color: #FFFFFF;
}

.sh-drawer-main a,
.sh-drawer-sub a {
    display: flex;
    align-items: center;
    min-height: 48px;
    color: var(--n-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--n-rule);
}

.sh-drawer-main a {
    font-size: 1rem;
    font-weight: 700;
}

.sh-drawer-main a[aria-current="page"] {
    color: var(--n-pink-ink);
}

.sh-drawer-sub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
    margin-top: 0.75rem;
}

.sh-drawer-sub a {
    font-size: 0.88rem;
    color: var(--n-ink-2);
    min-height: 44px;
}

@media (max-width: 960px) {
    .sh-nav {
        display: none;
    }

    .sh-cta {
        margin-left: auto;
    }

    .sh-menu-btn {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    :root {
        --n-header-h: 56px;
    }

    .sh-bar {
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .sh-logo svg {
        width: 22px;
        height: 22px;
    }

    .sh-logo-text {
        font-size: 1.35rem;
    }

    .sh-cta {
        min-height: 38px;
        padding: 0 0.8rem;
        font-size: 0.82rem;
    }

    /* スマホ下部に相談のバーがあるページでは、ヘッダーの相談ボタンを出さず、メニューだけにする */
    body.has-mobile-bar .sh-cta {
        display: none;
    }

    body.has-mobile-bar .sh-menu-btn {
        margin-left: auto;
    }
}

/* ===== 共通フッター ===== */
footer.sf {
    position: relative;
    margin: 0;
    padding: 3rem 1.5rem 2rem;
    background: #F3EFEA;
    color: var(--n-ink-2);
    border-top: 1px solid var(--n-rule);
    font-family: var(--n-font);
    /* 行間・字間をフッター側で決める。以前は各ページの本文の設定を引き継ぎ、
       トップ・医師と看護師・医療機関で見出しとリンクの間隔や折り返しが違っていた */
    line-height: 1.8;
    letter-spacing: 0.02em;
    text-align: left;
    overflow: visible;
}

footer.sf::before,
footer.sf::after {
    content: none;
    display: none;
}

.sf-inner {
    display: grid;
    /* リンクの列は、いちばん長いリンク（採用ブランディング支援（Narra））が1行に収まる幅を下限にする */
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(max-content, 1fr));
    gap: 2rem;
    max-width: 1032px;
    margin: 0 auto;
}

.sf-logo {
    font-family: 'Zen Kaku Gothic New', var(--n-font);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--n-ink);
    text-decoration: none;
    letter-spacing: -0.02em;
    /* 行の高さを文字の高さにして、ロゴの文字の上端を右の列見出しの上端にそろえる */
    display: inline-block;
    line-height: 1;
}

.sf-about {
    /* ロゴの行の高さを縮めた分、ロゴ→説明文の間隔が以前（約29px）と同じになる値 */
    margin: 0.85rem 0 0;
    font-size: 0.85rem;
    line-height: 1.8;
}

/* 語句ごとに折り返す（幅900〜1030pxで「一緒に／探す」のように割れていた）。列より長い語句は中で折り返す */
.sf-about span {
    display: inline-block;
}

.sf-license {
    margin: 0.8rem 0 0;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--n-muted);
}

.sf-h {
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--n-ink);
}

.sf-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sf-col li {
    margin: 0;
}

.sf-col a {
    display: inline-block;
    padding: 0.3rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--n-ink-2);
    text-decoration: none;
}

.sf-col a:hover,
.sf-bottom a:hover {
    color: var(--n-pink-ink);
    text-decoration: underline;
}

.sf-note {
    max-width: 1032px;
    margin: 2rem auto 0;
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--n-muted);
}

.sf-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem 1.5rem;
    max-width: 1032px;
    margin: 2rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--n-rule);
    font-size: 0.78rem;
    color: var(--n-muted);
}

.sf-bottom p {
    margin: 0;
}

.sf-sns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
}

.sf-bottom a {
    color: var(--n-ink-2);
    text-decoration: none;
}

@media (max-width: 900px) {
    .sf-inner {
        grid-template-columns: 1fr 1fr;
    }

    .sf-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    footer.sf {
        padding: 2.25rem 1rem 1.5rem;
    }

    .sf-inner {
        gap: 1.5rem 1rem;
    }
}

/* スマホ下部の相談バーがあるページは、フッターの最後がバーに隠れないよう余白を足す */
@media (max-width: 768px) {
    body.has-mobile-bar footer.sf {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
    }

    /* フッターの左右の余白もヘッダーと同じ1remに（以前は481〜768pxだけ24px） */
    footer.sf {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ===== Cookie の案内（画面の下に出る帯） ===== */
/* 案内が出ている間は、スマホ下部の相談バー（医師LP .mobile-bar・看護師ページ .mobile-fixed-cta）を案内の上に出す。
   高さ --n-cookie-h は assets/js/site.js が入れる */
body.cookie-open .mobile-bar,
body.cookie-open .mobile-fixed-cta {
    bottom: var(--n-cookie-h, 0px);
}

.cookie {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    padding: 0.9rem 1rem;
    padding-bottom: max(0.9rem, env(safe-area-inset-bottom));
    background: var(--n-ink);
    color: #F1F1F3;
    font-family: var(--n-font);
}

.cookie[hidden] {
    display: none;
}

.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem 1.2rem;
    max-width: 960px;
    margin: 0 auto;
}

.cookie p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
}

@media (max-width: 480px) {
    .cookie {
        padding: 0.65rem 0.9rem;
        padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    }

    .cookie p {
        font-size: 0.74rem;
        line-height: 1.55;
    }

    .cookie button {
        min-height: 38px;
        padding: 0 0.9rem;
    }
}

.cookie a {
    color: #FFFFFF;
    text-decoration: underline;
}

.cookie button {
    flex-shrink: 0;
    min-height: 40px;
    padding: 0 1.2rem;
    border: 0;
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--n-ink);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}
