/*
Updated: 2025-12-14 12:00:00
Theme Name: Toompea Theme
Theme URI: http://www.elegantthemes.com/gallery/divi/
Template: Divi
Author: Hans Heiki Metsamaa
Author URI: http://www.elegantthemes.com
Description: Divi Child Theme Smart. Flexible. Beautiful. Divi is the most powerful theme in our collection.
Version: 1.0.20251214e
Changelog:
- v1.0.20251214e: FIX - Re-added missing filter function and switched from :not(:has(.ios-youtube-link)) to positive targeting with .video-iframe-player class for better browser compatibility
- v1.0.20251214d: FIX - Android iframe sizing fixed by removing all min-height constraints, using clean 16:9 aspect-ratio with absolute positioning, added :not(:has(.ios-youtube-link)) selectors to prevent affecting iOS thumbnail solution
- v1.0.20251214c: FIX - Replaced padding-hack with natural image aspect ratio approach, removed forced container heights and black backgrounds causing black bars on iOS/Android
- v1.0.20251214b: FIX - Removed inline styles from iOS YouTube thumbnail, fixed black bar issue using CSS padding-hack for perfect 16:9 aspect ratio on all devices
- v1.0.20251214a: CRITICAL FIX - Fixed Sermon Manager video player bug where full YouTube URL was passed to data-plyr-embed-id instead of video ID, added iOS-specific solution with clickable thumbnail that opens YouTube directly
- v1.0.20251206a: CRITICAL FIX - Scoped mobile heading font-size rules to sermon containers only, removed .et_pb_module_header override to allow Divi Visual Builder responsive heading settings to work properly on mobile
- v1.0.20251202d: Performance optimization - added 12-hour transient caching for sermon years/counts queries, moved inline JS to external file for better browser caching
- v1.0.20251202c: Added loading animation to search button to provide visual feedback during form submission
- v1.0.20251202b: Added safe AJAX-based continuous YouTube thumbnail sync (one sermon per request) to avoid nginx 405/timeouts
- v1.0.20251202a: Improved YouTube thumbnail sync tool - \"Process ALL\" now covers all years and has safer timeout behavior
- v1.0.20251201h: Fixed double outline issue - removed outline when dropdown open or when active filter focused
- v1.0.20251201g: Unified filter active state to use outline (with gap) instead of border - consistent focus/active appearance
- v1.0.20251201f: Fixed searchable dropdown reset - visual state now updates when clearing filters
- v1.0.20251201e: Restored mobile filter toggle button for phone view
- v1.0.20251201d: Fixed sermon filter issues - mobile visibility, arrow/cross overlap, persistent active borders
- v1.0.20251201c: Enhanced sermon filter UX with active states, per-filter clear buttons, and global clear all functionality
- v1.0.20251201b: Updated sermon archive pagination with numbered pages on desktop and simplified arrow navigation on mobile
- v1.0.20251201a: Enhanced sermon archive cards with topics, tags, and fallback message for empty descriptions
- v1.0.20251126k: Unified sermon filter UI styling (all controls 50px height, consistent padding, borders, fonts)
*/

/*----------------------------
   GLOBAL VARIABLES AND STYLES
------------------------------*/

/* CSS Variables */
:root {
    --global-accent-color: #246572; /* Updated accent color */
    --global-grey-tone: #f5f5f5;   /* Default grey tone */
    --button-border-radius: 5px;   /* Default button border radius */
    --button-hover-transform: scale(1.02); /* Default hover effect */
    --button-padding: 12px 20px;    /* Default button padding */
    --input-padding: 12px 15px;     /* Default input/select padding */
    --font-color: #333;             /* Default font color */
    --input-border-color: #ccc;     /* Default input border color */
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05); /* Default box shadow */
    --transition-duration: 0.4s;    /* Default transition duration */
    --font-size-base: 18px;         /* Base font size */
    --line-height-base: 1.5;        /* Base line height */
    --hover-transition: transform var(--transition-duration) ease;
    /* Plyr Player Primary Color */
    --plyr-color-main: var(--global-accent-color);
}


/* Base Styles */
body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--font-color);
}


/* Content area */
#primary,
#primary.content-area {
    padding: 0;
    margin: 0;
}

/* Background color for no-results page */
#content.site-content {
    background-color: #fff;
}

.site-main.wpfc-sermon-container .no-results {
    font-size: 18px;
    color: var(--font-color);
    margin: 0 auto;
}

/*----------------------------
   FILTER BOX STYLES
------------------------------*/

/* ============================================
   SERMON FILTER CONTROLS - UNIFIED VISUAL SYSTEM
   
   Consistent styling for all filter bar controls:
   - Search input, dropdowns, and submit button
   - Same height, padding, borders, and fonts
   - Unified across desktop and mobile
   - Scoped to sermon filters only
   ============================================ */

/* Main filter container */
#wpfc_sermon_sorting {
    padding: 25px !important;
    margin: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 15px !important;
    max-width: 100% !important;
}

/* Sermon filter form */
.sermon-filter-form {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    justify-content: center !important;
    align-content: center !important;
    max-width: 100% !important;
    margin: 20px 0 !important;
}

/* Input and dropdown field wrappers */
.sermon-filter-keyword,
.sermon-filter-year,
.sortPreacher,
.sortSeries,
.sortTopics,
.sortSermonTags,
.sortBooks,
.sermon-filter-submit {
    flex: 1 1 200px !important;
    min-width: 150px !important;
    box-sizing: border-box !important;
    /* Ensure custom dropdowns take full width */
    width: 100%;
}

/* ============================================
   UNIFIED BASELINE FOR ALL FILTER CONTROLS
   
   All inputs, selects, custom dropdowns, and buttons
   share these core visual properties
   ============================================ */

/* Native select fields */
#wpfc_sermon_sorting select#sermon_year,
#wpfc_sermon_sorting select#wpfc_preacher,
#wpfc_sermon_sorting select#wpfc_sermon_series,
#wpfc_sermon_sorting select#wpfc_sermon_topics,
#wpfc_sermon_sorting select#wpfc_sermon_tags,
#wpfc_sermon_sorting select#wpfc_bible_book,
/* Text search input */
#wpfc_sermon_sorting input#sermon_keyword,
/* Custom dropdown controls */
#wpfc_sermon_sorting .custom-dropdown-control {
    /* Dimensions */
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    
    /* Spacing */
    padding: 12px 16px !important;
    margin: 0 !important;
    
    /* Typography */
    font-family: var(--global-font-family, inherit) !important;
    font-size: var(--font-size-base, 16px) !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: var(--ast-form-input-text, #475569) !important;
    
    /* Borders & Backgrounds */
    border: 1px solid var(--input-border-color, #ccc) !important;
    border-radius: var(--button-border-radius, 5px) !important;
    background-color: #ffffff !important;
    
    /* Box Model */
    box-sizing: border-box !important;
    
    /* Interaction */
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    cursor: pointer !important;
}

/* Search input specific (no cursor pointer) */
#wpfc_sermon_sorting input#sermon_keyword {
    cursor: text !important;
}

