@charset "utf-8";
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap');

:root {
    --theme-color: #fff;
    /* テーマカラー */
}

/* 共通のボーダースタイル */
.box,
#info,
#m-info {
    border-top: #626262 solid 1px;
    border-left: #626262 solid 1px;
    border-bottom: #000 solid 1px;
    border-right: #000 solid 1px;
    outline: 1px solid #000;
    outline-offset: -10px;
    overflow-wrap: break-word;
}

/* 中央配置 */
.box,
#info {
    margin-left: auto;
    margin-right: auto;
    width: 95%;
}

/* 共通のパディング */
#info,
#m-info {
    padding: 30px 10px;
    text-align: center;
    background-color: #CCFFCC;
}


/* ベーススタイル */
body {
    background: url(background.webp) fixed;
    background-size: cover;
    backdrop-filter: blur(1px);
    font: 400 normal/normal "Noto Sans JP", sans-serif;
    font-family: "Noto Sans JP", sans-serif;
    min-height: 100vh;
}

header {
    padding-top: 5px;
    background-color: var(--theme-color);
    display: flex;
    border-bottom: #828282 solid 1px;
    min-height: 56px;
}

header img {
    max-height: 40px;
}

.CONTENTS {
    display: flex;
}

#m-info {
    display: none;
}

#m-info h3 {
    margin: 0 20px 0 10px;
}

#m-info a {
    height: 30px;
    border-radius: 15px;
    background-color: aquamarine;
    border: #000 solid 1px;
    padding: 0 10px;
    text-decoration: none;
    color: #000;
}

body.no-scroll {
    position: fixed; /* 背景を完全に固定 */
    width: 100%;     /* 幅が縮まないように */
    left: 0;         /* 位置ズレ防止 */
    overflow: hidden;
    /* topプロパティはJSで動的に制御します */
}


.box {
    margin-top: 20px;
    height: auto;
    background: var(--theme-color);
    padding: 10px;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.box h2,
.box form,
.box small,
.box p {
    padding-left: 10px;
}

.box p.post-header {
    margin-left: 0px;
    padding-left: 10px;
}

#make_thread {
    padding-bottom: 50px;
}

.ul {
    padding-left: 0;
}

.ul li {
    list-style: none;
    margin: 0 auto 5px;
    max-width: 800px;
    width: 92%;
    border: #b1b1b1 1px solid;
    background-color: #f4f4f4;
    border-radius: 5px;
    padding-left: 5px;
}

.ul li:hover {
    background-color: #c4c4c4;
}

a {
    color: #000;
}

.textarea {
    min-width: 150px;
    max-width: 90%;
    resize: none;
    border: #6e6e6e 1px solid;
    border-radius: 2px;

}

.cookie-consent {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    font-size: 12px;
    color: #fff;
    border-top: solid 4px rgba(100, 100, 100, 0.5);
    background: rgba(0, 0, 0, .7);
    padding: 1.2em;
    box-sizing: border-box;
    visibility: hidden;
}

.cookie-consent.is-show {
    visibility: visible;
}

.cookie-consent a {
    color: #fff !important;
}

.cookie-agree {
    color: #fff;
    background: dodgerblue;
    padding: .5em 1.5em;
    cursor: pointer;
}

.input {
    max-width: 90%;
}

@media screen and (max-width: 600px) {
    .cookie-consent {
        flex-direction: column;
    }

    .cookie-text {
        margin-bottom: 1em;
    }
}

table {
    width: 90%;
}

#info {
    margin-top: 30px;
}

.center-img {
    margin: auto;
}

td {
    overflow-wrap: anywhere;
}

footer {
    padding-top: 5px;
    background-color: #fff;
    display: flex;
    justify-content: center;
    border-top: #000 solid 1px;
    position: absolute;
    bottom: 0;
    width: 100%;
}

#MAIN {
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px;
}

#comments {
    min-height: 500px;
}

#page {
    text-align: center;
    position: sticky;
}

