/* ======================================
   広告スタイル - A8.net / バリューコマース対応
   
   【重要】広告は固定配置（position: static）を使用し、
   スクロールに追従しません。コンテンツの邪魔にならない
   ように設計されています。
   ====================================== */

/* 共通広告コンテナ */
.ad-container {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 30px auto;
    text-align: center;
    max-width: 100%;
}

.ad-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.ad-content {
    display: inline-block;
    max-width: 100%;
}

/* サイドバー広告は廃止（メインコンテンツの幅を確保するため） */

/* 記事下広告 */
.article-bottom-ad {
    margin: 40px auto;
    max-width: 728px;
    clear: both;
}

.article-bottom-ad .ad-content {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    padding: 10px;
}

/* 728x90サイズ（リーダーボード） */
.ad-728x90 {
    width: 728px;
    height: 90px;
}

/* 記事内広告 */
.article-inline-ad {
    margin: 40px auto;
    max-width: 336px;
    clear: both;
}

.article-inline-ad .ad-content {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
}

/* 336x280サイズ（レクタングル大） */
.ad-336x280 {
    width: 336px;
    height: 280px;
}

/* インフィード広告（トップページ専用） */
.infeed-ad {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid #f0f4ff;
}

.infeed-ad:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.infeed-ad .ad-label {
    text-align: left;
    margin-bottom: 15px;
    color: #667eea;
    font-weight: 600;
}

.infeed-ad .ad-content {
    width: 100%;
    text-align: left;
}

/* 2カラムレイアウトは廃止（シンプルな1カラムレイアウトに統一） */

@media (max-width: 768px) {
    /* 記事下広告 - モバイル版 */
    .article-bottom-ad {
        max-width: 320px;
    }

    .article-bottom-ad .ad-content {
        min-height: 100px;
    }

    /* 728x90 → 320x100 に変更 */
    .ad-728x90 {
        width: 320px;
        height: 100px;
    }

    /* 記事内広告 - モバイル版 */
    .article-inline-ad {
        max-width: 300px;
    }

    .article-inline-ad .ad-content {
        min-height: 250px;
    }

    /* 336x280 → 300x250 に変更 */
    .ad-336x280 {
        width: 300px;
        height: 250px;
    }

    /* インフィード広告 */
    .infeed-ad {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ad-container {
        padding: 10px;
        margin: 20px auto;
    }

    .article-bottom-ad,
    .article-inline-ad {
        margin: 30px auto;
    }
}

/* 広告非表示時のプレースホルダー */
.ad-placeholder {
    background: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.ad-placeholder::before {
    content: "広告スペース";
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
}

/* 広告ホバー効果 */
.ad-container:hover {
    border-color: #ccc;
    background: #fff;
    transition: all 0.3s ease;
}

/* アクセシビリティ対応 */
.ad-container[aria-label] {
    position: relative;
}

/* 読み込み中アニメーション */
.ad-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.ad-loading::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
