/* 解説ページのサイドメニュー（templates/guides/_side_menu.html。2026-11-21。ADR 020 の9章）
   見た目は、アプリのサイドメニュー（templates/base.html の style と static/css/theme.css。docs/ui/design_guide.md の「サイドメニュー」）と同じ。
   解説ページは base.html・theme.css を読み込まない（鍵やログインに触る部品を読まないため）ので、同じ値をここに書く。
   パソコンの幅：左に置いたまま。スマホの幅（768px 以下）：上の帯の「☰」で開く（static/js/guide_menu.js） */

.gnav-layout { display: flex; min-height: 100vh; }
.gnav-page { flex: 1; min-width: 0; }

/* ---- サイドメニュー：白の地・線で区切る ---- */
.gnav {
    width: 290px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--c-bg);
    color: var(--c-text);
    border-right: 1px solid var(--c-line);
    line-height: 1.5;
    z-index: 100;
}
.gnav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 20px 18px 15px;
    border-bottom: 1px solid var(--c-line);
}
.gnav .gnav-title { font-size: 1.05em; font-weight: bold; color: var(--c-text); text-decoration: none; }
.gnav-close {
    display: none;
    background: var(--c-soft);
    color: var(--c-text);
    border: none;
    font-size: 1.1em;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}
.gnav-close:hover { background: var(--c-accent-light); }
.gnav-nav { flex: 1; padding: 15px 0; overflow-y: auto; }

/* メニューの項目 */
.gnav .gnav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 10px 12px 14px;
    color: var(--c-sub);
    text-decoration: none;
    border-left: 4px solid transparent;
    font-size: 0.9em;
    transition: background 0.2s ease, color 0.2s ease;
}
.gnav .gnav-item:hover { background: var(--c-soft); color: var(--c-text); }
/* 今開いているページの項目：やわらかい緑の地＋左の太い線＋太字（アプリと同じ） */
.gnav .gnav-item.is-current {
    background: var(--c-accent-light);
    color: var(--c-accent-dark);
    border-left: 5px solid var(--c-accent);
    font-weight: bold;
}
.gnav-icon { font-size: 1.15em; width: 22px; text-align: center; }
.gnav-text { flex: 1; }

/* いちばん上の「無料で作ってみる（登録不要）」：主なボタンの形（アプリの「かんたん作成」と同じ） */
.gnav .gnav-start {
    margin: 4px 8px 6px;
    background: var(--c-accent);
    border: 2px solid var(--c-accent);
    border-radius: var(--r-button);
    color: #fff;
    font-weight: bold;
    box-shadow: var(--shadow-button);
}
.gnav .gnav-start:hover, .gnav .gnav-start:active { background: var(--c-accent-dark); border-color: var(--c-accent-dark); color: #fff; }

/* まとまり（使い方・解説など）。開け閉めは <details> で、JavaScript を使わない */
.gnav-group { margin-bottom: 8px; }
.gnav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.85em;
    font-weight: bold;
    color: var(--c-sub);
    cursor: pointer;
    user-select: none;
    list-style: none;
}
.gnav-group-title::-webkit-details-marker { display: none; }
.gnav-group-title:hover { color: var(--c-text); }
.gnav-group-title::after { content: '▼'; font-size: 0.8em; transition: transform 0.3s; }
.gnav-group[open] > .gnav-group-title::after { transform: rotate(-180deg); }

/* 規約・表記：メニューのいちばん下に小さな文字のリンク */
.gnav-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    padding: 8px 18px 12px;
    border-top: 1px solid var(--c-line);
    font-size: var(--fs-small);
}
.gnav-legal a { color: var(--c-sub); text-decoration: none; font-size: 0.92em; }
.gnav-legal a:hover { color: var(--c-accent-dark); text-decoration: underline; }

.gnav a:focus-visible, .gnav button:focus-visible, .gnav summary:focus-visible, .gnav-toggle:focus-visible {
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
}

/* 上の帯の「☰」（スマホの幅だけ） */
.gnav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--c-text);
    font-size: 1.5em;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    line-height: 1;
}
.gnav-toggle:active { background: var(--c-soft); }

/* メニューを開いた時の背景の黒幕（hidden の付け外しは guide_menu.js） */
.gnav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1000;
}
/* スマホの幅で開いたままパソコンの幅に広げた時も、黒幕を残さない */
@media (min-width: 769px) {
    .gnav-overlay { display: none; }
}

/* ---- スマホの幅：アプリと同じく、上の帯のボタンで左から出す ---- */
@media (max-width: 768px) {
    .gnav-layout { display: block; }
    .gnav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: min(310px, 88vw);
        z-index: 1001;
        transform: translateX(-100%);
        visibility: hidden;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
        transition: transform 0.3s ease, visibility 0s linear 0.3s;
    }
    .gnav.open { transform: translateX(0); visibility: visible; transition: transform 0.3s ease; }
    .gnav-close { display: block; }
    .gnav-toggle { display: flex; }
    /* 上の帯：アプリと同じく白の地で上に留める。左に「☰」、右に「ログイン」 */
    .guide .lp-top {
        position: sticky;
        top: 0;
        z-index: 150;
        justify-content: flex-start;
        gap: 4px;
        padding: 8px 12px 8px 6px;
        background: var(--c-bg);
        border-bottom: 1px solid var(--c-line);
    }
    .guide .lp-top-login { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .gnav, .gnav.open, .gnav .gnav-item, .gnav-group-title::after { transition: none; }
}

@media print {
    .gnav, .gnav-toggle, .gnav-overlay { display: none !important; }
}
