/*
Theme Name: Bilim Saray
Theme URI: https://bilimsaray.kz
Description: Казахстанский образовательный портал — Дворец знаний для эрудита
Version: 1.0.0
Text Domain: bilim-saray
*/

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bs-bg: #f4f6f9;
    --bs-primary: #1a3a5c;
    --bs-gold: #d4a843;
    --bs-gold-light: #f0e4c8;
    --bs-text: #1e1e2d;
    --bs-text-secondary: #5a5a6e;
    --bs-white: #ffffff;
    --bs-border: #dde1e8;
    --bs-hover: #0f2a45;
    --bs-card-shadow: 0 2px 12px rgba(26, 58, 92, 0.07);
    --bs-radius: 6px;
    --bs-font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--bs-font);
    background: var(--bs-bg);
    color: var(--bs-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--bs-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--bs-gold);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Layout === */
.bs_container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bs_container--narrow {
    max-width: 820px;
}

/* === Header === */
.bs_header {
    background: var(--bs-primary);
    padding: 0;
}

.bs_header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 20px;
}

.bs_logo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bs_logo__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--bs-white);
    letter-spacing: 0.5px;
    line-height: 1.2;
    position: relative;
    display: inline-block;
}

.bs_logo__title::after {
    content: '';
    display: block;
    width: 48px;
    height: 2px;
    background: var(--bs-gold);
    margin-top: 4px;
    border-radius: 1px;
}

.bs_logo__subtitle {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 400;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.bs_header__search {
    position: relative;
}

.bs_header__search input {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--bs-white);
    padding: 8px 16px 8px 36px;
    border-radius: var(--bs-radius);
    font-size: 0.88rem;
    width: 220px;
    font-family: var(--bs-font);
    outline: none;
    transition: background 0.2s;
}

.bs_header__search input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.bs_header__search input:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--bs-gold);
}

.bs_header__search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.5);
    fill: none;
    stroke-width: 2;
    pointer-events: none;
}

/* === Category Navigation === */
.bs_catnav {
    background: var(--bs-hover);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    position: relative;
}

.bs_catnav__wrap {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 0;
    padding: 0;
}

.bs_catnav__wrap::-webkit-scrollbar {
    display: none;
}

.bs_catnav__item {
    display: inline-flex;
    align-items: center;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.2px;
}

.bs_catnav__item:hover,
.bs_catnav__item--active {
    color: var(--bs-white);
    background: rgba(255, 255, 255, 0.06);
    border-bottom-color: var(--bs-gold);
}

/* === Hero Section === */
.bs_hero {
    position: relative;
    background: var(--bs-primary);
    overflow: hidden;
    margin-bottom: 48px;
}

.bs_hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 380px;
}

.bs_hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px 48px 0;
    color: var(--bs-white);
}

.bs_hero__badge {
    display: inline-block;
    background: var(--bs-gold);
    color: var(--bs-primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 18px;
    align-self: flex-start;
}

.bs_hero__title {
    font-size: 1.85rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.bs_hero__title a {
    color: inherit;
}

.bs_hero__title a:hover {
    color: var(--bs-gold-light);
}

.bs_hero__excerpt {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
    margin-bottom: 24px;
}

.bs_hero__meta {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}

.bs_hero__image {
    position: relative;
    overflow: hidden;
}

.bs_hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs_hero__image--placeholder {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.15) 0%, rgba(26, 58, 92, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Section Headings === */
.bs_section__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--bs-border);
}

.bs_section__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-primary);
    position: relative;
    padding-left: 14px;
}

.bs_section__title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: var(--bs-gold);
    border-radius: 2px;
}

.bs_section__link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bs-gold);
}

/* === Post Grid === */
.bs_grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 56px;
}

.bs_card {
    background: var(--bs-white);
    border-radius: var(--bs-radius);
    overflow: hidden;
    box-shadow: var(--bs-card-shadow);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
}

.bs_card:hover {
    box-shadow: 0 6px 24px rgba(26, 58, 92, 0.12);
    transform: translateY(-2px);
}

.bs_card__image {
    position: relative;
    padding-top: 52%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bs-bg) 0%, var(--bs-border) 100%);
}

