/* フッター専用CSS */

/* フッター広告セクション */
.footer-ads-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 3rem 0;
    margin-top: 3rem;
    border-top: 1px solid #dee2e6;
}

.footer-ads-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-ad-wrapper {
    height: 100%;
    overflow: hidden; /* はみ出し防止 */
    border-radius: 1rem;
}

.footer-ad-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid #e9ecef;
}

.footer-ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: inherit;
    text-decoration: none;
}

/* 統一された画像コンテナ - はみ出し防止 */
.footer-ad-image {
    height: 200px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.footer-ad-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* はみ出し防止 */
    object-position: center;
}

/* RAW広告用の統一コンテナ - はみ出し防止 */
.footer-ad-raw {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* はみ出し防止 */
    border-radius: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem;
    position: relative;
}

.footer-ad-raw img {
    max-width: calc(100% - 1rem);
    max-height: calc(100% - 1rem);
    width: auto;
    height: auto;
    object-fit: contain; /* はみ出し防止 */
    object-position: center;
}

.footer-ad-raw iframe,
.footer-ad-raw object,
.footer-ad-raw embed {
    max-width: 100%;
    max-height: 100%;
}

.footer-ad-placeholder {
    background: linear-gradient(45deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    height: 200px;
    border-radius: 0.5rem;
}

.footer-ad-content {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.footer-ad-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: #212529;
    /* テキストのはみ出し防止 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.footer-ad-desc {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.5;
    /* テキストのはみ出し防止 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.footer-ad-btn {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s ease;
}

.footer-ad-btn:hover {
    background: linear-gradient(45deg, #e55a2e, #e08618);
    transform: scale(1.02);
    color: white;
}

/* メインフッター */
.main-footer {
    background: #2c3e50;
    color: #ecf0f1;
}

.footer-section-title {
    color: #3498db;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.footer-link {
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.3s ease;
    /* テキストのはみ出し防止 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.footer-link:hover {
    color: #3498db;
    text-decoration: none;
}

/* ソーシャルリンク */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--social-color, #7f8c8d);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.social-link:hover {
    transform: scale(1.1);
    color: white;
    text-decoration: none;
}

/* フッター下部 */
.footer-bottom {
    background: #34495e;
    padding: 1rem 0;
    border-top: 1px solid #4a5f7a;
}

/* フッター記事 */
.footer-post-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #4a5f7a;
    overflow: hidden; /* はみ出し防止 */
}

.footer-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.footer-post-link {
    color: #bdc3c7;
    text-decoration: none;
}

.footer-post-link:hover {
    color: #3498db;
    text-decoration: none;
}

.footer-post-title {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    /* テキストのはみ出し防止 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* フローティングボタン */
.floating-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1000;
}

.floating-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-scroll-top {
    background: linear-gradient(45deg, #007bff, #0056b3);
}

.btn-notification {
    background: linear-gradient(45deg, #28a745, #1e7e34);
}

.btn-share {
    background: linear-gradient(45deg, #6f42c1, #5a2d91);
}

.floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
    color: white;
}

/* スクロールインジケーター */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(0,0,0,0.1);
    z-index: 9999;
}

.scroll-progress {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    width: 0%;
    transition: width 0.3s ease;
}

/* 通知モーダル */
.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .footer-ads-section {
        padding: 2rem 0;
    }
    
    .footer-ad-card {
        padding: 1rem;
    }
    
    .footer-ad-image,
    .footer-ad-raw,
    .footer-ad-placeholder {
        height: 150px;
    }
    
    .footer-ad-title {
        font-size: 1rem;
        -webkit-line-clamp: 1;
    }
    
    .footer-ad-desc {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    .footer-ad-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .floating-buttons {
        bottom: 1rem;
        right: 1rem;
    }
    
    .floating-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .footer-post-title {
        font-size: 0.85rem;
        -webkit-line-clamp: 1;
    }
}

@media (max-width: 480px) {
    .footer-ad-image,
    .footer-ad-raw,
    .footer-ad-placeholder {
        height: 120px;
    }
    
    .footer-ad-title {
        font-size: 0.95rem;
    }
    
    .footer-ad-desc {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-section {
    animation: fadeInUp 0.6s ease;
}

.footer-section:nth-child(1) { animation-delay: 0.1s; }
.footer-section:nth-child(2) { animation-delay: 0.2s; }
.footer-section:nth-child(3) { animation-delay: 0.3s; }
.footer-section:nth-child(4) { animation-delay: 0.4s; }
.footer-section:nth-child(5) { animation-delay: 0.5s; }

/* はみ出し防止の共通ルール */
.footer-ad-wrapper * {
    max-width: 100% !important;
}

.main-footer * {
    max-width: 100% !important;
}

/* 特殊な広告コンテンツの制御 */
.footer-ad-raw table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed;
}

.footer-ad-raw table td,
.footer-ad-raw table th {
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-ad-raw pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: hidden;
}

/* フッター内のテーブル制御 */
.main-footer table {
    max-width: 100% !important;
    table-layout: fixed;
}

.main-footer table td,
.main-footer table th {
    word-wrap: break-word;
    overflow: hidden;
}

.footer-muted {
    color: #848688ff;
}

/* カルーセル制御の改善 */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-indicators {
    margin-bottom: 0;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background-color: transparent;
}

.carousel-indicators .active {
    background-color: white;
}