/* File: static/css/sermon_grid.css */
/* Grid card layout for sermon archive page — matches browse.html design */
/* Version: 1.3.1 */
/* Last Modified: 2026-02-23 */
/* Change: Add flex:1 to mosque-names for RTL gap fix — Refs #97 */

/* ============================================
   Grid Container
   ============================================ */

.sermon-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0;
}

@media (max-width: 768px) {
    .sermon-grid-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Grid Card
   ============================================ */

.sermon-grid-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.sermon-grid-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Thumbnail
   ============================================ */

.sermon-grid-thumb {
    position: relative;
    height: 140px;
    background: linear-gradient(135deg, #1a5f3c, #2e7d32);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.sermon-grid-thumb svg {
    opacity: 0.5;
}

/* Duration badge */
.sermon-grid-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
}

/* Play overlay */
.sermon-grid-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.sermon-grid-card:hover .sermon-grid-play-overlay {
    opacity: 1;
}

/* Disable hover overlay on touch devices */
@media (hover: none) {
    .sermon-grid-play-overlay {
        display: none;
    }
}

/* White circle play button inside overlay */
.sermon-grid-play-btn {
    width: 56px;
    height: 56px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a5f3c;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Info Section
   ============================================ */

.sermon-grid-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sermon-grid-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.sermon-grid-mosque {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.sermon-grid-mosque svg {
    margin-top: 2px;
    flex-shrink: 0;
}

.sermon-grid-mosque-names {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.sermon-grid-mosque-ar {
    font-weight: 700;
    font-size: 13px;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sermon-grid-mosque-en {
    font-weight: 400;
    font-size: 11px;
    color: #888;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sermon-grid-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

.sermon-grid-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sermon-grid-meta svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Language badges */
.sermon-grid-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lang-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #f0f0f0;
    color: #666;
    white-space: nowrap;
}

/* Admin hidden badges */
.sermon-grid-hidden-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: #ffebee;
    color: #c62828;
    white-space: nowrap;
    margin-top: 4px;
}

/* Stats row */
.sermon-grid-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.sermon-grid-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Play action row */
.sermon-grid-action {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    color: #1a5f3c;
    font-size: 13px;
    font-weight: 600;
}

.sermon-grid-action svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ============================================
   Progress Bar (Continue Listening)
   ============================================ */

.sermon-grid-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
}

.sermon-grid-progress-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 0 2px 2px 0;
    transition: width 0.3s ease;
}

/* ============================================
   Skeleton
   ============================================ */

.sermon-grid-skeleton {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.sermon-grid-skeleton .skel-thumb {
    height: 140px;
    background: #e9ecef;
}

.sermon-grid-skeleton .skel-info {
    padding: 16px;
}

.sermon-grid-skeleton .skel-line {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    margin-bottom: 8px;
}

@keyframes sermon-grid-shimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.sermon-grid-skeleton .skel-thumb,
.sermon-grid-skeleton .skel-line {
    animation: sermon-grid-shimmer 1.5s ease-in-out infinite;
}

/* ============================================
   Empty State (spans full grid)
   ============================================ */

.sermon-grid-container .sermon-empty {
    grid-column: 1 / -1;
}

