:root {
    --bg: #030712;
    --surface: rgba(15, 23, 42, 0.82);
    --glass: rgba(255, 255, 255, 0.05);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --border-bright: rgba(255, 255, 255, 0.18);
    --ink: #f1f5f9;
    --muted: rgba(148, 163, 184, 0.92);
    --faint: rgba(100, 116, 139, 0.8);
    --cyan: #06b6d4;
    --violet: #8b5cf6;
    --indigo: #6366f1;
    --max-w: 1120px;
}

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

body {
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.18), transparent 34%),
        radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.18), transparent 32%),
        var(--bg);
    color: var(--ink);
    line-height: 1.7;
}

[lang="ar"] body,
[lang="ar"] {
    font-family: "Tajawal", "Segoe UI", system-ui, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.wrap {
    width: min(var(--max-w), calc(100% - 32px));
    margin: 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--violet) 100%);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
}

.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.45), 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-bright);
    color: var(--ink);
    backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(3, 7, 18, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
}

.brand img {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.15s;
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--glass-hover);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.nav-lang {
    gap: 8px;
    padding-inline: 12px 14px;
}

.nav-lang-icon {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.14);
    color: #a5f3fc;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.nav-login-short {
    display: none;
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-bright);
    background: var(--glass);
    cursor: pointer;
    padding: 9px;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: all 0.25s ease;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0 16px;
    border-top: 1px solid var(--border);
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    padding: 11px 16px;
    border-radius: 10px;
    transition: all 0.15s;
}

.mobile-menu a:hover,
.mobile-menu a:active {
    color: var(--ink);
    background: var(--glass-hover);
}

.mobile-menu .mob-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
}

.mobile-menu .mob-cta {
    margin-top: 4px;
}

.hero {
    padding: 86px 0 42px;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    color: #a5f3fc;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.24);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 18px;
}

h1 {
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.05;
    letter-spacing: -0.05em;
    margin-bottom: 18px;
}

.grad {
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    max-width: 700px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 18px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    padding: 42px 0 90px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    min-height: 100%;
    transition: transform 0.18s, border-color 0.18s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.35);
}

.cover {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(139, 92, 246, 0.18));
    border-bottom: 1px solid var(--border);
    object-fit: cover;
    width: 100%;
}

.card-body {
    padding: 22px;
}

.meta {
    color: var(--faint);
    font-size: 13px;
    margin-bottom: 10px;
}

.card h2 {
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.excerpt {
    color: var(--muted);
    font-size: 15px;
}

.read-more {
    display: inline-flex;
    margin-top: 18px;
    color: #67e8f9;
    font-weight: 700;
}

.article {
    max-width: 820px;
    padding: 72px 0 90px;
}

.article h1 {
    text-align: left;
    margin-bottom: 14px;
}

[dir="rtl"] .article h1 {
    text-align: right;
}

.article-cover {
    border-radius: 28px;
    margin: 34px 0;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.article-body {
    color: rgba(226, 232, 240, 0.94);
    font-size: 18px;
    line-height: 1.85;
}

.article-body>*+* {
    margin-top: 1.15em;
}

.article-body h2,
.article-body h3 {
    color: var(--ink);
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-top: 1.8em;
}

.article-body h2 {
    font-size: clamp(26px, 3vw, 34px);
}

.article-body h3 {
    font-size: clamp(22px, 2.4vw, 28px);
}

.article-body p {
    margin: 0;
}

.article-body ul,
.article-body ol {
    padding-inline-start: 1.35em;
    margin-top: 1em;
}

.article-body li+li {
    margin-top: 0.55em;
}

.article-body strong {
    color: var(--ink);
}

.article-body code {
    color: #a5f3fc;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.18);
    border-radius: 8px;
    padding: 0.12em 0.38em;
    font-size: 0.9em;
    white-space: normal;
}

.article-body pre {
    overflow-x: auto;
    background: rgba(2, 6, 23, 0.72);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    white-space: pre;
}

.article-body pre code {
    display: block;
    color: rgba(226, 232, 240, 0.94);
    background: transparent;
    border: 0;
    padding: 0;
    white-space: pre;
}

.tag-list,
.share-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-list {
    margin: 22px 0 0;
}

.tag-chip {
    color: #a5f3fc;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.24);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
}

.share-box {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(139, 92, 246, 0.12)),
        rgba(255, 255, 255, 0.045);
    border: 1px solid var(--border);
    border-radius: 18px;
    margin: 28px 0;
    padding: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.share-box::before {
    content: "";
    position: absolute;
    inset: -60% auto auto -12%;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: rgba(6, 182, 212, 0.18);
    filter: blur(50px);
    pointer-events: none;
}

.share-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.share-title {
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.share-subtitle {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.share-mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: #67e8f9;
    font-weight: 900;
    flex-shrink: 0;
}

.share-link {
    --share-accent: #67e8f9;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    background: rgba(255, 255, 255, 0.075);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    padding: 7px 12px 7px 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

[dir="rtl"] .share-link {
    padding: 7px 8px 7px 12px;
}

.share-link::before {
    content: none;
}

.share-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--share-accent);
    color: #020617;
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
    flex-shrink: 0;
}

.share-icon svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: currentColor;
}

.share-link:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--share-accent) 60%, transparent);
    background: rgba(255, 255, 255, 0.11);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.share-facebook {
    --share-accent: #60a5fa;
}

