/* ==========================================================
   MakeYourScorpion - スタイルシート
   デザインコンセプト:
   色  : ホワイトベース × レーシングレッド(#C8102E)のアクセント
   書体: 見出し=Oswald(コンデンス体でレーシー) / 本文=Noto Sans JP
   特徴: ヘッダーの斜めストライプ + 背景に薄く動画を再生
   ========================================================== */

:root {
    --color-bg: #f7f6f3;
    --color-bg-alt: #ffffff;
    --color-card: rgba(255, 255, 255, 0.55);
    --color-card-hover: rgba(255, 255, 255, 0.75);
    --color-border: #e3e1db;
    --color-red: #c8102e;
    --color-red-dark: #8f0c21;
    --color-text: #1c1c1c;
    --color-text-muted: #6b6b6b;
    --color-gold: #9c7a1e;

    --font-display: 'Oswald', 'Noto Sans JP', sans-serif;
    --font-body: 'Noto Sans JP', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- 背景動画 ---------- */
.bg-video-wrap {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #f7f6f3;
}

.bg-video-wrap iframe {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 56.25vw; /* 16:9を維持しながら横幅いっぱいに拡大。縦は画面をはみ出してOK */
    transform: translateY(-50%);
    pointer-events: none;
}

/* スマホ: 縦型動画を使うため、YouTube埋め込みの黒帯(左右)を除いた
   実際の映像部分が画面いっぱいに広がるよう、iframe自体を拡大してクロップする */
@media (max-width: 900px) {
    .bg-video-wrap iframe {
        top: 50%;
        left: 50%;
        width: calc(max(100vh, 177.78vw) * 16 / 9);
        height: max(100vh, 177.78vw);
        transform: translate(-50%, -50%);
    }
}

.bg-video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.38) 0%, rgba(247,246,243,0.45) 100%);
}

.page-content {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .bg-video-wrap { display: none; }
}

/* ---------- ヘッダー(イタリア国旗風の3色構成: 緑/白/赤) ---------- */
.site-header-flag {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
}

.header-flex {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    width: 100%;
    margin: 0;
    max-width: none;
}

.header-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 16px 22px;
}

.header-col-left {
    flex: 0 0 500px;
    background: linear-gradient(135deg, #00a651 0%, #007a3a 100%);
}

.header-col-center {
    flex: 1 1 320px;
    min-width: 260px;
    background: linear-gradient(135deg, #ffffff 0%, #f2f0ea 100%);
    justify-content: flex-start;
    align-items: center;
    text-align: center;
}

.header-col-right {
    flex: 0 0 500px;
    background: linear-gradient(135deg, #e0303e 0%, #a3121d 100%);
    justify-content: center;
}

.header-brand {
    flex-shrink: 0;
    text-align: left;
}

.eyebrow-mini {
    font-family: var(--font-display);
    letter-spacing: 0.22em;
    font-size: 10px;
    color: var(--color-gold);
    margin: 0 0 4px;
    text-transform: uppercase;
}

.site-title-mini {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.01em;
    margin: 0;
    line-height: 1.1;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.site-logo-img {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
}

.title-accent-mini {
    display: inline-block;
    color: #ffe08a;
    margin-left: 0.2em;
    font-style: italic;
    transform: skewX(-6deg);
}

.site-subtitle-mini {
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin: 4px 0 0;
}

.update-note-mini {
    font-size: 10px;
    color: #9a9a9a;
    margin: 2px 0 0;
}

/* ---------- 右側「NOW PLAYING」(枠なし、赤い帯にそのまま乗せる) ---------- */
.now-playing-box {
    display: block;
}

.now-playing-caption {
    display: block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

.now-playing-countdown {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 2px;
}

.now-playing-title {
    display: -webkit-box;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.now-playing-box:hover .now-playing-title {
    text-decoration: underline;
}

/* ---------- ニュース枠(スマホ:最上部 / PC:左サイドバー下) ---------- */
.news-block {
    width: 100%;
}

.mobile-news-top {
    display: none;
}

@media (max-width: 900px) {
    .header-flex {
        flex-direction: column;
        align-items: stretch;
    }
    .header-col {
        flex: 0 0 auto;
        width: 100%;
        padding: 14px 18px;
    }
    .header-col-left { order: 1; }
    .mobile-news-top {
        display: block;
        order: 2;
        width: 100%;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.7);
        border-top: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
    }
    .header-col-center { order: 3; }
    .header-col-right { display: none; }
}

.desktop-news-in-sidebar {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.header-news-title {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #fff;
    background: var(--color-red-dark);
    display: table;
    margin: 0 auto 8px;
    padding: 2px 10px;
    border-radius: 4px;
}

.header-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}

.header-news-list li + li {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--color-border);
}

.header-news-list a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--color-text);
}

.header-news-list a:hover {
    color: var(--color-red-dark);
    text-decoration: underline;
}

.news-date {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--color-text);
    padding: 2px 4px;
    border-radius: 3px;
    flex-shrink: 0;
    min-width: 34px;
    text-align: center;
    margin-top: 2px;
}

.news-title-wrap {
    flex: 1;
    display: block;
}

.news-title {
    display: block;
    font-weight: 600;
    line-height: 1.4;
    /* 複数行になってもOK(省略しない) */
}

.news-tag {
    display: table;
    margin-left: auto;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--color-red-dark);
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 5px;
}