/* Submit button - matches height and alignment but emphasized styling */
#wpfc_sermon_sorting .sermon-filter-submit button {
    /* Dimensions - same as other controls */
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    
    /* Spacing */
    padding: 12px 20px !important;
    margin: 0 !important;
    
    /* Typography */
    font-family: var(--global-font-family, inherit) !important;
    font-size: var(--font-size-base, 16px) !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    
    /* Emphasized styling */
    background-color: var(--global-accent-color, #246572) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: var(--button-border-radius, 5px) !important;
    
    /* Box Model */
    box-sizing: border-box !important;
    
    /* Interaction */
    cursor: pointer !important;
    transition: transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease !important;
}

.sermon-description-content {
    font-size: 18px;
    line-height: 1.6;
    color: #444;
}

.wpfc-sermon-meta-item {
    font-size: var(--font-size-base) !important;
    line-height: 1.6;
    color: #444;
    margin-bottom: 4px;
    display: inline-block;
}
.wpfc-sermon-meta-item a {
    color: var(--global-accent-color);
    font-weight: 500;
    text-decoration: none;
}
.wpfc-sermon-meta-item a:hover {
    text-decoration: underline;
}

/* ============================================
   SERMON ARCHIVE META FOOTER SEPARATORS
   ============================================ */

/* Add pipe separators between meta items in archive cards */
.wpfc-sermon-footer .wpfc-sermon-meta-item:not(:last-child)::after {
    content: " | ";
    color: #999;
    margin: 0 8px;
}

/* Ensure meta items flow inline */
.wpfc-sermon-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: baseline;
}

/* Style for empty description fallback message */
.wpfc-sermon-description em {
    color: #999;
    font-style: italic;
}

/* ============================================
   MODERN SERMON PAGINATION
   ============================================ */

.sermon-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0 20px;
    padding: 20px;
}

/* Arrow buttons */
.sermon-pagination__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--global-accent-color);
    color: #fff;
    border-radius: var(--button-border-radius);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.sermon-pagination__arrow:hover {
    background: #1a4d57;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(36, 101, 114, 0.3);
}

.sermon-pagination__arrow.is-disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
}

/* Page numbers container (desktop only) */
.sermon-pagination__numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Individual page number */
.sermon-pagination__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: #f5f5f5;
    color: #333;
    border-radius: var(--button-border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sermon-pagination__number:hover {
    background: var(--global-accent-color);
    color: #fff;
    transform: translateY(-1px);
}

.sermon-pagination__number.is-current {
    background: var(--global-accent-color);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(36, 101, 114, 0.3);
}

/* Ellipsis */
.sermon-pagination__ellipsis {
    color: #999;
    padding: 0 4px;
    user-select: none;
}

/* Current page mobile (hidden on desktop) */
.sermon-pagination__current-mobile {
    display: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--global-accent-color);
}

/* Mobile styles */
@media (max-width: 767px) {
    .sermon-pagination {
        gap: 12px;
        margin: 30px 0 15px;
        padding: 15px 10px;
    }
    
    /* Hide page numbers on mobile */
    .sermon-pagination__numbers {
        display: none;
    }
    
    /* Show current page number on mobile */
    .sermon-pagination__current-mobile {
        display: inline-block;
    }
    
    /* Slightly larger arrows on mobile for easier tapping */
    .sermon-pagination__arrow {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
}

/* ============================================
   UNIFIED HOVER & FOCUS STATES
   ============================================ */

/* Hover state for inputs and selects */
#wpfc_sermon_sorting input#sermon_keyword:hover,
#wpfc_sermon_sorting select:hover,
#wpfc_sermon_sorting .custom-dropdown-control:hover {
    border-color: var(--global-accent-color, #246572) !important;
}

/* Focus state for inputs and selects */
#wpfc_sermon_sorting input#sermon_keyword:focus,
#wpfc_sermon_sorting select:focus,
#wpfc_sermon_sorting .custom-dropdown-control:focus {
    outline: 2px solid var(--global-accent-color, #246572) !important;
    outline-offset: 2px !important;
    border-color: var(--global-accent-color, #246572) !important;
}

/* When active filter is focused, remove the child element outline to avoid double outline */
.sermon-filter-wrapper.filter-active input:focus,
.sermon-filter-wrapper.filter-active select:focus,
.sermon-filter-wrapper.filter-active .custom-dropdown-control:focus {
    outline: none !important;
}

/* Also remove outline when dropdown is open to prevent stacking */
.sermon-filter-wrapper .custom-dropdown-control.is-open {
    outline: none !important;
}

/* Button hover state */
#wpfc_sermon_sorting .sermon-filter-submit button:hover {
    background-color: #1d5561 !important; /* Slightly darker accent */
    transform: scale(1.02) !important;
    box-shadow: 0 2px 8px rgba(36, 101, 114, 0.2) !important;
}

/* Button focus state */
#wpfc_sermon_sorting .sermon-filter-submit button:focus {
    outline: 2px solid var(--global-accent-color, #246572) !important;
    outline-offset: 2px !important;
}

/* Button active state */
#wpfc_sermon_sorting .sermon-filter-submit button:active {
    transform: scale(0.98) !important;
}

/* ============================================
   SEARCH BUTTON LOADING STATE
   ============================================ */

/* Button loading state */
#wpfc_sermon_sorting .sermon-filter-submit button.is-loading {
    cursor: wait !important;
    opacity: 0.8 !important;
    pointer-events: none !important;
}

/* Spinner container */
.button-spinner {
    display: inline-block;
    vertical-align: middle;
}

/* Spinner SVG icon */
.spinner-icon {
    width: 20px;
    height: 20px;
    animation: rotate 1s linear infinite;
}

/* Spinner circle path */
.spinner-path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

/* Rotate animation */
@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

/* Dash animation for the spinner circle */
@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Apply hover effect to all buttons */
button:hover,
input[type="submit"]:hover,
.sermon-buttons button:hover,
.related-sermon-item button:hover {
    transform: var(--button-hover-transform);
    transition: var(--hover-transition);
}

/* Hide the filter-toggle button by default */
#wpfc_sermon_sorting .filter-toggle {
    display: none;
}

/* ============================================
   RESPONSIVE STYLES - MOBILE
   
   Maintains unified visual system across all devices
   ============================================ */

@media (max-width: 768px) {
    .sermon-filter-keyword,
    .sermon-filter-year,
    .sortPreacher,
    .sortSeries,
    .sortTopics,
    .sortSermonTags,
    .sortBooks,
    .sermon-filter-submit {
        flex: 1 1 100% !important;
        margin-bottom: 0px !important;
    }
}