.bs_card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.bs_card:hover .bs_card__image img {
    transform: scale(1.04);
}

.bs_card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--bs-primary);
    color: var(--bs-white);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 10px;
    border-radius: 3px;
    z-index: 2;
}

.bs_card__body {
    padding: 20px 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bs_card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--bs-text);
}

.bs_card__title a {
    color: inherit;
}

.bs_card__title a:hover {
    color: var(--bs-primary);
}

.bs_card__excerpt {
    font-size: 0.88rem;
    color: var(--bs-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.bs_card__meta {
    font-size: 0.76rem;
    color: var(--bs-text-secondary);
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--bs-border);
}

/* === Categories Grid === */
.bs_categories {
    margin-bottom: 56px;
}

.bs_catgrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.bs_catgrid__item {
    background: var(--bs-white);
    border-radius: var(--bs-radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--bs-card-shadow);
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.bs_catgrid__item:hover {
    border-left-color: var(--bs-gold);
    transform: translateX(3px);
    color: var(--bs-primary);
}

.bs_catgrid__name {
    font-size: 0.88rem;
    font-weight: 600;
}

.bs_catgrid__count {
    font-size: 0.75rem;
    color: var(--bs-text-secondary);
    background: var(--bs-bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* === Single Post === */
.bs_single {
    padding: 48px 0 64px;
}

.bs_breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--bs-text-secondary);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.bs_breadcrumb a {
    color: var(--bs-text-secondary);
}

.bs_breadcrumb a:hover {
    color: var(--bs-gold);
}

.bs_breadcrumb__sep {
    color: var(--bs-border);
    font-size: 0.7rem;
}

.bs_article__header {
    margin-bottom: 36px;
}

.bs_article__cat {
    display: inline-block;
    background: var(--bs-gold-light);
    color: var(--bs-primary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: 14px;
}

.bs_article__title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--bs-primary);
    margin-bottom: 16px;
}

.bs_article__meta {
    font-size: 0.82rem;
    color: var(--bs-text-secondary);
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.bs_article__thumbnail {
    margin-bottom: 36px;
    border-radius: var(--bs-radius);
    overflow: hidden;
}

.bs_article__thumbnail img {
    width: 100%;
    display: block;
}

/* === Article Content Typography === */
.bs_content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--bs-text);
}

.bs_content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin: 40px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--bs-border);
}

.bs_content h3 {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin: 32px 0 14px;
}

.bs_content h4 {
    font-size: 1.08rem;
    font-weight: 600;
    margin: 28px 0 12px;
}

.bs_content p {
    margin-bottom: 20px;
}

.bs_content ul,
.bs_content ol {
    margin: 0 0 24px 28px;
}

.bs_content li {
    margin-bottom: 8px;
}

.bs_content blockquote {
    margin: 28px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--bs-gold);
    background: var(--bs-gold-light);
    border-radius: 0 var(--bs-radius) var(--bs-radius) 0;
    font-style: italic;
    color: var(--bs-text-secondary);
}

.bs_content blockquote p:last-child {
    margin-bottom: 0;
}

.bs_content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.92rem;
}

.bs_content table th,
.bs_content table td {
    padding: 12px 16px;
    border: 1px solid var(--bs-border);
    text-align: left;
}

.bs_content table th {
    background: var(--bs-primary);
    color: var(--bs-white);
    font-weight: 600;
}

.bs_content table tr:nth-child(even) {
    background: var(--bs-bg);
}

.bs_content img {
    border-radius: var(--bs-radius);
    margin: 24px 0;
}

.bs_content a {
    color: var(--bs-primary);
    border-bottom: 1px solid var(--bs-gold);
    transition: border-color 0.2s;
}

.bs_content a:hover {
    color: var(--bs-gold);
    border-bottom-color: transparent;
}

.bs_content .wp-caption {
    max-width: 100%;
    margin: 24px 0;
}

.bs_content .wp-caption-text {
    font-size: 0.82rem;
    color: var(--bs-text-secondary);
    padding: 8px 0 0;
    text-align: center;
}

/* === Related Posts === */
.bs_related {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 2px solid var(--bs-border);
}

.bs_related__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin-bottom: 24px;
    padding-left: 14px;
    position: relative;
}

