/* ==========================================================================
   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-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: 2rem;
    justify-content: center !important;
    text-align: center !important;
    width: 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: #1e293b !important;
    border-color: #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: currentColor;
    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: 4 columns */
@media screen and (min-width: 1024px) {
    .godseekers-grid {
        grid-template-columns: repeat(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: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: 16:9 box */
.godseekers-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16/9 Ratio */
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.04);
}

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

.godseekers-card: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;
}

/* ==========================================================================
   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: #1e293b !important;
    border-color: #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;
}

.godseekers-no-series {
    text-align: center;
    grid-column: 1 / -1;
    padding: 3.5rem 0;
    font-size: 1.1rem;
    opacity: 0.65;
}