/* Podcast Detail Section */

.podcast-detail-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Sticky Header Section */
.podcast-detail-header {
    position: sticky;
    top: 110px;
    padding-top: 20px;
    z-index: 40;
    background-color: var(--theme-bg-light);
    padding-bottom: 8px;
    margin-bottom: 24px;
}

.podcast-detail-header.sticky-active {
    border-bottom: 0.5px solid var(--theme-border);
}

/* Go Back Button */
.podcast-detail-back {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    cursor: pointer;
}

.podcast-detail-header .podcast-detail-back {
    margin-bottom: 20px;
}

.podcast-back-arrow {
    width: 9.556px;
    height: 9.556px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-back-arrow i {
    font-size: 10px;
    color: var(--theme-color-primary);
    transform: rotate(90deg);
}

.podcast-back-button {
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--theme-color-primary);
    background: none;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    padding: 0;
    line-height: 19px;
    transition: opacity 0.2s ease;
}

.podcast-back-button:hover {
    opacity: 0.7;
}

/* Podcast Info */
.podcast-detail-info {
    margin-bottom: 20px;
    transition: opacity 0.2s ease;
}

/* Make podcast-detail-info clickable when it has a link */
.podcast-detail-info.clickable {
    cursor: pointer;
}

.podcast-detail-info.clickable:hover {
    opacity: 0.7;
}

.podcast-host-link {
    font-family: 'Times', 'Times New Roman', serif;
    font-size: 12px;
    line-height: 21px;
    letter-spacing: 0.16px;
    color: var(--theme-color-primary);
    text-decoration: underline;
    text-underline-position: from-font;
    text-decoration-skip-ink: none;
    display: block;
    text-decoration: none;
    text-transform: uppercase;
    margin-bottom: 8px;
    transition: opacity 0.2s ease;
}

.podcast-host-link:hover {
    opacity: 0.7;
}

.podcast-detail-meta {
    display: flex;
    gap: 16px;
    font-family: 'Times', 'Times New Roman', serif;
    font-size: 12px;
    line-height: 21px;
    letter-spacing: 0.14px;
    color: var(--theme-color-primary);
}

.podcast-detail-date,
.podcast-detail-duration {
    margin: 0;
}

/* Podcast Title */
.podcast-detail-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.podcast-detail-title {
    font-family: 'Times', 'Times New Roman', serif;
    font-size: 32px;
    line-height: 40px;
    letter-spacing: 0.75px;
    color: var(--theme-color-primary);
    font-weight: normal;
    margin: 0;
    flex: 1;
}

.podcast-detail-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0.5px solid var(--theme-border);
    border-radius: 4px;
    background-color: var(--theme-bg-light);
    color: var(--theme-color-primary);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.podcast-detail-edit-btn:hover {
    opacity: 0.7;
    background-color: var(--theme-bg);
}

.podcast-detail-edit-btn i {
    font-size: 16px;
    color: var(--theme-color-primary);
}

/* Keywords */
.podcast-detail-keywords {
    display: block;
    margin-bottom: 24px;
}

.podcast-keyword-tag {
    font-family: 'Times', 'Times New Roman', serif;
    font-size: 12px;
    font-style: italic;
    line-height: 15px;
    letter-spacing: 0.36px;
    color: var(--theme-color-primary);
    border: none;
    padding: 0;
    display: inline;
}

/* YouTube Player Container */
.youtube-player-container {
    width: 100%;
    max-width: 100%;
    margin-bottom: 32px;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.youtube-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Description */
.podcast-detail-description {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    line-height: 23px;
    color: var(--theme-color-primary);
    margin: 0 0 40px 0;
}

/* Preserve line breaks in description fields (description_ai, extracted_data) */
.podcast-detail-description[style*="white-space: pre-wrap"],
.podcast-section-content .podcast-detail-description[style*="white-space: pre-wrap"] {
    white-space: pre-wrap !important;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Spotify Embed Container - Always visible below description */
.spotify-embed-container {
    margin: 0 0 40px 0;
    width: 100%;
    max-width: 100%;
    /* Height will be set dynamically to match iframe */
}

.spotify-embed-container iframe {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    border: none;
    height: 365px !important; /* Double the default Spotify embed height (232px * 2) */
    min-height: 365px;
}

/* For compact Spotify players, also double their height */
.spotify-embed-container iframe[height="152"] {
    height: 304px !important; /* Double compact player height (152px * 2) */
    min-height: 304px;
}

/* For any other Spotify embed heights, double them */
.spotify-embed-container iframe[height="232"] {
    height: 365px !important; /* Double full player height (232px * 2) */
    min-height: 365px;
}

/* Video embed container - match iframe height */
.podcast-section-content[id*="video_embed"] {
    /* Height will be set dynamically to match iframe */
    overflow: hidden;
}

.podcast-section-content[id*="video_embed"] iframe {
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    border: none;
    display: block;
}

/* Summary and Transcript Sections */


.podcast-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    cursor: pointer;
}

.podcast-section-title {
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--theme-color-primary);
    text-transform: uppercase;
    margin: 0;
    line-height: 21px;
}

