



:root {
    color-scheme: light dark;
}
body {
    margin: 0;
    background-color: #f4f4f4;
    color: #000000;
    font-size: 16px;
}

body {
    background-color: light-dark(#f4f4f4, #332B33);
    color: light-dark(#000000, #999999);
}

form input,
form textarea,
form select,
form button {
    color-scheme: light;
}

a {
    color: #0000FF;
    color: light-dark(
        #0000FF,
        #999999    );
}
a:visited {
    color: #663399;
    color: light-dark(
        #663399,
        #999999    );
}
a:active {
    color: #FF0000;
    color: light-dark(
        #FF0000,
        #999999    );
}

.quote-text {
    color: #666666;
    color: light-dark(
        #666666,
        #bbbbbb    );
}

.comment-text {
    color: #333333;
    color: light-dark(
        #333333,
        #cccccc    );
}

.note-text {
    color: #333333;
    color: light-dark(
        #333333,
        #cccccc    );
}

.name {
    color: #007700;
    color: light-dark(
        #007700,
        #91d18b    );
}

.cap {
    color: #ff4500;
    color: light-dark(
        #ff4500,
        #f48c40    );
}

.deleted-message {
    color: #ff0000;
    color: light-dark(
        #ff0000,
        #ff5555    );
}

.error-message {
    color: #ff0000;
    color: light-dark(
        #ff0000,
        #ff5555    );
}

hr {
    border: none;
    border-top: 1px solid #cccccc;
    border-top-color: light-dark(
        #cccccc,
        #333333    );
}

.embed-post {
    background-color: #f4f4f4;
    color: #000000;
    background-color: light-dark(
        #f4f4f4,
        #332B33    );
    color: light-dark(
        #000000,
        #999999    );
}

mark {
    background-color: transparent;
    color: inherit;
    margin: 0 5px;
}

/* パンくずリスト */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    list-style: none;
    padding-left: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding: 0 0.5rem;
    content: ">";
    vertical-align: middle;

    color: #000000;
    color: light-dark(
        #000000,
        #999999    );
}

/* 最後のパンくずリスト項目のリンクを無効にする */
.breadcrumb-item:last-child a {
    pointer-events: none;
    color: inherit;
    text-decoration: none;
}

/* スマートフォン用スタイル */
@media (max-width: 640px) {
    .embed-contents {
        position: relative;
        width: 100%;
        max-height: 200px;
        overflow: hidden;
    }
    .embed-instagram {
        width: 100%;
        height: 360px !important;
        max-height: 360px !important;
    }

    .embed-video iframe {
        width: 100%;
        height: 360px !important;
        max-height: 360px !important;
    }

    .embed-youtube iframe {
        width: 100%;
        height: 360px !important;
        max-height: 360px !important;
    }

    .embed-youtube {
        width: 100%;
        height: 360px !important;
        max-height: 360px !important;
    }

    .img-thumbnail, .embed-youtube-img, .embed-image, .video-thumbnail {
        max-width: 128px;
        max-height: auto;
    }
}

/* パソコン用スタイル */
@media (min-width: 641px) {
    .embed-contents {
        position: relative;
        width: 100%;
        max-height: 350px;
        overflow: hidden;
    }

    .embed-instagram {
        width: 600px;
        height: 360px !important;
        max-height: 360px !important;
    }

    .embed-video iframe {
        width: 600px;
        height: 360px !important;
        max-height: 360px !important;
    }

    .embed-youtube iframe {
        width: 600px;
        height: 360px !important;
        max-height: 360px !important;
    }

    .img-thumbnail, .embed-youtube-img, .embed-image, .video-thumbnail {
        max-width: 128px;
        max-height: auto;
        cursor: pointer;
    }
}

img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

img {
    max-height: 512px;
}

@media (max-width: 1024px) { 
  @view-transition {
    navigation: auto;
  }

  ::view-transition-old(root) {
    animation: fadeOut 0.5s ease forwards;
  }

  ::view-transition-new(root) {
    animation: fadeIn 0.5s ease forwards;
  }


  @keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

    :root {
    --bs-body-bg: #cce6ff !important;
    }
    input ,textarea{
        background-color: #ffffff !important; /* 白色 */
    }

    .embed-post {
        padding: 12px;
    }

    .btn-spacing {
        margin-right: 10px;
    }

    /* ページナビゲーションのスタイル */
    .pagination-links {
        display: flex;
        justify-content: center;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    /* トップ/ボトムへのリンクのスタイル */
    #top,
    #btm {
        color: #007bff;
        text-decoration: none;
        font-weight: bold;
    }

    #top:hover,
    #btm:hover {
        text-decoration: underline;
    }

    /* 投稿本文のスタイル */
    .post-content {
        border-bottom: 1px solid #e0e0e0;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }

    /* 投稿リストの間隔 */
    .post-list {
        margin-top: 20px;
    }

    /* 投稿内容のスタイル */
    .post-header {
        font-size: 0.9rem;
        color: #6c757d;
    }

    .post-message {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    /* ボタンやリンクの余白調整 */
    .post-actions a,
    .post-vote {
        margin-right: 0px;
    }

    /* ID カウントリンクのスタイル */
    .post-user-id {
        color: #007bff;
    }

    .post-user-id:hover {
        text-decoration: underline;
    }

    /* 区切り線の調整 */
    hr {
        margin-top: 20px;
        margin-bottom: 20px;
    }

   /* ファイル表示部ベース設定 */
    .grid-item {
        position: relative;
        display: inline-block;
        width: 100%; /* デフォルトは1列表示 */
        margin-bottom: 16px;
    }

    /* 画像のレスポンシブスタイル */
    .responsive-img {
        width: 33%;
        height: auto;
    }

    /* タブレットサイズ（2列表示） */
    @media (min-width: 576px) {
        .grid-item {
            width: 25% !important;
        }
    }

    /* デスクトップサイズ（4列表示） */
    @media (min-width: 768px) {
        .grid-item {
            width: 20% !important;
        }
    }

    /* 大画面（4列表示） */
    @media (min-width: 992px) {
        .grid-item {
            width: 20% !important;
        }
    }

    /* 超大画面（6列表示） */
    @media (min-width: 1200px) {
        .grid-item {
            width: 16.66% !important;
        }
    }

    /* ファイルサイズオーバーレイを画像の下に表示するスタイル */
    .file-size-overlay {
        display: block; /* 幅を100%に広げるため */
        background-color: rgba(0, 0, 0, 0.3); /* 背景色 */
        color: #fff;
        width: 100%; /* 画像と同じ幅で表示 */
        padding: 3px 0;
        font-size: 0.8rem;
        font-weight: bold;
        text-align: center;
        border-radius: 0 0 4px 4px; /* 下部だけ角を丸く */
        box-sizing: border-box;
    }


    /* 画像の下に表示するための調整 */
    .file-item img {
    display: block;
    }
    .btn-spacing {
    margin-right: 10px;
    }

    /* ファイル一覧リンクのスタイル */
    .file-list-link {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    }




    @font-face {
    font-family: 'spleen-32x64'; /* フォント名を設定 */
    src: url('https://cdn.hamster.land/system/spleen-32x64.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


.breadcrumb {
    margin-top:16px;
}


.btn-spacing {
    padding: 0px 10px 0px 10px;
    text-align: center; /* テキストの中央揃え */
    letter-spacing: 5px; /* 文字間隔 */
    display: inline-block; /* ボタンをブロック要素のように表示 */
    vertical-align: middle; /* インライン要素内の垂直方向の中央揃え */
}


.user-icon {
    flex-shrink: 0;
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, #e0e0e0, #f8f8f8); /* グラデーション背景 */
    border: 2px solid #ddd; /* 外枠 */
    border-radius: 12px; /* 丸い形 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* ソフトな影 */
    display: flex; /* 中央揃えのためにフレックスボックス */
    align-items: center; /* 垂直方向中央揃え */
    justify-content: center; /* 水平方向中央揃え */
    overflow: hidden; /* 画像が枠を超えないようにする */
}

.user-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠に合わせてトリミング */
    border-radius: 12px; /* 画像も丸くする */
}

.disabled {
    pointer-events: none; /* クリック無効 */
    background-color: #e0e0e0; /* 背景色を灰色に */
    color: #a0a0a0; /* 文字色を薄い灰色に */
    cursor: not-allowed; /* カーソルを変更 */
}

    /* 画像のレスポンシブスタイル */
    .responsive-img {
    width: 33%;
    height: auto;
    }
    
    /* タブレットサイズ（2列表示） */
    @media (min-width: 576px) {
    .grid-item {
    width: 25% !important;
    }
    }
    
    /* デスクトップサイズ（4列表示） */
    @media (min-width: 768px) {
    .grid-item {
    width: 20% !important;
    }
    }
    
    /* 大画面（4列表示） */
    @media (min-width: 992px) {
    .grid-item {
    width: 20% !important;
    }
    }
    
    /* 超大画面（6列表示） */
    @media (min-width: 1200px) {
    .grid-item {
    width: 16.66% !important;
    }
    }
    
    /* ファイルサイズオーバーレイを画像の下に表示するスタイル */
    .file-size-overlay {
    display: block; /* 幅を100%に広げるため */
    background-color: rgba(0, 0, 0, 0.3); /* 背景色 */
    color: #fff;
    width: 100%; /* 画像と同じ幅で表示 */
    padding: 3px 0;
    font-size: 0.8rem;
    font-weight: bold;
    text-align: center;
    border-radius: 0 0 4px 4px; /* 下部だけ角を丸く */
    box-sizing: border-box;
    }
    
    
    /* 画像の下に表示するための調整 */
    .file-item img {
    display: block;
    }
    .btn-spacing {
    margin-right: 10px;
}

.thread {
    margin: 0px 0px 8px 8px;
}

@media (prefers-color-scheme: dark) {
    /* navbar本体の背景色を暗色にする */
    nav.navbar {
        background-color: #212529 !important; /* bg-dark 相当 */
    }
    /* ナビバー内の文字（リンクやブランド名）を白くする */
    nav.navbar a.nav-link, 
    nav.navbar .navbar-brand {
        color: #ffffff !important;
    }
    /* ホバー時の色を少し薄くする例 */
    nav.navbar a.nav-link:hover {
        color: #cccccc !important;
    }
    /* navbar-togglerアイコンの色を明るく */
    .navbar-dark .navbar-toggler-icon {
        filter: invert(1) brightness(200%);
    }
}

.btn.vote-btn[data-vote-type="good"] {
    background-color: light-dark(#00bbbb, #cccccc);
    color: light-dark(#ffffff, #000000);
}
.btn.vote-btn[data-vote-type="bad"] {
    background-color: light-dark(#cc0000, #cccccc);
    color: light-dark(#ffffff, #000000)
}

/* 投稿全体 */
.posts{
position: relative; /* ← 擬似要素の基準 */
border: 1px solid #000; /* フォールバック */
border: 1px solid light-dark(#000,#ccc); /* 好みで残す */
padding: 15px;
border-radius: 5px;
margin: 0 3px 15px;
background-color: #F8F9FA; /* 単色のみ残す */
overflow: hidden; /* 角丸に合わせる */
}

/* パターンだけ描画して薄くする */
.posts::before{
content: "";
position: absolute;
inset: 0; /* ≒ top:0; right:0; … */
background: url("https://cdn.hamster.land/1/admin/fd9c18010b.png")
top left / 120px repeat; /* サイズはお好みで */
opacity: 0.33; /* ★ 濃さ調整 */
pointer-events: none; /* クリック透過 */
z-index: 0; /* 後ろへ */
}

/* 中身を前面へ（任意）*/
.posts > *{ z-index: 1; position: relative; }

/* 埋め込み用は縁だけ外す（背景は使い回し可）*/
.embed-post .posts{ border:none; }