* { box-sizing: border-box; }

/* ---------------基本----------------- */
html, body {
    height: 100%;
}

html {
    scrollbar-gutter: stable;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;

    margin: 0;
    font-family: "\6E38\660E\671D", YuMincho, "Hiragino Mincho ProN W3", "\30D2\30E9\30AE\30CE\660E\671D   ProN W3", "Hiragino Mincho ProN", "HG\660E\671D  E", "\FF2D\FF33   \FF30\660E\671D", "\FF2D\FF33   \660E\671D", serif;
    background-color: #EAE6E2;
    color: #111;
    line-height: 1.5;
}

.page-main {
    flex: 1;
}
.page-inner {
    width: 90%;
    margin: 0 auto;
    padding: 0 0 16px;
}

.page-header {
    position: sticky;
    top: 0;
    padding: 16px 0 8px;
    /* background: none; */
    /* padding: 8px 0; */
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.page-title {
    margin: 0
}

.toggle-btn {
    position: static;
    /* top: 12px; */
    right: 18px;
    z-index: 1;

    font-size: 32px;
    background: none;
    border: none;
    /* padding: 8px 10px; */
    cursor: pointer;
    color: #111;

    margin-left: auto;
}

a {
    color: inherit;
    text-decoration: none;
}
a:hover { text-decoration: underline;}

/* ---------------サイドバー概観----------------- */
/* サイドバーは画面に固定して“上に被せる” */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 260px;
    background: #fbfbfcCC;
    border-left: 1px solid #e7e7ea;
    padding: 24px 18px;

    z-index: 1000;

  /* 最初は画面外（右）に隠す */
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow: auto;
}

/* 開いたら表示（本文は動かない） */
.sidebar-open .sidebar {
    transform: translateX(0);
}

/* 背景の暗幕（クリックで閉じる） */
.backdrop {
    position: fixed;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 999;
}

.sidebar-open .backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* ついで：開いてる間は背景スクロールを止めたいなら */
/* .sidebar-open {
    overflow: hidden;
} */


/* サイドバーの中身 */
.sidebar__nav {
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 18px;
    align-items: flex-end;
    text-align: right; 
}

.sidebar__link {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 10px;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__link--accent {
    font-weight: 700;
}

/* --------------Flash---------------- */
.flash {
    border-radius: 12px;
    padding: 10px 12px;
    margin: 12px 0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.flash.hide {
    opacity: 0;
    transform: translateY(-6px);
}

.flash-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(720px, calc(100vw - 24px));
    z-index: 2000;
    pointer-events: none; /* 下のUI操作を邪魔しない */
}

.flash--success {
    border-color: #D0D9EC;
    background: #D0D9EC;
}

.flash--error {
    border-color: #F4A7BE;
    background: #F4A7BE;
}

.flash--info {
    border-color: #9fb7e5;
    background: #9fb7e5
}


/* utility for multiline text */
.prewrap {
    white-space: pre-wrap;
    padding-left: 0;
    text-indent: 0;
}

/* -----------footer----------- */
footer {
    text-align: center;
    padding: 5px;
    color: #000;
    padding: 20px;
}

.site-footer{
    margin-top: auto;
}


/* ---------error page----------- */
.error-container {
    text-align: center;
    margin-top: 80px;
}

.error-container h1 {
    font-size: 28px;
    margin-bottom: 16px;
}

.error-container .btn {
    display: inline-block;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}