.podcast-section-expand {
    width: 16px;
    height: 16px;
    border: none;
    background: none;
    color: var(--theme-color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    flex-shrink: 0;
}

.podcast-section-expand i {
    font-size: 16px;
    color: var(--theme-color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.podcast-section-content {
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, visibility 0.4s ease, margin-bottom 0.4s ease;
}

.podcast-section-content.expanded {
    max-height: none;
    opacity: 1;
    visibility: visible;
    margin-bottom: 32px;
}

/* Transcript Entries */
.transcript-entry {
    margin-bottom: 24px;
}

.transcript-entry:last-child {
    margin-bottom: 0;
}

.transcript-speaker {
    font-family: 'Times', 'Times New Roman', serif;
    font-size: 14px;
    line-height: 21px;
    letter-spacing: 0.14px;
    color: var(--theme-color-primary);
    margin: 0 0 4px 0;
    font-weight: normal;
}

.transcript-text {
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    line-height: 23px;
    color: var(--theme-color-primary);
    margin: 0 0 8px 0;
}

.transcript-text:last-child {
    margin-bottom: 0;
}

/* Preserve line breaks in transcript content */
#transcript-content .podcast-detail-description,
#transcript-content p.podcast-detail-description {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Preserve line breaks in summary content */
#summary-content .podcast-detail-description,
#summary-content p.podcast-detail-description {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Render HTML tags in extracted_data content */
#field-extracted_data-content .podcast-detail-description,
#field-extracted_data-content p.podcast-detail-description,
#field-extracted_data_text-content .podcast-detail-description,
#field-extracted_data_text-content p.podcast-detail-description {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal; /* Allow normal wrapping */
}

/* Style HTML elements within extracted_data */
#field-extracted_data-content .podcast-detail-description *,
#field-extracted_data_text-content .podcast-detail-description * {
    max-width: 100%;
}

#field-extracted_data-content .podcast-detail-description img,
#field-extracted_data_text-content .podcast-detail-description img {
    max-width: 100%;
    height: auto;
}

/* Style lists in extracted_data */
#field-extracted_data-content .podcast-detail-description ul,
#field-extracted_data-content .podcast-detail-description ol,
#field-extracted_data_text-content .podcast-detail-description ul,
#field-extracted_data_text-content .podcast-detail-description ol {
    margin: 16px 0;
    padding-left: 24px;
}

#field-extracted_data-content .podcast-detail-description li,
#field-extracted_data_text-content .podcast-detail-description li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Style blockquote in extracted_data */
#field-extracted_data-content .podcast-detail-description blockquote,
#field-extracted_data_text-content .podcast-detail-description blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    border-left: 3px solid var(--theme-border);
    font-style: italic;
}

/* Style code in extracted_data */
#field-extracted_data-content .podcast-detail-description code,
#field-extracted_data_text-content .podcast-detail-description code {
    background-color: var(--theme-bg-light);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 1023px) {
    /* Disable sticky header on mobile */
    .podcast-detail-header {
        position: static;
        top: auto;
    }
}

@media (max-width: 768px) {
    .podcast-detail-title {
        font-size: 24px;
        line-height: 32px;
    }
    
    .podcast-detail-title-wrapper {
        gap: 8px;
    }
    
    .podcast-detail-edit-btn {
        width: 28px;
        height: 28px;
    }
    
    .podcast-detail-edit-btn i {
        font-size: 14px;
    }

    .podcast-detail-description {
        font-size: 14px;
        line-height: 20px;
    }

    .podcast-section-content {
        max-width: 100%;
    }
}

