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

:root {
    --color-bg: #fdfdfd;
    --color-surface: #ffffff;
    --color-text: #1a1a2e;
    --color-text-muted: #555568;
    --color-primary: #2d5be3;
    --color-primary-hover: #1e44b8;
    --color-accent: #e8ecf8;
    --color-border: #e2e2ea;
    --color-footer-bg: #1a1a2e;
    --color-footer-text: #c5c5d2;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;
    --max-width: 1200px;
    --header-height: 72px;
    --radius: 8px;
    --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 30px rgba(0,0,0,0.10);
    --transition: 0.25s ease;
}

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

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

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

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.3;
    color: var(--color-text);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}


/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 18px 24px;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.2);
}

.cookie-banner.active { display: flex; }

.cookie-banner a { color: #93b4ff; }

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-banner-buttons button {
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background var(--transition);
}

.btn-accept-cookies {
    background: var(--color-primary);
    color: #fff;
}

.btn-accept-cookies:hover { background: var(--color-primary-hover); }

.btn-decline-cookies {
    background: transparent;
    color: var(--color-footer-text);
    border: 1px solid var(--color-footer-text) !important;
}

.btn-decline-cookies:hover {
    background: rgba(255,255,255,0.08);
}


/* --- Header & Navigation --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.site-logo:hover { color: var(--color-primary); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 6px 0;
    transition: var(--transition);
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.nav-toggle.active span:nth-child(2) { opacity: 0; }

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-menu a {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 4px 0;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}


/* --- Hero Section --- */
.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, #f0f4ff 100%);
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}


/* --- Page Header (non-hero pages) --- */
.page-header {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.2rem;
}

.page-header p {
    color: var(--color-text-muted);
    margin-top: 8px;
    font-size: 1.05rem;
}


/* --- Post Grid (Home) --- */
.posts-section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.6rem;
    margin-bottom: 32px;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.post-card-image {
    width: 100%;
    height: 200px;
    background: var(--color-accent);
    object-fit: cover;
}

.post-card-body {
    padding: 24px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.post-card-category {
    background: var(--color-accent);
    color: var(--color-primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.post-card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.post-card-body h3 a {
    color: var(--color-text);
}

.post-card-body h3 a:hover {
    color: var(--color-primary);
}

.post-card-excerpt {
    color: var(--color-text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    transition: var(--transition);
}

.pagination a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination .current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}


/* --- Article Page --- */
.article-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    padding: 48px 0 80px;
}

.article-content {
    min-width: 0;
}

.article-hero-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 32px;
    background: var(--color-accent);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.article-author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-accent);
    object-fit: cover;
}

.article-body h2 {
    font-size: 1.5rem;
    margin: 36px 0 16px;
}

.article-body h3 {
    font-size: 1.2rem;
    margin: 28px 0 12px;
}

.article-body p {
    margin-bottom: 18px;
}

.article-body blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 16px 24px;
    margin: 28px 0;
    background: var(--color-accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--color-text-muted);
}

.article-body ul, .article-body ol {
    margin: 0 0 18px 24px;
}

.article-body li {
    margin-bottom: 6px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.article-tags a {
    background: var(--color-accent);
    color: var(--color-text-muted);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition);
}

.article-tags a:hover {
    background: var(--color-primary);
    color: #fff;
}


/* --- Sidebar --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
}

.sidebar-widget h4 {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    color: var(--color-text);
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-widget ul li:last-child { border-bottom: none; }

.sidebar-widget ul a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.sidebar-widget ul a:hover { color: var(--color-primary); }

.sidebar-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-body);
    outline: none;
    transition: border var(--transition);
}

.sidebar-search input:focus {
    border-color: var(--color-primary);
}


/* --- About Page --- */
.about-section {
    padding: 0 0 60px;
}

.about-intro {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 780px;
    margin-bottom: 40px;
}

.about-section p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 780px;
    margin-bottom: 10px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 28px;
    margin-top: 32px;
}

.team-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: box-shadow var(--transition);
}

.team-card:hover { box-shadow: var(--shadow-md); }

.team-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--color-accent);
    margin: 0 auto 16px;
    object-fit: cover;
}

.team-card h3 { font-size: 1.1rem; margin-bottom: 4px; }

.team-card .role {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 500;
}

.team-card p {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    margin-top: 10px;
}


/* --- Contact Page --- */
.contact-section {
    padding: 0 0 60px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-text);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: border var(--transition);
    background: var(--color-surface);
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
    border-color: var(--color-primary);
}

.contact-form textarea {
    resize: vertical;
    min-height: 140px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

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

.contact-info-block {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.contact-info-item h3 {
    font-family: var(--font-body);
    font-size: 1rem;
    margin-bottom: 6px;
}

.contact-info-item p {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.contact-map-placeholder {
    width: 100%;
    height: 220px;
    background: var(--color-accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}


/* --- Cookies Policy Page --- */
.policy-content {
    padding: 0 0 60px;
    max-width: 800px;
}

.policy-content h2 {
    font-size: 1.4rem;
    margin: 36px 0 14px;
}

.policy-content h3 {
    font-size: 1.15rem;
    margin: 24px 0 10px;
}

.policy-content p {
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.policy-content ul {
    margin: 0 0 18px 24px;
    color: var(--color-text-muted);
}

.policy-content li { margin-bottom: 6px; }

.policy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 0.9rem;
}

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

.policy-table th {
    background: var(--color-accent);
    font-weight: 600;
    color: var(--color-text);
}

.policy-table td {
    color: var(--color-text-muted);
}

.policy-updated {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 8px;
}


/* --- Footer --- */
.site-footer {
    margin-top: auto;
    background: var(--color-footer-bg);
    color: var(--color-footer-text);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-about p {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-top: 12px;
}

.site-footer h4 {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 16px;
}

.site-footer ul {
    list-style: none;
}

.site-footer ul li { margin-bottom: 10px; }

.site-footer ul a {
    color: var(--color-footer-text);
    font-size: 0.88rem;
    transition: color var(--transition);
}

.site-footer ul a:hover { color: #fff; }

.footer-bottom {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

.footer-bottom-links {
    display: flex;
    gap: 20px;
}

.footer-bottom-links a {
    color: var(--color-footer-text);
    font-size: 0.82rem;
}

.footer-bottom-links a:hover { color: #fff; }


/* --- Flash Messages --- */
.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 0.92rem;
}

.flash-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.flash-error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #f8bbd0;
}


/* --- Responsive --- */
@media (max-width: 1024px) {
    .article-wrapper {
        grid-template-columns: 1fr;
    }
    .sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .sidebar-widget {
        flex: 1 1 280px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    :root { --header-height: 64px; }

    .hero { padding: 48px 0; }
    .hero h1 { font-size: 2rem; }

    .nav-toggle { display: block; }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-surface);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 28px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 899;
    }

    .nav-menu.open { transform: translateX(0); }

    .nav-menu a { font-size: 1.15rem; }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .page-header h1 { font-size: 1.7rem; }

    .article-hero-img { height: 220px; }

    .article-body h2 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero h1 { font-size: 1.6rem; }
    .section-title { font-size: 1.3rem; }
    .post-card-body { padding: 18px; }
    .cookie-banner { flex-direction: column; text-align: center; }
}