/* ===== フォント：端末デフォルトのゴシック体に統一 ===== */
html {
    font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic",
                 "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
    -webkit-text-size-adjust: 100%;
}
body, button, input, select, textarea {
    font-family: inherit;
}

/* ===== 変数 ===== */
:root {
    --header-h: 48px;
    --bg: #1c1c1c;
    --bg-header: #141414;
    --bg-panel: #262626;
    --bg-title: #303030;
    --text: #d8d8d8;
    --border: #3a3a3a;
}
@media (min-width: 600px) {
    :root { --header-h: 56px; }
}

/* ===== 全体 ===== */
body {
    margin: 0;
    padding-top: var(--header-h);
    background-color: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
}
body.menu-open { overflow: hidden; }

/* ===== リンク（全統一：白・色変化なし・下線あり） ===== */
a, a:visited, a:hover, a:active, a:focus {
    color: #fff;
    text-decoration: underline;
}

/* ===== 見出し共通（リセットのみ） ===== */
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: bold; }

/* ===== ページタイトル専用タグ ===== */
page-title {
    display: block;
    margin: 4px 0 12px;
    padding: 8px 10px;
    font-size: clamp(20px, 5.5vw, 28px);
    font-weight: bold;
    line-height: 1.3;
    background-color: var(--bg-title);
    border-left: 4px solid var(--text);
    border-bottom: 1px solid var(--border);
}

/* ===== header ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    box-sizing: border-box;
    width: 100%;
    height: var(--header-h);
    padding-right: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-header);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
}
header h1 { font-size: clamp(20px, 5.5vw, 28px); }
header h2 { font-size: clamp(18px, 5vw, 24px); }
header h3 { font-size: clamp(16px, 4.4vw, 20px); }
header h4 { font-size: clamp(14px, 3.8vw, 16px); }

.site-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(20px, 5.5vw, 28px);
    font-weight: bold;
}
.site-logo img { height: var(--header-h); width: auto; }

/* ===== ハンバーガーボタン ===== */
.hamburger {
    position: relative;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
}
.hamburger span {
    position: absolute;
    left: 8px;
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform .3s, opacity .3s, top .3s;
}
.hamburger span:nth-child(1) { top: 12px; }
.hamburger span:nth-child(2) { top: 19px; }
.hamburger span:nth-child(3) { top: 26px; }
.hamburger.is-open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }
.hamburger:focus-visible { outline: 2px solid #777; border-radius: 4px; }

/* ===== オーバーレイ ===== */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.menu-overlay.is-open { opacity: 1; pointer-events: auto; }

/* ===== 右スライドメニュー（本体） ===== */
.global-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 120;
    box-sizing: border-box;
    width: min(280px, 80vw);
    height: 100%;
    padding-top: var(--header-h);
    background-color: #202020;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s ease, visibility .3s;
}

.global-nav ul {
    list-style: none;
    margin: 0;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.global-nav a,
.global-nav a:visited,
.global-nav a:hover,
.global-nav a:active,
.global-nav a:focus {
    text-decoration: none;          /* ボタンなので下線は消す */
}

.global-nav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    min-height: 56px;               /* 指で押しやすい高さ */
    padding: 0 18px 0 20px;
    font-size: 17px;
    font-weight: bold;
    letter-spacing: .04em;
    background: #202020;
    border-bottom: 4px solid #777;    /* 左のアクセント線 */
    transition: background .2s, border-color .2s, transform .1s;
}

/* 右端の矢印 */
.global-nav a::after {
    content: "›";
    font-size: 26px;
    line-height: 1;
    color: #888;
    transition: transform .2s, color .2s;
}

.global-nav a:hover,
.global-nav a:focus-visible {
    border-bottom-color: #fff;
}
.global-nav a:hover::after,
.global-nav a:focus-visible::after {
    color: #fff;
    transform: translateX(3px);
}

/* 押した時 */
.global-nav a:active {
    transform: scale(0.97);
    background: #222;
}

/* 現在のページ */
.global-nav a[aria-current="page"] {
    /* border-bottom-color: #fff; */
    background-color: #202020;
}
.global-nav.is-open { transform: translateX(0); visibility: visible; }

/* ===== main ===== */
main {
    background-color: var(--bg-panel);
    margin: 8px;
    padding: 8px;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
}
main h1 {
    margin: 20px 0 10px;
    padding: 4px 10px;
    font-size: clamp(18px, 5vw, 24px);
    border-left: 4px solid #999;
    border-bottom: 1px solid var(--border);
}
main h2 {
    margin: 16px 0 8px;
    padding: 2px 8px;
    font-size: clamp(16px, 4.4vw, 20px);
    border-left: 3px solid #777;
}
main h3 {
    margin: 12px 0 6px;
    font-size: clamp(15px, 4vw, 18px);
    border-bottom: 1px dotted #666;
}
main h4 {
    margin: 10px 0 4px;
    font-size: clamp(14px, 3.7vw, 16px);
    color: #bbb;
}

/* ===== footer（リンク集） ===== */
footer {
    background-color: var(--bg-panel);
    margin: 8px;
    padding: 10px 12px;
    font-size: 13px;
}
footer h1 { font-size: 16px; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
footer h2 { font-size: 15px; margin: 0 0 6px; }
footer h3 { font-size: 14px; margin: 0 0 4px; }
footer h4 { font-size: 13px; margin: 0 0 4px; color: #bbb; }
footer ul {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
}
footer small { display: block; color: #999; }

footer table {
    width: 100%;
    font-size: 20px;
    color: white;
}

footer table thead tr th {
    background-color: #373737;
    border: 1px solid #454545;
}

footer table th,
footer table td {
    padding: 5px 8px;
    text-align: center;
}

footer table tbody tr th a,
footer table tbody tr th a:visited {
    color: #454545;
}

footer table tbody tr th a:hover,
footer table tbody tr th a:hover:visited {
    color: white;
}
