/* ==========================================================================
   GodSeekers Sermon Series Grid - Layout Architecture Only
   Relying purely on inheritance and theme/Brizy global styling variables.
   ========================================================================== */

.godseekers-series-grid-wrapper {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    --godseekers-accent: #3b82f6;
    --godseekers-accent-alpha: rgba(59, 130, 246, 0.15);
}

.godseekers-series-grid-wrapper *,
.godseekers-series-grid-wrapper *::before,
.godseekers-series-grid-wrapper *::after {
    box-sizing: inherit;
}

/* Year Filter Row */
.godseekers-filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    justify-content: center !important;
    text-align: center !important;
    width: 100%;
}

/* Search Bar Wrapper */
.godseekers-search-container {
    display: flex;
    max-width: 420px;
    margin: 0 auto 2.5rem auto;
    position: relative;
    width: 100%;
}

.godseekers-search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.85rem !important;
    font-size: 0.95rem;
    font-family: inherit;
    color: inherit;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    outline: none;
    transition: all 0.25s ease;
}

.godseekers-search-input:focus {
    background: #ffffff;
    border-color: var(--godseekers-accent, #3b82f6);
    box-shadow: 0 0 0 3px var(--godseekers-accent-alpha, rgba(59, 130, 246, 0.15));
}

.godseekers-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

/* Skeleton Loading Cards */
.godseekers-skeleton-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.godseekers-skeleton-image {
    width: 100%;
    padding-top: 56.25%; /* 16:9 Ratio */
    background: #e2e8f0;
    position: relative;
    overflow: hidden;
}

.godseekers-skeleton-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.godseekers-skeleton-title {
    height: 1.25rem;
    width: 80%;
    background: #e2e8f0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.godseekers-skeleton-text {
    height: 0.85rem;
    width: 100%;
    background: #f1f5f9;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.godseekers-skeleton-text.short {
    width: 60%;
}

.godseekers-skeleton-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.godseekers-skeleton-meta-line {
    height: 0.75rem;
    width: 45%;
    background: #f1f5f9;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Shimmer Animation Effect */
.godseekers-shimmer::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 20%,
        rgba(255, 255, 255, 0.7) 60%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: godseekers-shimmer-pulse 1.6s infinite;
    content: '';
}

@keyframes godseekers-shimmer-pulse {
    100% {
        transform: translateX(100%);
    }
}


/* Year Filter Button Structural Layout */
.godseekers-filter-btn {
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #f8fafc;
    color: #334155;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.55rem 1.35rem;
    transition: all 0.25s ease;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.godseekers-filter-btn:hover {
    background-color: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.25);
    color: #0f172a;
}

.godseekers-filter-btn:active {
    transform: scale(0.97);
}

.godseekers-filter-btn.active {
    background-color: var(--godseekers-accent, #1e293b) !important;
    border-color: var(--godseekers-accent, #1e293b) !important;
    color: #ffffff !important;
    filter: none !important;
    font-weight: 600;
}

/* Outer Grid & Loading Animations */
.godseekers-grid-container-outer {
    position: relative;
    width: 100%;
}

.godseekers-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.godseekers-loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Spin animation for the loading overlay */
.godseekers-spinner {
    width: 36px;
    height: 36px;
    border: 3.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    border-top-color: var(--godseekers-accent, currentColor);
    color: var(--godseekers-accent, #3b82f6);
    animation: godseekers-spin 0.9s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes godseekers-spin {
    to { transform: rotate(360deg); }
}

.godseekers-grid {
    display: grid;
    gap: 2rem;
    width: 100%;
    transition: opacity 0.35s ease;
}

.godseekers-grid.loading-state {
    opacity: 0.45;
}

/* ==========================================================================
   Responsive Breakpoints - Rigid Layout Grid
   ========================================================================== */

/* Desktop Scale: Dynamic columns based on settings with a 4 columns fallback */
@media screen and (min-width: 1024px) {
    .godseekers-grid {
        grid-template-columns: repeat(var(--desktop-cols, 4), minmax(0, 1fr));
    }
}

/* Tablet Landscape Scale: 3 columns */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .godseekers-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet Portrait Scale: 2 columns */
@media screen and (min-width: 480px) and (max-width: 767px) {
    .godseekers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile Scale: 1 column */
@media screen and (max-width: 479px) {
    .godseekers-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Card Structure & Inner Hierarchy
   ========================================================================== */

.godseekers-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.28s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: transparent;
}

.godseekers-card.godseekers-hover-enabled:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.godseekers-card-link {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image Aspect Ratio Constraint */
.godseekers-card-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.04);
}

.godseekers-card-image-wrapper.aspect-16-9 {
    padding-top: 56.25%; /* 16:9 Ratio */
}

.godseekers-card-image-wrapper.aspect-4-3 {
    padding-top: 75%; /* 4:3 Ratio */
}

.godseekers-card-image-wrapper.aspect-1-1 {
    padding-top: 100%; /* 1:1 Ratio */
}

.godseekers-card-image-wrapper.aspect-original {
    padding-top: 0;
    aspect-ratio: auto;
}

.godseekers-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.godseekers-card-image-wrapper.aspect-original .godseekers-card-image {
    position: relative;
    height: auto;
    max-height: 350px;
}

.godseekers-card.godseekers-hover-enabled:hover .godseekers-card-image {
    transform: scale(1.04);
}

/* Card Content Area styling */
.godseekers-card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 1.25rem;
}

.godseekers-card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
    font-family: inherit;
    color: inherit;
}

.godseekers-card-description {
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.25rem 0;
    opacity: 0.8;
}

/* Meta Labels Line */
.godseekers-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: auto;
    font-size: 0.8rem;
    opacity: 0.7;
}

.godseekers-card-count,
.godseekers-card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.godseekers-meta-icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.2px;
    flex-shrink: 0;
    color: var(--godseekers-accent, currentColor);
}

/* ==========================================================================
   AJAX Pagination Mechanics
   ========================================================================== */

.godseekers-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3.5rem;
    width: 100%;
}

