/* ===========================================================
   Enestein 2026 Modernization Layer
   Global overrides for consistent visual system across pages
   =========================================================== */

:root {
    --bg-primary: #070d16;
    --bg-secondary: #0d1522;
    --bg-card: #111c2d;
    --bg-card-hover: #16243a;
    --bg-elevated: #122033;
    --bg-input: #0e1828;

    --text-primary: #e6edf8;
    --text-secondary: #9fb0c8;
    --text-muted: #70829f;
    --text-link: #5eead4;

    --accent-primary: #2dd4bf;
    --accent-secondary: #0ea5e9;
    --accent-glow: rgba(45, 212, 191, 0.25);
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #2dd4bf 52%, #f59e0b 100%);
    --accent-gradient-2: linear-gradient(135deg, #38bdf8 0%, #2dd4bf 50%, #fb923c 100%);

    --border: rgba(185, 206, 238, 0.16);
    --border-hover: rgba(207, 224, 250, 0.28);

    --shadow-sm: 0 10px 24px rgba(4, 10, 20, 0.22);
    --shadow-md: 0 14px 40px rgba(4, 10, 20, 0.3);
    --shadow-lg: 0 24px 64px rgba(4, 10, 20, 0.4);
    --shadow-glow: 0 16px 48px rgba(45, 212, 191, 0.2);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --nav-height: 76px;
    --container-max: 1240px;
}

:root[data-theme="light"] {
    --bg-primary: #f4f8fd;
    --bg-secondary: #edf3fb;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fbff;
    --bg-elevated: #ffffff;
    --bg-input: #f2f6fc;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-link: #0ea5e9;

    --accent-primary: #0891b2;
    --accent-secondary: #0ea5e9;
    --accent-glow: rgba(14, 165, 233, 0.2);

    --border: rgba(15, 23, 42, 0.1);
    --border-hover: rgba(15, 23, 42, 0.2);

    --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 16px 32px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 56px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 16px 40px rgba(14, 165, 233, 0.16);
}

html,
body {
    text-wrap: pretty;
}

body {
    background:
        radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.14) 0%, transparent 35%),
        radial-gradient(circle at 85% 12%, rgba(45, 212, 191, 0.12) 0%, transparent 34%),
        radial-gradient(circle at 55% 78%, rgba(245, 158, 11, 0.08) 0%, transparent 40%),
        var(--bg-primary);
    color: var(--text-primary);
}

:root[data-theme="light"] body {
    background:
        radial-gradient(circle at 12% 16%, rgba(14, 165, 233, 0.12) 0%, transparent 34%),
        radial-gradient(circle at 86% 14%, rgba(16, 185, 129, 0.1) 0%, transparent 36%),
        linear-gradient(180deg, #f7fbff 0%, #eef4fb 100%);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 28px 28px;
}

:root[data-theme="light"] body::after {
    opacity: 0.4;
    background-image:
        linear-gradient(rgba(2, 6, 23, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(2, 6, 23, 0.018) 1px, transparent 1px);
}

.container {
    width: min(var(--container-max), 100% - 40px);
    padding: 0;
}

.main-content,
.footer,
/* ===== Navigation ===== */
.navbar {
    backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    background: rgba(7, 13, 22, 0.72);
}

:root[data-theme="light"] .navbar {
    background: rgba(248, 252, 255, 0.78);
}

.navbar.is-scrolled {
    box-shadow: 0 12px 38px rgba(3, 9, 20, 0.22);
}

.nav-brand {
    gap: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
}

.nav-link {
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text-secondary) !important;
}

.nav-link:hover,
.nav-link.active,
.dropdown-item:hover {
    background: rgba(45, 212, 191, 0.12);
}

.nav-link.active {
    color: var(--accent-primary) !important;
    border: 1px solid rgba(45, 212, 191, 0.32);
}

.dropdown-menu {
    border-radius: 14px;
    background: rgba(14, 22, 35, 0.96);
    border: 1px solid var(--border-hover);
    box-shadow: var(--shadow-lg);
}

:root[data-theme="light"] .dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
}

.theme-toggle,
.search-toggle,
.lang-toggle {
    border-radius: 14px;
    border-color: var(--border);
    background: rgba(45, 212, 191, 0.1);
    color: var(--text-primary);
}