@media (max-width: 600px) {
    /* Container adjustments for mobile */
    #wpfc_sermon_sorting {
        padding: 0px !important;
        margin-bottom: 25px !important;
        margin-top: 25px !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    /* Mobile filter toggle button */
    #wpfc_sermon_sorting .filter-toggle {
        display: block !important;
        width: calc(100% - 10px);
        margin: 0 5px;
        
        /* Match button styling */
        height: 50px !important;
        padding: 12px 16px !important;
        font-family: var(--global-font-family, inherit) !important;
        font-size: var(--font-size-base, 16px) !important;
        font-weight: 600 !important;
        line-height: 1.5 !important;
        
        background-color: var(--global-accent-color, #246572) !important;
        color: #ffffff !important;
        text-align: center;
        border: none !important;
        border-radius: var(--button-border-radius, 5px) !important;
        box-sizing: border-box !important;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.3s ease !important;
    }
    
    #wpfc_sermon_sorting .filter-toggle:hover {
        background-color: #1d5561 !important;
        transform: scale(1.02) !important;
    }
    
    /* Form visibility toggle */
    .sermon-filter-form {
        display: none !important;
    }
    
    #wpfc_sermon_sorting.active .sermon-filter-form {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: center !important;
        margin-top: 10px !important;
    }
    
    /* Field wrappers - full width on mobile */
    .sermon-filter-keyword,
    .sermon-filter-year,
    .sortPreacher,
    .sortSeries,
    .sortTopics,
    .sortSermonTags,
    .sortBooks,
    .sermon-filter-submit {
        flex: 1 1 calc(100% - 10px) !important;
        margin: 0 5px !important;
        box-sizing: border-box !important;
    }
    
    /* Maintain consistent height on mobile - DO NOT reduce height */
    #wpfc_sermon_sorting input#sermon_keyword,
    #wpfc_sermon_sorting select#sermon_year,
    #wpfc_sermon_sorting select#wpfc_preacher,
    #wpfc_sermon_sorting select#wpfc_sermon_series,
    #wpfc_sermon_sorting select#wpfc_sermon_topics,
    #wpfc_sermon_sorting select#wpfc_sermon_tags,
    #wpfc_sermon_sorting select#wpfc_bible_book,
    #wpfc_sermon_sorting .custom-dropdown-control,
    #wpfc_sermon_sorting .sermon-filter-submit button {
        /* Keep same 50px height as desktop */
        height: 50px !important;
        min-height: 50px !important;
        max-height: 50px !important;
        
        /* Slightly adjusted padding for mobile */
        padding: 12px 14px !important;
        
        /* Font size slightly smaller but still 16px to prevent iOS zoom */
        font-size: 16px !important;
    }
    
    /* Custom dropdown arrow spacing for mobile */
    #wpfc_sermon_sorting .custom-dropdown-control {
        padding-right: 40px !important;
    }
    
    .sermon-filter-keyword,
    .sermon-filter-year,
    .sortPreacher,
    .sortSeries,
    .sortTopics,
    .sortSermonTags,
    .sortBooks {
        margin-bottom: 10px !important;
    }
}

/* Hide duplicate filter sections on desktop */
@media (min-width: 768px) {
    #wpfc_sermon_sorting:nth-of-type(2) {
        display: none !important;
    }
}

/* ============================================
   SERMON FILTER ACTIVE STATES & CLEAR BUTTONS
   ============================================ */

/* Filter wrapper container for relative positioning */
.sermon-filter-wrapper {
    position: relative !important;
    transition: all 0.3s ease !important;
}

