/* CSS v2 - Pure ASCII, no Cyrillic */
:root {
    --primary: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
}

.dark body {
    background: var(--gray-900);
    color: var(--gray-100);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.dark .header-glass {
    background: rgba(17, 24, 39, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero-section {
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section.glass-bg {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2rem;
    margin: 2rem 0;
}

.dark .hero-section.glass-bg {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.dark .hero-description {
    color: var(--gray-400);
}

/* News Cards */
.news-card {
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.dark .news-card {
    background: var(--gray-800);
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.news-card-image {
    height: 200px;
    overflow: hidden;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 1.5rem;
}

.news-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.dark .news-card-title {
    color: var(--gray-100);
}

.news-card-excerpt {
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.dark .news-card-excerpt {
    color: var(--gray-400);
}

.news-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.dark .news-card-footer {
    border-top: 1px solid var(--gray-700);
}

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
    margin: 3rem 0;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate-fade-in { animation: fadeIn 0.5s ease-out; }
.animate-slide-in { animation: slideIn 0.5s ease-out; }

.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }

/* Utility classes */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* ===== ICON STYLES ===== */
/* SVG icons in buttons */
.btn svg,
.news-card-read-more svg {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn:hover svg,
.news-card:hover .news-card-read-more svg {
    transform: translateX(4px);
}

/* Menu toggle icons */
button[aria-label*="меню"] svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Dark mode toggle icons */
button[aria-label*="тему"] svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Calendar/eye/link icons in news meta */
.news-card-date svg,
.news-card-footer svg {
    width: 1rem;
    height: 1rem;
    opacity: 0.7;
}

/* Back button icon */
a[href*="news"] svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Hero section icons */
.hero-section .btn svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Ensure all SVGs are visible */
svg {
    display: inline-block;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Fix for missing icons */
.news-card-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Mobile menu icons */
.md\\:hidden button svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* Language switcher flags */
.language-flag {
    display: inline-block;
    width: 1.25rem;
    height: 1rem;
    margin-right: 0.25rem;
    background-size: cover;
    border-radius: 2px;
    vertical-align: middle;
}

.flag-ru {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 6'%3E%3Cpath fill='%23fff' d='M0 0h9v3H0z'/%3E%3Cpath fill='%23D52B1E' d='M0 3h9v3H0z'/%3E%3Cpath fill='%23003A9C' d='M0 2h9v2H0z'/%3E%3C/svg%3E");
}

.flag-en {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Cpath fill='%23012169' d='M0 0h60v30H0z'/%3E%3Cpath fill='%23fff' d='M0 0l60 30m0-30L0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath fill='%23C8102E' d='M0 0l60 30m0-30L0 30' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath fill='%23fff' d='M30 0v30M0 15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath fill='%23C8102E' d='M30 0v30M0 15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E");
}

/* Fix for broken image icons */
.news-card-image img {
    min-height: 200px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.dark .news-card-image img {
    background: linear-gradient(135deg, #374151, #4b5563);
}

/* Loading states for images */
.news-card-image {
    position: relative;
}

.news-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.5rem;
    z-index: 1;
}

.news-card-image.loaded::before {
    display: none;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== OPTIMIZED SPACING ===== */
/* Reduced margins and paddings */
.container {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (max-width: 768px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Hero section spacing */
.hero-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.hero-section.glass-bg {
    margin-top: 1rem;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
}

.hero-title {
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.hero-description {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* News grid spacing */
.grid {
    gap: 1.5rem;
    margin: 2rem 0;
}

.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

/* News cards optimized */
.news-card {
    margin-bottom: 1rem;
}

.news-card-content {
    padding: 1.25rem;
}

.news-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.news-card-excerpt {
    font-size: 0.9375rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.news-card-footer {
    padding-top: 0.75rem;
}

.news-card-image {
    height: 160px;
}

/* Feature cards */
.card-glass {
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* Section spacing */
.mb-12 { margin-bottom: 2rem; }
.mb-16 { margin-bottom: 2.5rem; }
.mb-24 { margin-bottom: 3rem; }

.py-8 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-12 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 2.5rem; padding-bottom: 2.5rem; }

/* Button spacing */
.btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

/* Line clamping for better text fit */
.line-clamp-2 {
    -webkit-line-clamp: 2;
    max-height: 2.8em;
}

.line-clamp-3 {
    -webkit-line-clamp: 3;
    max-height: 4.2em;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .news-card-image {
        height: 140px;
    }
    
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}
