/**
 * Post Cards Layout Styles
 */

.post-cards {
    background: var(--color-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-2xl);
    overflow-x: clip;
}

.post-cards__container {
    width: min(100%, var(--container-narrow));
    margin-left: auto;
    margin-right: auto;
}

.post-cards__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
}

.post-cards__intro-wrap {
    max-width: 720px;
}

.post-cards__intro {
    color: var(--color-primary-dark);
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

.post-cards__intro h1,
.post-cards__intro h2,
.post-cards__intro h3 {
    margin: 0;
    color: var(--color-primary);
    line-height: 1.15;
}

.post-cards__intro h1 { font-size: clamp(32px, 4vw, 48px); }
.post-cards__intro h2 { font-size: clamp(28px, 3.5vw, 40px); }
.post-cards__intro h3 { font-size: clamp(24px, 3vw, 32px); }

.post-cards__intro > * { margin: 0; }
.post-cards__intro > * + * { margin-top: var(--spacing-sm); }

.post-cards__nav {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.post-cards__nav-btn {
    width: 45px;
    height: 45px;
    border: 1px solid var(--color-primary);
    border-radius: var(--border-radius-md);
    background: transparent;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.post-cards__nav-btn:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.post-cards__nav-btn span {
    display: none;
}

.post-cards__nav-btn::before {
    content: '';
    width: 40px;
    height: 40px;
    display: block;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.159 16.767l0.754-0.754-6.035-6.035-0.754 0.754 5.281 5.281-5.256 5.256 0.754 0.754 3.013-3.013z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.159 16.767l0.754-0.754-6.035-6.035-0.754 0.754 5.281 5.281-5.256 5.256 0.754 0.754 3.013-3.013z'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.post-cards__nav-btn--prev::before {
    transform: rotate(180deg);
}

/* === CAROUSEL === */

.post-cards__slider {
    margin-left: max(0px, (100% - var(--container-narrow)) / 2);
    padding-right: max(0px, (100% - var(--container-narrow)) / 2);
    overflow: visible !important;
    cursor: grab;
}

.post-cards__slider:active {
    cursor: grabbing;
}

.post-cards__slider .swiper-wrapper {
    align-items: stretch;
}

.post-cards__slider:not(.swiper-initialized) .swiper-wrapper {
    gap: var(--spacing-md);
}

.post-cards__slider .swiper-slide {
    height: auto;
    width: 70vw;
}

@media (min-width: 1024px) {
    .post-cards__slider .swiper-slide {
        width: 389px;
    }
}

/* === GRID === */

.post-cards__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
}

@media (min-width: 1024px) {
    .post-cards__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* === CTA === */

.post-cards__cta-wrap {
    display: flex;
    justify-content: center;
}

/* === CARDS === */

.post-cards__card {
    height: 100%;
}

.post-cards__card-link {
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    background: var(--color-neutral-200);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.post-cards__image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-neutral-100);
}

.post-cards__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.post-cards__card-link:hover .post-cards__image {
    transform: scale(1.06);
}

.post-cards__image--placeholder {
    background: linear-gradient(135deg, var(--color-secondary-dark), var(--color-neutral-200));
}

.post-cards__body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-xl);
}

.post-cards__title {
    margin: 0;
	color: var(--color-primary);
}

.post-cards__excerpt {
    margin: 0;
    color: var(--color-primary-dark);
    line-height: var(--line-height-normal);
}

/* === RESPONSIVE === */

@media (max-width: 1023px) {
    .post-cards__head {
        flex-direction: column;
    }

    .post-cards__nav {
        display: none;
    }
}