/* Active filter state - use outline instead of border (creates gap) */
.sermon-filter-wrapper.filter-active {
    outline: 2px solid var(--global-accent-color, #246572) !important;
    outline-offset: 2px !important;
    background-color: rgba(36, 101, 114, 0.05) !important;
    border-radius: var(--button-border-radius) !important;
}

/* Keep the wrapper outline even when child is focused (prevents double outline) */
.sermon-filter-wrapper.filter-active:focus-within {
    outline: 2px solid var(--global-accent-color, #246572) !important;
    outline-offset: 2px !important;
}

/* Clear filter buttons */
.filter-clear {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #f5f5f5 !important;
    border: none !important;
    color: #666 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    width: 28px !important;
    height: 28px !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
}

/* Show clear button when filter is active */
.sermon-filter-wrapper.filter-active .filter-clear {
    display: flex !important;
}

/* Clear button hover state */
.filter-clear:hover {
    background-color: var(--global-accent-color, #246572) !important;
    color: #fff !important;
    transform: translateY(-50%) scale(1.15) !important;
}

/* Mobile adjustments for filter wrappers */
@media (max-width: 767px) {
    .sermon-filter-wrapper {
        flex: 1 1 calc(100% - 10px) !important;
        margin: 0 5px !important;
        box-sizing: border-box !important;
    }

    /* Ensure wrapper has proper dimensions */
    .sermon-filter-wrapper.sermon-filter-keyword,
    .sermon-filter-wrapper.sermon-filter-year,
    .sermon-filter-wrapper.sortPreacher,
    .sermon-filter-wrapper.sortSeries,
    .sermon-filter-wrapper.sortTopics,
    .sermon-filter-wrapper.sortSermonTags,
    .sermon-filter-wrapper.sortBooks {
        min-height: 50px !important;
    }

    /* Clear button adjustments for mobile */
    .filter-clear {
        width: 36px !important;
        height: 36px !important;
        right: 8px !important;
    }

    /* Clear all button takes full width on mobile */
    .sermon-filter-clear-all {
        flex: 1 1 calc(100% - 10px) !important;
        margin: 0 5px !important;
        order: 999; /* Push to bottom of filters */
    }

    .sermon-filter-clear-all-btn {
        width: 100% !important;
        margin-top: 10px !important;
    }
}

/* Clear All Filters Button */
.sermon-filter-clear-all {
    flex: 1 1 200px !important;
    min-width: 150px !important;
    box-sizing: border-box !important;
}

.sermon-filter-clear-all-btn {
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding: 12px 15px !important;
    line-height: 1.5 !important;
    border: 2px solid var(--global-accent-color, #246572) !important;
    border-radius: var(--button-border-radius) !important;
    background: transparent !important;
    color: var(--global-accent-color, #246572) !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.sermon-filter-clear-all-btn:hover {
    background: var(--global-accent-color, #246572) !important;
    color: #fff !important;
    transform: scale(1.02) !important;
}

.sermon-filter-clear-all-btn:focus {
    outline: 2px solid var(--global-accent-color, #246572) !important;
    outline-offset: 2px !important;
}

/* Adjust padding for selects when clear button is present */
.sermon-filter-wrapper.filter-active select {
    padding-right: 50px !important;
}

/* Keyword input clear button positioning */
.sermon-filter-wrapper.sermon-filter-keyword.filter-active input {
    padding-right: 50px !important;
}

/* Custom dropdown arrow adjustment */
.sermon-filter-wrapper .custom-dropdown-control {
    padding-right: 50px !important;
}

/* Prevent clear button from interfering with dropdown clicks */
.filter-clear {
    pointer-events: auto !important;
}

/* Hide native select arrow when filter is active (browsers that support it) */
.sermon-filter-wrapper.filter-active select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: none !important;
}

/*----------------------------
   POST STYLING
------------------------------*/

/* Individual posts */
.wpfc-sermon > .wpfc-sermon-inner {
    background: #fff;
    box-shadow: var(--box-shadow) !important;
    border: 0 !important;
    border-radius: var(--button-border-radius) 0 0 var(--button-border-radius) !important; /* Desktop default */
    transition: transform 0.5s ease;
}

.wpfc-sermon > .wpfc-sermon-inner:hover {
    transform: scale(1.01);
}

/* Image corners */
.wpfc-sermon-image-img {
    width: 100%;
    background-size: cover;
    background-position: center;
    border-radius: var(--button-border-radius) 0 0 var(--button-border-radius) !important; /* Desktop default */
}

@media (max-width: 700px) {
    .wpfc-sermon-image-img {
        border-radius: var(--button-border-radius) var(--button-border-radius) 0 0 !important; /* Mobile: top-left & top-right */
    }
}

/*----------------------------
   SERMON SINGLE PAGE STYLES
------------------------------*/

/* Breadcrumbs */
.sermon-breadcrumbs {
    font-size: 19px;
    color: #4a5764;
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
}

.sermon-breadcrumbs a {
    color: var(--global-accent-color);
    text-decoration: none;
}

.sermon-breadcrumbs a:hover {
    text-decoration: underline;
}

.sermon-breadcrumbs span {
    color: var(--font-color);
    font-weight: bold;
}

nav.sermon-breadcrumbs span,
nav.sermon-breadcrumbs a {
    margin: 0 8px;
}

/* Sermon Container */
.sermon-container {
    max-width: 1300px;
    margin: 0 auto !important;
    padding: 20px 20px 75px 20px !important;
    display: flex;
    flex-direction: column;
}

body:not(.et-tb) #main-content .container,
body:not(.et-tb-has-header) #main-content .container {
    max-width: 1300px !important;
    width: 100%;
    margin: 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
}

/* Minimalistic Section Headers */
.sermon-details-header,
.sermon-description-header {
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.sermon-details-header h3,
.sermon-description-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--font-color);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sermon-description-header h3 .section-icon {
    color: var(--global-accent-color);
    flex-shrink: 0;
}

/* Clean Media Section */
.sermon-media-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Sermon Details */
.sermon-details {
    flex: 1;
    background-color: #fafafa;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

/* Compact Meta List */
.sermon-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.sermon-meta-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.5;
}

.sermon-meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 18px;
    min-width: 80px;
    flex-shrink: 0;
}

.meta-value {
    color: var(--font-color);
    font-size: 18px;
    flex: 1;
}

/* Sermon Details Links */
.sermon-details a,
.meta-value a {
    color: var(--global-accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sermon-details a:hover,
.meta-value a:hover {
    color: #1a4f5a;
    text-decoration: underline;
}

#et-boc #et-main-area .sermon-container .related-sermons .related-sermons-grid .related-sermon-item p {
    padding: 0px;
  }

/* Targeting all links with rel="tag" */
a[rel="tag"],
a[rel="tag"]:visited,
a[rel="tag"]:active {
    color: var(--global-accent-color) !important;
    text-decoration: none !important;
}

a[rel="tag"]:hover {
    text-decoration: underline !important;
}

.sermon-details a:hover {
    text-decoration: underline;
}

/* Sermon Content */
.sermon-content {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.sermon-content p {
    margin: 0px;
}

.sermon-media,
.sermon-media-section {
    flex: 1.6;
}

.sermon-details {
    flex: 1;
}

.sermon-media.active {
    display: block;
}

.sermon-media {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Robust Video Container - Safari & iOS Compatible */
.sermon-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    contain: layout size;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Desktop: Plyr fills container completely - for iframe videos only */
.sermon-media .video-iframe-player,
.sermon-media:has(.video-iframe-player) iframe,
.sermon-media:has(.video-iframe-player) video,
.sermon-media:has(.video-iframe-player) .plyr,
.sermon-media:has(.video-iframe-player) .plyr__video-wrapper {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    border-radius: 8px;
    object-fit: contain;
    object-position: center center;
}

/* Mobile: Smart player visibility with complete box hiding */
@media (max-width: 768px) {
    /* Video sermon styles - NOT audio-priority - for iframe videos only */
    .sermon-media:not(.sermon-media-section--audio-priority .sermon-media):has(.video-iframe-player) {
        display: block;
        background: #000; /* Prevent white space while loading */
        aspect-ratio: 16/9;
        border-radius: 8px;
        overflow: hidden;
        position: relative;
        width: 100%;
        height: auto;
    }
    
    /* Default state - will be controlled by JavaScript based on available content */
    /* Only for video sermons, not audio-priority */
    .sermon-media-section:not(.sermon-media-section--audio-priority) #video-player {
        display: none; /* Hidden by default, JS will show if needed */
    }
    
    .sermon-media-section:not(.sermon-media-section--audio-priority) #audio-player {
        display: none; /* Hidden by default, JS will show if needed */
    }
    
    /* When video is active - show video, completely hide audio */
    .sermon-media.video-active #video-player {
        display: block !important;
    }
    
    /* Hide the ENTIRE audio-player div when video is active */
    .sermon-media.video-active #audio-player {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* When audio is active - show audio, completely hide video */
    .sermon-media.audio-active #video-player {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        z-index: -1 !important;
        width: 0 !important;
    }
    
    .sermon-media.audio-active #audio-player {
        display: block !important;
        position: relative !important;
        left: auto !important;
        background: transparent !important;
    }
    
    /* Adjust media container height and background for audio */
    .sermon-media.audio-active {
        min-height: 60px; /* Just enough for audio player */
        max-height: 80px; /* Limit height */
        aspect-ratio: unset;
        background: white !important; /* Pure white background */
        border-radius: 8px;
        padding: 10px;
    }
    
    .sermon-media.video-active {
        aspect-ratio: 16/9;
        width: 100%;
        height: auto;
    }
    
    /* Hide video Plyr on mobile */
    #video-player .plyr {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Keep audio Plyr visible when active - only for video sermons, not audio-priority */
    .sermon-media-section:not(.sermon-media-section--audio-priority) #audio-player .plyr {
        display: block !important;
        visibility: visible !important;
        background: white !important; /* Pure white background */
        border-radius: 8px;
        min-height: 50px; /* Compact audio player */
        max-height: 60px;
        padding: 8px;
        border: 1px solid #e5e7eb;
    }
    
    /* Audio player controls styling - only for video sermons */
    .sermon-media-section:not(.sermon-media-section--audio-priority) #audio-player .plyr__controls {
        background: transparent !important;
        border-radius: 6px;
    }
    
    /* Audio player progress bar - only for video sermons */
    .sermon-media-section:not(.sermon-media-section--audio-priority) #audio-player .plyr__progress {
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    /* Fast native video display with optimizations - for iframe videos only */
    #video-player .video-iframe-player {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 16/9 !important;
        object-fit: contain !important;
        border-radius: 8px;
        background: #000;
        visibility: visible !important;
        opacity: 1 !important;
        border: 0;
    }
    
    #video-player:has(.video-iframe-player) iframe,
    #video-player:has(.video-iframe-player) video {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 16/9 !important;
        object-fit: contain !important;
    }
    
    /* Loading state optimization */
    .sermon-media.loading {
        background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
        background-size: 200% 100%;
        animation: loading-shimmer 2s infinite;
    }
    
    @keyframes loading-shimmer {
        0% { background-position: 200% 0; }
        100% { background-position: -200% 0; }
    }
    
    /* Mobile button active states */
    .sermon-buttons button.active-player {
        background: #2563eb !important;
        color: white !important;
        transform: scale(1.02);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    }
    
    .sermon-buttons button:not(.active-player) {
        opacity: 0.8;
    }
    
    /* Force hide audio player container completely when video is active */
    .sermon-media.video-active + #audio-player,
    .video-active #audio-player,
    body.mobile .sermon-media.video-active ~ #audio-player {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        z-index: -1 !important;
    }
    
    /* Force hide video player container completely when audio is active */
    .sermon-media.audio-active + #video-player,
    .audio-active #video-player,
    body.mobile .sermon-media.audio-active ~ #video-player,
    body.mobile .audio-active #video-player,
    #video-player.sermon-media.audio-active,
    div.sermon-media.audio-active#video-player {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        width: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        z-index: -1 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        max-height: 0 !important;
        max-width: 0 !important;
    }
    
    /* Additional nuclear option for video player hiding */
    @media (max-width: 768px) {
        #video-player.audio-active,
        #video-player.sermon-media.audio-active,
        .audio-active#video-player {
            display: none !important;
            visibility: hidden !important;
            position: absolute !important;
            left: -10000px !important;
            top: -10000px !important;
            width: 0 !important;
            height: 0 !important;
            z-index: -999 !important;
            opacity: 0 !important;
            overflow: hidden !important;
        }
        
        #video-player.audio-active * {
            display: none !important;
            visibility: hidden !important;
        }
    }
}

