:root {
    --mzb-primary: var(--mz-primary, #002654);
    --mzb-primary-dark: var(--mz-primary-dark, #001838);
    --mzb-accent: var(--mz-accent, #ce1126);
    --mzb-soft: var(--mz-primary-100, #e8edf4);
    --mzb-white: #ffffff;
    --mzb-text: var(--mz-text, #1f2937);
    --mzb-muted: var(--mz-muted, #6b7280);
    --mzb-border: var(--mz-border, #e5e7eb);
    --mzb-bg: var(--mz-bg, #f8fafc);
    --mzb-cream: #f7f3eb;
    --mzb-cream-dark: #ebe5da;
    --mzb-radius: 22px;
    --mzb-shadow: 0 18px 45px rgba(0, 38, 84, 0.08);
}

.mzb-main,
.mzb-archive,
.mzb-single,
.mzb-cover-books {
    direction: rtl;
    color: var(--mzb-text);
}

.mzb-main {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.mzb-archive {
    padding: 24px 0 56px;
}

.mzb-archive__head {
    max-width: 760px;
    margin: 0 auto 34px;
    text-align: center;
}

.mzb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--mzb-accent);
    font-size: 14px;
    font-weight: 800;
}

.mzb-eyebrow::before,
.mzb-eyebrow::after {
    content: "";
    width: 18px;
    height: 2px;
    background: var(--mzb-accent);
    border-radius: 99px;
}

.mzb-archive__title {
    margin: 0;
    color: var(--mzb-primary);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 900;
    line-height: 1.25;
}

.mzb-archive__desc {
    margin: 14px auto 0;
    max-width: 620px;
    color: var(--mzb-muted);
    font-size: 16px;
    line-height: 1.9;
}

.mzb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.mzb-card {
    overflow: hidden;
    background: var(--mzb-white);
    border: 1px solid var(--mzb-border);
    border-radius: var(--mzb-radius);
    box-shadow: var(--mzb-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mzb-card:hover {
    transform: translateY(-6px);
    border-color: rgba(206, 17, 38, 0.22);
    box-shadow: 0 24px 55px rgba(0, 38, 84, 0.13);
}

.mzb-card__image {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, var(--mzb-soft), #ffffff);
}

.mzb-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.mzb-card:hover .mzb-card__image img {
    transform: scale(1.04);
}

.mzb-card__placeholder,
.mzb-single__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 260px;
    color: var(--mzb-primary);
    font-size: 22px;
    font-weight: 900;
    background:
        radial-gradient(circle at top right, rgba(206, 17, 38, 0.12), transparent 34%),
        linear-gradient(135deg, #ffffff, var(--mzb-soft));
}

.mzb-card__content {
    padding: 22px;
}

.mzb-card__top,
.mzb-single__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.mzb-badge,
.mzb-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.mzb-badge {
    color: var(--mzb-primary);
    background: var(--mzb-soft);
}

.mzb-status {
    color: var(--mzb-white);
    background: var(--mzb-primary);
}

.mzb-status--coming_soon {
    color: var(--mzb-primary);
    background: #fff3cd;
}

.mzb-status--unavailable {
    background: #6b7280;
}

.mzb-card__title {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.45;
}

.mzb-card__title a {
    color: var(--mzb-primary);
    text-decoration: none;
}

.mzb-card__title a:hover {
    color: var(--mzb-accent);
}

.mzb-card__desc {
    display: -webkit-box;
    min-height: 58px;
    margin: 0 0 16px;
    overflow: hidden;
    color: var(--mzb-muted);
    font-size: 14px;
    line-height: 1.8;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mzb-card__meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--mzb-muted);
    font-size: 13px;
    font-weight: 700;
}

.mzb-card__meta span {
    position: relative;
    padding-right: 16px;
}

.mzb-card__meta span::before {
    content: "";
    position: absolute;
    top: 9px;
    right: 0;
    width: 6px;
    height: 6px;
    background: var(--mzb-accent);
    border-radius: 999px;
}

.mzb-card__actions,
.mzb-single__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mzb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none !important;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mzb-btn:hover {
    transform: translateY(-2px);
}

.mzb-btn--primary {
    color: var(--mzb-white) !important;
    background: var(--mzb-primary);
}

.mzb-btn--primary:hover {
    background: var(--mzb-primary-dark);
}

.mzb-btn--ghost {
    color: var(--mzb-primary) !important;
    background: var(--mzb-white);
    border-color: var(--mzb-border);
}

.mzb-btn--ghost:hover {
    color: var(--mzb-accent) !important;
    border-color: rgba(206, 17, 38, 0.34);
}

.mzb-btn--large {
    min-height: 52px;
    padding: 14px 28px;
    font-size: 16px;
}

.mzb-btn.is-disabled,
.mzb-btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
}

.mzb-pagination {
    margin-top: 34px;
}

.mzb-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    list-style: none;
}

.mzb-pagination a,
.mzb-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--mzb-white);
    border: 1px solid var(--mzb-border);
    color: var(--mzb-primary);
    font-weight: 800;
    text-decoration: none;
}

.mzb-pagination .current {
    color: var(--mzb-white);
    background: var(--mzb-primary);
    border-color: var(--mzb-primary);
}

.mzb-empty {
    padding: 26px;
    color: var(--mzb-muted);
    text-align: center;
    background: var(--mzb-white);
    border: 1px dashed var(--mzb-border);
    border-radius: var(--mzb-radius);
}

.mzb-single {
    padding: 24px 0 56px;
}

.mzb-single__wrap {
    display: grid;
    grid-template-columns: minmax(260px, 380px) 1fr;
    gap: 38px;
    align-items: start;
}

.mzb-single__cover {
    overflow: hidden;
    background: var(--mzb-white);
    border: 1px solid var(--mzb-border);
    border-radius: 28px;
    box-shadow: var(--mzb-shadow);
}

.mzb-single__cover img {
    display: block;
    width: 100%;
    height: auto;
}

.mzb-single__content {
    padding: 10px 0;
}

.mzb-single__title {
    margin: 0 0 16px;
    color: var(--mzb-primary);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 950;
    line-height: 1.2;
}

.mzb-single__desc {
    margin: 0 0 24px;
    color: var(--mzb-muted);
    font-size: 17px;
    line-height: 2;
}

.mzb-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.mzb-info-item {
    padding: 16px;
    background: var(--mzb-white);
    border: 1px solid var(--mzb-border);
    border-radius: 18px;
}

.mzb-info-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--mzb-muted);
    font-size: 13px;
    font-weight: 800;
}

.mzb-info-item strong {
    display: block;
    color: var(--mzb-primary);
    font-size: 16px;
    font-weight: 950;
}

.mzb-single__body {
    margin-top: 38px;
    padding: 30px;
    background: var(--mzb-white);
    border: 1px solid var(--mzb-border);
    border-radius: 28px;
    box-shadow: var(--mzb-shadow);
}

.mzb-single__body h2 {
    margin: 0 0 18px;
    color: var(--mzb-primary);
    font-size: 28px;
    font-weight: 950;
}

.mzb-single__body-content {
    color: var(--mzb-text);
    font-size: 16px;
    line-height: 2;
}

.mzb-single__body-content p,
.mzb-single__body-content ul,
.mzb-single__body-content ol {
    margin-bottom: 18px;
}

/* Cover cards shortcode: [mz_books_covers] */
.mzb-cover-books {
    width: 100%;
}

.mzb-cover-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(160px, 1fr));
    gap: 22px;
    align-items: stretch;
}

