/* ===========================================
   共通パーツ（ウィジェット・ページ共通）
   =========================================== */

/* --- 順位バッジ共通 --- */
.ranking-num {
    position: absolute;
    top: -5px;
    left: -5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 2px;
    background: #333;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    z-index: 10;
}

.rank-1 .ranking-num { background: #f0c040; }
.rank-2 .ranking-num { background: #aaa; }
.rank-3 .ranking-num { background: #c87941; }

/* ===========================================
   ランキングウィジェット（サイドバー）
   =========================================== */

.ranking-widget { font-size: 14px; }

.ranking-tabs {
    display: flex;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    justify-content: space-between;
    align-items: center;
}
.ranking-tab {
    position: relative;
    padding: 5px 0; 
    flex: 1;
    text-align: center;
    cursor: pointer;
    color: #666;
    font-size: 13px;
    transition: all .2s;
}
.ranking-tab.active {
    color: #fff;
    font-weight: bold;
    background-color: #e44;
    border-radius: 3px;
}

.ranking-tab.active::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-style: solid;
    border-width: 6px 5px 0 5px;
    border-color: #e44 transparent transparent transparent;
}

.ranking-pane { display: none; }
.ranking-pane.active { display: block; }

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

.ranking-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.ranking-thumb {
    position: relative;
    flex-shrink: 0;
    display: block;
    z-index: 5;
}

.ranking-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.ranking-info { flex: 1; min-width: 0; }

.ranking-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
}

/* アイテム全体をリンク化 */
.ranking-item .ranking-title::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.ranking-more-btn-wrap { margin-top: 15px; text-align: center; }
.ranking-more-link {
    display: block;
    padding: 10px;
    background: #f8f8f8;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s;
}
/*.ranking-more-link:hover { background: #e44; color: #fff; border-color: #e44; }*/

/* ウィジェット内カテゴリー専用：左ラインスタイル */
.ranking-item-cat .post-category {
    background: transparent !important;
    color: #333 !important;
    font-size: 10px;
    padding: 0 0 0 10px; 
    position: relative;
    border: none;
	line-height:1;
}
.ranking-item-cat .post-category::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 10px;
    background: #e44;
}

/* ===========================================
   ランキング一覧ページ（メインコンテンツ用）
   =========================================== */

/* --- 2カラムレイアウト設定 --- */
.ranking-page-flex {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}
.ranking-page-flex .main-content {
    flex: 1;
    min-width: 0;
}
.ranking-page-flex .sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* --- ページヘッダーとナビ（既存サイト赤タブ） --- */
.ranking-page-header {
	text-align: center;
	margin-bottom: 40px;
}
.ranking-page-nav {
	border-top:2px solid #eee;
	padding-top:30px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0 40px;
    list-style: none;
    width: 100%;
}
.ranking-page-nav a {
    position: relative;
    padding: 10px 0;
    flex: 1;
    text-align: center;
    background: #eee;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    border-radius: 3px;
    transition: 0.2s;
}
.ranking-page-nav a.active {
    background-color: #e44 !important;
    color: #fff !important;
    font-weight: bold;
}

.ranking-page-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-style: solid;
    border-width: 6px 5px 0 5px;
    border-color: #e44 transparent transparent transparent;
}

/* --- 記事カード（枠線なし・シンプル版） --- */
.ranking-card {
    display: flex;
    gap: 25px;
    padding: 25px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    position: relative;
    transition: opacity 0.3s ease; /* ホバー時に薄くする */
}

.ranking-card:hover {
    opacity: 0.7; /* ホバー時の動きはこれだけ */
}

/* --- サムネイル（幅250px） --- */
.ranking-card-left {
    width: 250px; 
    flex-shrink: 0;
}
.ranking-card-img {
    position: relative;
    display: block;
    z-index: 5;
}
.ranking-card-img img {
    width: 100%;
    height: 160px; /* 横幅250pxに合わせた高さ */
    object-fit: cover;
    border-radius: 0;
}

/* --- サムネイル左上の順位バッジ --- */
.ranking-card .ranking-num {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    z-index: 10;
    border-radius: 2px;
}

/* 1-3位の色（!importantで確実に適用） */
.rank-1 .ranking-num { background: #f0c040 !important; }
.rank-2 .ranking-num { background: #aaa !important; }
.rank-3 .ranking-num { background: #c87941 !important; }
.ranking-num { background: #333; } /* 4位以降 */

/* --- 右側テキスト情報 --- */
.ranking-card-right {
    flex: 1;
    min-width: 0;
}

.ranking-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ranking-card-cat {
    font-size: 10px;
    background: #e4e9e9;
    color: #666;
    padding: 4px 8px;
    border-radius: 5px;
	margin-right:5px;
}

.ranking-card-date { font-size: 12px; color: #999; }

.ranking-card-title {
    font-size: 20px;
    margin: 5px 0 15px;
    line-height: 1.4;
}

.ranking-card-title a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
}

/* 記事全体をリンク化 */
.ranking-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* --- 著者情報（アバター40px） --- */
.ranking-card-author {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #444;
    position: relative;
    z-index: 5;
}

.ranking-card-author img {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
}

/* --- レスポンシブ（スマホ時は縦並び） --- */
@media (max-width: 959px) {
    .ranking-page-flex { flex-direction: column; }
    .ranking-page-flex .sidebar { width: 100%; }
}

@media (max-width: 767px) {
    .ranking-card {
        flex-direction: column;
        gap: 15px;
        padding: 20px 0;
    }
    .ranking-card-left {
        width: 100%;
    }
    .ranking-card-img img {
        height: auto;
        aspect-ratio: 16/9;
    }
    .ranking-card-title { font-size: 17px; }
}