/* ============================================
   SERMON AUDIO PLAYER TWEAKS (Audio-only sermons)
   ============================================ */

/* 1) Remove inner card styling - use only the outer card */
.sermon-media-section--audio-priority .sermon-media {
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    min-height: 0;
    padding: 0;
    aspect-ratio: unset;
    height: auto;
    overflow: visible;
}

/* 2) Center the audio player inside the outer card */
.sermon-media-section--audio-priority {
    display: flex;
    align-items: flex-end; /* Align to bottom - change to 'center' for middle, 'flex-start' for top */
    justify-content: center; /* Horizontally center */
    min-height: 220px; /* enough space without huge empty area */
    padding: 32px 24px;
    border-radius: 12px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    overflow: visible;
    }
    
.sermon-media-section--audio-priority .plyr {
    width: 100%;
    max-width: 720px;
}

/* Remove any decorative elements */
.sermon-media-section--audio-priority::after,
.sermon-media-section--audio-priority #audio-player::before {
    display: none;
    }
    
/* Remove inner card from #audio-player and center it */
.sermon-media-section--audio-priority #audio-player {
    width: 100%;
    max-width: 720px;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure Plyr player fits nicely */
.sermon-media-section--audio-priority #audio-player .plyr,
.sermon-media-section--audio-priority #audio-player audio {
    position: relative !important;
    min-height: 0 !important;
    height: auto !important;
        background: transparent !important;
    box-shadow: none !important;
    max-width: 100%;
    }
    
.sermon-media-section--audio-priority #audio-player .plyr__controls {
        background: transparent !important;
}

/* Brand-colored progress bar */
.sermon-media-section--audio-priority .audio-primary-player .plyr__progress,
.sermon-media-section--audio-priority #audio-player .plyr__progress {
    background: rgba(36, 101, 114, 0.1) !important;
}

.sermon-media-section--audio-priority .audio-primary-player .plyr__progress input,
.sermon-media-section--audio-priority #audio-player .plyr__progress input {
    color: var(--global-accent-color) !important;
}

/* ============================================
   PLYR SETTINGS MENU FIX
   ============================================ */

/* 3) Make sure Plyr menu is really hidden when the hidden attribute is present */
.sermon-media-section .plyr__menu__container[hidden] {
    display: none !important;
}

/* 4) Anchor the dropdown just under the settings icon and keep it inside the card */
.sermon-media-section .plyr__controls__item.plyr__menu {
    position: relative;
    overflow: visible;
}

.sermon-media-section .plyr__menu__container {
    position: absolute;
    top: calc(100% + 8px);  /* just under the controls bar */
    right: 0;
    left: auto;
    bottom: auto;
    transform: none;
    z-index: 50;
    width: auto;
    max-width: 240px;
    height: auto;
    /* Use Plyr's default styling */
    background: rgba(255, 255, 255, 0.98);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Style the menu buttons to match Plyr defaults */
.sermon-media-section .plyr__menu__container .plyr__control {
    background: transparent;
    border: none;
    color: #4a5464;
        border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    text-align: left;
    width: 100%;
    cursor: pointer;
        transition: background 0.2s ease;
    }
    
.sermon-media-section .plyr__menu__container .plyr__control:hover {
    background: rgba(74, 84, 100, 0.08);
    }
    
.sermon-media-section .plyr__menu__container .plyr__control[aria-checked="true"] {
    background: rgba(36, 101, 114, 0.12);
    color: var(--global-accent-color);
        font-weight: 500;
}

/* Menu value styling */
.sermon-media-section .plyr__menu__container .plyr__menu__value {
    color: #8f9bb3;
    float: right;
        font-size: 13px;
}

/* Back button styling */
.sermon-media-section .plyr__menu__container .plyr__control--back {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 4px;
    padding-bottom: 8px;
    font-weight: 500;
    }
    
/* Ensure parent doesn't clip the menu */
.sermon-media-section--audio-priority,
.sermon-media-section--audio-priority .sermon-media,
.sermon-media-section--audio-priority #audio-player {
    overflow: visible;
}