.theme-toggle:hover,
.search-toggle:hover,
.lang-toggle:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
}

.lang-toggle {
    min-width: 88px;
    font-weight: 700;
}

.nav-actions {
    gap: 10px;
}

/* ===== Shared Layout ===== */
.section {
    padding: 92px 0;
}

.section-title,
.page-title,
.hero-main-title,
.section-title-modern {
    letter-spacing: -0.02em;
}

.section-header,
.section-header-modern {
    margin-bottom: 56px;
}

.section-badge {
    border-radius: 999px;
    padding: 8px 18px;
    border-color: rgba(45, 212, 191, 0.3);
    background: rgba(45, 212, 191, 0.12);
    color: #7ae6d7;
    letter-spacing: 0.08em;
}

.page-header {
    padding: 156px 0 76px;
}

.page-header::before {
    background:
        radial-gradient(ellipse at 25% 25%, rgba(14, 165, 233, 0.18) 0%, transparent 44%),
        radial-gradient(ellipse at 78% 12%, rgba(45, 212, 191, 0.14) 0%, transparent 45%);
}

/* ===== Buttons / Inputs ===== */
.btn,
.btn-modern-outline,
.social-feed-cta,
.btn-hero {
    border-radius: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.btn-primary,
.newsletter-form button,
.social-feed-cta {
    background: var(--accent-gradient);
    box-shadow: 0 12px 26px var(--accent-glow);
}

.btn-primary:hover,
.newsletter-form button:hover,
.social-feed-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px var(--accent-glow);
}

.btn-outline,
.btn-modern-outline {
    border: 1px solid var(--border-hover);
    background: rgba(10, 18, 32, 0.2);
}

:root[data-theme="light"] .btn-outline,
:root[data-theme="light"] .btn-modern-outline {
    background: #fff;
}

.search-form,
.search-input-group,
.contact-form input,
.contact-form textarea,
.newsletter-form input {
    border-radius: 14px;
    border-color: var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.04) 100%);
}

:root[data-theme="light"] .search-form,
:root[data-theme="light"] .search-input-group,
:root[data-theme="light"] .contact-form input,
:root[data-theme="light"] .contact-form textarea,
:root[data-theme="light"] .newsletter-form input {
    background: #fff;
}

.search-input-group {
    padding: 10px 10px 10px 20px;
    border-width: 1px;
    box-shadow: var(--shadow-sm);
}