.mzb-cover-card {
    position: relative;
    display: flex;
    min-height: 345px;
    padding: 28px 22px 24px;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    background: var(--mzb-cream);
    border: 1px solid rgba(0, 38, 84, 0.08);
    border-radius: 9px;
    color: var(--mzb-primary);
    text-decoration: none !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.mzb-cover-card::before {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: 3px;
    background: var(--mzb-accent);
    border-radius: 99px;
}

.mzb-cover-card:hover {
    transform: translateY(-4px);
    border-color: rgba(206, 17, 38, 0.2);
    box-shadow: 0 14px 30px rgba(0, 38, 84, 0.08);
}

.mzb-cover-card__category {
    position: absolute;
    top: 30px;
    right: 32px;
    max-width: calc(100% - 118px);
    color: var(--mzb-accent);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mzb-cover-card__level {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    max-width: 98px;
    padding: 9px 13px;
    color: #ffffff;
    background: var(--mzb-accent);
    border-radius: 999px;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mzb-cover-card__title {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 175px;
    margin: 54px 0 44px;
    padding: 0 6px;
    color: var(--mzb-primary);
    text-align: center;
    font-size: clamp(20px, 1.65vw, 27px);
    font-weight: 950;
    line-height: 1.35;
}

.mzb-cover-card__author {
    display: block;
    padding-right: 8px;
    color: #8c97a6;
    font-size: 17px;
    font-weight: 850;
    line-height: 1.4;
}

@media (max-width: 1400px) {
    .mzb-cover-grid {
        grid-template-columns: repeat(4, minmax(160px, 1fr));
    }
}

@media (max-width: 1024px) {
    .mzb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mzb-single__wrap {
        grid-template-columns: 1fr;
    }

    .mzb-cover-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

@media (max-width: 767px) {
    .mzb-main {
        width: min(100% - 24px, 1200px);
        padding: 30px 0;
    }

    .mzb-grid,
    .mzb-info-grid,
    .mzb-cover-grid {
        grid-template-columns: 1fr;
    }

    .mzb-card__actions,
    .mzb-single__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .mzb-btn {
        width: 100%;
    }

    .mzb-cover-card {
        min-height: 315px;
    }
}
