/**
 * Posts Archive Styles
 *
 * Styles for blog post archive, filters, and post cards.
 */

/* ==========================================================================
   Post Archive Section
   ========================================================================== */

/* Hide hero banner when post-archive section exists on page */
.im-main:has(.post-archive) .hero-banner {
    display: none;
}

.post-archive {
    padding: 4rem 0;
}

h1.post-archive__heading {
    color: var(--color-module-title);
    text-align: center;
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.06rem;
    margin: 0 0 1.875rem;
}
h2.tag-heading {
    color: var(--color-module-title);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02rem;
    margin: 0;
}
/* ==========================================================================
   Filters
   ========================================================================== */

.post-archive__filters-wrapper {
    margin-bottom: 1rem;
}

.post-archive__filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.375rem;
    justify-content: flex-start;
    padding: 0.375rem 0;
    align-items:center;
}

/* Mobile slider effect - below 1025px */
@media (width <= 1025px) {
    .post-archive__filters-wrapper {
        overflow: auto hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        margin-left: calc(-1 * var(--content-gutter, 1.25rem));
        margin-right: calc(-1 * var(--content-gutter, 1.25rem));
        padding-left: var(--content-gutter, 1.25rem);
        padding-right: var(--content-gutter, 1.25rem);
    }

    /* Hide scrollbar for Chrome, Safari and Opera */
    .post-archive__filters-wrapper::-webkit-scrollbar {
        display: none;
    }

    .post-archive__filters {
        flex-wrap: nowrap;
        min-width: min-content;
    }

    .post-archive__filter {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

.post-archive__filter {
    padding: 0.425rem 0.75rem;
    background: var(--btn-secondary-bg, #E8E0E4);
    border: 0.125rem solid transparent;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-brand, #320C20);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.post-archive__filter:hover,
.post-archive__filter:focus-visible {
    background: #e8e8e8;
}

.post-archive__filter.is-active {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
}

.post-archive__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 1.25rem 0 3rem;
}

.post-archive__no-results {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 1.125rem;
    color: #666;
}

.post-archive__load-more {
    text-align: center;
}
.post-archive__load-more button {
    max-width: 25rem;
    width: 100%;
    border-width: 0.125rem;
}
.post-card {
    background: var(--color-white, #FFFFFF);
    border-radius: 0.5rem;
    overflow: hidden;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

a.post-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card__image {
    position: relative;
    aspect-ratio: 305 / 207;
    overflow: hidden;
    background: #C4C4C4;
    border-radius: 1.25rem;
    display: flex;
    align-items: flex-end;
    gap: 0.3125rem;
    justify-content: flex-start;
    padding: 0.75rem 0.9375rem;
}

.post-card__image--placeholder {
    background: #C4C4C4;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.25rem;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    margin: 0;
    position:absolute;
    inset:0;
}

.post-card__tag {
    color: #FFF;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.014rem;
    border-radius: 0.1875rem;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(0.09375rem);
    padding: 0.5rem 0.625rem;
}

.resource-type-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 0.625rem;
    margin-top: auto;
    flex: 1;
    align-items: center;
    position: relative;
}
.resource-type-tag{
    flex-wrap: wrap;
    gap: 0.5rem;
}
.post-card__play-icon {
    display: inline-block;
    width: 2.375rem;
    height: 2.375rem;
}

.post-card__play-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.post-card__content {
    padding-top: 0.4375rem;
}

h2.post-card__title {
    color: var(--color-module-title);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.33;
    letter-spacing: -0.0225rem;
    margin: 0 0 0.125rem 0;
    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-card__summary {
    color: var(--color-module-title);
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.5;
    letter-spacing: -0.0175rem;
    margin: 0;
    /* Clamp to 2 lines on mobile */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (width >= 640px) {
    .post-archive__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (width >= 1025px) {
    .post-card:hover .post-card__image img, .post-card__link:focus-visible .post-card__image img{
      transform: scale(1.05);
    }
    .post-card__link:focus-visible .post-card__title{
        color: var(--color-brand);
    }
    .post-archive__load-more{
        padding-top: 0.25rem;
    }

    .post-archive__load-more button {
        max-width: 21.25rem;
    }
    .post-archive {
        padding: 5rem 0;
    }

    .post-archive__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .post-card__title {
        font-size: 1.5rem;
    }
    .post-card__content {
        padding-top: 0.875rem;
    }

    /* Expand to 4 lines on desktop */
    .post-card__summary {
        -webkit-line-clamp: 4;
    }
    .post-archive__filters {
        flex-wrap:wrap;
    }
}

@media (width >= 1280px) {
    .post-archive__grid {
        grid-template-columns: repeat(4, 1fr);
        column-gap: 2rem;
        row-gap: 3.25rem;
    }
}
