/* Kulash Bayseitova — дизайн в стиле bokey.kz */

:root {
    --color-bg: #faf9f7;
    --color-paper: #ffffff;
    --color-text: #2c2c2c;
    --color-text-muted: #6b6b6b;
    --color-accent: #8b6914;
    --color-accent-light: #a8821a;
    --color-accent-dark: #6b5010;
    --color-header-bg: #f5f3ef;
    --color-header-border: #e0ddd6;
    --color-nav-bg: #ebe8e2;
    --color-nav-border: #d8d4cc;
    --color-nav-text: #2d2a26;
    --color-header: #2d2a26;
    --color-footer-bg: #3d3832;
    --color-nav-hover: #dfdbd3;
    --color-border: #e8e4df;
    --color-card-bg: #ffffff;
    --font-sans: 'PT Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'PT Serif', Georgia, serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
    --radius: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    font-size: 15px;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header bar — светлая полоса с языками */
.header-bar {
    background: var(--color-header-bg);
    padding: 10px 0;
    border-bottom: 1px solid var(--color-header-border);
}

.header-bar-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Hero header — светлый, элегантный */
.hero-header {
    background: var(--color-header-bg);
    padding: 48px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--color-header-border);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--color-nav-text);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--color-text-muted);
    font-weight: 400;
}

/* Language switcher */
.language-switcher {
    display: flex;
    gap: 6px;
}

.lang-link {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(45,42,38,0.06);
    color: var(--color-nav-text);
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
}

.lang-link:hover {
    background: rgba(45,42,38,0.1);
}

.lang-link.active {
    background: var(--color-accent);
    color: #fff;
}

/* Navigation — светлая навигация */
.main-navigation {
    background: var(--color-nav-bg);
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--color-nav-border);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: block;
    padding: 14px 20px;
    color: var(--color-nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.nav-menu > li > a:hover {
    background: var(--color-nav-hover);
}

/* Submenu */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-paper);
    min-width: 260px;
    box-shadow: var(--shadow-lg);
    list-style: none;
    z-index: 100;
    border: 1px solid var(--color-border);
}

.has-submenu:hover .submenu {
    display: block;
}

.submenu li a {
    display: block;
    padding: 12px 20px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s;
}

.submenu li a:hover {
    background: var(--color-bg);
    border-left-color: var(--color-accent);
}

/* Content layout */
.site-content {
    padding: 40px 0 60px;
}

.content-wrapper {
    display: flex;
    gap: 40px;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
}

