/*
    Connect Station HOME
    File: /css/ads.css
    Description: 内部広告（6:5比率）専用スタイル
*/

.egic-ad-space {
    width: 100%;
    /* スマホで大きくなりすぎないよう最大幅を設定 (300px〜360px推奨) */
    max-width: 320px; 
    /* 縦横比 6:5 (横6に対して縦5) */
    aspect-ratio: 6 / 5;
    
    margin: 3rem auto; /* 中央寄せ */
    background-color: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 0.6s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.egic-ad-space.loaded {
    opacity: 1;
}

.egic-ad-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.egic-ad-link img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 枠いっぱいに表示 */
    display: block;
    transition: transform 0.4s ease;
}

.egic-ad-link:hover img {
    transform: scale(1.05);
}

/* バッジ (左上) */
.ad-badge {
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 90, 158, 0.9); /* プライマリーカラー */
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-bottom-right-radius: 8px;
    z-index: 2;
    font-family: sans-serif;
    font-weight: bold;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

/* 画像がない場合のフォールバック表示 */
.ad-fallback-box {
    display: none; /* 初期非表示 */
    width: 100%;
    height: 100%;
    background-color: #e0f7fa; /* 薄い青 */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    border: 4px solid #fff;
    box-sizing: border-box;
}

.fallback-badge {
    background: #005a9e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.fallback-text {
    font-weight: bold;
    color: #0277bd;
    font-size: 1.1rem;
    line-height: 1.5;
}