



: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; }
  }
}

@font-face {
    font-family: 'spleen-32x64'; /* フォント名を設定 */
    src: url('https://cdn.hamster.land/system/spleen-32x64.otf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    font-family: 'spleen-32x64', sans-serif; /* フォントを適用 */
}

/* OSのカラースキームに従う（defaultの場合） */
@media (prefers-color-scheme: light) {
    html[data-theme="default"] {
        --background-image: url('https://cdn.hamster.land/system/backimage-light.gif');
    }
}
@media (prefers-color-scheme: dark) {
    html[data-theme="default"] {
        --background-image: url('https://cdn.hamster.land/system/backimage-dark.gif');
    }
}

/* 手動設定（ライトモード） */
html[data-theme="light"] {
    --background-image: url('https://cdn.hamster.land/system/backimage-light.gif');
}

/* 手動設定（ダークモード） */
html[data-theme="dark"] {
    --background-image: url('https://cdn.hamster.land/system/backimage-dark.gif');
}

body {
    background-image: var(--background-image);
}


.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 {
    /* まず古いブラウザ向けの確実な色を指定 */
    border: 1px solid #000; /* 例: ライトモード用の色 */
    border: 1px solid light-dark(#000000, #cccccc);
    padding: 15px; /* 内側の余白 */
    border-radius: 5px; /* 角を丸くする */
    margin: 0px 3px 15px 3px;
}
.embed-post .posts {
    border: none;
}