.news-more-link {
    display: inline-block;
    margin-top: 12px;
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.05em;
    color: var(--color-red-dark);
    font-weight: 700;
}

.news-more-link:hover {
    text-decoration: underline;
}

/* ---------- フィルタータブ ---------- */
.filter-nav {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 18px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid var(--color-border);
}

.filter-tab {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 18px;
    border-radius: 999px;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.filter-tab:hover {
    color: var(--color-text);
    border-color: var(--color-red);
}

.filter-tab.active {
    background: var(--color-red);
    color: #fff;
    border-color: var(--color-red);
}

/* ---------- テキスト検索フォーム(キーワードタブと同じ行) ---------- */
.filter-nav-with-search {
    align-items: center;
}

.text-search-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.text-search-input {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.8);
    color: var(--color-text);
    width: 260px;
    max-width: 60vw;
}

.text-search-input:focus {
    outline: none;
    border-color: var(--color-red);
}

.text-search-btn {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 18px;
    border-radius: 999px;
    border: 1px solid var(--color-red-dark);
    background: var(--color-red-dark);
    color: #fff;
    cursor: pointer;
}

.text-search-btn:hover {
    background: var(--color-red);
    border-color: var(--color-red);
}

.text-search-clear {
    font-size: 12px;
    color: var(--color-text-muted);
    text-decoration: underline;
}

.filter-nav-sub {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid var(--color-border);
}

.platform-filter-group {
    display: inline-flex;
    gap: 4px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--color-border);
}

.header-keyword-search {
    flex: 1;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    margin: 0;
    min-width: 280px;
}

.filter-nav-sub .filter-tab {
    font-size: 11px;
    padding: 6px 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.7);
    color: var(--color-text);
    font-weight: 600;
}

.filter-nav-sub .filter-tab:hover {
    color: #000;
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--color-red);
}

.filter-nav-sub .filter-tab.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--color-red-dark);
    border-color: var(--color-red-dark);
    font-weight: 700;
}

.category-tab {
    font-size: 13px;
    padding: 7px 16px;
}

/* ---------- 3カラムレイアウト(左サイドバー・中央・右サイドバー) ---------- */
.layout-wrap {
    max-width: 1960px;
    margin: 0 auto;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 0 12px;
}

.side-left,
.side-right {
    flex-shrink: 0;
    position: sticky;
    top: 16px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 14px;
    margin-top: 32px;
}

.left-column {
    flex-shrink: 0;
    width: 330px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.left-column .side-left {
    margin-top: 0;
    width: auto;
    position: static; /* ニュース欄との重なりを避けるため、追従(sticky)をやめる */
}

.news-side-box {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    position: static; /* チャンネル一覧(sticky)と重ならないよう追従を解除 */
}

.news-side-box .header-news-list {
    max-height: none;
    overflow-y: visible;
    flex: 1;
}

.side-left {
    width: 330px;
}

.side-right {
    width: 330px;
}

.side-title {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: #fff;
    background: var(--color-red-dark);
    display: table;
    margin: 0 auto 12px;
    padding: 3px 14px;
    border-radius: 4px;
    text-align: center;
}

.channel-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.channel-rank-list li {
    padding: 0;
    border-bottom: 1px dashed var(--color-border);
}

.channel-rank-list li:last-child {
    border-bottom: none;
}

.channel-rank-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--color-text);
    cursor: pointer;
    font-weight: 600;
}

.channel-rank-link:hover {
    color: var(--color-red-dark);
}

.channel-rank-link.active {
    color: var(--color-red-dark);
    font-weight: 700;
}

.channel-clear-link {
    display: block;
    margin-top: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    text-decoration: underline;
}

.channel-rank-num {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-red-dark);
    width: 18px;
    flex-shrink: 0;
}

.channel-rank-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--color-border);
}

.channel-rank-logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-red-dark);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    text-transform: uppercase;
    padding: 0;
    box-sizing: border-box;
}

.channel-rank-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-rank-count {
    font-size: 11px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.side-ad-disclosure {
    font-size: 10px;
    color: var(--color-text-muted);
    margin: -4px 0 10px;
}

.rakuten-ad-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.rakuten-ad-list li + li {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.rakuten-ad-list a {
    display: block;
    color: var(--color-text);
}

.rakuten-ad-list img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 6px;
}

.rakuten-ad-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.rakuten-ad-price {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-red-dark);
    font-size: 12px;
    margin-top: 4px;
}

