/* inf-block/style.css */

/* --- 共用樣式 --- */
.wp-block-theme-embed-block {
    margin: 1.5em 0;
}

.inf-block-embed-container {
    position: relative;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
}

.inf-block-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Info Card General Styles --- */
.inf-block-info-card {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 15px;
    width: 100%;
    background-color: #f9f9f9;
    padding: 10px;
    border-left: 5px solid #ff0034;
    box-sizing: border-box;
}

.inf-block-info-card .details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
}

.inf-block-info-card .title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.inf-block-info-card .author {
    font-size: 14px;
    color: #777;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- YouTube Specific Card Styles --- */
.inf-block-info-card.is-youtube img {
    border-radius: 50% !important;
    width: 60px !important;
    height: 60px !important;
    margin: 0 15px 0 0 !important;
    object-fit: cover !important;
    flex-shrink: 0;
    border: none !important;
}

/* --- Google Maps Specific Card Styles --- */
.inf-block-info-card.is-gmap {
    border-left-color: #4285F4;
}

.inf-block-info-card.is-gmap img {
    border-radius: 4px !important;
    width: 60px !important;
    height: 60px !important;
    margin: 0 15px 0 0 !important;
    object-fit: cover !important;
    flex-shrink: 0;
    border: none !important;
}

/* --- Default Icon Styles (Font Awesome Version) --- */
.inf-block-default-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 15px 0 0;
    flex-shrink: 0;
    background-color: #e9e9e9;
    border-radius: 50%;
    font-size: 28px;
    color: #555;
}

.inf-block-default-icon-wrapper.is-youtube-icon {
    color: #FF0000;
}
.inf-block-default-icon-wrapper.is-youtube-icon::before {
    font-family: "Font Awesome 5 Brands", "FontAwesome";
    content: "\f167";
}

.inf-block-default-icon-wrapper.is-gmap-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: #4285F4;
}
.inf-block-default-icon-wrapper.is-gmap-icon::before {
    font-family: "Font Awesome 5 Free", "FontAwesome";
    font-weight: 900;
    content: "\f3c5";
}

/* --- Clickable Link Styles --- */
.inf-block-info-card-link,
.inf-block-info-card-link:hover {
    display: block;
    text-decoration: none;
    color: inherit;
}

.inf-block-info-card-link .inf-block-info-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* --- Theme Specific Overrides --- */
#si-single-content .inf-block-info-card img {
    max-width: none !important;
}

/* --- Aspect Ratio Classes --- */
.is-aspect-ratio-16-9 { padding-bottom: 56.25%; }
.is-aspect-ratio-4-3 { padding-bottom: 75%; }
.is-aspect-ratio-1-1 { padding-bottom: 100%; }
.is-aspect-ratio-21-9 { padding-bottom: 42.857%; }

/* --- Podcast Player Styles (Fixed Version) --- */

/* ✅ 通用 Podcast 容器設定 - 使用 !important 確保覆蓋 aspect-ratio */
.inf-block-embed-container.is-podcast-player {
    position: relative !important;
    padding-bottom: 0 !important; /* 強制移除 padding-bottom，防止被 aspect-ratio 影響 */
    height: auto !important; /* 強制重置高度 */
    overflow: visible !important; /* 允許內容正常顯示 */
}

.inf-block-embed-container.is-podcast-player iframe {
    position: relative !important; /* 改為 relative，讓高度可以自然呈現 */
    width: 100% !important;
    height: 100% !important;
}

/* Spotify Podcast - 修正為標準高度 152px */
.inf-block-embed-container.is-podcast-player.is-spotify-player {
    height: 152px !important;
}

/* Apple Podcasts - 小尺寸播放器 */
.inf-block-embed-container.is-podcast-player.is-apple-player {
    height: 175px !important;
}

/* Apple Podcasts - 大尺寸播放器 */
.inf-block-embed-container.is-podcast-player.is-apple-player.is-apple-podcast-large {
    height: 450px !important;
}

/* 強制修正 Spotify 播放器高度 */
.inf-block-embed-container.is-spotify-player {
    position: relative; /* 確保 iframe 的絕對定位有效 */
    height: 352px !important; /* Spotify 預設的嵌入高度，您可以調整 */
    padding-bottom: 0 !important; /* 非常重要！強制覆蓋長寬比樣式 */
}

/* 針對小尺寸的 Spotify 播放器 */
.inf-block-embed-container.is-spotify-player iframe[src*="compact=1"] {
    height: 152px !important;
}