/* =====================================================
   NILOBLOG — TAG SEARCH PAGE
   RTL | Responsive | PHP 7.4 compatible
   ===================================================== */

:root {
    --nl-primary: #243d63;
    --nl-primary-dark: #152743;
    --nl-accent: #c9a45c;
    --nl-accent-light: #f8f0df;
    --nl-bg: #f3f5f8;
    --nl-surface: #ffffff;
    --nl-text: #283548;
    --nl-muted: #6b7688;
    --nl-border: #e1e6ed;
    --nl-shadow: 0 8px 28px rgba(25, 42, 66, .07);
    --nl-radius: 14px;
    --nl-transition: .2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    direction: rtl;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 28px 16px 40px;
    direction: rtl;
    text-align: right;
    background: var(--nl-bg);
    color: var(--nl-text);
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 2;
    overflow-wrap: anywhere;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

a {
    color: var(--nl-primary);
    text-decoration: none;
    transition: color var(--nl-transition);
}

a:hover {
    color: #a67d36;
}

/* ????? ???? ????? */
body > h1 {
    display: block;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 24px;
    padding: 22px 26px;
    background: linear-gradient(
        125deg,
        var(--nl-primary-dark),
        var(--nl-primary)
    );
    border-radius: var(--nl-radius);
    border-bottom: 4px solid var(--nl-accent);
    box-shadow: var(--nl-shadow);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.9;
}

body > h1 a {
    color: #fff;
}

body > h1 a:hover {
    color: #f0d7a7;
}

/* ??? ???? ???? */
.category-page {
    display: flow-root;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px;
    background: var(--nl-surface);
    border: 1px solid var(--nl-border);
    border-radius: 18px;
    box-shadow: var(--nl-shadow);
}

/* ???? ????? ????? */
.category-page > div:first-child {
    position: relative;
    margin: 0 0 25px !important;
    padding: 18px 22px !important;
    background: linear-gradient(110deg, #f8f5ee, #fff);
    border: 1px solid #e9dfca !important;
    border-right: 4px solid var(--nl-accent) !important;
    border-radius: 11px;
}

.category-page > div:first-child h2 {
    margin: 0;
    padding: 0;
    color: var(--nl-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 2;
}

/* ??? ??????? */
.category-page > div:nth-child(2) {
    display: flow-root;
    width: 100%;
    padding: 0 !important;
    font-family: Tahoma, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 2 !important;
}

/* ???? ???? ? ???? ????? */
.category-page .col-md-6 {
    float: right;
    min-width: 0;
    width: 100%;
}

.category-page .col-md-6:first-child {
    width: 66%;
    padding-left: 22px;
}

.category-page .col-md-6:last-child {
    width: 34%;
    padding-right: 8px;
}

/* ???? ????? */
.category-page .col-md-6:first-child > div {
    margin: 0 0 17px !important;
    padding: 20px !important;
    background: #fff;
    border: 1px solid var(--nl-border);
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(25, 42, 66, .035);
    transition:
        border-color var(--nl-transition),
        box-shadow var(--nl-transition),
        transform var(--nl-transition);
}

.category-page .col-md-6:first-child > div:hover {
    border-color: #d8c49c;
    box-shadow: 0 7px 20px rgba(25, 42, 66, .07);
}

/* ????? ?? ???? */
.category-page .col-md-6:first-child > div > h2 {
    margin: 0 0 13px;
    padding: 0 0 12px;
    border-bottom: 1px solid #edf0f4;
    color: var(--nl-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.9;
}

.category-page .col-md-6:first-child > div > h2 a {
    color: var(--nl-primary);
}

.category-page .col-md-6:first-child > div > h2 a:hover {
    color: #a67d36;
}

/* ????? ???? */
.first-section-news {
    min-width: 0;
    margin: 0;
    padding: 0;
    color: #465267;
    font-size: 13px;
    line-height: 2.15;
}

.first-section-news p {
    margin: 0 0 12px;
    line-height: 2.15;
}

.first-section-news img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.first-section-news .img-responsive {
    display: block;
    max-width: 100%;
    object-fit: cover;
}

.first-section-news .col-md-4 {
    min-width: 0;
    max-width: 100%;
}

.first-section-news strong {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
}

.first-section-news strong a {
    display: inline-block;
    padding: 5px 12px;
    color: var(--nl-primary);
    background: var(--nl-accent-light);
    border: 1px solid #eadbb9;
    border-radius: 7px;
}

.first-section-news strong a:hover {
    color: #fff;
    background: var(--nl-primary);
    border-color: var(--nl-primary);
}

/* ???? ????? ? ????? */
.category-page .col-md-6:last-child > a {
    display: block;
    margin: 0 0 14px;
}

.category-page .col-md-6:last-child > a img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    transition: opacity var(--nl-transition);
}

.category-page .col-md-6:last-child > a:hover img {
    opacity: .88;
}

/* ????? ????? ???? */
.last-news {
    margin-top: 22px;
    padding: 19px;
    background: #fff;
    border: 1px solid var(--nl-border);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(25, 42, 66, .04);
}

.last-news h3,
.last-news h2 {
    margin: 0 0 12px;
    padding: 0 12px 12px 0;
    color: var(--nl-primary);
    border-bottom: 1px solid var(--nl-border);
    font-size: 16px;
    line-height: 1.9;
}

.last-news ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.last-news li {
    margin: 0;
    padding: 10px 4px !important;
    border-bottom: 1px solid #edf0f4;
    line-height: 1.9;
}

.last-news li:last-child {
    border-bottom: none !important;
}

.last-news li a {
    display: block;
    color: #43516a;
    font-size: 13px;
    transition: padding-right var(--nl-transition);
}

.last-news li a:hover {
    padding-right: 5px;
    color: #a67d36;
}

/* ????????? ?????? ?????? ?? HTML ???? */
body > div[style*="margin:30px"] {
    display: flow-root;
    width: 100% !important;
    max-width: 1180px;
    margin: 24px auto !important;
    padding: 22px !important;
    background: #fff;
    border: 1px solid var(--nl-border);
    border-radius: 14px;
    box-shadow: var(--nl-shadow);
}

body > div[style*="margin:30px"] h3 {
    margin: 0 0 16px;
    color: var(--nl-primary);
    font-size: 17px;
    line-height: 1.9;
}

body > div[style*="margin:30px"] a {
    display: inline-block;
    margin: 4px 3px;
    padding: 5px 12px;
    color: #42516a;
    background: #f5f7fa;
    border: 1px solid #e5eaf1;
    border-radius: 20px;
    font-size: 12px;
    line-height: 1.9;
    transition:
        color var(--nl-transition),
        background var(--nl-transition),
        border-color var(--nl-transition);
}

body > div[style*="margin:30px"] a:hover {
    color: var(--nl-primary);
    background: var(--nl-accent-light);
    border-color: #ddc69c;
}

/* ???????? ?????? ??????? */
.category-page::after,
.category-page > div:nth-child(2)::after {
    display: table;
    clear: both;
    content: "";
}

/* ???? */
@media (max-width: 900px) {
    body {
        padding: 18px 12px 30px;
    }

    .category-page {
        padding: 17px;
    }

    .category-page .col-md-6:first-child {
        width: 62%;
        padding-left: 14px;
    }

    .category-page .col-md-6:last-child {
        width: 38%;
        padding-right: 6px;
    }

    .first-section-news .col-md-4 {
        flex-basis: 85px;
        width: 85px;
        max-width: 85px;
    }

    .first-section-news .img-responsive {
        height: 80px;
    }
}

/* ?????? */
@media (max-width: 640px) {
    body {
        padding: 10px 8px 24px;
        font-size: 13px;
        line-height: 1.9;
    }

    body > h1 {
        margin-bottom: 14px;
        padding: 15px 17px;
        border-radius: 12px;
        font-size: 18px;
    }

    .category-page {
        padding: 12px;
        border-radius: 13px;
    }

    .category-page > div:first-child {
        margin-bottom: 17px !important;
        padding: 13px 14px !important;
    }

    .category-page > div:first-child h2 {
        font-size: 14px;
    }

    .category-page .col-md-6:first-child,
    .category-page .col-md-6:last-child {
        float: none;
        width: 100%;
        padding: 0;
    }

    .category-page .col-md-6:first-child > div {
        margin-bottom: 13px !important;
        padding: 14px !important;
        border-radius: 11px;
    }

    .category-page .col-md-6:first-child > div > h2 {
        margin-bottom: 10px;
        padding-bottom: 9px;
        font-size: 15px;
    }

    .first-section-news {
        font-size: 12px;
    }

    .last-news {
        margin-top: 16px;
        padding: 14px;
    }

    body > div[style*="margin:30px"] {
        margin: 16px auto !important;
        padding: 14px !important;
    }
}

/* ?????? ????? */
@media (max-width: 380px) {
    body {
        padding-right: 6px;
        padding-left: 6px;
    }

    .category-page {
        padding: 9px;
    }

    .category-page .col-md-6:first-child > div {
        padding: 11px !important;
    }

    body > h1 {
        padding: 13px;
        font-size: 16px;
    }
}