@charset "UTF-8";

/* * DMM Gemini Article Creator Styles
 * (v23.5.3 修正: スマホ表示の最適化・基本情報テーブルのレイアウト調整)
 */

/* --------------------------------------------------
   動画コンテナ (アスペクト比維持・中央寄せ)
-------------------------------------------------- */
.dmm-movie-wrap {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    background-color: #000; /* 動画読み込み前の背景 */
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.dmm-movie-wrap iframe {
    vertical-align: bottom; /* 下部の隙間除去 */
}

/* --------------------------------------------------
   レーダーチャート用 (SVG)
-------------------------------------------------- */
.dgac-radar-wrapper {
    position: relative;
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    /* アスペクト比を確保してガタつき防止 */
    aspect-ratio: 1.15 / 1; 
}

/* --------------------------------------------------
   画像グリッドレイアウト (カラム落ち防止・高さ統一)
-------------------------------------------------- */
.dgac-img-grid {
    display: grid;
    /* 強制的に3等分する (カラム落ちを絶対防ぐ) */
    grid-template-columns: repeat(3, 1fr);
    gap: 10px; /* 画像間の隙間 */
    margin-bottom: 30px;
    width: 100%;
}

.dgac-img-grid figure {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    /* Grid内での画像はみ出し防止 */
    min-width: 0; 
}

.dgac-img-grid img {
    width: 100%;
    height: 220px !important; /* 高さ固定 */
    object-fit: cover; /* 比率維持トリミング */
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: block;
}

/* --------------------------------------------------
   シンプルリスト (11位以下)
-------------------------------------------------- */
.dgac-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

/* PCレイアウト: 画像(左) - テキスト(右) */
.dgac-list-item {
    display: flex;
    flex-direction: row; /* 横並び */
    justify-content: flex-start; /* 左詰め */
    gap: 20px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 20px;
    align-items: flex-start;
}

/* 左側: 画像エリア */
.dgac-list-thumb {
    width: 200px; /* 画像幅を少しコンパクトに */
    flex-shrink: 0;
}

.dgac-list-thumb img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    object-fit: cover;
    aspect-ratio: 16 / 10;
    transition: opacity 0.3s;
}
.dgac-list-thumb img:hover {
    opacity: 0.8;
}

/* 右側: テキストエリア */
.dgac-list-content {
    flex: 1;
    min-width: 0;
}

/* 各パーツのスタイル */
.dgac-list-rank {
    display: inline-block;
    background: #eee;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.dgac-list-title {
    font-weight: bold;
    font-size: 1.1em;
    line-height: 1.4;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    color: #333;
}

.dgac-list-title:hover {
    text-decoration: underline;
    color: #0073aa;
}

.dgac-list-desc {
    font-size: 0.9em;
    color: #666;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.dgac-list-btn {
    display: inline-block;
    font-size: 0.85em;
    padding: 6px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
}

.dgac-list-btn:hover {
    background: #eee;
    border-color: #ccc;
    color: #333;
}

/* --------------------------------------------------
   レスポンシブ対応 (スマホ)
-------------------------------------------------- */
@media (max-width: 768px) {
    /* --- ランキング詳細（リッチ表示）の調整 --- */
    
    /* 動画とチャートを縦積みに変更 */
    .cap-box > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 15px !important; /* 要素間の隙間を調整 */
    }

    /* ★重要: PHP側のインラインスタイル(min-width: 300px)を強制上書き */
    .cap-box > div > div[style*="min-width: 300px"] {
        min-width: 100% !important;
        max-width: 100% !important;
        flex: auto !important;
    }
    
    /* レーダーチャートのサイズ調整 */
    .dgac-radar-wrapper {
        max-width: 280px; /* スマホでは少し小さめに */
    }

    /* --- シンプルリスト（11位以下）の調整 --- */
    
    /* 横並び(リスト)を維持しつつ間隔を調整 */
    .dgac-list-item {
        flex-direction: row; 
        align-items: flex-start;
        gap: 12px;
    }

    /* 画像サイズをスマホ用に最適化 */
    .dgac-list-thumb {
        width: 100px; /* 幅を固定して小さく */
        min-width: 100px;
        margin: 0;
    }
    
    .dgac-list-thumb img {
        aspect-ratio: 16 / 10; 
        object-fit: cover;
    }

    /* テキストエリアの調整 */
    .dgac-list-content {
        width: auto;
        flex: 1; /* 残りの幅を埋める */
    }
    
    .dgac-list-title {
        font-size: 14px; /* タイトル文字サイズ調整 */
        margin-bottom: 5px;
        line-height: 1.4;
    }
    
    .dgac-list-desc {
        font-size: 12px;
        margin-bottom: 8px;
        line-height: 1.5;
        /* 長すぎる説明文を3行で省略表示 */
        display: -webkit-box;
        -webkit-line-clamp: 3; 
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .dgac-list-btn {
        padding: 4px 12px;
        font-size: 11px;
    }
    
    /* 口コミボックス等のインラインスタイル要素への安全策 */
    div[style*="background: #eef9fd"], 
    div[style*="background: #fff8e1"] {
        padding: 15px !important;
        font-size: 0.95em;
    }

    /* --- 基本情報テーブルのスマホ最適化 --- */
    .swl-table {
        width: 100% !important;
        font-size: 0.85rem; /* 文字を少し小さく */
        table-layout: fixed; /* 列幅を固定して崩れ防止 */
    }
    
    .swl-table td {
        padding: 8px 10px !important;
        word-wrap: break-word; /* 長い文字を折り返す */
        overflow-wrap: break-word;
        vertical-align: middle;
    }
    
    /* 項目名（左側）のスタイル */
    .swl-table td:first-child {
        width: 30%; /* 幅を30%に制限 */
        min-width: 80px; /* 最低幅を確保 */
        background-color: #f9f9f9; /* 背景色で視認性アップ */
        font-weight: bold;
    }

    /* --- 画像グリッドレイアウト (スマホ用) --- */
    .dgac-img-grid {
        grid-template-columns: repeat(2, 1fr); /* スマホは2列 */
    }
    .dgac-img-grid img {
        height: 140px !important;
    }
}