.rainbow {
    background: linear-gradient(to right, #e60000, #f39800, #fff100, #009944, #0068b7, #1d2088, #920783);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    background: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    color: #333;
}

.btn:hover {
    background: #ccc;
}

.hidden {
    display: none;
}

.archived-label {
    color: red;
    font-size: 1rem;
    border-radius: 2px;
    margin-left: 5px;
}

.post_a {
    color: #0033ff;
}

.post_a:hover {
    color: #ff2200;
}

.tooltip {
    position: relative;
    cursor: help;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 10;
    bottom: 120%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    white-space: normal;
    word-wrap: break-word;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

#icon-preview {
    margin-left: 10px;
    border-radius: 50%;
    border: #000 solid 1px;
    height: 100%;
}

a.name-link {
    text-decoration: none;
}

a.name-link:hover {
    text-decoration: underline;
}



input[type="text"] {
    border: #6e6e6e 1px solid;
    border-radius: 2px;
}

input[type="file"]::file-selector-button {
    border: #828282 solid 1px;
    background-color: #e4e4e4;
    border-radius: 2px;
    color: #000;
    font-size: 1em;
}

button[type="submit"] {
    background-color: #e4e4e4;
    border: #828282 solid 1px;
    border-radius: 2px;
    color: #000;
    margin-top: 3px;
}

button[type="submit"]:hover,
input[type="file"]::file-selector-button:hover {
    border: #666 solid 1px;
    cursor: pointer;
}

button[type="submit"]:active,
input[type="file"]::file-selector-button:active {
    background-color: #979797;
}

.login-btn {
    margin-left: auto;
    margin-right: 20px;
    max-height: 35px;
    padding: 2px;
    padding-left: 10px;
    padding-right: 10px;
    background-color: #000000;
    color: #ffffff;
    border: #6e6e6e solid 1px;
    border-radius: 6px;
    text-decoration: none;
}

.login-btn a {
    text-decoration: none;
    color: #ffffff;
}

select {
    border: #6e6e6e 1px solid;
    border-radius: 2px;
    padding: auto;
    background-color: #fff;
    color: #000;
}

.post-header {
    border-bottom: #ccc dashed 1px;
    background-color: #f4f4f4;
}


#x {
    background-color: #000;
    color: #fff;
}

#Atag:hover {
    background-color: rgb(255, 170, 139);
}

div.post-img {
    width: 100%;
    padding-left: 10px;
    padding-top: 3px;
}

div.post-img a {
    display: inline-block;
    /* これでimgのサイズに合わせる */
    max-width: 70%;
    /* または fit-content（Safari対策） */
}

div.post-img a img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    box-shadow: 1px 1px 2px #ccc;
    display: block;
}


.manual-update-btn:hover {
    background: #1976D2;
}

#charCount {
    position: absolute;
    bottom: 8px;
    right: 11%;
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 6px;
    pointer-events: none;
}

.modal-content {
    border-top: #6e6e6e dashed 1px;
}

.modal-content h3 {
    margin-left: 10px;
}

.modal-content label {
    display: block;
    margin: 6px 0;
}

.modal-content textarea {
    margin-top: 4px;

}


.modal-actions button[type="submit"],
.toggle-report-button {
    margin-left: 0px;
    display: inline-block;
    padding: 6px 12px;
    margin-top: 10px;
    border: 1px solid red;
    background-color: #fff;
    color: red;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;

    font-size: 1em;
}

#menu-trigger-container {
    margin-left: 10px;
    /* 左側に配置 */
    height: 40px;
    display: flex;
    align-items: center;
}

/* 2. トリガーの共通スタイル */
#menu-trigger {
    cursor: pointer;
    height: 40px;
    width: 40px;
    display: flex;
    /* 内部の要素（barまたはimg）をFlexで制御 */
    align-items: center;
    justify-content: center;
}

/* 3. ログイン時（アイコン）のスタイル */
#menu-trigger.logged-in img {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    border: 1px solid #ccc;
    object-fit: cover;
}

/* 4. 非ログイン時（ハンバーガー）のスタイル */
#menu-trigger.logged-out {
    flex-direction: column;
    /* 縦並びに戻す */
    gap: 4px;
}

#menu-trigger.logged-out .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.2s ease-in-out;
}

.menu-login-box {
    text-align: center;
    padding: 10px 0;
}

.menu-login-box p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.login-button-in-menu {
    display: inline-block;
    background-color: #000000ff;
    /* リンクのデフォルト色を使用 */
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}

.login-button-in-menu:hover {
    background-color: #adadadff;
    color: #000000ff;
}

#icon-trigger img {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    border: 1px solid #ccc;
    object-fit: cover;
}

/* 背景オーバーレイ */
#menu-overlay {
    display: none;
    /* 初期状態は非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: opacity 0.3s ease;
    opacity: 0;
}

#menu-overlay.menu-open {
    display: block;
    opacity: 1;
}

#slide-menu {
    position: fixed;
    /* ★修正: モバイルではfixed */
    top: 0;
    left: -300px;
    /* ★修正: 左からスライド */
    width: 280px;
    height: 100vh;
    background-color: #fefefe;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 101;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    font-family: "Noto Sans JP", sans-serif;
}

#slide-menu.menu-open {
    left: 0;
    /* ★修正: 左にスライドイン */
}

/* --- メニュー内部のスタイル (mypage.php を参考) --- */