.godseekers-page-btn {
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: transparent;
    color: inherit;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.godseekers-page-btn:hover:not(.disabled):not(:disabled) {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: currentColor;
}

.godseekers-page-btn.active {
    background-color: var(--godseekers-accent, #1e293b) !important;
    border-color: var(--godseekers-accent, #1e293b) !important;
    color: #ffffff !important;
    filter: none !important;
    font-weight: 600;
}

.godseekers-page-btn.disabled,
.godseekers-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: rgba(0, 0, 0, 0.08);
}

.godseekers-page-dots {
    padding: 0 0.3rem;
    font-size: 0.9rem;
    opacity: 0.55;
    user-select: none;
}

.pagination-arrow-icon {
    width: 15px;
    height: 15px;
    stroke-width: 2.2px;
}

/* Interactive Controls Bar */
.godseekers-controls-row {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    max-width: 650px;
    margin: 0 auto 2.5rem auto;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.godseekers-controls-row .godseekers-search-container {
    margin: 0;
    flex-grow: 1;
}

.godseekers-sort-container {
    position: relative;
    flex-shrink: 0;
    width: 200px;
}

.godseekers-sort-select {
    width: 100%;
    padding: 0.65rem 2.2rem 0.65rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: inherit;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.25s ease;
}

.godseekers-sort-select:focus {
    background: #ffffff;
    border-color: var(--godseekers-accent, #3b82f6);
    box-shadow: 0 0 0 3px var(--godseekers-accent-alpha, rgba(59, 130, 246, 0.15));
}

.godseekers-sort-chevron {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    pointer-events: none;
    color: #94a3b8;
}

@media screen and (max-width: 550px) {
    .godseekers-controls-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    .godseekers-sort-container {
        width: 100%;
    }
}
