/**
 * Blog Collection Page Styles
 *
 * Page-level styles for the blog collection/archive page.
 * Card-level styles are inherited from blog-section.css (globally enqueued).
 *
 * @package TwentyTwentyFive_Child
 */

/* ==========================================================================
   Page Container
   ========================================================================== */
.jtr-blog-collection {
    background-color: var(--bc-bg-color, #0E0E0E);
    padding: 15px 40px 100px 15px;
    min-height: 60vh;
}

/* ==========================================================================
   Hero Header
   ========================================================================== */
.jtr-blog-collection__hero {
    margin-bottom: 0;
}

.jtr-blog-collection__hero .jtr-blog__header {
    padding-top: 50px;
}

.jtr-blog-collection__hero .jtr-blog__title {
    font-size: 72px;
}

/* Use h1 instead of h2 for the page title */
.jtr-blog-collection h1.jtr-blog__title {
    font-family: 'MirthaDisplayTrial', serif;
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 16px 0;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

/* ==========================================================================
   Blog Grid (3 columns, independent of blog section's --blog-cols variable)
   ========================================================================== */
.jtr-blog-collection__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Hide stray <p> tags injected by WordPress wpautop */
.jtr-blog-collection__grid > p {
    display: none;
}

/* ==========================================================================
   Load More Button
   ========================================================================== */
.jtr-blog-collection__load-more {
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

.jtr-blog-collection__load-more-btn {
    font-family: 'Matter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #ffffff;
    background: transparent;
    border: 2px solid #FF2F2E;
    padding: 16px 48px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.jtr-blog-collection__load-more-btn:hover {
    background: #FF2F2E;
    color: #ffffff;
}

/* Loading state */
.jtr-blog-collection__btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.jtr-blog-collection__load-more-btn.is-loading .jtr-blog-collection__btn-text {
    display: none;
}

.jtr-blog-collection__load-more-btn.is-loading .jtr-blog-collection__btn-loading {
    display: inline-flex;
}

.jtr-blog-collection__load-more-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* Spinner */
.jtr-blog-collection__spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #FF2F2E;
    border-radius: 50%;
    animation: jtr-spin 0.6s linear infinite;
}

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

/* All loaded message */
.jtr-blog-collection__all-loaded {
    font-family: 'Matter', sans-serif;
    font-size: 14px;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==========================================================================
   Card entrance animation (for AJAX-loaded cards)
   ========================================================================== */
.jtr-blog__card.jtr-card--entering {
    opacity: 0;
    transform: translateY(20px);
    animation: jtr-card-enter 0.4s ease forwards;
}

@keyframes jtr-card-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delay for each card in a batch */
.jtr-blog__card.jtr-card--entering:nth-child(3n+1) { animation-delay: 0s; }
.jtr-blog__card.jtr-card--entering:nth-child(3n+2) { animation-delay: 0.1s; }
.jtr-blog__card.jtr-card--entering:nth-child(3n)   { animation-delay: 0.2s; }

/* ==========================================================================
   Empty State
   ========================================================================== */
.jtr-blog-collection__empty {
    text-align: center;
    padding: 60px 20px;
    color: #888888;
    font-family: 'Matter', sans-serif;
    font-size: 16px;
}

/* ==========================================================================
   Responsive: Large Desktop (1400px)
   ========================================================================== */
@media (max-width: 1400px) {
    .jtr-blog-collection__hero .jtr-blog__title {
        font-size: 64px;
    }
}

/* ==========================================================================
   Responsive: Desktop (1200px)
   ========================================================================== */
@media (max-width: 1200px) {
    .jtr-blog-collection__hero .jtr-blog__title {
        font-size: 56px;
    }
}

/* ==========================================================================
   Responsive: Tablet (1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .jtr-blog-collection__hero .jtr-blog__title {
        font-size: 48px;
    }

    .jtr-blog-collection__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .jtr-blog-collection__load-more {
        margin-top: 50px;
    }
}

/* ==========================================================================
   Responsive: Mobile (768px)
   ========================================================================== */
@media (max-width: 768px) {
    .jtr-blog-collection {
        padding: 50px 20px;
    }

    .jtr-blog-collection__hero .jtr-blog__title {
        font-size: 40px;
    }

    .jtr-blog-collection__grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .jtr-blog-collection__load-more-btn {
        padding: 14px 40px;
        font-size: 13px;
    }

    .jtr-blog-collection__load-more {
        margin-top: 40px;
    }
}

/* ==========================================================================
   Responsive: Mobile Portrait (480px)
   ========================================================================== */
@media (max-width: 480px) {
    .jtr-blog-collection {
        padding: 40px 15px;
    }

    .jtr-blog-collection__hero .jtr-blog__title {
        font-size: 32px;
    }

    .jtr-blog-collection__load-more-btn {
        padding: 12px 32px;
    }
}