/* プロフィール欄 */
.menu-profile {
    align-items: flex-start;
    padding: 20px;
    position: relative;
    /* ★修正: position: absolute; の基準点として relative を指定 */
}

.menu-profile img {
    /* ★修正: #menu-icon-preview への限定を解除 (imgタグでOK) */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    border: 1px solid #ddd;
    object-fit: cover;
    /* ★修正: object-fitを追加 (2つ目の定義から移動) */
}

.menu-profile h3 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 0;
    word-break: break-all;
}

.menu-profile .badge {
    font-size: 0.8em;
    background-color: #d9534f;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
}

/* リンク */
.menu-links {
    padding: 10px;
}

.menu-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-links li {
    margin: 0;
}

.menu-links a {
    text-decoration: none;
    color: #337ab7;
    font-size: 1em;
    display: block;
    padding: 12px 10px;
    border-radius: 4px;
}

.menu-links a:hover {
    background-color: #f0f0f0;
}

/* 区切り線とログアウト */
.menu-links .menu-separator {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.menu-links .logout-link a,
.menu-links li.logout-link a {
    color: #d9534f;
    /* ログアウトは赤色に */
    font-weight: bold;
    /* ★修正: 見た目を強調 */
}

/* 変更を保存ボタンのスタイルと配置 */
#icon-upload-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.8em;
    z-index: 102;
}

.menu-links li.menu-separator strong {
    padding: 0 10px;
    /* 他のリンクと左端を合わせる */
    display: block;
    color: #555;
    font-size: 0.9em;
}

#page {
    text-align: center;
    padding: 10px 0;
}

.pagination {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-block;
}

.pagination li {
    display: inline;
    margin: 0 2px;
}

.pagination .btn {
    /* 既存の .btn スタイルを流用しつつ調整 */
    text-decoration: none;
    padding: 6px 10px;
}

.pagination .btn.current-page {
    background-color: #f0f0f0;
    color: #000;
    font-weight: bold;
    cursor: default;
}

.pagination .page-ellipsis {
    padding: 6px 4px;
    color: #555;
}


/* 3. PC設定 (851px以上) */
@media (min-width: 901px) {

    #menu-trigger-container {
        display: none !important;
    }

    #menu-overlay {
        display: none !important;
    }

    /* PCではスライドメニューを常時表示のサイドバーに変更 */
    #slide-menu {
        position: static;
        /* ★修正: fixedを解除 */
        left: 0;
        width: 250px;
        height: auto;
        /* ★修正: PC用の幅 (元の.LEFTより広い) */
        /* 親要素の高さに合わせる */
        background-color: var(--theme-color, #fff);
        /* 元の.LEFTの背景色に合わせる */
        padding: 10px 0 0 10px;
        box-shadow: none;
        /* 影を削除 */
        z-index: 1;

        /* 内部のスタイルが崩れる場合、ここで調整 */
        /* 例: .menu-profile, .menu-links のスタイル調整 */
    }

    /* .RIGHT の幅を調整 (元々 90% だったのを、flexで自動調整) */
    .CONTENTS {
        display: flex;
        flex-grow: 1;
        /* ★修正: Flexboxで配置 */
    }

    .RIGHT {
        flex-grow: 1;
        /* ★修正: 残りのスペースを全て使う */
        width: auto;
        /* 元の width: 90% や 100% をリセット */
    }
}

/* 4. モバイル設定 (850px以下) - 既存のスタイルを再確認 */
@media (max-width: 900px) {
    /* .LEFT は #slide-menu が代行するため不要 */

    .RIGHT {
        width: 100%;
        /* モバイルではRIGHTが全幅 */
    }

    /* モバイルではアイコントリガーを表示 */
    #icon-trigger {
        display: flex;
    }

    #menu-trigger {
        display: flex;
    }
}



/* デスクトップ対応 */
@media (min-width: 851px) {
    header {
        padding-bottom: 5px;
    }

    .box {

        max-width: 850px;
    }

    #info {
        max-width: 850px;
    }

}

/* モバイル対応 */
@media (max-width: 850px) {
    header {
        padding-bottom: 10px;
    }


    .RIGHT {
        width: 100%;
    }

    #m-info {
        display: none;
    }

    .cookie-agree {
        padding: .5em 9em;
    }

    input[type="file"]::file-selector-button,
    button[type="submit"] {
        padding: 2px;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 1.15em;
        margin-bottom: 5px;
    }

    .post-header {
        font-size: 0.85em;
        border-bottom: #ccc dashed 1px;
    }

    .username {
        font-size: 1.3em;
    }

    .box {
        padding: 8px;
        outline-offset: -8px;

    }

    #info {
        outline-offset: -8px;

    }

}