/*
Theme Name: Abay Map
Theme URI: https://abaymap.kz
Description: Кастомная тема «Литературная карта Абайской области». Повторяет дизайн оригинала пиксель-в-пиксель, без Elementor.
Author: Abay Map
Version: 1.8.0
Text Domain: abaymap
*/

/* ===== Шрифт заголовков (с оригинала) ===== */
@font-face {
    font-family: "Octyabrskaya";
    src: url("assets/fonts/octyabrskaya.woff2") format("woff2"),
         url("assets/fonts/octyabrskaya.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ===== Переменные палитры ===== */
:root {
    --brand: #1f4da4;
    --accent: #347aff;
    --navy: #001c51;
    --about: #c9dff7;
    --ink: #272727;
    --muted-ink: #4b4b4b;

    --font-display: "Octyabrskaya", sans-serif;
    --font-nav: "Manrope", sans-serif;
    --font-body: "Inter", sans-serif;
    --font-btn: "Roboto", sans-serif;
}

/* ===== Базовое ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: #fff;
    color: #333;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
/* Заголовки используют шрифт Octyabrskaya (единственный вес 400).
   Сбрасываем жирность по умолчанию и отключаем синтез фальшивого жирного —
   именно это делало текст «жирным». */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 400;
    font-synthesis: none;
}
ul { margin: 0; padding: 0; list-style: none; }

/* ===== Контейнер: контент 1280px, поля 80px на широких ===== */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}
@media (min-width: 1024px) {
    .container { padding: 0 80px; }
}

/* ===== Кнопка-пилюля ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 100px;
    font-family: var(--font-btn);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    color: #fff;
    transition: background-color .2s;
}
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: #2f6fe6; }
.btn--navy { background: var(--navy); }
.btn--navy:hover { background: #002a78; }

/* ===== Шапка ===== */
.site-header { background: var(--brand); }
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 66px;
}
.site-header__logo img { height: 34px; width: auto; }

.site-nav { display: none; align-items: center; gap: 23px; }
.site-nav a {
    font-family: var(--font-nav);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1;
    color: rgba(255,255,255,.95);
    transition: color .2s;
}
.site-nav a:hover { color: #fff; }

.lang { display: flex; align-items: center; gap: 12px; }
.lang a {
    font-family: var(--font-nav);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    transition: color .2s;
}
.lang a:hover, .lang a.is-active { color: #fff; }
.lang__sep { width: 1px; height: 12px; background: rgba(255,255,255,.3); }

.burger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-nav);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}
.mobile-nav { display: none; border-top: 1px solid rgba(255,255,255,.15); background: var(--brand); }
.mobile-nav.is-open { display: block; }
.mobile-nav a { display: block; padding: 12px 0; font-family: var(--font-nav); font-size: 14px; font-weight: 700; text-transform: uppercase; color: rgba(255,255,255,.95); }

@media (min-width: 1024px) {
    .site-nav { display: flex; }
    .burger { display: none; }
}

/* ===== Hero ===== */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 594px;
    overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.32); }