.share-x {
    --share-accent: #f8fafc;
}

.share-linkedin {
    --share-accent: #38bdf8;
}

.share-whatsapp {
    --share-accent: #34d399;
}

.related {
    border-top: 1px solid var(--border);
    padding-top: 34px;
    margin-top: 54px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.related-card {
    padding: 16px;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.empty {
    padding: 40px 0 90px;
    text-align: center;
    color: var(--muted);
}

.pagination {
    padding-bottom: 90px;
}

.pagination nav {
    display: flex;
    justify-content: center;
}

.footer {
    border-top: 1px solid var(--border);
    padding: 46px 0 34px;
    background:
        radial-gradient(circle at 12% 0%, rgba(6, 182, 212, 0.08), transparent 32%),
        rgba(255, 255, 255, 0.015);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: min(100%, 360px);
}

.footer-logo {
    height: 42px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 10px 24px rgba(6, 182, 212, 0.16));
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.footer-links a {
    padding: 7px 10px;
    border-radius: 999px;
    transition: color 0.16s, background 0.16s;
}

.footer-links a:hover {
    color: var(--ink);
    background: var(--glass-hover);
}

.footer-copy {
    font-size: 13px;
    color: var(--faint);
    line-height: 1.6;
}

@media (max-width: 1024px) {
    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }
}

@media (max-width: 900px) {

    .grid,
    .related-list {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 58px;
    }
}

@media (max-width: 768px) {
    .nav-inner {
        min-height: 64px;
        gap: 10px;
    }

    .brand img {
        height: 38px;
    }

    .nav-actions {
        gap: 8px;
    }

    .nav-actions .btn {
        min-height: 40px;
        border-radius: 11px;
    }

    .nav-lang {
        padding: 8px 10px;
    }

    .nav-login {
        padding: 10px 13px;
    }

    .nav-hamburger {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 18px;
    }

    .footer-brand {
        flex-direction: column;
        justify-content: center;
        gap: 10px;
    }

    .footer-logo {
        height: 54px;
    }

    .footer-links {
        justify-content: center;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .article {
        padding-top: 50px;
    }
}

@media (max-width: 480px) {
    .nav-inner {
        gap: 8px;
    }

    .brand img {
        height: 36px;
    }

    .nav-actions {
        gap: 6px;
    }

    .nav-actions .btn {
        min-height: 40px;
    }

    .nav-lang {
        padding: 8px;
    }

    .nav-lang-text {
        display: none;
    }

    .nav-login {
        padding: 9px 11px;
        font-size: 13px;
    }

    .nav-login-full {
        display: none;
    }

    .nav-login-short {
        display: inline;
    }

    .nav-hamburger {
        width: 40px;
        height: 40px;
    }

    .footer {
        padding: 40px 0 28px;
    }

    .footer-brand {
        align-items: center;
        gap: 9px;
    }

    .footer-logo {
        height: 58px;
    }

    .footer-copy {
        font-size: 12px;
    }
}