.sidebar-menu ul {
    list-style: none;
    background: var(--color-paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.sidebar-menu li a {
    display: block;
    padding: 14px 20px;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.sidebar-menu li:last-child a {
    border-bottom: none;
}

.sidebar-menu li a:hover {
    background: var(--color-bg);
    color: var(--color-accent-dark);
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* Page header */
.page-header {
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-accent);
}

.page-header h1 {
    font-family: var(--font-serif);
    color: var(--color-header);
    font-size: 36px;
    font-weight: 700;
}

/* Quick links — карточки быстрого доступа (в стиле bokey.kz) */
.quick-links {
    margin-bottom: 40px;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.quick-link-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    background: var(--color-paper);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.quick-link-card:hover {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-md);
    color: var(--color-accent-dark);
}

@media (max-width: 600px) {
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
}

/* Homepage — контент без общей карточки */
.homepage .main-content {
    background: transparent;
    padding: 0;
}

/* Внутренние страницы — белая карточка контента */
.main-content:has(.page-header),
.main-content:has(.books-grid),
.main-content:has(.bibliography-list),
.main-content:has(.news-list),
.main-content:has(.content-list),
.main-content:has(.media-gallery) {
    background: var(--color-paper);
    padding: 40px 44px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.intro-section {
    margin-bottom: 48px;
    background: var(--color-paper);
    padding: 36px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.intro-section h2 {
    font-family: var(--font-serif);
    color: var(--color-header);
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
}

.intro-content p {
    margin-bottom: 16px;
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.8;
}

.biography-section {
    margin-bottom: 0;
}

.biography-section h2 {
    font-family: var(--font-serif);
    color: var(--color-header);
    margin-bottom: 28px;
    font-size: 28px;
    font-weight: 700;
}

.biography-content {
    display: flex;
    gap: 44px;
    flex-wrap: wrap;
    background: var(--color-paper);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.biography-image {
    flex: 0 0 340px;
}

.biography-image img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.biography-text {
    flex: 1;
    min-width: 280px;
}

.biography-text h3 {
    font-family: var(--font-serif);
    color: var(--color-header);
    margin-bottom: 20px;
    font-size: 26px;
    font-weight: 700;
}

.biography-text h4 {
    font-family: var(--font-serif);
    color: var(--color-accent-dark);
    margin-top: 28px;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 600;
}

.biography-text ul {
    margin-left: 24px;
    margin-bottom: 16px;
}

.biography-text li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.biography-text p {
    margin-bottom: 14px;
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.8;
}

/* Bibliography */
.bibliography-items {
    list-style: none;
}

.bibliography-item {
    padding: 24px;
    margin-bottom: 16px;
    background: var(--color-bg);
    border-left: 4px solid var(--color-accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.bibliography-item h3 {
    color: var(--color-header);
    margin-bottom: 8px;
    font-size: 17px;
}

.bibliography-item .author,
.bibliography-item .year {
    color: var(--color-text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.bibliography-item .description {
    margin-top: 10px;
    color: var(--color-text);
}

/* News */
.news-list .news-item {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--color-border);
}

.news-list .news-item:last-child {
    border-bottom: none;
}

.news-media {
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
}

.news-media img {
    width: 100%;
    max-width: 600px;
    display: block;
}

.news-media iframe {
    border-radius: var(--radius);
}

.news-content p {
    margin-bottom: 10px;
}

.news-date {
    color: var(--color-text-muted);
    font-size: 13px;
}

/* Books grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 28px;
}

.book-item {
    text-align: center;
    background: var(--color-bg);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s;
}

.book-item:hover {
    box-shadow: var(--shadow-md);
}

.book-cover {
    margin-bottom: 16px;
}

.book-cover img {
    width: 100%;
    max-width: 160px;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.book-info h3 {
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--color-text);
    font-weight: 600;
}

.btn-view-pdf {
    display: inline-block;
    padding: 8px 18px;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-view-pdf:hover {
    background: var(--color-accent-light);
}

/* Content items */
.content-list .content-item {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--color-border);
}

.content-list .content-item:last-child {
    border-bottom: none;
}

.content-image {
    margin-bottom: 16px;
    border-radius: var(--radius);
    overflow: hidden;
}

.content-image img {
    width: 100%;
    max-width: 600px;
    display: block;
}

.content-body h3 {
    color: var(--color-header);
    margin-bottom: 12px;
    font-size: 20px;
}

.content-body p {
    margin-bottom: 14px;
}

.btn-external {
    display: inline-block;
    padding: 8px 18px;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-external:hover {
    background: var(--color-accent-light);
}

/* Media gallery */
.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.media-item {
    background: var(--color-paper);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s;
}

.media-item:hover {
    box-shadow: var(--shadow-md);
}

.media-content img {
    width: 100%;
    display: block;
}

.media-info {
    padding: 16px;
}

.media-info h4 {
    color: var(--color-header);
    margin-bottom: 6px;
    font-size: 16px;
}

.media-info p {
    color: var(--color-text-muted);
    font-size: 13px;
}

/* No content */
.no-content {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-muted);
    font-size: 16px;
}

/* Footer */
.site-footer {
    background: var(--color-footer-bg);
    color: rgba(255,255,255,0.9);
    padding: 28px 0;
    text-align: center;
    margin-top: 48px;
    font-size: 14px;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Планшеты */
@media (max-width: 900px) {
    .container {
        padding: 0 20px;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .sidebar-menu ul {
        display: flex;
        flex-wrap: wrap;
    }
    
    .sidebar-menu li {
        flex: 1;
        min-width: 140px;
    }
}

/* Телефоны и маленькие планшеты */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .hero-header {
        padding: 28px 0 24px;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .header-bar {
        padding: 12px 0;
    }
    
    .lang-link {
        padding: 8px 16px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Меню — вертикально, удобно для пальцев */
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu > li > a {
        padding: 14px 20px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .submenu {
        position: static;
        display: none;
        min-width: 100%;
    }
    
    .has-submenu:hover .submenu,
    .has-submenu.menu-open .submenu,
    .has-submenu:focus-within .submenu {
        display: block;
    }
    
    .submenu li a {
        padding: 14px 20px 14px 36px;
        min-height: 48px;
        display: flex;
        align-items: center;
        background: var(--color-paper);
    }
    
    .site-content {
        padding: 24px 0 40px;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
    
    .biography-content {
        flex-direction: column;
        padding: 20px;
    }
    
    .biography-image {
        flex: 0 0 auto;
    }
    
    .intro-section {
        padding: 24px 20px;
    }
    
    .intro-section h2,
    .biography-section h2 {
        font-size: 24px;
    }
    
    .main-content:has(.page-header),
    .main-content:has(.books-grid),
    .main-content:has(.bibliography-list),
    .main-content:has(.news-list),
    .main-content:has(.content-list),
    .main-content:has(.media-gallery) {
        padding: 24px 20px;
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .book-item {
        padding: 16px;
    }
    
    .media-gallery {
        grid-template-columns: 1fr;
    }
    
    .quick-links {
        margin-bottom: 28px;
    }
    
    .quick-link-card {
        padding: 24px 20px;
        min-height: 56px;
    }
    
    .news-media iframe {
        height: 220px;
    }
    
    .site-footer {
        padding: 24px 16px;
        margin-top: 32px;
        font-size: 13px;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .language-switcher {
        gap: 4px;
    }
    
    .lang-link {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar-menu li {
        min-width: 100%;
    }
}

/* Видео — responsive */
.news-media iframe,
.media-content iframe {
    max-width: 100%;
}

/* Безопасная зона для вырезов камеры (iPhone и др.) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}