/* ============================================
   BUTTON STYLING FOR AUDIO-PRIMARY
   ============================================ */

.sermon-container.audio-only .sermon-buttons {
    justify-content: flex-start;
}

.sermon-buttons button.audio-primary {
    background: var(--global-accent-color);
    color: white;
    border-color: var(--global-accent-color);
    box-shadow: 0 4px 12px rgba(36, 101, 114, 0.25);
}

.sermon-buttons button.audio-primary:hover {
    background: #1a4f5a;
    border-color: #1a4f5a;
    box-shadow: 0 6px 16px rgba(36, 101, 114, 0.35);
    }
    
/* ============================================
   MOBILE RESPONSIVE TWEAKS
   ============================================ */

@media (max-width: 768px) {
    /* Audio-priority specific mobile styles */
    .sermon-media-section--audio-priority {
        padding: 16px !important;
        min-height: 140px !important;
        /* Keep flex layout for proper centering on mobile */
        display: flex !important;
        align-items: center !important; /* Center vertically on mobile for better UX */
        justify-content: center !important;
        background: #fafafa !important;
        border: 1px solid #f0f0f0 !important;
        border-radius: 12px !important;
    }
    
    /* Override any conflicting video styles for audio-priority */
    .sermon-media-section--audio-priority .sermon-media {
        display: flex !important;
        background: none !important;
        min-height: 0 !important;
        aspect-ratio: unset !important;
        overflow: visible !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* Ensure audio player wrapper is properly sized on mobile */
    .sermon-media-section--audio-priority #audio-player {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
    }
    
    /* Make sure Plyr is visible and properly styled for audio-priority */
    .sermon-media-section--audio-priority #audio-player .plyr {
        display: block !important;
        visibility: visible !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
        border: none !important;
        min-height: auto !important;
        max-height: none !important;
        padding: 0 !important;
    }
    
    .sermon-media-section--audio-priority .plyr__controls {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: transparent !important;
        padding: var(--plyr-control-spacing, 10px) !important;
    }
    
    /* Ensure settings menu works on mobile for audio-priority */
    .sermon-media-section--audio-priority .plyr__menu__container {
        position: fixed !important;
        right: 8px;
        top: auto !important;
        bottom: auto !important;
    }
}

/* Desktop audio player white background */
@media (min-width: 769px) {
    #audio-player .plyr {
        background: white !important;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 8px;
    }
    
    #audio-player .plyr__controls {
        background: white !important;
        border-radius: 6px;
    }
}

/* Desktop Plyr settings styling - REMOVED dark theme, now using light menu styles from sermon audio section */

/* iOS specific video attributes for inline playback */
.sermon-media video {
    -webkit-playsinline: true;
    playsinline: true;
    controls: true;
    preload: metadata;
    object-fit: cover;
    object-position: center center;
}

/* YouTube/Vimeo iframe parameters for iOS */
/* Note: 'allow' attribute is set in HTML, not CSS */
.sermon-media iframe[src*="youtube.com"],
.sermon-media iframe[src*="youtu.be"],
.sermon-media iframe[src*="vimeo.com"] {
    /* Styling only - allow attribute must be set on iframe HTML element */
    border: none !important;
    border-radius: 8px;
}

/* Simple controls positioning */
.sermon-media .plyr__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
}

/* iOS plyr fixes - less aggressive approach */
/* Desktop Safari plyr fixes only */
@media (min-width: 769px) {
    @supports (-webkit-touch-callout: none) {
        .sermon-media .plyr__controls {
            pointer-events: auto !important;
            z-index: 10 !important;
        }
    }
}

/* Safari fullscreen - Proper video scaling */
.sermon-media .plyr:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 999999 !important;
    max-width: none !important;
    max-height: none !important;
}

.sermon-media .plyr:-webkit-full-screen .plyr__video-wrapper,
.sermon-media .plyr:-webkit-full-screen video,
.sermon-media .plyr:-webkit-full-screen iframe {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
}