/* スマートフォンでは左サイドバー(チャンネルランキング)・右サイドバー(広告)ともに非表示にする
   (右側の広告は、動画一覧内への差し込み広告のみで表示する) */
@media (max-width: 900px) {
    .left-column,
    .side-right {
        display: none;
    }
}

/* タブレット程度の画面幅では、右サイドバーを中央の下に回り込ませる */
@media (max-width: 1100px) and (min-width: 901px) {
    .layout-wrap {
        flex-wrap: wrap;
    }
    .side-right {
        width: 100%;
        position: static;
        order: 3;
    }
    .tile-grid {
        order: 2;
    }
}

/* ---------- タイルグリッド ---------- */
.tile-grid {
    flex: 1;
    min-width: 0;
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-flow: dense;
    gap: 22px;
}

.tile-large {
    grid-column: span 2;
    grid-row: span 2;
}

@media (max-width: 600px) {
    /* 1列表示になる画面幅では拡大サイズを無効化(崩れ防止) */
    .tile-large {
        grid-column: span 1;
        grid-row: span 1;
    }
}

.popular-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--color-gold);
    color: #1c1c1c;
    font-weight: 700;
}

/* ---------- 広告タイル(楽天アフィリエイト) ---------- */
.ad-tile {
    border-style: dashed;
    border-color: rgba(0, 0, 0, 0.15);
}

.ad-tile .tile-thumb img {
    object-fit: contain;
    background: #fff;
    padding: 10px;
    box-sizing: border-box;
}

.ad-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
    background: #555;
    color: #fff;
    font-weight: 700;
}

.tile-views {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--color-text-muted);
}

.tile-large .tile-title {
    font-size: 17px;
    -webkit-line-clamp: 3;
}

.tile-large .tile-views {
    font-size: 13px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-muted);
    padding: 60px 20px;
    font-size: 14px;
}

.tile {
    display: block;
    background: var(--color-card);
    backdrop-filter: blur(3px);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.tile:hover {
    transform: translateY(-4px);
    border-color: var(--color-red);
    background: var(--color-card-hover);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.tile-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.platform-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.tile.platform-youtube   .platform-badge { background: #cc1f2c; }
.tile.platform-instagram .platform-badge { background: #b3327c; }
.tile.platform-tiktok    .platform-badge { background: #1f1f1f; border: 1px solid #3ddbd2; color: #3ddbd2; }
.tile.platform-threads   .platform-badge { background: #1f1f1f; border: 1px solid #eee; }
.tile.platform-minkara   .platform-badge { background: #ff6600; }

.platform-badge.badge-short {
    background: #1c1c1c;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.tile-body {
    padding: 14px 16px 16px;
}

.tile-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 10px;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
}

.tile-channel {
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- フッター ---------- */
.site-footer {
    text-align: center;
    padding: 20px 16px;
    color: #f5f5f5;
    background: rgba(28, 28, 28, 0.92);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
    border-top: 1px solid var(--color-border);
}

.site-footer p {
    margin: 0 0 6px;
}

.site-footer p:last-child {
    margin-bottom: 0;
    font-weight: 400;
    color: #cfcfcf;
}

.site-footer a {
    color: #ffd166;
    text-decoration: underline;
}

/* ---------- もっと見るボタン ---------- */
.show-more-wrap {
    text-align: center;
    padding: 0 20px 40px;
    max-width: 1280px;
    margin: 0 auto;
}

.show-more-btn {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 12px 32px;
    border-radius: 999px;
    border: 1px solid var(--color-red-dark);
    color: var(--color-red-dark);
    background: rgba(255, 255, 255, 0.6);
    transition: background 0.15s ease, color 0.15s ease;
}

.show-more-btn:hover {
    background: var(--color-red-dark);
    color: #fff;
}

/* ---------- ニュース専用ページ(news.php) ---------- */
.news-page-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.news-page-back {
    margin: 0 0 20px;
}

.news-page-back a {
    font-size: 13px;
    color: var(--color-text-muted);
}

.news-page-back a:hover {
    color: var(--color-red-dark);
}

.news-page-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-page-list li {
    border-bottom: 1px solid var(--color-border);
}

.news-page-list a {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 4px;
    color: var(--color-text);
}

.news-page-list a:hover {
    color: var(--color-red-dark);
}

.news-page-list .news-title {
    font-size: 15px;
}

.news-page-source {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--color-text-muted);
}

/* ---------- トップに戻るボタン ---------- */
.back-to-top {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.85);
    color: var(--color-red-dark);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease, border-color 0.15s ease;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #fff;
    border-color: var(--color-red);
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top { transition: opacity 0.01s linear; }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 480px) {
    .site-header { padding: 40px 16px 28px; }
    .tile-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding: 24px 14px 40px; }
}

/* ---------- モーション設定を尊重 ---------- */
@media (prefers-reduced-motion: reduce) {
    .tile { transition: none; }
    .tile:hover { transform: none; }
}