.hero__content { position: relative; z-index: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero__title {
    max-width: 1100px;
    font-family: var(--font-display);
    font-size: 44px;
    line-height: 1.05;
    color: #fff;
}
.hero__subtitle {
    margin-top: 24px;
    max-width: 1200px;
    font-size: 18px;
    line-height: 27px;
    color: #fff;
}
.hero__buttons { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (min-width: 640px) { .hero__title { font-size: 60px; } }
@media (min-width: 1024px) { .hero__title { font-size: 84px; line-height: 84px; } }

/* ===== О проекте ===== */
.about { padding: 60px 0; }
.about__card {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    background: var(--about);
    border-radius: 10px;
    overflow: hidden;
}
.about__text { padding: 48px 32px; }
.about__title { font-family: var(--font-display); font-size: 28px; line-height: 1.2; color: var(--ink); }
.about__desc { margin-top: 16px; max-width: 460px; font-size: 16px; line-height: 24px; color: var(--muted-ink); }
.about__btn { margin-top: 28px; }
.about__map { display: flex; align-items: center; justify-content: center; padding: 0 32px 48px; }
.about__map img { width: 100%; max-width: 600px; height: auto; }
@media (min-width: 1024px) {
    .about__card { grid-template-columns: 1fr 1fr; }
    .about__text { padding: 70px 24px 70px 85px; }
    .about__title { font-size: 37px; }
    .about__map { justify-content: flex-end; padding: 30px 50px 30px 0; }
}

/* ===== Подвал ===== */
.site-footer { margin-top: auto; }
.footer-main {
    background: var(--brand);
}
/* Орнамент-полоса: повторяется по горизонтали (как в оригинале) */
.footer-ornament {
    height: 31px;
    background: var(--brand) url("assets/img/footer-bg.svg") repeat-x center / contain;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 55px;
    padding-bottom: 55px;
}
.footer-col__logo img { height: 34px; width: auto; }
.footer-note { margin-top: 20px; max-width: 320px; font-size: 13px; line-height: 24px; color: rgba(255,255,255,.9); }
.footer-col__title { font-family: var(--font-display); font-size: 21px; line-height: 1; color: #fff; }
.footer-links { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; padding: 0; }
.footer-links li { list-style: none; margin: 0; }
.footer-links a { font-size: 14px; color: rgba(255,255,255,.9); transition: color .2s; }
.footer-links a:hover { color: #fff; }
.footer-contacts { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.footer-contact { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.9); }
.footer-contact:hover { color: #fff; }
.footer-contact svg { flex: 0 0 auto; }
.footer-contact span { font-size: 14px; line-height: 21px; }

.footer-bottom { background: var(--navy); }
.footer-bottom__inner { display: flex; align-items: center; justify-content: center; height: 54px; }
.footer-bottom p { margin: 0; font-size: 12px; color: rgba(255,255,255,.85); }

@media (min-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.1fr 1fr 1fr; } }

/* ===== Энциклопедия: категории + карточки ===== */
.enc { padding: 56px 0; }
.enc__grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
.enc__side-title { font-family: var(--font-display); font-size: 22px; color: var(--ink); margin-bottom: 16px; }
.enc__cats { display: flex; flex-direction: column; gap: 4px; }
.enc__cats a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: 8px;
    font-size: 15px; color: var(--muted-ink); transition: background .15s, color .15s;
}
.enc__cats a:hover { background: var(--about); color: var(--brand); }
.enc__cats a.is-active { background: var(--brand); color: #fff; }
.enc__count { font-size: 12px; opacity: .7; }

.enc__cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.enc-card {
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid #e6ebf3; border-radius: 12px; overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.enc-card:hover { box-shadow: 0 10px 30px rgba(31, 77, 164, .12); transform: translateY(-3px); }
.enc-card__img { height: 180px; background: var(--about); overflow: hidden; flex: 0 0 auto; }
.enc-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.enc-card__noimg { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #c9dff7, #9ec2f0); }
.enc-card__body { padding: 16px 18px; flex: 1 1 auto; }
.enc-card__cat { display: inline-block; font-size: 12px; color: var(--brand-accent); margin-bottom: 6px; }
.enc-card__title {
    font-family: var(--font-display); font-size: 19px; line-height: 1.25; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.enc-card__excerpt {
    margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted-ink);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.enc__empty { font-size: 15px; color: var(--muted-ink); }

/* Алфавитный вид (Библиотеки): 2 колонки, группы по буквам */
.enc-alpha { column-count: 2; column-gap: 40px; }
.enc-alpha__group { break-inside: avoid; margin-bottom: 22px; display: flex; gap: 14px; }
.enc-alpha__letter {
    flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px;
    background: var(--brand); color: #fff; font-family: var(--font-display);
    font-size: 17px; display: flex; align-items: center; justify-content: center;
}
.enc-alpha__items { list-style: none; margin: 0; padding: 3px 0 0; }
.enc-alpha__items li { margin: 0 0 8px; }
.enc-alpha__items a { font-size: 15px; color: var(--muted-ink); transition: color .15s; }
.enc-alpha__items a:hover { color: var(--brand); }
@media (max-width: 700px) { .enc-alpha { column-count: 1; } }

/* Карточки галереи */
.gal__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gal-card { display: block; border-radius: 12px; overflow: hidden; background: var(--about); position: relative; }
.gal-card__img { aspect-ratio: 4 / 3; }
.gal-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gal-card:hover .gal-card__img img { transform: scale(1.05); }
.gal-card__cap {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 14px 16px 12px;
    background: linear-gradient(to top, rgba(0,28,81,.8), rgba(0,28,81,0));
    color: #fff; font-size: 14px; font-weight: 600;
}
@media (min-width: 900px) { .gal__grid { grid-template-columns: repeat(3, 1fr); } }

@media (min-width: 900px) {
    .enc__grid { grid-template-columns: 250px 1fr; gap: 40px; }
    .enc__cards { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Внутренние страницы: шапка с орнаментом ===== */
.page-hero {
    position: relative;
    background: #0056b4;          /* сплошной синий, как в оригинале */
    padding: 48px 0;
    overflow: hidden;
}
/* Орнамент сверху — обесцвеченный (saturate 0) и еле заметный (opacity .19) */
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("assets/img/ornament.jpg") repeat;
    opacity: .19;
    filter: saturate(0);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero__title { font-family: var(--font-display); font-size: 30px; line-height: 1.2; color: #fff; }
.page-hero__subtitle { margin-top: 12px; max-width: 640px; font-size: 16px; line-height: 24px; color: rgba(255,255,255,.9); }
.page-body { padding: 56px 0; }
.page-body p { font-size: 16px; line-height: 28px; color: var(--muted-ink); }
@media (min-width: 1024px) { .page-hero__title { font-size: 37px; } }

/* ===== Шапка страницы карты (светлая, заголовок + описание) ===== */
.map-head { background: #dceafc; padding: 36px 0; }
.map-head__grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; }
.map-head__title { font-family: var(--font-display); font-size: 28px; line-height: 1.15; color: var(--ink); text-transform: uppercase; }
.map-head__desc { font-size: 15px; line-height: 24px; color: var(--muted-ink); }
@media (min-width: 1024px) {
    .map-head__grid { grid-template-columns: 1fr 1fr; gap: 60px; }
    .map-head__title { font-size: 34px; }
}

/* ===== Интерактивная карта районов (SVG) ===== */
.map-section { padding: 30px 0 60px; }

/* Панель фильтров по типам */
.map-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.map-filter {
    border: 1px solid #cdd9ec; background: #fff; color: var(--muted-ink);
    padding: 7px 16px; border-radius: 100px; font-size: 14px; cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.map-filter:hover { border-color: var(--brand-accent); color: var(--brand); }
.map-filter.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.map-wrap {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}
.map-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.map-wrap .region {
    fill: #b3cdff;
    stroke: #fff;
    stroke-width: 2;
    stroke-linejoin: round;
    cursor: pointer;
    transition: fill .2s;
}
/* Каждый район — свой мягкий синий оттенок (в одной гамме, не режет глаз) */
.region#beskaragay { fill: #cfe2fb; }
.region#kurchatov  { fill: #bcd6f8; }
.region#borodulih  { fill: #aeccf2; }
.region#semey      { fill: #9dbff0; }
.region#zhanasemei { fill: #c4ddf9; }
.region#zharmin    { fill: #a9c8f5; }
.region#abay       { fill: #b9d4f7; }
.region#kokpekti   { fill: #93b8ee; }
.region#aksuat     { fill: #a3c3f3; }
.region#ayagoz     { fill: #b3cef6; }
.region#urzhar     { fill: #8fb6ec; }
.region#makanchi   { fill: #99bdf0; }

.map-wrap .region:hover,
.map-wrap .region.is-active { fill: var(--brand-accent); }

.map-label {
    position: absolute;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.3;
    color: #333;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
    pointer-events: none;
    z-index: 2;
}
@media (max-width: 640px) { .map-label { font-size: 9px; padding: 1px 5px; } }

/* ===== Метки мест на карте ===== */
.map-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 3;
    cursor: pointer;
}
.map-pin__dot {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--brand-accent);
    border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    transition: transform .15s;
}
.map-pin:hover .map-pin__dot,
.map-pin:focus .map-pin__dot { transform: scale(1.25); }
/* наведённая метка и её карточка — поверх остальных меток */
.map-pin:hover,
.map-pin:focus,
.map-pin.is-open { z-index: 50; }

.map-pin__popup {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: 230px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .22);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s, transform .15s;
    z-index: 4;
}
.map-pin:hover .map-pin__popup,
.map-pin:focus .map-pin__popup,
.map-pin.is-open .map-pin__popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.map-pin__popup img { width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.map-pin__popup strong { display: block; font-size: 15px; color: var(--brand); font-family: var(--font-body); }
.map-pin__cat { display: inline-block; margin-top: 3px; font-size: 12px; color: var(--brand-accent); }
.map-pin__addr { display: block; margin-top: 4px; font-size: 12px; color: #666; }
.map-pin__popup p { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: #333; }
.map-pin__more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--brand-accent); }

/* ===== Страница места (на всю ширину) ===== */
.place-img { margin-bottom: 24px; }
.place-img img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 12px; }
.place-content { font-size: 16px; line-height: 1.7; color: var(--muted-ink); }
.place-content p { margin: 0 0 16px; }
.place-content h2, .place-content h3 { font-family: var(--font-display); color: var(--ink); margin: 28px 0 12px; }

/* ===== Страница статьи (на всю ширину) ===== */
.enc-single { max-width: none; }
.enc-single__img { margin-bottom: 24px; }
.enc-single__img img { width: 100%; max-height: 460px; object-fit: cover; border-radius: 12px; }
.enc-single__content { font-size: 16px; line-height: 1.7; color: var(--muted-ink); }
.enc-single__content p { margin: 0 0 16px; }
.enc-single__content h2, .enc-single__content h3 { font-family: var(--font-display); color: var(--ink); margin: 28px 0 12px; }
