:root {
    --posts-radius: 22px;
}

 .post-badge--dark {
     background: rgba(34, 34, 34, 0.55);
     border-color: rgba(255, 255, 255, 0.22);
     color: rgba(255, 255, 255, 0.92);
 }

.posts-page {
    min-height: 60vh;
    direction: rtl;
    text-align: right;
}

.posts-hero {
    padding: 4rem 0 2.25rem;
    background: var(--primary-bg);
}

 .posts-hero .container {
     position: relative;
 }

.posts-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    font-weight: 800;
    color: var(--text-light);
    direction: rtl;
}

.posts-breadcrumb a {
    text-decoration: none;
    color: var(--text-dark);
}

.posts-breadcrumb a:hover {
    color: var(--primary-dark);
}

.posts-breadcrumb-sep {
    opacity: 0.45;
}

.posts-title {
    margin: 0.9rem 0 0.55rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-align: right;
}

.posts-subtitle {
    margin: 0;
    max-width: 70ch;
    color: var(--text-light);
    font-weight: 650;
    text-align: right;
}

.posts-toolbar {
    margin-top: 1.35rem;
    display: grid;
    grid-template-columns: 1fr 260px auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem;
    border-radius: var(--posts-radius);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(204, 31, 40, 0.12);
    box-shadow: 0 14px 34px rgba(34, 34, 34, 0.10);
    direction: rtl;
}

.posts-search,
.posts-filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.9rem;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(204, 31, 40, 0.16);
    box-shadow: none;
    direction: rtl;
}

.posts-search {
    border-radius: 999px;
}

.posts-filter {
    border-radius: 999px;
}

.posts-search i,
.posts-filter i {
    color: var(--primary-dark);
    opacity: 0.9;
}

.posts-search input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-weight: 700;
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
}

 .posts-search:focus-within,
 .posts-filter:focus-within {
     border-color: rgba(204, 31, 40, 0.32);
     box-shadow: 0 0 0 4px rgba(204, 31, 40, 0.14);
 }

.posts-filter select {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-weight: 800;
    color: var(--text-dark);
    appearance: none;
    direction: rtl;
    text-align: right;
}

.posts-stats {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(204, 31, 40, 0.10);
    border: 1px solid rgba(204, 31, 40, 0.16);
    color: rgba(34, 34, 34, 0.85);
    font-weight: 900;
    width: fit-content;
    direction: rtl;
}

.posts-list {
    padding: 2.75rem 0 4.75rem;
    background: #ffffff;
    direction: rtl;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.35rem;
    direction: rtl;
}

.post-item {
    grid-column: span 4;
    background: #fff;
    border: 1px solid rgba(204, 31, 40, 0.12);
    box-shadow: 0 14px 34px rgba(34, 34, 34, 0.10);
    overflow: hidden;
    border-radius: var(--posts-radius);
    position: relative;
    transition: transform 220ms ease, box-shadow 220ms ease;
    direction: rtl;
}

 .post-item::before {
     content: '';
     position: absolute;
     inset: 0 0 auto 0;
     height: 4px;
     background: var(--brand-primary);
     opacity: 0.9;
 }

.post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 48px rgba(34, 34, 34, 0.14);
}

.post-item-media {
    position: relative;
    overflow: hidden;
}

 .post-item-media::after {
     content: '';
     position: absolute;
     inset: auto 0 0 0;
     height: 55%;
     background: rgba(34, 34, 34, 0.55);
     pointer-events: none;
 }

.post-item-media img {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
    transform: scale(1.01);
    transition: transform 500ms ease;
}

.post-item:hover .post-item-media img {
    transform: scale(1.06);
}

.post-item-badges {
    position: absolute;
    inset-inline-end: 12px;
    top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    z-index: 1;
    direction: rtl;
}

.post-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    font-weight: 900;
    color: rgba(34, 34, 34, 0.82);
    font-size: 0.78rem;
    direction: rtl;
}

.post-item-body {
    padding: 1.05rem 1.05rem 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 220px;
    direction: rtl;
}

.post-item-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    text-align: right;
}

.post-item-title a {
    color: var(--text-dark);
    text-decoration: none;
}

.post-item-title a:hover {
    color: var(--primary-dark);
}

.post-item-excerpt {
    margin: 0;
    color: var(--text-light);
    font-weight: 650;
    line-height: 1.65;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: right;
}

.post-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    color: var(--text-light);
    font-weight: 750;
    font-size: 0.92rem;
    direction: rtl;
}

 .post-item-meta span {
     padding: 0.35rem 0.6rem;
     border-radius: 999px;
     border: 1px solid rgba(204, 31, 40, 0.14);
     background: rgba(204, 31, 40, 0.06);
 }

.post-item-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.post-item-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(204, 31, 40, 0.10);
    border: 1px solid rgba(204, 31, 40, 0.16);
    color: var(--primary-dark);
    font-weight: 900;
    text-decoration: none;
    transition: transform 180ms ease, background-color 180ms ease;
    margin-top: auto;
    direction: rtl;
}

 .post-item-cta:focus-visible,
 .page-pill:focus-visible {
     outline: none;
     box-shadow: 0 0 0 4px rgba(204, 31, 40, 0.18);
 }

.post-item-cta:hover {
    transform: translateY(-1px);
    background: rgba(204, 31, 40, 0.16);
    color: var(--primary-dark);
}

.posts-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    direction: rtl;
}

 .posts-pagination {
     padding-top: 0.5rem;
 }

.pagination-creative {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(204, 31, 40, 0.16);
    box-shadow: 0 14px 34px rgba(34, 34, 34, 0.10);
    direction: rtl;
}

.page-pill {
    min-width: 46px;
    height: 46px;
    padding: 0 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(204, 31, 40, 0.22);
    background: rgba(255, 255, 255, 0.92);
    color: var(--primary-dark);
    font-weight: 950;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background-position 300ms ease, border-color 180ms ease;
    background-image: none;
    direction: rtl;
}

.page-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(34, 34, 34, 0.10);
    border-color: rgba(204, 31, 40, 0.38);
}

.page-pill.is-active {
    border-color: rgba(204, 31, 40, 0.55);
    background: rgb(204, 31, 40);
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(34, 34, 34, 0.12);
}

.page-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.65);
}

@media (max-width: 992px) {
    .posts-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .posts-stats {
        justify-self: end;
    }

    .post-item {
        grid-column: span 6;
    }
}

@media (max-width: 576px) {
    .posts-hero {
        padding: 3.25rem 0 2rem;
    }

    .posts-toolbar {
        grid-template-columns: 1fr;
    }

    .post-item {
        grid-column: span 12;
    }
}