.bs_related__title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 3px;
    background: var(--bs-gold);
    border-radius: 2px;
}

.bs_related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.bs_related__item {
    background: var(--bs-white);
    border-radius: var(--bs-radius);
    overflow: hidden;
    box-shadow: var(--bs-card-shadow);
    transition: transform 0.2s;
}

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

.bs_related__thumb {
    padding-top: 55%;
    position: relative;
    overflow: hidden;
    background: var(--bs-bg);
}

.bs_related__thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bs_related__body {
    padding: 14px 16px 18px;
}

.bs_related__heading {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.bs_related__heading a {
    color: var(--bs-text);
}

.bs_related__heading a:hover {
    color: var(--bs-primary);
}

/* === Archive === */
.bs_archive {
    padding: 48px 0 64px;
}

.bs_archive__header {
    margin-bottom: 36px;
}

.bs_archive__title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--bs-primary);
    margin-bottom: 8px;
}

.bs_archive__desc {
    font-size: 0.95rem;
    color: var(--bs-text-secondary);
    line-height: 1.6;
}

.bs_filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.bs_filter__chip {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bs-white);
    color: var(--bs-text-secondary);
    border: 1px solid var(--bs-border);
    transition: all 0.2s;
}

.bs_filter__chip:hover,
.bs_filter__chip--active {
    background: var(--bs-primary);
    color: var(--bs-white);
    border-color: var(--bs-primary);
}

/* === Pagination === */
.bs_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 48px;
}

.bs_pagination a,
.bs_pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--bs-radius);
    font-size: 0.88rem;
    font-weight: 500;
    background: var(--bs-white);
    color: var(--bs-text);
    border: 1px solid var(--bs-border);
    transition: all 0.2s;
}

.bs_pagination a:hover {
    background: var(--bs-primary);
    color: var(--bs-white);
    border-color: var(--bs-primary);
}

.bs_pagination .current {
    background: var(--bs-primary);
    color: var(--bs-white);
    border-color: var(--bs-primary);
}

/* === Page === */
.bs_page {
    padding: 48px 0 64px;
}

.bs_page__title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--bs-primary);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bs-border);
}

/* === 404 === */
.bs_404 {
    text-align: center;
    padding: 80px 0 100px;
}

.bs_404__code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--bs-border);
    line-height: 1;
    margin-bottom: 16px;
}

.bs_404__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin-bottom: 12px;
}

.bs_404__text {
    font-size: 1rem;
    color: var(--bs-text-secondary);
    margin-bottom: 32px;
}

.bs_btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--bs-primary);
    color: var(--bs-white);
    border-radius: var(--bs-radius);
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s;
}

.bs_btn:hover {
    background: var(--bs-hover);
    color: var(--bs-white);
}

/* === Footer === */
.bs_footer {
    background: var(--bs-primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 48px 0 0;
    margin-top: 48px;
}

.bs_footer__inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    padding-bottom: 40px;
}

.bs_footer__brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--bs-white);
    margin-bottom: 12px;
}

.bs_footer__tagline {
    font-size: 0.85rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.5);
}

.bs_footer__cattitle {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bs-gold);
    margin-bottom: 18px;
}

.bs_footer__catlist {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 20px;
}

.bs_footer__catlist li a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.82rem;
    transition: color 0.2s;
}

.bs_footer__catlist li a:hover {
    color: var(--bs-gold);
}

.bs_footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
}

/* === Responsive === */
@media (max-width: 992px) {
    .bs_hero__inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .bs_hero__content {
        padding: 36px 0;
    }
    .bs_hero__image {
        height: 260px;
    }
    .bs_catgrid {
        grid-template-columns: repeat(3, 1fr);
    }
    .bs_related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bs_footer__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .bs_footer__catlist {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .bs_header__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 0 16px;
    }
    .bs_header__search input {
        width: 100%;
    }
    .bs_grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .bs_catgrid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bs_article__title {
        font-size: 1.55rem;
    }
    .bs_hero__title {
        font-size: 1.4rem;
    }
    .bs_related__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .bs_container {
        padding: 0 16px;
    }
    .bs_catgrid {
        grid-template-columns: 1fr;
    }
    .bs_card__body {
        padding: 16px;
    }
}