.contact-form input,
.contact-form textarea {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ===== Card System ===== */
.article-card,
.featured-card,
.quote-card,
.category-card,
.contact-card,
.about-card,
.sidebar-widget,
.featured-modern-card,
.article-modern-card,
.category-modern-card,
.social-feed-card,
.popular-item,
.quick-links-card,
.hub-intro,
.featured-article-card,
.top-article-item,
.resource-item,
.categories-list .category-item,
.distribution-item {
    background: linear-gradient(170deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

:root[data-theme="light"] .article-card,
:root[data-theme="light"] .featured-card,
:root[data-theme="light"] .quote-card,
:root[data-theme="light"] .category-card,
:root[data-theme="light"] .contact-card,
:root[data-theme="light"] .about-card,
:root[data-theme="light"] .sidebar-widget,
:root[data-theme="light"] .featured-modern-card,
:root[data-theme="light"] .article-modern-card,
:root[data-theme="light"] .category-modern-card,
:root[data-theme="light"] .social-feed-card,
:root[data-theme="light"] .popular-item,
:root[data-theme="light"] .quick-links-card,
:root[data-theme="light"] .hub-intro,
:root[data-theme="light"] .featured-article-card,
:root[data-theme="light"] .top-article-item,
:root[data-theme="light"] .resource-item,
:root[data-theme="light"] .categories-list .category-item,
:root[data-theme="light"] .distribution-item {
    background: #fff;
}

.article-card:hover,
.featured-card:hover,
.quote-card:hover,
.featured-modern-card:hover,
.article-modern-card:hover,
.social-feed-card:hover,
.category-modern-card:hover,
.popular-item:hover,
.featured-article-card:hover,
.top-article-item:hover,
.resource-item:hover,
.categories-list .category-item:hover,
.distribution-item:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-image,
.card-image-featured {
    border-bottom: 1px solid var(--border);
}

.card-body,
.card-body-featured {
    padding: 22px;
}

.card-excerpt,
.featured-card-excerpt {
    min-height: 52px;
}

.card-meta,
.featured-card-meta {
    gap: 12px;
}

/* ===== Article Detail / Prose ===== */
.article-header {
    min-height: 64vh;
}

.article-header-overlay {
    background: linear-gradient(to top, rgba(7, 13, 22, 0.94) 0%, rgba(7, 13, 22, 0.78) 35%, rgba(7, 13, 22, 0.1) 100%);
    padding: 88px 0 52px;
}

.article-title {
    max-width: 880px;
}

.article-excerpt {
    max-width: 820px;
}

.prose {
    font-size: 1.08rem;
    line-height: 1.9;
}

.prose h2 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.prose blockquote {
    background: rgba(45, 212, 191, 0.08);
    border-left: 4px solid var(--accent-primary);
    color: var(--text-secondary);
    border-radius: 0 14px 14px 0;
}

.prose pre {
    border-radius: 14px;
    background: rgba(5, 10, 20, 0.75);
}

:root[data-theme="light"] .prose pre {
    background: #0f172a;
    color: #e2e8f0;
}

/* ===== Theme Fixes For Inline Page Styles ===== */
.credibility-intro,
.author-bio-box,
.editorial-policy,
.credentials-box,
.disclaimer-box,
.content-philosophy,
.content-item,
.quick-links-card,
.trust-item,
.credibility-section,
.editorial-approach,
.ymyl-disclaimer,
.external-resources,
.article-sources,
.ymyl-notice,
.article-freshness,
.external-links-widget,
.resource-item,
.distribution-item,
.categories-list .category-item,
.top-article-item {
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)) !important;
    box-shadow: var(--shadow-sm);
}

:root[data-theme="light"] .credibility-intro,
:root[data-theme="light"] .author-bio-box,
:root[data-theme="light"] .editorial-policy,
:root[data-theme="light"] .credentials-box,
:root[data-theme="light"] .disclaimer-box,
:root[data-theme="light"] .content-philosophy,
:root[data-theme="light"] .content-item,
:root[data-theme="light"] .quick-links-card,
:root[data-theme="light"] .trust-item,
:root[data-theme="light"] .credibility-section,
:root[data-theme="light"] .editorial-approach,
:root[data-theme="light"] .ymyl-disclaimer,
:root[data-theme="light"] .external-resources,
:root[data-theme="light"] .article-sources,
:root[data-theme="light"] .ymyl-notice,
:root[data-theme="light"] .article-freshness,
:root[data-theme="light"] .external-links-widget,
:root[data-theme="light"] .resource-item,
:root[data-theme="light"] .distribution-item,
:root[data-theme="light"] .categories-list .category-item,
:root[data-theme="light"] .top-article-item {
    background: #fff !important;
}

.credentials-box li,
.disclaimer-box p,
.ymyl-content p,
.source-author,
.source-publisher,
.resource-source,
.item-views,
.about-mini-bio,
.quick-links a {
    color: var(--text-secondary) !important;
}

.author-articles-section h2,
.editorial-policy h2,
.editorial-policy h3,
.quick-links-card h4,
.resource-title,
.content-item h4,
.credibility-intro h2,
.article-sources h3,
.external-resources h4,
.external-links-widget h4 {
    color: var(--text-primary) !important;
}

.ymyl-disclaimer,
.ymyl-notice,
.disclaimer-box {
    border-left: 4px solid #f59e0b !important;
}

.meta-updated,
.article-freshness {
    border: 1px solid rgba(14, 165, 233, 0.32) !important;
}

.meta-updated i,
.freshness-item i {
    color: var(--accent-secondary) !important;
}

.topic-cluster-widget,
.topic-cluster,
.contact-cta,
.author-hero,
.about-hero {
    background: linear-gradient(135deg, #0c4a6e 0%, #0f766e 60%, #b45309 100%) !important;
    color: #eff9ff !important;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.topic-item,
.cluster-article,
.topic-item.coming-soon {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.topic-item:hover,
.cluster-article:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* ===== Home Page Enhancements ===== */
.hero-gradient {
    background:
        radial-gradient(circle at 25% 25%, rgba(56, 189, 248, 0.5) 0%, transparent 42%),
        radial-gradient(circle at 80% 20%, rgba(45, 212, 191, 0.42) 0%, transparent 40%),
        radial-gradient(circle at 64% 88%, rgba(249, 115, 22, 0.32) 0%, transparent 36%),
        linear-gradient(135deg, #082f49 0%, #0f172a 44%, #111827 100%);
    background-size: 150% 150%;
}

.hero-gradient::before {
    background: linear-gradient(180deg, rgba(3, 10, 23, 0.2), rgba(3, 10, 23, 0.42));
}

.hero-main-title {
    font-size: clamp(3.2rem, 10vw, 5.8rem);
    letter-spacing: -0.03em;
}

.brain-circle {
    box-shadow: 0 24px 60px rgba(6, 182, 212, 0.24);
}

.hero-featured-box {
    border-radius: 24px;
    border-color: rgba(226, 243, 255, 0.3);
    background: rgba(5, 11, 21, 0.5);
}

:root[data-theme="light"] .hero-featured-box {
    background: rgba(255, 255, 255, 0.82);
}

.quote-modern-card,
.cta-modern-card {
    box-shadow: var(--shadow-lg);
}

.cta-modern-card {
    background: linear-gradient(135deg, #0f766e 0%, #0284c7 55%, #ea580c 100%);
}

/* ===== Missing Utility Blocks ===== */
.search-results-section {
    margin-top: 40px;
}

.search-results-section + .search-results-section {
    margin-top: 56px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

.footer {
    background: linear-gradient(180deg, rgba(6, 13, 24, 0.88) 0%, rgba(8, 16, 30, 0.96) 100%);
    border-top: 1px solid var(--border);
}

:root[data-theme="light"] .footer {
    background: linear-gradient(180deg, #f6f9ff 0%, #edf3fb 100%);
}

.footer-bottom {
    gap: 24px;
}

.footer-bottom-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-design a {
    color: var(--text-link);
}

.footer-partners {
    margin-top: 8px;
}

.footer-partners h5 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.partner-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.partner-links a {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary) !important;
    font-size: 0.8rem;
}

.partner-links a:hover {
    color: var(--text-primary) !important;
    border-color: var(--border-hover);
}

.empty-state {
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
    padding: 64px 24px;
}

.pagination {
    margin-top: 56px;
}

.page-btn {
    border-radius: 12px;
    min-width: 46px;
    height: 46px;
}

.page-btn:hover,
.page-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff !important;
}

.back-to-top {
    width: 52px;
    height: 52px;
    border-radius: 16px;
}

/* ===== Responsive Refinements ===== */
@media (max-width: 1024px) {
    .hub-layout,
    .author-layout,
    .about-layout,
    .contact-layout,
    .article-layout {
        gap: 30px;
    }

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

@media (max-width: 768px) {
    .container {
        width: min(var(--container-max), 100% - 28px);
    }

    .nav-actions {
        gap: 6px;
    }

    .theme-toggle,
    .search-toggle {
        width: 38px;
        height: 38px;
    }

    .lang-toggle {
        min-width: 70px;
        height: 38px;
        padding: 0 12px;
        font-size: 0.82rem;
    }

    .nav-menu {
        justify-content: flex-start;
        padding: 24px 18px 32px;
        gap: 6px;
        overflow-y: auto;
    }

    .nav-link,
    .dropdown-toggle {
        width: 100%;
        justify-content: center;
        padding: 12px 14px;
    }

    .section {
        padding: 72px 0;
    }

    .page-header {
        padding: 132px 0 60px;
    }

    .hero-gradient {
        min-height: auto;
        padding: 120px 0 64px;
    }

    .hero-featured-box,
    .quote-modern-card,
    .cta-modern-card {
        padding: 26px;
    }

    .featured-card-meta,
    .card-meta {
        gap: 10px;
    }

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

    .footer-bottom {
        align-items: flex-start;
    }

    .partner-links a {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .section-header,
    .section-header-modern {
        margin-bottom: 38px;
    }

    .hero-main-title {
        font-size: 2.7rem;
    }

    .quote-text-large {
        font-size: 1.2rem;
    }

    .article-card,
    .featured-card,
    .quote-card,
    .article-modern-card,
    .featured-modern-card {
        border-radius: 16px;
    }

    .card-body,
    .card-body-featured,
    .quote-card {
        padding: 18px;
    }

    .back-to-top {
        right: 18px;
        bottom: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
