/* ==========================================================================
   サイト共通ヘッダー（views/partials/header.ejs）: 案A 誌面ヘッダ型
   ユーティリティ行（MouseLog / PadLog・日本語 / EN・ログイン）→ マストヘッド → SEARCH · TOPIC · MAP。
   全ページ（Bootstrap を読むページ・管理画面も含む）に出るので、すべて .sh の中だけに効かせ、
   style.css の nav / nav a、Bootstrap の a / p / button の既定値を打ち消す。
   ブレークポイント: 767px（スマホ）
   ========================================================================== */

.sh {
    display: block;
    position: relative;
    background: #fff;
    color: #111;
    border-bottom: 1.5px solid #111;
    padding: 0;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}
.sh *, .sh *::before, .sh *::after { box-sizing: border-box; }
.sh a { color: #111; text-decoration: none; }
.sh a:hover { color: #111; text-decoration: none; }
.sh p { margin: 0; }
.sh a:focus-visible, .sh button:focus-visible, .sh input:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* ── ユーティリティ行 ── */
.sh-util {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 24px;
    border-bottom: 1px solid #e3e3e3;
    font-size: 12px;
    min-width: 0;
}
.sh-sp { flex: 1; min-width: 0; }
.sh-sw {
    display: inline-flex;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 11.5px;
    letter-spacing: .04em;
    flex: none;
}
.sh .sh-sw a {
    color: #999;
    padding: 2px 0;
    margin-right: 14px;
    border-bottom: 1.5px solid transparent;
    line-height: 1.5;
}
.sh .sh-sw a:hover { color: #111; }
.sh .sh-sw a.is-on { color: #111; font-weight: 700; border-bottom-color: #111; }
.sh-lang {
    display: inline-flex;
    border: 1px solid #111;
    border-radius: 4px;
    overflow: hidden;
    font-size: 11px;
    flex: none;
}
.sh .sh-lang a { padding: 1px 8px; color: #111; line-height: 1.6; }
.sh .sh-lang a:hover { background: #f0f0f0; }
.sh .sh-lang a.is-on { background: #111; color: #fff; }
.sh-login, .sh-me {
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
}
.sh-me-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.sh-av {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1;
    flex: none;
    overflow: hidden;
}
.sh-av img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #e6e6e6;
}
.sh .sh-admin {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    border: 1px solid #111;
    border-radius: 999px;
    padding: 0 8px;
    line-height: 1.6;
    flex: none;
}
.sh-logout {
    appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 11.5px;
    color: #777;
    cursor: pointer;
    white-space: nowrap;
    flex: none;
}
.sh-logout:hover { color: #111; text-decoration: underline; }
.sh-logout { display: inline-flex; align-items: center; }
.sh-logout svg { display: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── マストヘッド ── */
.sh-mast { text-align: center; padding: 20px 16px 12px; }
.sh .sh-word {
    display: inline-block;
    font-size: 50px;
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: 1;
    color: #111;
}
.sh-word small {
    font-size: 12px;
    font-weight: 400;
    color: #888;
    letter-spacing: 0;
    margin-left: 8px;
}
.sh .sh-tag {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 10.5px;
    letter-spacing: .22em;
    color: #777;
    margin: 8px 0 0;
    line-height: 1.5;
}

/* ── ナビ（SEARCH · TOPIC · MAP） ── */
.sh .sh-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
    width: auto;
    margin: 0 24px;
    border-top: 1.5px solid #111;
}
.sh .sh-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 30px;
    font-family: ui-monospace, Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    color: #111;
    line-height: 1.4;
}
.sh .sh-nav a:hover { background: #f3f3f3; }
.sh .sh-nav a.is-open { background: #111; color: #fff; }
.sh .sh-nav a.active:not(.is-open) { box-shadow: inset 0 -2px 0 #111; }
.sh-nav svg {
    width: 15px;
    height: 15px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── 検索欄（SEARCH で開閉） ── */
.sh-search { border-top: 1px solid #e3e3e3; padding: 12px 24px; background: #f3f3f3; }
.sh-search[hidden] { display: none; }
.sh-sform { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.sh-sform input {
    flex: 1;
    min-width: 0;
    border: 0;
    border-bottom: 1.5px solid #111;
    border-radius: 0;
    background: transparent;
    padding: 8px 2px;
    margin: 0;
    font: inherit;
    font-size: 16px;
    color: #111;
    -webkit-appearance: none;
    appearance: none;
}
.sh-sform input:focus { outline: none; border-bottom-width: 2.5px; }
.sh-sform button {
    flex: none;
    border: 0;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 8px 20px;
    margin: 0;
    font: inherit;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
}
.sh-sform button:hover { background: #333; }
/* style.css のスマホ用 button[type="submit"] { width: 100% } を打ち消す */
.sh .sh-sform button { width: auto; }

/* ── スマホ ── */
@media (max-width: 767px) {
    .sh-util { padding: 6px 12px; gap: 8px; }
    .sh .sh-sw a { margin-right: 10px; }
    .sh-me-name { max-width: 96px; }
    /* スマホではログアウトをアイコンだけに（文字は読み上げ用に残す） */
    .sh-logout { padding: 4px; margin: -4px; }
    .sh-logout svg { display: block; }
    .sh-logout-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .sh-mast { padding: 14px 12px 8px; }
    .sh .sh-word { font-size: 32px; }
    .sh-word small { display: block; margin: 4px 0 0; }
    .sh .sh-tag { font-size: 9px; letter-spacing: .14em; }
    .sh-tag span { display: none; }
    .sh .sh-nav {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        gap: 0;
        margin: 0;
    }
    .sh .sh-nav a {
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 8px 0;
        font-size: 9.5px;
        letter-spacing: .08em;
        min-height: 48px;
    }
    .sh .sh-nav a + a { border-left: 1px solid #e3e3e3; }
    .sh-nav svg { width: 17px; height: 17px; }
    .sh-search { padding: 10px 12px; }
}
@media (max-width: 374px) {
    .sh-me-name { display: none; }
}
