/* リセットCSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* スクロールの自然な挙動（スムーススクロール・アンカー余白） */
:root {
    --header-height: 72px;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height); /* 固定ヘッダー分。アンカーリンクで飛んだときに見切れないように */
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* キーボードフォーカス（:focus-visible）グローバルルール */
:focus-visible {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* スクリーンリーダー専用（視覚的に非表示だがアクセシブル） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* モバイルファースト（デフォルト: スマートフォン） */
/* びわ湖をイメージした配色 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(180deg, #E8F4F8 0%, #F0F8FF 100%);
    min-height: 100vh;
    padding-top: var(--header-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* コンテナ（モバイル: 16px、タブレット: 24px、PC: 32px） */
.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
}

/* パンくずリスト */
.breadcrumbs {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

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

.breadcrumbs-link {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs-link:hover {
    color: #004499;
    text-decoration: underline;
}

.breadcrumbs-link:focus {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.breadcrumbs-separator {
    margin: 0 0.5rem;
    color: #666;
    font-size: 0.875rem;
}

.breadcrumbs-current {
    color: #333;
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumbs {
        font-size: 0.875rem;
    }

    .breadcrumbs-separator {
        margin: 0 0.25rem;
    }
}

/* ヘッダー（モバイル優先）
   backdrop-filter は ::before に分離。
   backdrop-filter を .header 自体に置くと新しい containing block が生成され、
   内部の position:fixed 要素（ハンバーガーメニュー等）がヘッダー領域に閉じ込められるため。 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(74, 144, 226, 0.15);
    transition: transform 0.25s ease;
}
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(91, 163, 245, 0.92);
    background: linear-gradient(135deg, rgba(91, 163, 245, 0.95) 0%, rgba(74, 144, 226, 0.95) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: -1;
}
/* 上スクロール中はヘッダーを非表示 */
.header.header-hidden {
    transform: translateY(-100%);
}
/* 詳細ページなどではヘッダー常時表示（header-scroll.js と連動） */
body.always-show-header .header {
    transform: none !important;
}

.header .container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    text-align: center;
}

.logo a {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    gap: 8px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 16px; /* iOSでズームを防ぐ */
    min-height: 44px; /* タップ領域の最小サイズ */
    background-color: rgba(255, 255, 255, 0.9);
    -webkit-appearance: none;
    appearance: none;
}

.search-button {
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    min-height: 44px; /* タップ領域の最小サイズ */
    min-width: 64px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    backdrop-filter: blur(10px);
}

.search-button:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ブログ検索（ボディ上部） */
.blog-search-wrap {
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    padding: 16px 0;
    border-bottom: 1px solid rgba(74, 144, 226, 0.15);
}
.blog-search-wrap .search-form-body {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
}
.blog-search-wrap .search-form-body .search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #c5d9ed;
    border-radius: 12px;
    font-size: 16px;
    min-height: 44px;
    background-color: #fff;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
}
.blog-search-wrap .search-form-body .search-input::placeholder {
    color: #666;
}
.blog-search-wrap .search-form-body .search-button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #fff;
    border: 1px solid #357ABD;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    min-height: 44px;
    min-width: 64px;
    font-weight: 500;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.blog-search-wrap .search-form-body .search-button:hover {
    background: linear-gradient(135deg, #357ABD 0%, #2a6ba8 100%);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}
.blog-search-wrap .search-form-body .search-button:active {
    background: #2a6ba8;
}

/* ハンバーガーメニューボタン */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
    position: relative;
    -webkit-tap-highlight-color: transparent; /* iOS タップ時のハイライトを無効化 */
    touch-action: manipulation; /* ダブルタップズームを防止 */
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ハンバーガーメニューオーバーレイ */
.hamburger-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hamburger-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 768px) {
    .hamburger-overlay {
        display: none;
    }
}

/* ハンバーガーメニュー */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.hamburger-menu.active {
    right: 0;
}

.hamburger-menu-header {
    padding: 20px 16px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #5BA3F5 0%, #4A90E2 100%);
}

.hamburger-menu-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.hamburger-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.hamburger-menu-item {
    border-bottom: 1px solid #e0e0e0;
}

.hamburger-menu-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-menu-link .menu-icon {
    margin-right: 8px;
    font-size: 18px;
    line-height: 1;
}

.hamburger-menu-link:hover,
.hamburger-menu-link:active {
    background-color: #f0f0f0;
}

.hamburger-menu-link-primary {
    background: linear-gradient(135deg, #5BA3F5 0%, #4A90E2 100%);
    color: #fff;
    font-weight: 600;
}

.hamburger-menu-link-primary:hover,
.hamburger-menu-link-primary:active {
    background: linear-gradient(135deg, #4A90E2 0%, #3A7BC8 100%);
}

.hamburger-menu-user {
    display: block;
    padding: 16px 20px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.hamburger-menu-section {
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.hamburger-menu-section-title {
    display: block;
    padding: 12px 20px;
    color: #5BA3F5;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hamburger-menu-footer {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.hamburger-menu-version {
    font-size: 12px;
    color: #999;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.menu-label-short {
    display: none;
}

.hamburger-menu-dropdown-toggle {
    display: none;
}

.hamburger-menu-dropdown {
    border-bottom: none;
}

.hamburger-menu-dropdown > .hamburger-menu-section-title {
    display: block;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.hamburger-menu-dropdown-panel {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hamburger-menu-dropdown-panel .hamburger-menu-link {
    padding-left: 28px;
}

.hamburger-menu-account {
    border-top: 1px solid #e0e0e0;
}

.hamburger-menu-account .hamburger-menu-link,
.hamburger-menu-account .hamburger-menu-user {
    border-bottom: 1px solid #e0e0e0;
}

@media (min-width: 768px) {
    /* PC: 2行固定（1行目=ロゴ、2行目=日常ナビ+アカウント）。管理者ツールはドロップダウンへ */
    .header .container {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        position: relative;
        gap: 8px 16px;
    }

    .header-top {
        flex-shrink: 0;
        order: 1;
        width: auto;
        flex: 1 1 auto;
        min-width: 0;
    }

    .hamburger-btn {
        display: none;
    }

    .hamburger-overlay {
        display: none;
    }

    .nav {
        order: 1;
        flex: 1;
        display: flex;
        justify-content: flex-end;
        margin-left: 20px;
        margin-right: 0;
        min-width: 0;
    }

    .search-form {
        width: auto;
        max-width: 300px;
        flex-shrink: 1;
    }

    .hamburger-menu {
        position: static;
        order: 2;
        width: 100%;
        max-width: none;
        height: auto;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        transform: none;
        flex-shrink: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding: 8px 0 0;
        margin-top: 0;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px 12px;
    }

    .hamburger-menu.active {
        right: auto;
    }

    .hamburger-menu-header {
        display: none;
    }

    .hamburger-menu-list {
        display: flex;
        align-items: center;
        gap: 2px 0;
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
        min-width: 0;
    }

    .hamburger-menu-item {
        border-bottom: none;
        flex-shrink: 0;
        position: relative;
    }

    .hamburger-menu-link {
        padding: 6px 10px;
        background-color: transparent;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .hamburger-menu-link:hover {
        background-color: rgba(255, 255, 255, 0.18);
    }

    .hamburger-menu-link:active {
        background-color: rgba(255, 255, 255, 0.28);
    }

    .hamburger-menu-link-primary {
        background: rgba(255, 255, 255, 0.22);
        color: #fff;
        border: 1px solid rgba(255, 255, 255, 0.35);
        font-weight: 600;
    }

    .hamburger-menu-link-primary:hover {
        background-color: rgba(255, 255, 255, 0.32);
    }

    .hamburger-menu-user {
        padding: 0 4px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        flex-shrink: 0;
        border-bottom: none;
    }

    .menu-label-long {
        display: none;
    }

    .menu-label-short {
        display: inline;
    }

    .hamburger-menu-dropdown {
        position: relative;
    }

    .hamburger-menu-dropdown > .hamburger-menu-section-title {
        display: none;
    }

    .hamburger-menu-dropdown-toggle {
        display: inline-flex;
        align-items: center;
        padding: 6px 10px;
        background: transparent;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 13px;
        font-weight: 500;
        min-height: 32px;
        cursor: pointer;
        white-space: nowrap;
        font-family: inherit;
    }

    .hamburger-menu-dropdown-toggle::after {
        content: '';
        display: inline-block;
        width: 0;
        height: 0;
        margin-left: 6px;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 5px solid currentColor;
    }

    .hamburger-menu-dropdown-toggle:hover,
    .hamburger-menu-dropdown.is-open .hamburger-menu-dropdown-toggle {
        background-color: rgba(255, 255, 255, 0.18);
    }

    .hamburger-menu-dropdown-panel {
        display: none;
        position: absolute;
        top: calc(100% - 2px);
        left: 0;
        min-width: 240px;
        padding: 8px 0;
        margin-top: 0;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
        z-index: 1100;
    }

    .hamburger-menu-dropdown-panel::before {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: -8px;
        height: 8px;
    }

    .hamburger-menu-list > .hamburger-menu-dropdown:last-child .hamburger-menu-dropdown-panel {
        left: auto;
        right: 0;
    }

    .hamburger-menu-dropdown:hover .hamburger-menu-dropdown-panel,
    .hamburger-menu-dropdown.is-open .hamburger-menu-dropdown-panel {
        display: block;
    }

    .hamburger-menu-dropdown-panel .hamburger-menu-item {
        display: block;
        width: 100%;
    }

    .hamburger-menu-dropdown-panel .hamburger-menu-link {
        display: flex;
        width: 100%;
        padding: 10px 16px;
        color: #2c3e50;
        font-size: 14px;
        border-radius: 0;
        min-height: 40px;
        white-space: normal;
    }

    .hamburger-menu-dropdown-panel .hamburger-menu-link:hover,
    .hamburger-menu-dropdown-panel .hamburger-menu-link:focus {
        background-color: #f0f6fc;
        color: #1a5276;
    }

    .hamburger-menu-account {
        display: flex;
        align-items: center;
        gap: 4px 8px;
        flex-shrink: 0;
        margin-left: auto;
        border-top: none;
        padding-left: 12px;
        border-left: 1px solid rgba(255, 255, 255, 0.28);
    }

    .hamburger-menu-account .hamburger-menu-link,
    .hamburger-menu-account .hamburger-menu-user {
        border-bottom: none;
    }

    .hamburger-menu-footer {
        margin-left: 0;
        margin-top: 0;
        padding: 0;
        border-top: none;
        background-color: transparent;
        flex-shrink: 0;
    }

    .hamburger-menu-version {
        color: rgba(255, 255, 255, 0.65);
        font-size: 11px;
        white-space: nowrap;
    }
}

/* メインコンテンツ */
.main {
    min-height: calc(100vh - 200px);
    padding: 24px 0;
}

/* メッセージ表示 */
.messages-container {
    max-width: 1200px;
    margin: 0 auto 24px;
    padding: 0 16px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.message-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.page-title {
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
}

.search-results {
    margin-bottom: 16px;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.1);
}

/* グリッドレイアウト（モバイル: 1列） */
.post-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 16px;
    margin-bottom: 32px;
    /* スクロール時の再描画範囲を限定 */
    contain: layout style;
}

/* 投稿アイテム */
.post-item {
    position: relative;
    background-color: #fff;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* スクロール性能向上: レイアウト計算を分離（他要素への影響を限定） */
    contain: layout style paint;
    /* オフスクリーン要素のレンダリングを遅延（描画コスト削減） */
    content-visibility: auto;
    contain-intrinsic-size: auto 280px;
}

.post-item:active {
    transform: scale(0.98);
}

.post-link {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* ストレッチドリンク: カード全体をタップで詳細へ遷移 */
.post-link-stretch {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* タグはストレッチドリンクより前面（タグクリックで絞り込み） */
.post-tags-above-link {
    position: relative;
    z-index: 2;
    pointer-events: auto;
}

/* 日付・タイトル・プレースホルダー内要素もクリック透過 */
.post-item .post-thumbnail *,
.post-item .post-info .post-date,
.post-item .post-info .post-title {
    pointer-events: none;
}

.post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px 16px 0 0;
}

/* !important: CMS由来の <img style="width:…; height:…"> インラインスタイルを上書きするため必須 */
.post-thumbnail .thumbnail-image {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    object-fit: cover !important;
    object-position: center center !important;
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    display: block;
    border-radius: 0;
    /* ドラッグを無効化（タップで詳細遷移を確実に） */
    -webkit-user-drag: none;
    user-drag: none;
}

/* サムネイル・投稿情報はクリックをストレッチドリンクへ透過 */
.post-item .post-thumbnail,
.post-item .post-info,
.post-item .post-date,
.post-item .post-title {
    pointer-events: none;
}

/* カード全体でポインターカーソル表示 */
.post-item {
    cursor: pointer;
}

/* YouTubeサムネイルの場合のオーバーレイ */
.post-thumbnail.youtube-thumbnail {
    position: relative;
}

.post-thumbnail.youtube-thumbnail::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.post-thumbnail.youtube-thumbnail:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.post-thumbnail.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    aspect-ratio: 16 / 9;
    gap: 8px;
}

.post-thumbnail.placeholder-card {
    isolation: isolate;
    gap: 7px;
    padding: 18px;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.36) 0 14%, transparent 15%),
        radial-gradient(circle at 86% 76%, rgba(255, 255, 255, 0.22) 0 17%, transparent 18%),
        linear-gradient(135deg, #1d4ed8 0%, #38bdf8 52%, #0f766e 100%);
}

.post-thumbnail.placeholder-card::before,
.post-thumbnail.placeholder-card::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

.post-thumbnail.placeholder-card::before {
    inset: 12px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 14px;
}

.post-thumbnail.placeholder-card::after {
    right: -32px;
    bottom: -42px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
}

.post-thumbnail.placeholder-blog {
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.36) 0 13%, transparent 14%),
        radial-gradient(circle at 86% 74%, rgba(255, 255, 255, 0.2) 0 16%, transparent 17%),
        linear-gradient(135deg, #2563eb 0%, #0ea5e9 48%, #14b8a6 100%);
}

.post-thumbnail.placeholder-announcement {
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.34) 0 13%, transparent 14%),
        radial-gradient(circle at 84% 74%, rgba(255, 255, 255, 0.18) 0 16%, transparent 17%),
        linear-gradient(135deg, #0f766e 0%, #22c55e 45%, #60a5fa 100%);
}

.post-thumbnail.placeholder-important {
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.34) 0 13%, transparent 14%),
        radial-gradient(circle at 84% 74%, rgba(255, 255, 255, 0.2) 0 16%, transparent 17%),
        linear-gradient(135deg, #b91c1c 0%, #f97316 46%, #facc15 100%);
}

.post-thumbnail.placeholder-youtube {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.post-thumbnail.placeholder-text {
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
}

.placeholder-icon {
    font-size: 48px;
    line-height: 1;
    opacity: 0.7;
}

.placeholder-icon.youtube-icon {
    color: #fff;
    font-size: 56px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.placeholder-icon.text-icon {
    color: #5BA3F5;
    font-size: 48px;
}

.placeholder-card .placeholder-icon.text-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.76);
    border-radius: 16px;
    font-size: 24px;
    font-weight: 800;
    opacity: 1;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(4px);
}

.placeholder-text {
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.placeholder-card .placeholder-kicker,
.placeholder-card .placeholder-subtext,
.placeholder-card .placeholder-text {
    color: #fff;
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.26);
}

.placeholder-card .placeholder-kicker {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.placeholder-card .placeholder-text {
    max-width: 92%;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.placeholder-card .placeholder-subtext {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.88;
}

.post-thumbnail.placeholder-youtube .placeholder-text {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 投稿情報（画像の下に表示） */
.post-info {
    padding: 12px 8px;
}

.post-date {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    display: block;
}

.post-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.post-item .tag {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #4a8a34 0%, #3d7a2a 100%);
    border-radius: 16px;
    font-size: 12px;
    color: #fff;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(74, 138, 52, 0.3);
}

.post-item .post-tags a.tag {
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.post-item .post-tags a.tag:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.tag-filter-results {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    border-radius: 12px;
    font-size: 14px;
    color: #333;
}
.tag-filter-results .tag-filter-clear {
    margin-left: 12px;
    color: #4A90E2;
    text-decoration: none;
    font-size: 13px;
}
.tag-filter-results .tag-filter-clear:hover {
    text-decoration: underline;
}

/* ブログ一覧のグリッドラッパー（リフロー範囲の限定） */
.post-grid-wrap {
    contain: layout style;
}

/* 記事詳細ページ（フルスクリーン時は post-detail.css で上書き） */
.post-detail {
    max-width: 100%;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.post-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #E8F4F8;
}

.post-detail-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    color: #2c3e50;
    margin-bottom: 12px;
    word-break: break-word;
}

.post-detail .post-title {
    font-size: 24px;
    margin-bottom: 16px;
    color: #333;
    line-height: 1.4;
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

.post-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.post-detail .post-date {
    font-size: 14px;
    color: #666;
}

.post-detail .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-detail .tag {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #4a8a34 0%, #3d7a2a 100%);
    border-radius: 16px;
    font-size: 13px;
    color: #fff;
    min-height: 28px;
    box-shadow: 0 1px 3px rgba(74, 138, 52, 0.3);
}
.post-detail .post-tags a.tag {
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s ease;
}
.post-detail .post-tags a.tag:hover {
    opacity: 0.9;
}

.post-content {
    margin-bottom: 32px;
    line-height: 1.8;
    font-size: 16px;
}

.post-content img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
    /* 画像を統一サイズに */
    display: block;
    object-fit: contain;
    object-position: center;
    aspect-ratio: 16 / 9; /* 16:9のアスペクト比を強制 */
    max-height: 600px;
    background-color: #f8f9fa;
}

/* スライダーやモザイク内の画像は除外 */
.post-content .slider-item img,
.post-content .mosaic-item img {
    aspect-ratio: 16 / 9; /* スライダー内も16:9に統一 */
    object-fit: cover; /* スライダー内はcover */
    max-height: none;
}

/* !important: CMS由来のインラインスタイル上書き */
.post-content .thumbnail-image {
    max-width: none !important;
    height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.post-content p {
    margin-bottom: 16px;
}

/* YouTube埋め込み用のレスポンシブラッパー */
.youtube-embed-wrapper {
    position: relative;
    width: 100%;
    margin: 24px 0;
    overflow: hidden;
    border-radius: 16px; /* スライダーと統一 */
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
    background-color: #000;
    /* 16:9のアスペクト比を維持しつつ最大高さを制限 */
    aspect-ratio: 16 / 9;
    max-height: 600px; /* スライダーと統一 */
}

.youtube-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 複数画像の縦並び表示 */
.post-content .image-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 24px 0;
    width: 100%;
    min-width: 0;
}

.post-content .image-stack-item {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
/* !important: CMS由来のインラインスタイル上書き */
.post-content .image-stack-item img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    box-sizing: border-box;
}

/* 画像スライダー（レガシー・他ページ用に残す） */
.image-slider {
    position: relative;
    width: 100%;
    margin: 24px 0;
    overflow: hidden;
    border-radius: 16px;
    background: transparent;
}

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: transparent;
}

.slider-track {
    display: flex;
    transition: transform 0.3s ease;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
    background: transparent;
}

.slider-item {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* モバイル向け: 16:9のアスペクト比に統一 */
    aspect-ratio: 16 / 9;
    max-height: 600px;
}

.slider-item img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 16px;
    object-fit: cover; /* containからcoverに変更して統一感を出す */
    background: #f8f9fa;
    transform: translateZ(0);
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    user-select: none;
}

.slider-nav:active {
    background-color: rgba(0, 0, 0, 0.7);
}

.slider-prev {
    left: 12px;
}

.slider-next {
    right: 12px;
}

.slider-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    position: relative;
    margin-top: 12px;
    background: transparent;
}

.slider-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background-color: rgba(74, 144, 226, 0.4);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.slider-indicator.active {
    background-color: #4a90e2;
    transform: scale(1.3);
}

.slider-indicator:hover {
    background-color: rgba(74, 144, 226, 0.6);
}

.slider-indicator:active {
    transform: scale(1.1);
}

/* モザイク形式の画像ギャラリー */
.image-mosaic {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    margin: 24px 0;
    border-radius: 16px;
    overflow: hidden;
}

.mosaic-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.mosaic-main {
    grid-row: 1 / 3;
    aspect-ratio: 4 / 5;
}

.mosaic-thumb {
    aspect-ratio: 1 / 1;
}

.mosaic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.mosaic-item:hover img {
    transform: scale(1.05);
}

/* モザイク形式（3枚の場合） */
.image-mosaic:has(.mosaic-item:nth-child(3):last-child) {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.image-mosaic:has(.mosaic-item:nth-child(3):last-child) .mosaic-main {
    grid-row: 1 / 3;
    grid-column: 1;
}

/* モザイク形式（4枚以上の場合） */
.image-mosaic:has(.mosaic-item:nth-child(4)) {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.image-mosaic:has(.mosaic-item:nth-child(4)) .mosaic-main {
    grid-row: 1 / 3;
    grid-column: 1;
}

/* モバイル対応（モザイク） */
@media (max-width: 767px) {
    .image-mosaic {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .mosaic-main {
        grid-row: 1;
        grid-column: 1;
        aspect-ratio: 4 / 5;
    }
    
    .mosaic-thumb {
        aspect-ratio: 4 / 5;
    }
    
    /* モバイルでの画像サイズ調整 */
    .post-content img {
        max-height: 300px;
    }
    
    .placeholder-icon {
        font-size: 36px;
    }
    .placeholder-icon.youtube-icon {
        font-size: 42px;
    }
    .placeholder-icon.text-icon {
        font-size: 36px;
    }
    .related-post-thumbnail .placeholder-icon {
        font-size: 24px;
    }
    .related-post-thumbnail .placeholder-icon.youtube-icon {
        font-size: 28px;
    }
    .related-post-thumbnail .placeholder-icon.text-icon {
        font-size: 24px;
    }
}

/* 関連投稿（スクロール表示） */
.related-posts {
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.related-posts-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

.related-posts-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    padding-bottom: 8px;
}

.related-posts-scroll::-webkit-scrollbar {
    height: 6px;
}

.related-posts-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.related-posts-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.related-posts-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.related-posts-container {
    display: flex;
    gap: 16px;
    padding-bottom: 8px;
}

.related-post-item {
    flex-shrink: 0;
    width: 200px;
    text-decoration: none;
    color: inherit;
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.related-post-item:active {
    transform: scale(0.98);
}

.related-post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    position: relative;
    border-radius: 16px 16px 0 0;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 関連投稿のYouTubeサムネイルオーバーレイ */
.related-post-thumbnail.youtube-thumbnail {
    position: relative;
}

.related-post-thumbnail.youtube-thumbnail::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    color: #fff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.related-post-thumbnail.youtube-thumbnail:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

.related-post-thumbnail.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    gap: 6px;
}

.related-post-thumbnail.placeholder-youtube {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
}

.related-post-thumbnail .placeholder-icon {
    font-size: 32px;
    line-height: 1;
    opacity: 0.7;
}

.related-post-thumbnail .placeholder-icon.youtube-icon {
    color: #fff;
    font-size: 36px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.related-post-thumbnail .placeholder-icon.text-icon {
    color: #5BA3F5;
    font-size: 32px;
}

.related-post-thumbnail .placeholder-text {
    color: #666;
    font-size: 10px;
    font-weight: 500;
}

.related-post-thumbnail.placeholder-youtube .placeholder-text {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.related-post-info {
    padding: 12px;
}

.related-post-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-date {
    font-size: 11px;
    color: #666;
    display: block;
}

.post-footer {
    text-align: center;
    margin-top: 32px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    background: #2c5aa0;
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-size: 17px;
    min-height: 52px;
    min-width: 180px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.4);
    border: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 矢印アイコン */
.back-link::before {
    content: '←';
    font-size: 20px;
    font-weight: bold;
}

.back-link:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.pagination-link {
    padding: 12px 20px;
    background: linear-gradient(135deg, #E8F4F8 0%, #D4E8F5 100%);
    color: #2c3e50;
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    min-height: 44px;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.1);
}

.pagination-link:active {
    transform: scale(0.98);
    box-shadow: 0 1px 2px rgba(74, 144, 226, 0.1);
}

.pagination-current {
    font-size: 14px;
    color: #666;
    padding: 12px;
}

.no-posts {
    text-align: center;
    padding: 48px 16px;
    color: #666;
}

/* フッター */
.footer {
    background: linear-gradient(135deg, #4A90E2 0%, #5BA3F5 100%);
    padding: 24px 0;
    margin-top: 48px;
    text-align: center;
    color: #fff;
    font-size: 12px;
    box-shadow: 0 -2px 8px rgba(74, 144, 226, 0.2);
}

.footer p {
    margin: 0;
}

.footer-links {
    margin-bottom: 8px;
}

.footer-links a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer-links a + a {
    margin-left: 16px;
}

/* タブレット（768px以上） */
@media (min-width: 768px) {
    :root {
        --header-height: 108px;
    }
    body {
        font-size: 17px;
    }
    
    .container {
        padding: 0 24px;
        max-width: 1200px;
    }
    
    .header {
        padding: 12px 0;
    }
    
    .header .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 8px 16px;
    }
    
    .logo {
        text-align: left;
    }
    
    .logo a {
        font-size: 24px;
    }
    
    .search-form {
        width: auto;
    }
    
    .search-input {
        width: 240px;
    }
    
    .main {
        padding: 32px 0;
    }
    
    .page-title {
        font-size: 28px;
        margin-bottom: 32px;
    }
    
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .post-info {
        padding: 16px;
    }
    
    .post-date {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .post-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .post-item .tag {
        font-size: 11px;
        padding: 3px 10px;
    }
    
    .post-detail {
        max-width: 800px;
    }
    
    .slider-item {
        /* タブレット向け: 4:3のアスペクト比 */
        aspect-ratio: 4 / 3;
        max-height: 70vh;
    }
    
    .slider-nav {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
    
    .slider-prev {
        left: 16px;
    }
    
    .slider-next {
        right: 16px;
    }
    
    .slider-indicator {
        width: 10px;
        height: 10px;
    }
    
    .post-header {
        margin-bottom: 32px;
        padding-bottom: 20px;
    }

    .post-detail-title {
        font-size: 26px;
    }
    
    .post-detail .post-title {
        font-size: 32px;
        margin-bottom: 20px;
    }
    
    .related-posts {
        margin: 40px 0;
    }
    
    .related-posts-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .related-post-item {
        width: 240px;
    }
    
    .related-post-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    .post-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .post-item:hover .thumbnail-image {
        transform: scale(1.02);
    }
    
    .search-button:hover {
        background-color: rgba(255, 255, 255, 0.3);
    }
    
    .back-link:hover {
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(44, 90, 160, 0.5);
        background: #3d6db5;
    }
    
    .pagination-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2);
    }
}

/* PC（1024px以上） */
@media (min-width: 1024px) {
    :root {
        --header-height: 108px;
    }
    body {
        font-size: 18px;
    }
    
    .container {
        padding: 0 32px;
    }
    
    .header {
        padding: 12px 0;
    }

    .header .container {
        gap: 8px 16px;
    }

    .nav {
        margin-left: 24px;
        margin-right: 24px;
    }

    .search-form {
        max-width: 350px;
    }
    
    .main {
        padding: 40px 0;
    }
    
    .page-title {
        font-size: 32px;
        margin-bottom: 40px;
    }
    
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
    
    .post-detail .post-title {
        font-size: 36px;
    }
    
    .post-content {
        font-size: 18px;
    }
    
    .post-content img {
        max-height: 600px;
    }
    
    .slider-item {
        /* デスクトップ向け: 4:3のアスペクト比、最大高さ制限 */
        aspect-ratio: 4 / 3;
        max-height: 500px;
    }
    
    .related-posts {
        margin: 48px 0;
    }
    
    .related-posts-title {
        font-size: 28px;
        margin-bottom: 24px;
    }
    
    .related-post-item {
        width: 280px;
    }
    
    .slider-nav {
        width: 56px;
        height: 56px;
        font-size: 32px;
    }
    
    .slider-prev {
        left: 24px;
    }
    
    .slider-next {
        right: 24px;
    }
    
    .slider-indicator {
        width: 12px;
        height: 12px;
    }
    
    .footer {
        font-size: 14px;
    }
}

/* ========== ライトボックス（画像拡大表示） ========== */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox-overlay.lightbox-open {
    display: flex;
    opacity: 1;
}
body.lightbox-active {
    overflow: hidden;
}
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}
@media (min-width: 1024px) {
    .lightbox-image {
        max-width: min(1200px, 90vw);
    }
}
.lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10001;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.35);
}
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    transition: background 0.2s ease;
    z-index: 2;
}
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.35);
}
@media (max-width: 767px) {
    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}
.lightbox-counter {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

/* ── Toastr カスタマイズ ── */
#toast-container {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "MS PGothic", sans-serif;
}
#toast-container > div {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    padding: 16px 20px;
}
#toast-container > .toast-success { background-color: #5BA3F5; }
#toast-container > .toast-error   { background-color: #e74c3c; }
#toast-container > .toast-warning { background-color: #f39c12; }
#toast-container > .toast-info    { background-color: #3498db; }
.toast-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}
.toast-message {
    font-size: 14px;
    line-height: 1.5;
}
@media (max-width: 768px) {
    #toast-container {
        width: 90%;
        max-width: 300px;
    }
    #toast-container.toast-top-right {
        right: 5%;
        top: 20px;
    }
}

/* モバイル GPU 負荷軽減: backdrop-filter を不透明背景に置換 */
@media (max-width: 768px) {
    .header::before {
        background: linear-gradient(135deg, #5BA3F5 0%, #4A90E2 100%);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .search-button {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background-color: rgba(255, 255, 255, 0.25);
    }
}

/* ========== 無限スクロール UI ========== */
.scroll-sentinel-top,
.scroll-sentinel-bottom {
    height: 10px;
    margin: 20px 0;
    width: 100%;
    background: transparent;
}

.loading-indicator-top,
.loading-indicator-bottom {
    display: none;
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
}

.loading-indicator-top::after,
.loading-indicator-bottom::after {
    content: '読み込み中...';
}

.end-message {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.error-message {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
    font-size: 14px;
}

/* ===== 上部へ戻るボタン（全ページ共通） ===== */
.scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 144, 226, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.15s;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: rgba(53, 122, 189, 0.95);
}

.scroll-to-top svg {
    pointer-events: none;
}
