/**
 * AI Content Generator - Frontend Styles
 * 글 본문에 삽입되는 요소들의 스타일
 */

/* ===========================================
   썸네일 + 광고 컨테이너 레이아웃
   =========================================== */
.aicg-thumb-ad-container {
    margin: 20px 0;
}

.aicg-thumb-ad-row {
    display: flex;
    gap: 20px;
    align-items: center; /* 수직 중앙 정렬로 변경 */
    justify-content: center;
    flex-wrap: wrap;
}

.aicg-thumbnail {
    margin: 0;
    flex: 1;
    min-width: 300px; /* 너무 작아지지 않도록 */
    max-width: 500px;
}

.aicg-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
    border-radius: 8px; /* 미관상 라운드 처리 */
}

.aicg-ad-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 광고 크기에 맞춰 적절히 조절 */
}

.aicg-ad-bottom {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    width: 100%; /* 전체 너비 차지 */
    clear: both;
}

/* ===========================================
   관련 글 섹션
   =========================================== */
.aicg-related-posts {
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.aicg-related-posts h2 {
    font-size: 1.3em;
    margin-bottom: 20px;
}

.aicg-related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.aicg-related-post-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.aicg-related-post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.aicg-related-post-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f5f5f5;
}

.aicg-related-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aicg-related-post-content {
    padding: 15px;
}

.aicg-related-post-title {
    font-weight: 600;
    font-size: 1em;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aicg-related-post-excerpt {
    font-size: 0.85em;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aicg-related-post-card.no-thumbnail .aicg-related-post-content {
    padding: 20px;
}

/* ===========================================
   모바일 대응 (768px 이하)
   =========================================== */
@media (max-width: 768px) {
    /* 썸네일 + 광고 */
    .aicg-thumb-ad-row {
        flex-direction: column;
        align-items: center;
    }

    .aicg-ad-right {
        display: none;
    }

    .aicg-thumbnail {
        max-width: 100%;
    }

    /* 관련 글 */
    .aicg-related-posts-grid {
        grid-template-columns: 1fr;
    }
}
