/* ==========================================================================
   AIC Egerton Chapel — Standardized Sermon Cards & Container Layout
   ========================================================================== */

/* Container Layout (Desktop & Tablets) */
.sermons-list,
.sermon-grid,
#sermons-container,
#sermon-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    align-items: stretch;
    gap: 28px;
    width: 100%;
    box-sizing: border-box;
}

/* Single-Column Stack on Mobile Viewports (prevents horizontal bleed and awkward stacking) */
@media (max-width: 768px) {
    .sermons-list,
    .sermon-grid,
    #sermons-container,
    #sermon-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .sermon-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
}

/* Sermon Card Component */
.sermon-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(51, 32, 90, 0.08);
    box-shadow: 0 8px 24px rgba(23, 18, 38, 0.07);
    overflow: hidden;
    text-align: left;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sermon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(51, 32, 90, 0.13);
}

/* Media Preview Banner */
.sermon-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #1b0d30 0%, #31154e 50%, #4a1c6e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sermon-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sermon-card:hover .sermon-preview img {
    transform: scale(1.04);
}

/* Preview floating badge */
.sermon-preview-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: rgba(18, 12, 32, 0.78);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Graceful Branded Placeholder Graphic */
.sermon-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: radial-gradient(circle at 50% 35%, rgba(124, 58, 237, 0.38), transparent 70%),
                linear-gradient(135deg, #1b0d30 0%, #31154e 50%, #4a1c6e 100%);
    color: #ffffff;
    padding: 20px;
    box-sizing: border-box;
}

.sermon-placeholder-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #f8fafc;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.sermon-placeholder-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.82);
}

/* Backward-compatible overlay styling if present without new wrapper */
.sermon-title-overlay {
    position: absolute;
    inset: auto 0 0;
    margin: 0;
    padding: 24px 16px 12px;
    background: linear-gradient(transparent, rgba(15, 10, 26, 0.92));
    color: #fff;
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 700;
}

/* If the modern .sermon-card-title exists in content, hide duplicate overlay */
.sermon-card:has(.sermon-card-title) .sermon-title-overlay {
    display: none;
}

/* Card Content Area - Identical Padding */
.sermon-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 24px;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .sermon-content {
        padding: 20px 18px;
    }
}

/* Unique, Noticeable Sermon Title Placement */
.sermon-title-wrapper {
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3eff9;
    position: relative;
}

.sermon-title-wrapper::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 44px;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #e11d48);
    border-radius: 2px;
}

.sermon-card-title,
.sermon-title {
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.35;
    color: #1e1338;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    letter-spacing: -0.01em;
}

.sermon-card:hover .sermon-card-title,
.sermon-card:hover .sermon-title {
    color: #7c3aed;
}

/* Sermon Meta (Preacher, Date) */
.sermon-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f0ecf5;
}

.sermon-meta div {
    display: flex;
    flex-direction: column;
}

.sermon-meta strong {
    margin-bottom: 2px;
    color: #7c3aed;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.sermon-meta span {
    color: #4a455a;
    font-size: 0.94rem;
    font-weight: 500;
}

.sermon-scripture-reference {
    margin: 0 0 12px;
    padding: 6px 12px;
    background: #fbf7ff;
    border-left: 3px solid #7c3aed;
    border-radius: 4px;
    color: #554a69;
    font-size: 0.88rem;
    font-weight: 600;
}

.sermon-series {
    margin: 0 0 12px;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Audio Player */
.sermon-content audio {
    width: 100%;
    margin: 0 0 14px;
    height: 38px;
    border-radius: 8px;
}

/* Action Buttons */
.sermon-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: auto;
    padding-top: 6px;
}

.sermon-actions a,
.sermon-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    background: #7c3aed;
    color: #ffffff;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
    transition: all 0.2s ease;
}

.sermon-actions a:hover,
.sermon-actions button:hover {
    transform: translateY(-2px);
    background: #6d28d9;
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.32);
    color: #ffffff;
}

.sermon-actions .sermon-download-link {
    background: #1e1338;
    box-shadow: 0 4px 12px rgba(30, 19, 56, 0.18);
}

.sermon-actions .sermon-download-link:hover {
    background: #321e5a;
    box-shadow: 0 6px 16px rgba(30, 19, 56, 0.28);
}

.sermon-actions .sermon-video-link {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.sermon-actions .sermon-video-link:hover {
    background: #b91c1c;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.32);
}

/* Empty, Loading & Notice States */
.sermon-loading,
.sermon-empty,
.sermon-load-error,
.sermon-source-notice {
    grid-column: 1 / -1;
    margin: 0;
    padding: 36px 20px;
    color: #555;
    text-align: center;
    background: #ffffff;
    border-radius: 14px;
    border: 1px dashed #d1c9db;
}

.sermon-load-error {
    color: #b91c1c;
    border-color: #fca5a5;
    background: #fef2f2;
}

.sermon-source-notice {
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff7e6;
    color: #754c00;
    text-align: left;
    border: 1px solid #ffd591;
}

/* More Sermons Section & CTA Alignment (Breathing Room) */
.more-sermons {
    margin-top: 42px !important;
    margin-bottom: 20px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

@media (min-width: 769px) {
    .more-sermons {
        margin-top: 56px !important;
        margin-bottom: 28px !important;
    }
}

.more-sermons .btn-more {
    padding: 14px 36px !important;
    font-size: 1.05rem !important;
}
