/* styles.css: pedag.com.ua */
:root {
    color-scheme: dark;
    --primary-hover: #eeaea6;
    --accent-warning: #d4b06a;
    --article-max: 760px;
    --radius-sm: 6px;
    --hero-pos: 26%;
    --primary-light: rgba(224, 143, 134, 0.12);
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --border: #2f2b3c;
    --primary: #e08f86;
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --text-main: #f4f2f8;
    --font-serif: 'Lora', Georgia, "Times New Roman", serif;
    --text-muted: #aaa6b8;
    --bg: #14121a;
    --surface: #1a1822;
    --primary-glow: rgba(224, 143, 134, 0.35);
    --container: 1120px;
    --surface-alt: #211e2b;
    --radius-lg: 14px;
    --accent-warning-bg: rgba(212, 176, 106, 0.12);
    --header-bg: rgba(20, 18, 26, 0.86);
    --radius-md: 10px;
    --text-body: #e2dfe9;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

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

::selection {
    background: var(--primary-light);
    color: var(--text-main);
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.logo-dot {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-glow);
}

.logo-sub {
    font-weight: 500;
    opacity: 0.65;
}

.main-nav {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    font-weight: 500;
}

.main-nav a {
    color: var(--text-muted);
}

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

.lang-switcher {
    display: flex;
    flex-shrink: 0;
    gap: 4px;
    background: var(--surface-alt);
    padding: 3px;
    border-radius: var(--radius-sm);
}

.lang-switcher a {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 6px;
}

.lang-switcher a:hover {
    color: var(--text-main);
}

.lang-switcher a.active {
    background: var(--surface);
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Hero */
main {
    max-width: var(--container);
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.hero {
    max-width: var(--article-max);
    margin: 0 auto 40px;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.hero-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 4px 12px;
    border-radius: 50px;
}

.reading-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.article-title {
    font-family: var(--font-heading);
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-main);
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    overflow-wrap: break-word;
}

.lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.meta-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.meta-item {
    display: flex;
    flex-direction: column;
}

.meta-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.meta-item .value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.hero-visual {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.18);
    background: var(--surface-alt);
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center var(--hero-pos, 50%);
}

/* Article */
.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 48px;
    align-items: start;
}

.content-body {
    max-width: var(--article-max);
    min-width: 0;
    overflow-wrap: break-word;
}

.content-body p {
    font-family: var(--font-serif);
    font-size: 1.12rem;
    line-height: 1.85;
    color: var(--text-body);
    margin-bottom: 1.8rem;
}

.content-body h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin: 2.8rem 0 1rem;
}

.content-body h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    margin: 2rem 0 0.75rem;
}

.content-body strong {
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--text-main);
}

.content-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

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

.content-body blockquote {
    margin: 2rem 0;
    padding: 20px 24px;
    background: var(--surface-alt);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--text-main);
}

.content-body blockquote cite {
    display: block;
    margin-top: 10px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-style: normal;
    font-weight: 600;
    color: var(--primary);
}

.info-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 2rem 0;
    box-shadow: 0 4px 15px -4px rgba(0, 0, 0, 0.05);
}

.info-box-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 12px;
}

.info-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-box li {
    position: relative;
    padding-left: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-box li::before {
    content: "•";
    position: absolute;
    left: 4px;
    color: var(--primary);
    font-size: 1.3rem;
    top: -2px;
}

/* Sidebar */
.sidebar {
    min-width: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.author-card, .toc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.author-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    object-position: center var(--hero-pos, 50%);
}

.author-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.author-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.author-bio {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
}

.author-socials {
    display: flex;
    gap: 8px;
}

.author-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-muted);
}

.author-socials a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.toc-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-list li a {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.toc-list li a span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

.toc-list li a:hover {
    color: var(--primary);
}

/* Related cards */
.related-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.section-line {
    flex-grow: 1;
    height: 1px;
    background: var(--border);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 25px -8px var(--primary-glow);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    background: var(--primary-light);
    padding: 3px 8px;
    border-radius: 4px;
}

.tag.warning {
    color: var(--accent-warning);
    background: var(--accent-warning-bg);
}

.card-meta .date,
.card-meta .card-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card h3,
.card .card-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.4;
}

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

.card p,
.card .card-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    align-items: center;
}

.read-more,
.card-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.card-link:hover {
    color: var(--primary-hover);
}

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 40px 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
}

.brand-desc,
.footer-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-nav,
.footer-links {
    display: flex;
    gap: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    flex-wrap: wrap;
    list-style: none;
}

.footer-nav a,
.footer-links a {
    color: var(--text-muted);
}

.footer-nav a:hover,
.footer-links a:hover {
    color: var(--primary);
}

.footer-copy {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.footer-copy p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
    overflow-wrap: break-word;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        order: 2;
    }

    .sidebar-sticky {
        position: static;
    }

    .main-nav {
        display: none;
    }

    .content-body p {
        font-size: 1.05rem;
    }
}

@media (max-width: 640px) {
    .header-inner {
        padding: 12px 16px;
    }

    main {
        padding: 24px 16px 48px;
    }

    .hero-top,
    .meta-panel {
        flex-wrap: wrap;
    }

    .content-body h2 {
        font-size: 1.35rem;
    }

    .info-box {
        padding: 18px;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }
}

@media print {
    .site-header, .sidebar, .related-section, .site-footer {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    .content-wrapper {
        display: block;
    }
}
