/* =========================================================
   Category / archive listings — safabrura.co.il
   ========================================================= */

.archive-header {
    margin-bottom: 34px;
    text-align: center;
}
.archive-header h1.page-title {
    margin: 0;
    font-family: var(--safa-display);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 500;
    line-height: 1.2;
    color: var(--hd-ink);
}
.archive-header h1.page-title::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin: 14px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--hd-accent), var(--hd-accent-2));
}
.archive-count {
    margin: 12px 0 0;
    font-family: var(--safa-ui);
    font-size: 14px;
    color: var(--hd-ink-soft);
}

/* ---------- The grid ---------- */

.category-wrap--cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

/* ---------- Card ---------- */

.category-wrap--cards .post-box {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: auto;
    padding: 20px 20px 18px;
    border: 1px solid rgba(92, 42, 77, .09);
    border-radius: 18px;
    background: linear-gradient(160deg, #fdf6fa 0%, #f8f4fd 58%, #fff7f2 100%);
    box-shadow: 0 2px 10px rgba(92, 42, 77, .05);
    color: var(--hd-ink);
    text-decoration: none;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background-color .22s ease;
}
.category-wrap--cards .post-box:hover {
    transform: translateY(-3px);
    border-color: rgba(194, 88, 143, .35);
    background: #fff;
    box-shadow: 0 14px 34px rgba(92, 42, 77, .13);
}

/* A play mark, so an audio lecture reads as one at a glance */
.post-box__mark {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    box-shadow: inset 0 0 0 1px rgba(194, 88, 143, .16);
    transition: background-color .22s ease, box-shadow .22s ease;
}
.post-box__mark svg {
    width: 12px;
    height: 12px;
    fill: var(--hd-accent);
    /* the glyph points the way the language reads */
    transform: scaleX(-1);
}
.category-wrap--cards .post-box:hover .post-box__mark {
    background: linear-gradient(120deg, var(--hd-accent), var(--hd-accent-2));
}
.category-wrap--cards .post-box:hover .post-box__mark svg {
    fill: #fff;
}

.category-wrap--cards .post-title {
    margin: 0;
    padding: 0;
    padding-inline-end: 34px;
    min-height: 0;
    font-family: var(--safa-display);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.35;
    text-align: right;
    color: var(--hd-ink);
    text-wrap: balance;
}

.post-subtitle {
    margin: 0;
    font-family: var(--safa-ui);
    font-size: 14px;
    line-height: 1.5;
    color: var(--hd-ink-soft);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 12px;
}

.post-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-family: var(--safa-ui);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--hd-ink-soft);
    background: rgba(255, 255, 255, .8);
    border: 1px solid rgba(92, 42, 77, .07);
    font-variant-numeric: tabular-nums;
}
.post-chip--hebrew {
    color: #a34a78;
    background: rgba(194, 88, 143, .11);
    border-color: rgba(194, 88, 143, .16);
}
.post-chip--place {
    color: #6d4a95;
    background: rgba(143, 91, 184, .12);
    border-color: rgba(143, 91, 184, .18);
}

/* Cards with no metadata at all */
.category-wrap--cards .post-box--plain {
    justify-content: center;
    min-height: 118px;
}
.category-wrap--cards .post-box--plain .post-title {
    text-align: center;
    padding-inline-end: 0;
    padding-top: 10px;
}

/* ---------- Pagination ---------- */

.nav-wrap {
    margin-top: 40px;
}
.nav-pagination .nav-links {
    justify-content: center;
    gap: 4px;
}
.page-numbers {
    width: auto;
    min-width: 38px;
    height: 38px;
    margin: 3px;
    padding: 0 10px;
    border: 1px solid var(--hd-line);
    border-radius: 12px;
    background: #fff;
    color: var(--hd-ink-soft);
    font-family: var(--safa-ui);
    font-size: 15px;
    line-height: 36px;
    font-variant-numeric: tabular-nums;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.page-numbers:hover {
    color: var(--hd-accent);
    background: rgba(194, 88, 143, .07);
    border-color: rgba(194, 88, 143, .3);
}
.page-numbers.current,
.page-numbers.current:hover {
    color: #fff;
    background: linear-gradient(120deg, var(--hd-accent), var(--hd-accent-2));
    border-color: transparent;
    box-shadow: 0 5px 14px rgba(194, 88, 143, .28);
}
.page-numbers.dots,
.page-numbers.dots:hover {
    border-color: transparent;
    background: transparent;
    color: var(--hd-ink-soft);
}

/* The "12 most recent" list and any other plain audio tiles */
.category-wrap a.audio-post {
    width: auto;
    min-height: 110px;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 18px;
    border: 1px solid rgba(92, 42, 77, .09);
    border-radius: 18px;
    background: linear-gradient(160deg, #fdf6fa 0%, #f8f4fd 58%, #fff7f2 100%);
    box-shadow: 0 2px 10px rgba(92, 42, 77, .05);
    color: var(--hd-ink);
    font-family: var(--safa-display);
    font-size: 19px;
    line-height: 1.35;
    text-align: center;
}
.category-wrap a.audio-post:hover {
    transform: translateY(-3px);
    background: #fff;
    color: var(--hd-accent);
    border-color: rgba(194, 88, 143, .35);
    box-shadow: 0 14px 34px rgba(92, 42, 77, .13);
}

@media (max-width: 575px) {
    .category-wrap--cards {
        grid-template-columns: 1fr;
    }
    .archive-header {
        margin-bottom: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-wrap--cards .post-box,
    .category-wrap a.audio-post,
    .post-box__mark,
    .page-numbers {
        transition: none !important;
    }
}
