/* styles.css */
:root {
    /* 1. Theme Configuration: Dark Mode / Oceanic Palette */
    --bg: #0b1116;
    --surface: #161e29;
    --card: #1c2533;
    --text: #e6edf3;
    --muted: #8b949e;
    --accent: #2f81f7; /* Bright Ocean Blue */
    --accent2: #d2a8ff; /* Soft Lavender for contrast */
    
    --radius: 18px;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Spacing variables */
    --space-sm: clamp(8px, 2vw, 12px);
    --space-md: clamp(16px, 3vw, 24px);
    --space-lg: clamp(32px, 5vw, 48px);
    --container: 1150px;
}

/* 2. Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* 3. Background Decor: Radial Blobs (Pure CSS) */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.25;
}

body::before {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

body::after {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent2) 0%, transparent 70%);
}

/* 4. Typography & Common */
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* 5. Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 17, 22, 0.7); /* Translucent --bg */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.lang-switcher {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-switcher a {
    color: var(--muted);
    padding: 4px 0;
    position: relative;
}

.lang-switcher a.active,
.lang-switcher a:hover {
    color: var(--accent);
}

/* 6. Main Layout */
main {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

.article-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--space-lg);
    max-width: 900px;
    background: linear-gradient(90deg, var(--text), var(--muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 7. Hero Section */
.hero {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content .lead {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: var(--space-md);
}

.meta-info {
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Hero Visual: CSS Generated "Image" */
.hero-visual {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.05);
}

.visual-texture {
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(at 80% 0%, hsla(250,60%,60%,0.2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(200,80%,50%,0.2) 0px, transparent 50%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 10px);
    background-size: cover;
}

/* Desktop Hero Layout */
@media (min-width: 900px) {
    .hero {
        grid-template-columns: 1fr 1.2fr;
        gap: var(--space-lg);
        align-items: center;
    }
}

/* 8. Article Content */
.content-body {
    max-width: 760px;
    margin-bottom: var(--space-lg);
}

.content-body p {
    margin-bottom: 1.5rem;
    color: #c0c6cf; /* Slightly softer than pure white */
    font-size: 1.05rem;
}

.content-body h2, 
.content-body h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.content-body blockquote {
    border-left: 4px solid var(--accent2);
    padding-left: var(--space-md);
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--text);
    background: linear-gradient(90deg, rgba(210, 168, 255, 0.05), transparent);
    padding: var(--space-md);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.content-body ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.content-body ul li {
    margin-bottom: 0.5rem;
    list-style-type: disc;
    color: var(--muted);
}

.content-body ul li strong {
    color: var(--text);
}

/* 9. Related Materials (Cards) */
.related-materials {
    margin-top: calc(var(--space-lg) * 2);
}

.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.divider-line {
    flex-grow: 1;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--space-md);
}

/* Card Style: Glass Panel + Glow */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: var(--space-md);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(47, 129, 247, 0.3);
    box-shadow: 0 10px 30px -10px rgba(47, 129, 247, 0.15);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    font-size: 0.8rem;
}

.badge {
    background: rgba(47, 129, 247, 0.15);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.badge.accent-badge {
    background: rgba(210, 168, 255, 0.15);
    color: var(--accent2);
}

.date {
    color: var(--muted);
}

.card h4 {
    margin-bottom: 8px;
    font-size: 1.1rem;
    color: var(--text);
}

.card p {
    font-size: 0.9rem;
    color: var(--muted);
    flex-grow: 1; /* Push footer down */
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    opacity: 0.5;
}

/* 10. Footer */
footer {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: var(--space-lg);
    background: var(--surface);
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-center {
    display: flex;
    gap: 20px;
}

.footer-center a {
    color: var(--text);
    font-size: 0.9rem;
    opacity: 0.7;
}

.footer-center a:hover {
    opacity: 1;
    color: var(--accent);
}

.dmca-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--muted);
    cursor: default;
}

@media (min-width: 600px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Hero Visual: Real Image Settings */
.hero-visual {
    width: 100%;
    /* Висота блоку: на мобільному менше, на десктопі більше */
    height: 300px; 
    border: 1px solid var(--muted);
    border-radius: var(--radius); /* Зберігаємо скруглення теми */
    overflow: hidden;
    position: relative;
    background: #000; /* Фон, якщо картинка не завантажиться */
}

/* styles.css */

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заповнює блок, обрізаючи зайве */
    
    /* 👇 ДОДАЙТЕ ЦЕЙ РЯДОК 👇 */
    object-position: top center; 
    
    display: block;
    border-radius: var(--radius); /* Щоб кути картинки теж були заокруглені */
}

/* На великих екранах робимо блок на всю висоту батьківського контейнера */
@media (min-width: 900px) {
    .hero-visual {
        height: 100%;
        min-height: 400px;
    }
}