.sermon-media .plyr:not(:-webkit-full-screen) {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

/* Force video/iframe reset after Safari fullscreen exit */
.sermon-media .plyr:not(:-webkit-full-screen) video,
.sermon-media .plyr:not(:-webkit-full-screen) iframe {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

/* Ensure video container matches right column height */
.sermon-content {
    align-items: stretch;
}

/* Keep min-height for video sermons only, not audio-only */
.sermon-media-section:not(.sermon-media-section--audio-priority),
.sermon-details {
    min-height: 450px;
}

.sermon-media {
    height: 100%;
}

/* Video sermons keep their aspect ratio and sizing - for iframe videos only */
.sermon-media-section:not(.sermon-media-section--audio-priority) .sermon-media:has(.video-iframe-player) {
    aspect-ratio: 16/9;
}

.sermon-media:has(.video-iframe-player) iframe,
.sermon-media:has(.video-iframe-player) video {
    height: 100% !important;
    aspect-ratio: 16/9;
}

/* Modern Sermon Buttons */
.sermon-buttons {
    display: flex;
    gap: 12px;
    padding-top: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: auto;
}

.sermon-buttons button {
    padding: 14px 24px;
    border: 2px solid var(--global-accent-color);
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: white;
    color: var(--global-accent-color);
    box-shadow: 0 3px 12px rgba(36, 101, 114, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.sermon-buttons button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.sermon-buttons button:hover::before {
    left: 100%;
}

.sermon-buttons button:hover {
    background-color: var(--global-accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 101, 114, 0.25);
}

.sermon-buttons button.active {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: default;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sermon-buttons button.active:hover {
    background-color: #f8f9fa;
    color: #6c757d;
    transform: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Clean Sermon Description */
.sermon-description {
    margin-bottom: 32px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    padding: 24px;
}

.sermon-description-content {
    background: white;
    padding: 20px;
    border-radius: 6px;
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: #374151;
    border: 1px solid #f3f4f6;
}

.sermon-description-content p {
    margin-bottom: 16px;
}

.sermon-description-content p:last-child {
    margin-bottom: 0;
}

/* Sermon Description Links */
.sermon-description a {
    color: var(--global-accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sermon-description a:hover {
    color: #1a4f5a;
    text-decoration: underline;
}

/*----------------------------
   RESPONSIVE STYLES
------------------------------*/

@media (max-width: 1200px) {
    .related-sermons-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
}

@media (max-width: 1024px) {
    .sermon-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .sermon-container {
        padding: 15px 15px 40px 15px !important;
    }
    
    .sermon-media-section,
    .sermon-details {
        flex: 1;
        min-height: auto;
    }
    
    .sermon-details {
        padding: 20px;
    }
    
    .sermon-description {
        padding: 20px;
    }
    
    .sermon-description-content {
        padding: 18px;
    }
    
    .sermon-details-header h3,
    .sermon-description-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .sermon-container {
        padding: 12px 12px 30px 12px !important;
    }
    
    .sermon-content {
        gap: 16px;
        flex-direction: column;
    }
    
    .sermon-details {
        padding: 16px;
    }
    
    /* Mobile: Simple native video setup - for iframe videos only */
    .sermon-media:has(.video-iframe-player) {
        aspect-ratio: 16/9;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    /* Mobile: Hide plyr, show native - for iframe videos only */
    .sermon-media:has(.video-iframe-player) .plyr {
        display: none !important;
    }
    
    .sermon-media:has(.video-iframe-player) iframe,
    .sermon-media:has(.video-iframe-player) video {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 16/9 !important;
        object-fit: contain !important;
        object-position: center center;
    }
    
    /* iOS mobile video attributes */
    .sermon-media video {
        -webkit-playsinline: true !important;
        playsinline: true !important;
        controls: true !important;
    }
    
    /* Mobile plyr controls - less aggressive approach */
    .sermon-media .plyr__controls {
        pointer-events: auto !important;
        z-index: 10 !important;
    }
    
    /* Fix plyr video wrapper alignment on mobile */
    .sermon-media .plyr__video-wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .sermon-media .plyr__video-wrapper video,
    .sermon-media .plyr__video-wrapper iframe {
        object-fit: contain !important;
        object-position: center center !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    .sermon-media-section,
    .sermon-details {
        min-height: auto;
    }
    
    .sermon-description {
        padding: 16px;
    }
    
    .sermon-description-content {
        padding: 16px;
    }
    
    .sermon-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .sermon-buttons button {
        width: 100%;
        min-width: auto;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .sermon-meta-item {
        padding: 6px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .meta-label {
        font-size: 18px;
        min-width: auto;
    }
    
    .meta-value {
        font-size: 18px;
    }
    
    .sermon-details-header h3,
    .sermon-description-header h3 {
        font-size: 18px;
    }
    
    .sermon-media-section,
    .sermon-details {
        min-height: auto;
        flex: 1;
    }
    
    .related-sermons {
        padding: 16px;
        margin-top: 20px;
    }
    
    .related-sermons > h3 {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .related-sermons-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    .related-sermon-item {
        border-radius: 6px;
        max-width: none;
    }
    
    .related-sermon-item h4 {
        font-size: 18px;
        margin: 12px 12px 8px 12px;
    }
    
    .related-sermon-item p {
        font-size: 18px;
        margin: 0 12px 12px 12px;
    }
    
    .related-sermon-item img {
        height: 140px;
    }
    
    .sermon-filter-keyword,
    .sermon-filter-year,
    .sermon-filter-submit {
        flex: 1 1 100%;
    }
    #filterOverlay div {
        width: 90% !important;
        margin: 10% auto !important;
    }
    .related-sermons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .related-sermons {
        padding: 20px;
        margin-top: 24px;
    }
    
    .related-sermons > h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .related-sermon-item h4 {
        font-size: 18px;
        margin: 16px 16px 10px 16px;
    }
    
    .related-sermon-item p {
        font-size: 18px;
        margin: 0 16px 16px 16px;
    }
}

@media (max-width: 700px) {
    .sermon-breadcrumbs {
        font-size: var(--font-size-base);
    }
    .sermon-container {
        padding: 5px 5px 20px 5px !important;
    }
    .sermon-content p {
        margin: 5px 0;
    }
    .sermon-media {
        margin-bottom: 20px;
        width: 100%;
    }
    .sermon-buttons button {
        margin-bottom: 10px;
        font-size: 14px !important;
    }
    .sermon-description {
        margin-top: 0;
    }
    .sermon-container, .related-sermon-item, .sermon-description, .sermon-details {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .sermon-description, .sermon-details {
        font-size: 1rem !important;
    }
    .wpfc-sermon-meta-item {
        font-size: 1rem !important;
        margin-bottom: 2px;
    }
}

/* SCOPED MOBILE HEADINGS - Only applies to sermon-specific content areas
   Divi Visual Builder module responsive settings are no longer overridden.
   This ensures heading font size changes in the Visual Builder work as expected. */
@media (max-width: 700px) {
    /* Sermon container headings only */
    .sermon-container h1,
    .sermon-container .entry-title,
    .wpfc-sermon-container h1,
    .wpfc-sermon-container .entry-title {
        font-size: 2rem !important;
        line-height: 1.1 !important;
    }
    
    .sermon-container h2,
    .wpfc-sermon-container h2 {
        font-size: 1.5rem !important;
        line-height: 1.15 !important;
    }
    
    .sermon-container h3,
    .wpfc-sermon-container h3 {
        font-size: 1.2rem !important;
        line-height: 1.2 !important;
    }
    
    /* NOTE: Removed .et_pb_module_header from selector to allow Divi 
       Heading modules to use their own responsive settings from Visual Builder */
}

/*big error :D koodi lõpp on lahti. Üks lehe osa püsib selliselt korras ja teine osa laguneb ära kui sulgemise sulg lisada. */

.plyr__video-embed iframe {
    position: absolute;
}

/*---------------------------
   RELATED SERMONS STYLES - TAILWIND INSPIRED
------------------------------*/

.related-sermons {
    margin-top: 32px;
    margin-bottom: 32px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    padding: 24px;
}

.related-sermons > h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--font-color);
    margin: 0 0 24px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.related-sermons-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    justify-items: start;
}

.related-sermon-item {
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.related-sermon-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #e5e7eb;
}

.related-sermon-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    aspect-ratio: 16/9;
    border-radius: 8px 8px 0 0;
}

.related-sermon-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-sermon-item h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--font-color);
    margin: 16px 16px 12px 16px;
    line-height: 1.4;
}

.related-sermon-item p {
    font-size: 18px;
    color: #6b7280;
    margin: 0 16px 16px 16px;
    line-height: 1.5;
}

.related-sermon-item p strong {
    font-weight: 500;
    color: #374151;
}

.related-sermon-item p a {
    color: var(--global-accent-color);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-sermon-item p a:hover {
    color: #1a4f5a;
    text-decoration: underline;
}

.related-sermon-link {
    text-decoration: none;
    color: inherit;
}

/*---------------------------
   OTHER STYLES
------------------------------*/

body:not(.et-tb) #main-content .container,
body:not(.et-tb-has-header) #main-content .container {
    padding-top: 0px !important;
}

.sermon-filter-date-from input,
.sermon-filter-date-to input {
    width: 100%;
    padding: var(--input-padding);
    line-height: 1.5;
    border: 1px solid var(--input-border-color);
    border-radius: var(--button-border-radius);
    box-sizing: border-box;
    color: #475569;
}

/* Sermon Blog Post Links (Jutlustaja and Topic) */
.wpfc-sermon-meta a,
.wpfc-sermon-meta a:visited,
.wpfc-sermon-meta a:active {
    color: var(--global-accent-color);
    text-decoration: none;
}

.wpfc-sermon-meta a:hover {
    text-decoration: underline;
}

/* Sermon Detail Links (Added as per your request) */
.sermon-details a,
.sermon-details a:visited,
.sermon-details a:active {
    color: var(--global-accent-color);
    text-decoration: none;
}

.sermon-details a:hover {
    text-decoration: underline;
}

/* Apply global accent color to any links within the sermon description */
.sermon-description a,
.sermon-description a:visited,
.sermon-description a:active {
    color: var(--global-accent-color);
    text-decoration: none;
}

.sermon-description a:hover {
    text-decoration: underline;
}

@media (min-width: 981px) {
    #left-area {
        width: 100% !important;
        float: none !important;
        margin: 0 auto !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 700px) {
    .related-sermons {
        padding: 12px;
        margin-top: 16px;
    }
    
    .related-sermons > h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .related-sermons-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    
    .related-sermon-item h4 {
        font-size: 18px;
        margin: 10px 10px 6px 10px;
    }
    
    .related-sermon-item p {
        font-size: 18px;
        margin: 0 10px 10px 10px;
    }
    
    .related-sermon-item img {
        height: 120px;
    }
    
    .related-sermon-item {
        max-width: none;
    }
}

input#sermon_keyword,
select#sermon_year,
select#wpfc_preacher,
select#wpfc_sermon_series,
select#wpfc_sermon_topics,
select#wpfc_bible_book,
.sermon-filter-submit button {
    font-size: clamp(1rem, 2vw, 1.125rem) !important;
    min-height: 44px !important;
}

@media (max-width: 700px) {
    .sermon-filter-keyword,
    .sermon-filter-year,
    .sortPreacher,
    .sortSeries,
    .sortTopics,
    .sortBooks,
    .sermon-filter-submit {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
    input#sermon_keyword,
    select#sermon_year,
    select#wpfc_preacher,
    select#wpfc_sermon_series,
    select#wpfc_sermon_topics,
    select#wpfc_bible_book,
    .sermon-filter-submit button {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/*----------------------------
   SEARCHABLE DROPDOWN FIXES
   Ensure native selects are hidden when custom dropdowns are active
------------------------------*/

/* Hide native selects that have been converted to custom dropdowns */
.sortPreacher select#wpfc_preacher:not(:only-child),
.sortSeries select#wpfc_sermon_series:not(:only-child),
.sortTopics select#wpfc_sermon_topics:not(:only-child),
.sortBooks select#wpfc_bible_book:not(:only-child) {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Ensure custom dropdown wrappers take full width in their containers */
.sortPreacher .custom-dropdown-wrapper,
.sortSeries .custom-dropdown-wrapper,
.sortTopics .custom-dropdown-wrapper,
.sortBooks .custom-dropdown-wrapper {
    width: 100% !important;
    display: block !important;
}

/*----------------------------
   IOS YOUTUBE THUMBNAIL FIX
   Replace iframe with clickable thumbnail for better iOS compatibility
   Let image maintain its natural 16:9 aspect ratio without forcing container height
------------------------------*/

/* iOS YouTube Link - Clickable Thumbnail */
.wpfc-sermon-video-player.ios-youtube-link {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

/* Remove any aspect ratio hacks - let image determine height naturally */
.wpfc-sermon-video-player.ios-youtube-link::before,
.wpfc-sermon-video-player.ios-youtube-link::after {
    content: none !important;
    display: none !important;
}

/* Let image maintain its natural 16:9 aspect ratio */
.wpfc-sermon-video-player.ios-youtube-link img {
    display: block;
    width: 100%;
    height: auto; /* NOT 100% - let it scale naturally */
    object-fit: contain; /* Don't crop anything */
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

/* Hover effect */
.wpfc-sermon-video-player.ios-youtube-link:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.wpfc-sermon-video-player.ios-youtube-link:hover img {
    opacity: 0.9;
}

/* Play button centered on image */
.wpfc-sermon-video-player.ios-youtube-link .youtube-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.wpfc-sermon-video-player.ios-youtube-link .youtube-play-overlay svg {
    width: 40px;
    height: 40px;
    fill: white;
    transition: transform 0.2s ease;
}

.wpfc-sermon-video-player.ios-youtube-link:hover .youtube-play-overlay {
    background: rgba(255, 0, 0, 1);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Badge in bottom right corner */
.wpfc-sermon-video-player.ios-youtube-link .ios-youtube-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    pointer-events: none;
}

/* Loading state for thumbnail */
.wpfc-sermon-video-player.ios-youtube-link img[src*="maxresdefault.jpg"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Mobile-specific overrides to remove any forced heights or black backgrounds */
@media (max-width: 767px) {
    /* Ensure containers don't force height or show black background */
    .sermon-media-section,
    .sermon-media-section #video-player,
    .sermon-media-section .wpfc-sermon-video-player.ios-youtube-link {
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }

    /* Remove any existing aspect-ratio hacks */
    .sermon-media-section .wpfc-sermon-video-player.ios-youtube-link::before,
    .sermon-media-section .wpfc-sermon-video-player.ios-youtube-link::after {
        content: none !important;
        display: none !important;
    }

    /* Let image maintain natural 16:9 proportions */
    .sermon-media-section .wpfc-sermon-video-player.ios-youtube-link img {
        display: block;
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 12px;
    }

    /* Smaller play button on mobile */
    .sermon-media-section .wpfc-sermon-video-player.ios-youtube-link .youtube-play-overlay {
        width: 60px;
        height: 60px;
    }

    .sermon-media-section .wpfc-sermon-video-player.ios-youtube-link .youtube-play-overlay svg {
        width: 30px;
        height: 30px;
    }

    /* Smaller badge on mobile */
    .sermon-media-section .wpfc-sermon-video-player.ios-youtube-link .ios-youtube-badge {
        font-size: 11px;
        padding: 5px 10px;
        bottom: 10px;
        right: 10px;
    }
}

/* Desktop layout */
@media (min-width: 768px) {
    .sermon-content {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 24px;
    }

    .sermon-media-section,
    .sermon-details {
        flex: 1 1 0;
    }
}





/*Otseülekande CSS*/
.tp-yt-wrap{
  position:relative;
  width:100%;
  padding-top:56.25%;
  border-radius:12px;
  overflow:hidden;
}
.tp-yt-wrap iframe,
.tp-yt-wrap .tp-yt-fallback{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}
.tp-yt-wrap .tp-yt-fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
  background:#f6f6f6;
  font-size:18px;
}
