/* SWELL子テーマ用 アイキャッチ画像拡大モーダル スタイル */

/* クリック可能な画像のスタイル */
.sfim-clickable {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.sfim-clickable:hover {
    opacity: 0.8;
}

/* モーダルオーバーレイ */
.sfim-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

/* モーダルコンテンツ */
.sfim-modal-content {
    position: relative;
    background-color: transparent;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    max-height: 96vh;
    overflow: hidden;
    animation: sfim-fadeIn 0.3s ease;
}

@keyframes sfim-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 閉じるボタン */
.sfim-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    background-color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sfim-close:hover,
.sfim-close:focus {
    background-color: #555;
    color: #ffffff;
}

/* 画像コンテナ */
.sfim-image-container {
    text-align: center;
    margin: 0;
    max-height: 70vh;
    overflow: hidden;
}

#sfim-modal-image {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

/* もっと見るボタン */
.sfim-more-button {
    display: block;
    background-color: #007cba;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    margin: 10px auto;
    transition: background-color 0.3s ease;
    text-align: center;
    max-width: 200px;
}

.sfim-more-button:hover {
    background-color: #005a87;
    color: white;
    text-decoration: none;
}

/* タクソノミーセクション */
.sfim-taxonomies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 10px 0;
}

.sfim-categories,
.sfim-tags {
    display: contents;
}

.sfim-categories a,
.sfim-tags a {
    display: inline-block;
    background-color: #f5f5f5;
    color: #333;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sfim-categories a:hover,
.sfim-tags a:hover {
    background-color: #007cba;
    color: white;
    text-decoration: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* スマホ表示ではモーダル機能を無効化 */
    .sfim-modal {
        display: none !important;
    }
    
    /* スマホ表示ではクリック可能な画像のスタイルを通常のリンクに戻す */
    .sfim-clickable {
        cursor: default;
        transition: none;
    }
    
    .sfim-clickable:hover {
        opacity: 1;
    }
    
    /* スマホ表示ではモーダル関連のスタイルを無効化 */
    .sfim-modal-content,
    .sfim-close,
    .sfim-image-container,
    .sfim-more-button,
    .sfim-taxonomies {
        display: none !important;
    }
    
    /* スマホ表示ではbodyのスクロール制御を無効化 */
    body.sfim-modal-open {
        overflow: auto !important;
    }
}

/* ローディング状態 */
.sfim-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.sfim-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: sfim-spin 1s linear infinite;
    margin-left: 10px;
}

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

/* モーダル表示時のスクロール無効化 */
body.sfim-modal-open {
    overflow: hidden;
}