/* ==========================================================================
   arwriter-apple Theme - RTL-First Apple-Style Design
   Using CSS Logical Properties for seamless RTL/LTR support
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables / Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Colors - ARWriter brand palette */
    --color-primary: #7C6AEB;
    --color-primary-hover: #6B58E0;
    --color-secondary: #86868b;
    --color-success: #34c759;
    --color-warning: #ff9f0a;
    --color-error: #ff3b30;

    /* Light theme */
    --color-bg: #ffffff;
    --color-bg-secondary: #f5f5f7;
    --color-bg-tertiary: #fbfbfd;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-strong: rgba(0, 0, 0, 0.12);
    --color-text: #1d1d1f;
    --color-text-secondary: #6e6e73;
    --color-text-tertiary: #86868b;
    --color-text-inverted: #ffffff;

    /* Shadows - Apple-style depth */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);

    /* Typography */
    --font-arabic: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-latin: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', SFMono-Regular, Consolas, monospace;

    /* Ghost custom font support */
    --gh-font-heading: var(--font-arabic);
    --gh-font-body: var(--font-arabic);

    /* Font sizes - Fluid typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
    --text-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.875rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
    --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.25rem);
    --text-5xl: clamp(2.75rem, 2rem + 3.75vw, 4.5rem);

    /* Line heights */
    --leading-tight: 1.2;
    --leading-snug: 1.35;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.75rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-14: 3.5rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Layout */
    --max-width: 1200px;
    --content-width: 720px;
    --header-height: 64px;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark theme */
.theme-dark,
[data-theme="dark"] {
    --color-bg: #000000;
    --color-bg-secondary: #1c1c1e;
    --color-bg-tertiary: #2c2c2e;
    --color-surface: #1c1c1e;
    --color-surface-elevated: #2c2c2e;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-border-strong: rgba(255, 255, 255, 0.15);
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #6e6e73;
}

/* Auto theme (system preference) */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) {
        --color-bg: #000000;
        --color-bg-secondary: #1c1c1e;
        --color-bg-tertiary: #2c2c2e;
        --color-surface: #1c1c1e;
        --color-surface-elevated: #2c2c2e;
        --color-border: rgba(255, 255, 255, 0.1);
        --color-border-strong: rgba(255, 255, 255, 0.15);
        --color-text: #f5f5f7;
        --color-text-secondary: #a1a1a6;
        --color-text-tertiary: #6e6e73;
    }
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* RTL text alignment */
[dir="rtl"] body {
    text-align: right;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Skip link */
.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    z-index: 9999;
    padding: var(--space-3) var(--space-4);
    background: var(--color-primary);
    color: var(--color-text-inverted);
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    inset-inline-start: var(--space-4);
    top: var(--space-4);
}

/* Visually hidden */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
}

.gh-inner {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--space-6);
}

.gh-canvas {
    max-width: var(--content-width);
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--color-text);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

p {
    margin-block-end: var(--space-4);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

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

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverted);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-text-inverted);
    transform: scale(1.02);
}

.btn-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: var(--color-bg-tertiary);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
}

.btn-block {
    width: 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-block-end: 1px solid var(--color-border);
    transition: all var(--transition-base);
}

.theme-dark .site-header,
[data-theme="dark"] .site-header {
    background: rgba(0, 0, 0, 0.72);
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .site-header {
        background: rgba(0, 0, 0, 0.72);
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: var(--space-8);
}

.header-brand {
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-logo img {
    height: 32px;
    width: auto;
}

.header-logo .logo-dark {
    display: none;
}

.theme-dark .header-logo .logo-light,
[data-theme="dark"] .header-logo .logo-light {
    display: none;
}

.theme-dark .header-logo .logo-dark,
[data-theme="dark"] .header-logo .logo-dark {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .header-logo .logo-light {
        display: none;
    }

    :root:not(.theme-light) .header-logo .logo-dark {
        display: block;
    }
}

.header-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
}

.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.mobile-menu-title {
    font-size: var(--text-base);
    font-weight: 800;
    color: var(--color-text);
}

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

.nav-list {
    display: flex;
    gap: var(--space-8);
    list-style: none;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.header-search-btn,
.header-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-search-btn:hover,
.header-theme-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.header-theme-btn .icon-moon {
    display: none;
}

.theme-dark .header-theme-btn .icon-sun,
[data-theme="dark"] .header-theme-btn .icon-sun {
    display: none;
}

.theme-dark .header-theme-btn .icon-moon,
[data-theme="dark"] .header-theme-btn .icon-moon {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .header-theme-btn .icon-sun {
        display: none;
    }

    :root:not(.theme-light) .header-theme-btn .icon-moon {
        display: block;
    }
}

.header-members {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.member-premium-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1;
    user-select: none;
}

.btn-signin {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 400;
    color: var(--color-primary);
}

.btn-subscribe {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--color-primary);
    color: var(--color-text-inverted);
    border-radius: var(--radius-full);
}

.btn-subscribe:hover {
    background: var(--color-primary-hover);
    color: var(--color-text-inverted);
}

.member-avatar,
.member-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.member-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: var(--color-text-inverted);
    font-size: var(--text-sm);
    font-weight: 600;
}

.header-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

@media (max-width: 768px) {

    .header-nav,
    .header-members {
        display: none;
    }

    .header-menu-btn {
        display: flex;
    }

    /* تصغير خط العنوان على الجوال */
    .header-title {
        font-size: var(--text-sm);
        white-space: nowrap;
    }

    /* إخفاء زر البحث على الجوال فقط */
    .header-search-btn {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Enhanced Animations & Effects
   -------------------------------------------------------------------------- */

/* Animated grain texture overlay */
@keyframes grain {

    0%,
    100% {
        transform: translate(0, 0)
    }

    10% {
        transform: translate(-5%, -10%)
    }

    20% {
        transform: translate(-15%, 5%)
    }

    30% {
        transform: translate(7%, -25%)
    }

    40% {
        transform: translate(-5%, 25%)
    }

    50% {
        transform: translate(-15%, 10%)
    }

    60% {
        transform: translate(15%, 0%)
    }

    70% {
        transform: translate(0%, 15%)
    }

    80% {
        transform: translate(3%, 35%)
    }

    90% {
        transform: translate(-10%, 10%)
    }
}

.noise-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
    animation: grain 8s steps(10) infinite;
}

/* Scroll reveal animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes floatGentle {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 113, 227, 0.3), 0 0 40px rgba(0, 113, 227, 0.1);
    }

    50% {
        box-shadow: 0 0 30px rgba(0, 113, 227, 0.4), 0 0 60px rgba(0, 113, 227, 0.2);
    }
}

.reveal {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.reveal-scale {
    opacity: 0;
    animation: fadeInScale 0.8s ease-out forwards;
}

/* Stagger delays for sequential reveals */
.reveal:nth-child(1) {
    animation-delay: 0.1s;
}

.reveal:nth-child(2) {
    animation-delay: 0.2s;
}

.reveal:nth-child(3) {
    animation-delay: 0.3s;
}

.reveal:nth-child(4) {
    animation-delay: 0.4s;
}

.reveal:nth-child(5) {
    animation-delay: 0.5s;
}

/* Enhanced shadows with depth */
.depth-shadow-sm {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 4px 8px rgba(0, 0, 0, 0.04);
}

.depth-shadow-md {
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.06),
        0 4px 8px rgba(0, 0, 0, 0.06),
        0 8px 16px rgba(0, 0, 0, 0.06),
        0 16px 32px rgba(0, 0, 0, 0.06);
}

.depth-shadow-lg {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.08),
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 16px 32px rgba(0, 0, 0, 0.08),
        0 32px 64px rgba(0, 0, 0, 0.08);
}

/* Magnetic hover effect */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.magnetic:hover {
    transform: scale(1.05) translateY(-2px);
}

/* Shimmer effect for CTAs */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.shimmer-effect {
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

/* --------------------------------------------------------------------------
   Hero Section (Enhanced)
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-20) 0;
    text-align: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-bg+.hero-content {
    color: var(--color-text-inverted);
}

.hero-logo img {
    height: 80px;
    width: auto;
    margin-inline: auto;
    margin-block-end: var(--space-6);
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 800;
    margin-block-end: var(--space-4);
}

.hero-description {
    font-size: var(--text-xl);
    opacity: 0.9;
    margin-block-end: var(--space-8);
}

.hero-cta {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: var(--space-8);
    inset-inline: 0;
    text-align: center;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* --------------------------------------------------------------------------
   Marquee Hero (Homepage)
   -------------------------------------------------------------------------- */
.hero--marquee {
    min-height: auto;
    padding: var(--space-16) 0 var(--space-12);
    background: radial-gradient(1200px 420px at 50% -10%, rgba(0, 113, 227, 0.18), transparent 60%),
        var(--color-bg-secondary);
}

.hero--marquee .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-10);
}

.home-template .hero--marquee .hero-content {
    max-width: 860px;
    margin-inline: auto;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hero-marquee {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding-inline: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    direction: ltr;
}

.marquee-row {
    position: relative;
    overflow: hidden;
    padding-block: var(--space-2);
    --marquee-gap: var(--space-6);
    --marquee-duration: 42s;
}

.marquee-row::before,
.marquee-row::after {
    content: "";
    position: absolute;
    inset-block: 0;
    width: clamp(24px, 6vw, 72px);
    pointer-events: none;
    z-index: 1;
}

.marquee-row::before {
    left: 0;
    background: linear-gradient(to right, var(--color-bg-secondary), transparent);
}

.marquee-row::after {
    right: 0;
    background: linear-gradient(to left, var(--color-bg-secondary), transparent);
}

.marquee-inner {
    display: flex;
    width: max-content;
    will-change: transform;
    animation: marquee-scroll var(--marquee-duration) linear infinite;
    animation-delay: calc(var(--marquee-duration) / -2);
}

.marquee-row--reverse .marquee-inner {
    animation-direction: reverse;
}

.marquee-row:hover .marquee-inner {
    animation-play-state: paused;
}

.marquee-group {
    display: flex;
    align-items: center;
    gap: var(--marquee-gap);
    padding-inline-end: var(--marquee-gap);
}

.marquee-card {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    direction: rtl;
}

.marquee-card__label {
    font-weight: 700;
    color: var(--color-text);
}

.marquee-card__icon {
    display: grid;
    place-items: center;
    color: var(--icon-color, var(--color-primary));
    flex: 0 0 auto;
}

.marquee-card__icon svg {
    width: 44px;
    height: 44px;
}

@keyframes marquee-scroll {
    to {
        transform: translate3d(-50%, 0, 0);
    }
}

@media (max-width: 768px) {
    .hero--marquee {
        padding: var(--space-12) 0 var(--space-10);
    }

    .hero-marquee {
        gap: var(--space-4);
        padding-inline: var(--space-4);
    }

    .marquee-row {
        --marquee-gap: var(--space-4);
    }

    .marquee-card {
        padding: var(--space-3) var(--space-5);
        border-radius: var(--radius-lg);
    }

    .marquee-card__icon svg {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-inner {
        animation: none;
        transform: none;
    }

    .marquee-row {
        overflow-x: auto;
        scrollbar-width: thin;
    }
}

/* --------------------------------------------------------------------------
   Partners Strip (Homepage)
   -------------------------------------------------------------------------- */
.partners-strip {
    padding: var(--space-10) 0 var(--space-10);
    background: radial-gradient(900px 320px at 50% 0%, rgba(0, 113, 227, 0.10), transparent 60%),
        var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
}

.partners-strip__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
}

.partners-strip__title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    letter-spacing: -0.01em;
    text-align: center;
}

.partners-strip__marquee {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding-inline: var(--space-6);
    margin-block-start: var(--space-2);
    direction: ltr;
}

.partners-strip__row {
    --marquee-gap: var(--space-8);
    padding-block: var(--space-3);
}

.partner-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    height: 64px;
    border-radius: var(--radius-xl);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease;
    transform: translateZ(0);
}

.partner-logo img {
    height: 32px;
    width: auto;
    max-width: 140px;
    display: block;
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.partner-logo__label {
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--color-text);
    white-space: nowrap;
}

.partner-logo:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 113, 227, 0.35);
}

.partner-logo:hover img {
    opacity: 1;
}

.partner-logo:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.35);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .partners-strip__marquee {
        padding-inline: var(--space-4);
    }

    .partners-strip__row {
        --marquee-gap: var(--space-6);
        padding-block: var(--space-2);
    }

    .partner-logo {
        height: 56px;
        padding: var(--space-3) var(--space-5);
        border-radius: var(--radius-lg);
    }

    .partner-logo img {
        height: 28px;
        max-width: 120px;
    }

    .partner-logo__label {
        font-size: var(--text-xs);
    }
}

/* --------------------------------------------------------------------------
   Models Directory (/models)
   -------------------------------------------------------------------------- */
.models-page {
    padding: var(--space-14) 0 var(--space-16);
}

.models-hero {
    text-align: center;
    max-width: 980px;
    margin-inline: auto;
    margin-block-end: var(--space-10);
}

.models-title {
    margin: 0 0 var(--space-3);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.models-subtitle {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--text-lg);
    line-height: 1.8;
}

.models-app {
    display: grid;
    gap: var(--space-8);
}

.models-controls {
    display: flex;
    gap: var(--space-6);
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
}

.models-label {
    display: block;
    font-size: var(--text-xs);
    font-weight: 800;
    color: var(--color-text-secondary);
    margin-block-end: var(--space-2);
}

.models-search {
    flex: 1 1 520px;
    min-width: 260px;
}

.models-search-input input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.models-search-input input:focus {
    border-color: rgba(0, 113, 227, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.models-sorts {
    display: flex;
    gap: var(--space-4);
    flex: 0 0 auto;
}

.models-select {
    height: 44px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 700;
}

.models-meta {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    text-align: center;
}

.models-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-5);
}

.model-card {
    position: relative;
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: var(--space-3);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
    width: 100%;
    text-align: start;
    font: inherit;
    appearance: none;
    text-decoration: none;
    color: inherit;
}

.model-card:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 113, 227, 0.35);
}

.model-card__title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.25;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.model-card__badges {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
}

.model-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: var(--text-xs);
    font-weight: 800;
    white-space: nowrap;
}

.model-card__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    font-weight: 700;
}

.model-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.models-footer {
    display: grid;
    gap: var(--space-3);
    justify-items: center;
    padding-top: var(--space-4);
}

.models-load-btn {
    min-width: 220px;
}

.models-status {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
}

.models-breadcrumb {
    margin-bottom: var(--space-4);
}

.models-back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 800;
    color: var(--color-primary);
    text-decoration: none;
}

.models-back-link:hover {
    text-decoration: underline;
}

/* Drawer */
.model-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.model-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.model-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(560px, 100%);
    height: 100%;
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    transform: translateX(110%);
    transition: transform 0.22s ease;
    display: grid;
    grid-template-rows: auto 1fr;
}

.model-drawer.is-open .model-drawer__panel {
    transform: translateX(0);
}

.model-drawer__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.theme-dark .model-drawer__header,
[data-theme="dark"] .model-drawer__header {
    background: rgba(0, 0, 0, 0.55);
}

.model-drawer__kicker {
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    font-weight: 800;
    margin-bottom: 6px;
}

.model-drawer__title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.3;
    word-break: break-word;
}

.model-drawer__close {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    display: grid;
    place-items: center;
    color: var(--color-text);
    cursor: pointer;
    flex: 0 0 auto;
}

.model-drawer__content {
    padding: var(--space-6);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.model-section {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
}

.model-section__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-base);
    font-weight: 900;
}

.model-kv {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
}

.model-kv strong {
    color: var(--color-text);
    font-weight: 900;
}

.model-links {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.model-readme {
    margin: 0;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 52vh;
    overflow: auto;
}

.skeleton-line {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.06));
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s infinite linear;
    margin-bottom: 10px;
}

.theme-dark .skeleton-line,
[data-theme="dark"] .skeleton-line {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
}

.skeleton-line.w-90 {
    width: 90%;
}

.skeleton-line.w-80 {
    width: 80%;
}

.skeleton-line.w-70 {
    width: 70%;
}

.skeleton-line.w-60 {
    width: 60%;
}

.skeleton-line.w-40 {
    width: 40%;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 0% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 1200px) {
    .models-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .models-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .models-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

    .model-card,
    .model-drawer__panel {
        transition: none;
    }

    .skeleton-line {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
   Featured Section
   -------------------------------------------------------------------------- */
.featured-section {
    padding: var(--space-16) 0;
    background: var(--color-bg-secondary);
}

.featured-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--space-8);
}

.featured-title {
    font-size: var(--text-2xl);
    font-weight: 700;
}

.featured-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-primary);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.featured-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
}

.featured-card--large {
    grid-column: span 2;
}

.featured-card-image {
    display: block;
    position: relative;
    aspect-ratio: 16/9;
}

.featured-card--large .featured-card-image {
    aspect-ratio: 21/9;
}

.featured-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.featured-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.featured-card-content {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    padding: var(--space-6);
    color: white;
}

.featured-card-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: var(--radius-full);
    margin-block-end: var(--space-3);
}

.featured-card-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-block-end: var(--space-2);
}

.featured-card--large .featured-card-title {
    font-size: var(--text-2xl);
}

.featured-card-title a {
    color: inherit;
}

.featured-card-meta {
    font-size: var(--text-sm);
    opacity: 0.8;
}

@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-card--large {
        grid-column: span 1;
    }
}

/* --------------------------------------------------------------------------
   Posts Feed
   -------------------------------------------------------------------------- */
.site-content {
    padding: var(--space-16) 0;
}

.posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--space-8);
}

.posts-title {
    font-size: var(--text-xl);
    font-weight: 600;
}

.posts-feed--cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

.posts-feed--list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* --------------------------------------------------------------------------
   AdSense
   -------------------------------------------------------------------------- */
.adsense-block {
    width: 100%;
    text-align: center;
}

.adsense-block.is-hidden {
    display: none !important;
}

.adsense-label {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-block-end: var(--space-2);
}

.adsense-block--post-top,
.adsense-block--post-bottom {
    margin-block: var(--space-10);
}

.adsense-block--feed {
    margin: 0;
    grid-column: 1 / -1;
}

@media (max-width: 960px) {
    .posts-feed--cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .posts-feed--cards {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Post Card
   -------------------------------------------------------------------------- */
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.post-card-badge {
    position: absolute;
    top: var(--space-3);
    inset-inline-start: var(--space-3);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
}

.post-card-badge--premium {
    inset-inline-start: auto;
    inset-inline-end: var(--space-3);
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.post-card-badge--inline {
    position: static;
    display: inline-flex;
    margin-inline-start: var(--space-2);
    transform: translateY(-1px);
}

/* Paywall / Members CTA */
.content-cta {
    margin-block: var(--space-10);
}

.content-cta__card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    padding: var(--space-7);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.content-cta__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xl);
    font-weight: 900;
}

.content-cta__text {
    margin: 0 0 var(--space-5);
    color: var(--color-text-secondary);
    font-size: var(--text-base);
    line-height: 1.8;
}

.content-cta__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

/* Pricing */
.pricing-content,
.writers-content {
    padding-block: var(--space-10) var(--space-20);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-6);
    margin-block: var(--space-8);
    align-items: stretch;
}

.pricing-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: var(--space-7);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: var(--space-5);
}

.pricing-card.is-featured {
    border-color: rgba(0, 113, 227, 0.35);
    box-shadow: var(--shadow-lg);
}

.pricing-card__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xl);
    font-weight: 900;
}

.pricing-card__desc {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.pricing-card__prices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-4);
}

.pricing-price {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    padding: var(--space-4);
    text-align: center;
}

.pricing-price__amount {
    font-weight: 900;
    font-size: var(--text-xl);
    letter-spacing: -0.01em;
}

.pricing-price__hint {
    margin-top: 6px;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
}

.pricing-card__benefits {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--space-2);
    color: var(--color-text-secondary);
    font-weight: 700;
}

.pricing-card__benefits li {
    position: relative;
    padding-inline-start: 18px;
}

.pricing-card__benefits li::before {
    content: "✓";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    color: var(--color-primary);
    font-weight: 900;
}

.pricing-card__cta {
    display: grid;
    gap: var(--space-3);
}

.pricing-login {
    margin: 0;
    color: var(--color-text-secondary);
    font-weight: 700;
    font-size: var(--text-sm);
    text-align: center;
}

.pricing-login a {
    color: var(--color-primary);
    text-decoration: none;
}

.pricing-login a:hover {
    text-decoration: underline;
}

.pricing-faq {
    margin-top: var(--space-10);
}

.pricing-faq details {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: var(--space-4) var(--space-5);
    margin-top: var(--space-3);
}

.pricing-faq summary {
    cursor: pointer;
    font-weight: 900;
}

/* Writers */
.page-writers .writers-page-header {
    padding-block: var(--space-4) var(--space-2);
    text-align: start;
    background: none;
    border: 0;
}

.writers-page-title {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.writers-page-subtitle {
    margin: var(--space-1) 0 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.9;
    max-width: 60ch;
}

.page-writers .writers-content {
    padding-block-start: var(--space-6);
}

.writers-howto {
    margin-top: var(--space-10);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: var(--space-7);
    box-shadow: var(--shadow-sm);
}

.writers-howto h2 {
    margin: 0 0 var(--space-4);
    font-size: var(--text-xl);
    font-weight: 900;
}

.writers-howto ol {
    margin: 0;
    padding-inline-start: 1.25rem;
    list-style-position: outside;
    color: var(--color-text-secondary);
    font-weight: 700;
    line-height: 1.9;
}

.writers-howto ol li+li {
    margin-top: var(--space-2);
}

.writers-howto p {
    margin: var(--space-4) 0 0;
    color: var(--color-text-secondary);
    font-weight: 700;
}

.writers-howto a {
    color: var(--color-primary);
    text-decoration: none;
}

.writers-howto a:hover {
    text-decoration: underline;
}

.writers-howto a:focus-visible {
    outline: 3px solid rgba(0, 113, 227, 0.25);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.writers-status__card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    padding: var(--space-7);
    box-shadow: var(--shadow-sm);
    text-align: center;
    margin-block: var(--space-6);
}

.writers-status__card.is-premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.10));
    border-color: rgba(245, 158, 11, 0.35);
}

.writers-status__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.writers-status__card ol {
    margin: var(--space-4) auto 0;
    padding: 0;
    max-width: 640px;
    text-align: start;
    list-style-position: inside;
    color: var(--color-text-secondary);
    font-weight: 700;
    line-height: 1.9;
}

.writers-follow-hint {
    margin: var(--space-4) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: center;
}

.writers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-6);
}

.writers-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.writers-card h3 {
    margin: 0 0 var(--space-2);
    font-weight: 900;
}

.writers-card p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.writers-directory {
    margin-top: var(--space-12);
}

.writers-directory__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-6);
    flex-wrap: wrap;
    margin-bottom: var(--space-6);
}

.writers-directory__title {
    margin: 0;
    font-size: var(--text-2xl);
    font-weight: 900;
}

.writers-directory__controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1 1 auto;
}

.writers-search {
    flex: 1 1 320px;
    min-width: 220px;
}

.writers-search input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.writers-search input:focus {
    border-color: rgba(0, 113, 227, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.writers-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-size: var(--text-sm);
    font-weight: 800;
    user-select: none;
}

.writers-toggle input {
    width: 16px;
    height: 16px;
}

.writers-directory__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-6);
}

.writer-card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: var(--space-4);
    text-align: center;
}

.writer-card.is-following {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: var(--shadow-md);
}

.writer-card__link {
    color: inherit;
    text-decoration: none;
    display: grid;
    gap: var(--space-3);
    justify-items: center;
}

.writer-card__avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    display: grid;
    place-items: center;
}

.writer-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.writer-card__avatar-placeholder {
    font-weight: 900;
    font-size: var(--text-2xl);
    color: var(--color-text-inverted);
    background: var(--color-primary);
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.writer-card__name {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 900;
}

.writer-card__bio {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.writer-card__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.writer-follow-btn.is-following {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.writer-follow-btn.is-following:hover {
    opacity: 0.95;
}

.mobile-member-badge {
    margin-bottom: var(--space-3);
    display: inline-flex;
    justify-content: center;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 900;
}

.post-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
}

.post-card-tag {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-block-end: var(--space-2);
}

.post-card-title {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: var(--leading-snug);
    margin-block-end: var(--space-3);
}

.post-card-title a {
    color: inherit;
}

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

.post-card-excerpt {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-block-end: var(--space-4);
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block-start: var(--space-4);
    border-block-start: 1px solid var(--color-border);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.post-card-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.post-card-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
}

.post-card-author-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
}

.post-card-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

.separator {
    opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Article Page
   -------------------------------------------------------------------------- */
.post-article {
    padding-block-start: var(--space-8);
}

.article-header {
    text-align: center;
    margin-block-end: var(--space-10);
}

.breadcrumb {
    margin-block-end: var(--space-6);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    list-style: none;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.breadcrumb-item::after {
    content: '/';
    margin-inline-start: var(--space-2);
    opacity: 0.5;
}

.breadcrumb-item:last-child::after {
    display: none;
}

.breadcrumb-item a {
    color: inherit;
}

.breadcrumb-item a:hover {
    color: var(--color-primary);
}

.article-tags {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-block-end: var(--space-4);
}

.article-tag {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(0, 113, 227, 0.1);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: var(--leading-tight);
    margin-block-end: var(--space-4);
}

.article-excerpt {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    max-width: 700px;
    margin-inline: auto;
    margin-block-end: var(--space-8);
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.article-author {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    color: white;
    font-size: var(--text-lg);
    font-weight: 600;
}

.author-info {
    text-align: start;
}

.author-name {
    font-weight: 600;
    color: var(--color-text);
}

.article-date-reading {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* Feature Image */
.article-image {
    margin-block-end: var(--space-10);
}

.article-image img {
    width: 100%;
    max-height: 70vh;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.article-image figcaption {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-block-start: var(--space-3);
}

/* Article Content */
.article-wrapper {
    display: grid;
    grid-template-columns: 1fr minmax(0, var(--content-width)) 1fr;
    gap: var(--space-8);
}

.article-toc {
    position: sticky;
    top: calc(var(--header-height) + var(--space-8));
    align-self: start;
    padding: var(--space-5);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    max-height: calc(100vh - var(--header-height) - var(--space-16));
    overflow-y: auto;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--space-3);
}

.toc-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.toc-toggle {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: none;
}

.toc-content {
    font-size: var(--text-sm);
}

.toc-content a {
    display: block;
    padding: var(--space-2) 0;
    color: var(--color-text-secondary);
    border-inline-start: 2px solid transparent;
    padding-inline-start: var(--space-3);
    transition: all var(--transition-fast);
}

.toc-content a:hover,
.toc-content a.active {
    color: var(--color-primary);
    border-inline-start-color: var(--color-primary);
}

.article-content {
    grid-column: 2;
}

@media (max-width: 1200px) {
    .article-wrapper {
        display: block;
    }

    .article-toc {
        position: relative;
        top: 0;
        margin-block-end: var(--space-8);
        max-height: none;
    }

    .toc-toggle {
        display: block;
    }
}

/* Article Content Typography */
.gh-content {
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
}

.gh-content>*+* {
    margin-block-start: var(--space-6);
}

.gh-content h2 {
    font-size: var(--text-2xl);
    margin-block-start: var(--space-12);
    margin-block-end: var(--space-4);
}

.gh-content h3 {
    font-size: var(--text-xl);
    margin-block-start: var(--space-10);
    margin-block-end: var(--space-3);
}

.gh-content h4 {
    font-size: var(--text-lg);
    margin-block-start: var(--space-8);
    margin-block-end: var(--space-2);
}

.gh-content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gh-content blockquote {
    padding-inline-start: var(--space-6);
    border-inline-start: 3px solid var(--color-primary);
    font-style: italic;
    color: var(--color-text-secondary);
}

.gh-content pre {
    padding: var(--space-5);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.gh-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: var(--space-1) var(--space-2);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-sm);
}

.gh-content pre code {
    padding: 0;
    background: none;
}

.gh-content ul,
.gh-content ol {
    padding-inline-start: var(--space-6);
}

.gh-content li+li {
    margin-block-start: var(--space-2);
}

.gh-content img,
.gh-content figure {
    border-radius: var(--radius-md);
}

.gh-content figcaption {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-block-start: var(--space-2);
}

/* Tables */
.gh-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.gh-content thead th {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    font-weight: 700;
}

.gh-content th,
.gh-content td {
    padding: var(--space-3) var(--space-4);
    border-block-end: 1px solid var(--color-border);
    border-inline-end: 1px solid var(--color-border);
    text-align: start;
    vertical-align: top;
}

.gh-content tr:last-child td {
    border-block-end: 0;
}

.gh-content th:last-child,
.gh-content td:last-child {
    border-inline-end: 0;
}

.gh-content tbody tr:nth-child(even) {
    background: var(--color-bg-secondary);
}

.gh-content table caption {
    caption-side: bottom;
    padding: var(--space-3) var(--space-2) 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: center;
}

@media (max-width: 600px) {
    .gh-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Article Footer */
.article-footer {
    padding-block: var(--space-10);
    border-block-start: 1px solid var(--color-border);
    margin-block-start: var(--space-10);
}

.article-footer-tags {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-block-end: var(--space-8);
}

.footer-tags-label {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.footer-tags-list {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.footer-tag {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
    color: var(--color-text);
}

.footer-tag:hover {
    background: var(--color-bg-tertiary);
}

/* Author Box */
.author-box {
    display: flex;
    gap: var(--space-6);
    padding: var(--space-8);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    margin-block-end: var(--space-8);
}

.author-box-avatar {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.author-box-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-placeholder.large {
    width: 80px;
    height: 80px;
    font-size: var(--text-2xl);
}

.author-box-content {
    flex: 1;
}

.author-box-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-block-end: var(--space-1);
}

.author-box-name {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
}

.author-box-bio {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin-block-start: var(--space-2);
}

.author-box-location {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

.post-nav-item {
    padding: var(--space-6);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.post-nav-item:hover {
    background: var(--color-bg-tertiary);
}

.post-nav-label {
    display: block;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-block-end: var(--space-2);
}

.post-nav-title {
    display: block;
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
}

.post-nav-next {
    text-align: end;
}

@media (max-width: 600px) {
    .post-navigation {
        grid-template-columns: 1fr;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }

    .author-box-avatar {
        margin-inline: auto;
    }
}

/* Related Posts */
.related-posts {
    padding-block: var(--space-16);
    background: var(--color-bg-secondary);
    margin-block-start: var(--space-10);
}

.related-title {
    font-size: var(--text-xl);
    font-weight: 700;
    text-align: center;
    margin-block-end: var(--space-8);
}

.related-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

@media (max-width: 768px) {
    .related-feed {
        grid-template-columns: 1fr;
    }
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: 3px;
    z-index: 101;
    background: var(--color-border);
}

.reading-progress-bar {
    height: 100%;
    width: 0;
    background: var(--color-primary);
    transition: width 50ms linear;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--color-bg-secondary);
    padding-block: var(--space-16);
    margin-block-start: auto;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-12);
    padding-block-end: var(--space-10);
    border-block-end: 1px solid var(--color-border);
}

.footer-logo img {
    height: 32px;
    width: auto;
    margin-block-end: var(--space-4);
}

.footer-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    max-width: 300px;
}

.footer-nav-title,
.footer-social-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    margin-block-end: var(--space-4);
}

.footer-nav-list {
    list-style: none;
}

.footer-nav-list li {
    margin-block-end: var(--space-2);
}

.footer-nav-list a {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

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

.footer-social-links {
    display: flex;
    gap: var(--space-3);
}

.footer-social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.footer-social-links a:hover {
    background: var(--color-primary);
    color: white;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block-start: var(--space-6);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.footer-powered a {
    color: var(--color-text-secondary);
}

.footer-powered a:hover {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
    margin-block-start: var(--space-12);
}

.pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(.disabled) {
    background: var(--color-bg-tertiary);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Newsletter CTA
   -------------------------------------------------------------------------- */
.newsletter-cta {
    padding: var(--space-16) 0;
    background: linear-gradient(135deg, var(--color-primary), #4F46E5);
    color: white;
}

.newsletter-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-10);
}

.newsletter-content {
    flex: 1;
}

.newsletter-title {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-block-end: var(--space-2);
}

.newsletter-description {
    font-size: var(--text-base);
    opacity: 0.9;
}

.newsletter-form {
    flex: 1;
    max-width: 480px;
}

.newsletter-form-element {
    width: 100%;
}

.newsletter-form .form-group {
    display: flex;
    gap: var(--space-3);
}

.newsletter-form .form-input {
    flex: 1;
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
    font-family: inherit;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    transition: all var(--transition-fast);
}

.newsletter-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form .form-input:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.newsletter-form .form-submit {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    font-weight: 600;
    background: white;
    color: var(--color-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.newsletter-form .form-submit:hover {
    transform: scale(1.02);
}

.newsletter-form .btn-loading {
    display: none;
}

.newsletter-form [data-loading] .btn-text {
    display: none;
}

.newsletter-form [data-loading] .btn-loading {
    display: block;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spinner-circle {
    stroke: currentColor;
    stroke-dasharray: 60;
    stroke-dashoffset: 45;
}

.form-message {
    margin-block-start: var(--space-3);
    font-size: var(--text-sm);
    line-height: 1.4;
    text-align: center;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--color-text);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
}

.form-message.form-error {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.28);
    color: var(--color-text);
}

.form-message.form-success-message {
    background: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.28);
    color: var(--color-text);
}

.form-success {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-start: var(--space-4);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
}

.newsletter-subscribed {
    text-align: center;
}

.newsletter-subscribed svg {
    color: white;
    margin-block-end: var(--space-2);
}

@media (max-width: 768px) {
    .newsletter-inner {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-form {
        max-width: 100%;
    }

    .newsletter-form .form-group {
        flex-direction: column;
    }
}

/* --------------------------------------------------------------------------
   Share Buttons
   -------------------------------------------------------------------------- */
.share-buttons {
    display: flex;
    gap: var(--space-2);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.share-btn:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
}

.share-btn-copy .share-tooltip {
    position: absolute;
    bottom: 100%;
    inset-inline: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    background: var(--color-text);
    color: var(--color-bg);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.share-btn-copy.copied .share-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 8px);
}

/* --------------------------------------------------------------------------
   Mobile Menu
   -------------------------------------------------------------------------- */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    visibility: hidden;
}

.mobile-menu.is-open {
    visibility: visible;
}

.mobile-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.mobile-menu.is-open .mobile-menu-overlay {
    opacity: 1;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--color-surface);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
}

[dir="rtl"] .mobile-menu-panel {
    transform: translateX(-100%);
}

.mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5);
    border-block-end: 1px solid var(--color-border);
}

.mobile-menu-logo img {
    height: 28px;
    width: auto;
}

.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.mobile-nav-list {
    flex: 1;
    list-style: none;
    padding: var(--space-4);
    overflow-y: auto;
}

.mobile-nav-item {
    margin-block-end: var(--space-1);
}

.mobile-nav-link {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
    background: var(--color-bg-secondary);
}

.mobile-menu-actions {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    border-block-start: 1px solid var(--color-border);
}

.mobile-menu-footer {
    padding: var(--space-4);
    border-block-start: 1px solid var(--color-border);
}

.mobile-social {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
}

.mobile-social a {
    color: var(--color-text-secondary);
}

.mobile-social a:hover {
    color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Search Modal
   -------------------------------------------------------------------------- */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-block-start: 10vh;
}

.search-modal[hidden] {
    display: none;
}

.search-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin-inline: var(--space-4);
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideDown var(--transition-base);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-header {
    padding: var(--space-4);
    border-block-end: 1px solid var(--color-border);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.search-icon {
    color: var(--color-text-secondary);
}

.search-input {
    flex: 1;
    padding: var(--space-2);
    font-size: var(--text-lg);
    font-family: inherit;
    border: none;
    background: none;
    color: var(--color-text);
    outline: none;
}

.search-input::placeholder {
    color: var(--color-text-tertiary);
}

.search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    cursor: pointer;
}

.search-results {
    max-height: 60vh;
    overflow-y: auto;
    padding: var(--space-4);
}

.search-empty {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Tag & Author Pages
   -------------------------------------------------------------------------- */
.tag-header,
.author-header {
    position: relative;
    padding: var(--space-16) 0;
    text-align: center;
}

.tag-header-bg,
.author-header-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
}

.tag-header-bg::after,
.author-header-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
}

.tag-header-content,
.author-header-content {
    position: relative;
    color: var(--color-text);
}

.tag-header-bg+.tag-header-content,
.author-header-bg+.author-header-content {
    color: white;
}

.tag-header .tag-name,
.author-header .author-name {
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-block-end: var(--space-4);
}

.tag-header .tag-description,
.author-header .author-bio {
    font-size: var(--text-lg);
    max-width: 600px;
    margin-inline: auto;
    opacity: 0.9;
}

.tag-header .tag-meta,
.author-header .author-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    margin-block-start: var(--space-6);
}

.author-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-inline: auto;
    margin-block-end: var(--space-4);
    border: 4px solid white;
    box-shadow: var(--shadow-lg);
}

.author-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-placeholder.xlarge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    color: white;
    font-size: var(--text-4xl);
    font-weight: 600;
}

.author-location,
.author-website,
.author-social {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: inherit;
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Error Page
   -------------------------------------------------------------------------- */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-icon {
    color: var(--color-text-tertiary);
    margin-block-end: var(--space-6);
}

.error-code {
    font-size: var(--text-5xl);
    font-weight: 800;
    color: var(--color-text);
    margin-block-end: var(--space-2);
}

.error-message {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-block-end: var(--space-2);
}

.error-description {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    margin-block-end: var(--space-8);
}

.error-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.error-button:hover {
    background: var(--color-primary-hover);
    color: white;
    transform: scale(1.02);
}

/* --------------------------------------------------------------------------
   Page Template
   -------------------------------------------------------------------------- */
.page-article {
    padding-block: var(--space-16);
}

.page-header {
    text-align: center;
    margin-block-end: var(--space-10);
}

.page-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-block-end: var(--space-4);
}

.page-excerpt {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-inline: auto;
}

.page-image {
    margin-block-end: var(--space-10);
}

.page-image img {
    width: 100%;
    max-height: 50vh;
    object-fit: cover;
    border-radius: var(--radius-lg);
}

.page-content {
    max-width: var(--content-width);
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Ghost Cards (Embedded content)
   -------------------------------------------------------------------------- */
.kg-card {
    margin-block: var(--space-8);
}

.kg-image-card img,
.kg-gallery-image img {
    border-radius: var(--radius-md);
}

.kg-width-wide {
    max-width: calc(var(--content-width) + 200px);
    margin-inline: auto;
}

.kg-width-full {
    max-width: none;
    margin-inline: calc(-50vw + 50%);
}

.kg-bookmark-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.kg-bookmark-content {
    flex: 1;
    padding: var(--space-5);
}

.kg-bookmark-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-block-end: var(--space-2);
}

.kg-bookmark-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-block-start: var(--space-3);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-thumbnail {
    width: 200px;
    flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 600px) {
    .kg-bookmark-container {
        flex-direction: column-reverse;
    }

    .kg-bookmark-thumbnail {
        width: 100%;
        aspect-ratio: 16/9;
    }
}

/* ==========================================================================
   RTL Fixes - Ensure proper right-to-left layout
   ========================================================================== */

html[dir="rtl"],
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Header RTL */
[dir="rtl"] .header-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-list {
    flex-direction: row-reverse;
}

/* Post card RTL */
[dir="rtl"] .post-card-content {
    text-align: right;
}

[dir="rtl"] .post-card-meta {
    flex-direction: row-reverse;
}

/* Article RTL */
[dir="rtl"] .article-meta {
    flex-direction: row-reverse;
}

[dir="rtl"] .article-author {
    flex-direction: row-reverse;
}

[dir="rtl"] .author-info {
    text-align: right;
}

[dir="rtl"] .breadcrumb-list {
    flex-direction: row-reverse;
}

/* Footer RTL */
[dir="rtl"] .footer-inner {
    direction: rtl;
}

[dir="rtl"] .footer-top {
    direction: rtl;
}

[dir="rtl"] .footer-bottom {
    flex-direction: row-reverse;
}

/* Pagination RTL */
[dir="rtl"] .pagination-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .pagination-prev svg {
    transform: rotate(180deg);
}

[dir="rtl"] .pagination-next svg {
    transform: rotate(180deg);
}

/* Mobile Menu RTL */
[dir="rtl"] .mobile-menu-panel {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

[dir="rtl"] .mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

/* Table of Contents Fix */
.article-toc {
    min-width: 220px;
    max-width: 280px;
}

.toc-content {
    max-height: 60vh;
    overflow-y: auto;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-block-end: var(--space-2);
}

.toc-h3 {
    padding-inline-start: var(--space-4);
}

/* Share buttons RTL */
[dir="rtl"] .share-buttons {
    flex-direction: row-reverse;
}

/* Author box RTL */
[dir="rtl"] .author-box {
    flex-direction: row-reverse;
    text-align: right;
}

/* Post navigation RTL */
[dir="rtl"] .post-nav-prev {
    text-align: right;
}

[dir="rtl"] .post-nav-next {
    text-align: left;
}

/* Featured cards RTL */
[dir="rtl"] .featured-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .featured-card-content {
    text-align: right;
}

/* Hero RTL */
[dir="rtl"] .hero-cta {
    flex-direction: row-reverse;
}

/* Newsletter RTL */
[dir="rtl"] .newsletter-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .newsletter-content {
    text-align: right;
}

@media (max-width: 768px) {
    [dir="rtl"] .newsletter-inner {
        flex-direction: column;
        text-align: center;
    }

    [dir="rtl"] .newsletter-content {
        text-align: center;
    }
}

/* Tag and Author pages RTL */
[dir="rtl"] .tag-header-content,
[dir="rtl"] .author-header-content {
    text-align: right;
}

[dir="rtl"] .author-meta {
    flex-direction: row-reverse;
}

/* Related posts RTL */
[dir="rtl"] .related-feed {
    direction: rtl;
}

/* Article footer tags RTL */
[dir="rtl"] .article-footer-tags {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-tags-list {
    flex-direction: row-reverse;
}

/* Input fields RTL */
[dir="rtl"] input,
[dir="rtl"] textarea {
    text-align: right;
}

/* ==========================================================================
   RTL Comprehensive Fixes + Design Improvements
   ========================================================================== */

/* Font - Almarai instead of Tajawal */
@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

:root {
    --font-arabic: 'Almarai', -apple-system, BlinkMacSystemFont, sans-serif;
    --gh-font-heading: 'Almarai', -apple-system, BlinkMacSystemFont, sans-serif;
    --gh-font-body: 'Almarai', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    font-family: var(--font-arabic);
}

/* ==========================================================================
   HEADER - Right to Left
   ========================================================================== */
.site-header {
    direction: rtl;
}

.header-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.header-brand {
    order: 1;
}

.header-nav {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-actions {
    order: 3;
    display: flex;
    flex-direction: row;
    gap: var(--space-3);
}

.nav-list {
    display: flex;
    flex-direction: row;
    gap: var(--space-6);
}

.header-members {
    display: flex;
    flex-direction: row;
    gap: var(--space-3);
}

/* ==========================================================================
   TABLE OF CONTENTS - Desktop Fix
   ========================================================================== */
.article-wrapper {
    display: grid;
    grid-template-columns: 1fr minmax(0, var(--content-width)) 280px;
    gap: var(--space-10);
    align-items: start;
}

.article-content {
    grid-column: 2;
}

.article-toc {
    grid-column: 3;
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
    width: 280px;
    min-width: 280px;
    padding: var(--space-6);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    max-height: calc(100vh - var(--header-height) - var(--space-12));
    overflow-y: auto;
}

.toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--space-4);
    padding-block-end: var(--space-3);
    border-block-end: 1px solid var(--color-border);
}

.toc-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text);
}

.toc-content {
    font-size: var(--text-sm);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-block-end: var(--space-3);
}

.toc-item a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    border-inline-start: 2px solid transparent;
}

.toc-item a:hover,
.toc-item a.active {
    color: var(--color-primary);
    background: rgba(0, 113, 227, 0.08);
    border-inline-start-color: var(--color-primary);
}

.toc-h3 a {
    padding-inline-start: var(--space-6);
    font-size: var(--text-xs);
}

@media (max-width: 1200px) {
    .article-wrapper {
        display: block;
    }

    .article-toc {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 100%;
        margin-block-end: var(--space-8);
        max-height: none;
    }
}

/* ==========================================================================
   FEATURE IMAGE - Contained Width
   ========================================================================== */
.article-image {
    max-width: 960px;
    margin-inline: auto;
    margin-block-end: var(--space-12);
    padding-inline: var(--space-6);
}

.article-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.article-image figcaption {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-block-start: var(--space-4);
}

/* Page feature image */
.page-image {
    max-width: 960px;
    margin-inline: auto;
    margin-block-end: var(--space-10);
    padding-inline: var(--space-6);
}

.page-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

/* ==========================================================================
   NEWSLETTER - Beautiful Design
   ========================================================================== */
.newsletter-cta {
    padding: var(--space-20) var(--space-6);
    background: linear-gradient(135deg, #7C6AEB 0%, #4F46E5 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.newsletter-inner {
    max-width: 600px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
    position: relative;
    z-index: 1;
}

.newsletter-content {
    text-align: center;
}

.newsletter-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-block-end: var(--space-3);
    color: white;
}

.newsletter-description {
    font-size: var(--text-lg);
    opacity: 0.95;
    color: white;
}

.newsletter-form {
    width: 100%;
    max-width: 450px;
}

.newsletter-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.newsletter-form .form-input {
    width: 100%;
    padding: var(--space-4) var(--space-5);
    font-size: var(--text-base);
    font-family: inherit;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    outline: none;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.newsletter-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.newsletter-form .form-input:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.25);
}

.newsletter-form .form-submit {
    width: 100%;
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    font-weight: 700;
    font-family: inherit;
    background: white;
    color: #7C6AEB;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.newsletter-form .form-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.newsletter-subscribed {
    text-align: center;
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.newsletter-subscribed svg {
    margin-block-end: var(--space-3);
}

.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    margin-block-start: var(--space-4);
}

/* ==========================================================================
   RTL General Fixes
   ========================================================================== */

/* Footer */
.footer-top {
    direction: rtl;
    text-align: right;
}

.footer-bottom {
    direction: rtl;
    text-align: right;
}

/* Posts */
.posts-feed {
    direction: rtl;
}

.post-card-content {
    text-align: right;
}

.post-card-meta {
    direction: rtl;
}

/* Article */
.article-header {
    text-align: center;
}

.gh-content {
    text-align: right;
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-content h5,
.gh-content h6 {
    text-align: right;
}

/* Breadcrumb */
.breadcrumb-list {
    justify-content: center;
}

/* Author box */
.author-box {
    text-align: right;
}

/* Related posts */
.related-posts {
    direction: rtl;
}

/* Mobile menu */
.mobile-menu-panel {
    text-align: right;
}

.mobile-nav-list {
    text-align: right;
}

/* Hero */
.hero-content {
    text-align: center;
}

/* Featured */
.featured-card-content {
    text-align: right;
}

/* Tag/Author pages */
.tag-header,
.author-header {
    text-align: center;
}

/* Error page */
.error-page {
    text-align: center;
}

/* Forms */
input,
textarea,
select {
    text-align: right;
    direction: rtl;
}

.newsletter-form input {
    text-align: center;
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN
   ========================================================================== */

/* ==========================================================================
   HEADER - Full Responsive
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: auto;
    min-height: var(--header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-block-end: 1px solid var(--color-border);
}

.theme-dark .site-header,
[data-theme="dark"] .site-header {
    background: rgba(0, 0, 0, 0.92);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding-inline: var(--space-4);
    gap: var(--space-4);
    direction: rtl;
}

.header-brand {
    flex-shrink: 0;
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 28px;
    width: auto;
    max-width: 150px;
}

.header-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

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

.nav-list {
    display: flex;
    flex-direction: row;
    gap: var(--space-6);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    list-style: none;
}

.nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
    opacity: 0.8;
    transition: opacity var(--transition-fast);
    white-space: nowrap;
    padding: var(--space-2) var(--space-3);
}

.nav-link:hover {
    opacity: 1;
    color: var(--color-text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.header-search-btn,
.header-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-search-btn:hover,
.header-theme-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text);
}

.header-members {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.btn-signin {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-primary);
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-subscribe {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    text-decoration: none;
}

.header-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* ==========================================================================
   TABLET - 768px to 1024px
   ========================================================================== */
@media (max-width: 1024px) {
    .nav-list {
        gap: var(--space-4);
    }

    .nav-link {
        font-size: var(--text-xs);
        padding: var(--space-2);
    }

    .header-members .btn-signin {
        display: none;
    }

    .posts-feed--cards {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

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

    .featured-card--large {
        grid-column: span 1;
    }

    .article-wrapper {
        display: block;
    }

    .article-toc {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 100%;
        margin-block-end: var(--space-8);
    }
}

/* ==========================================================================
   MOBILE - Below 768px
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .header-inner {
        padding-inline: var(--space-4);
    }

    .header-nav {
        display: none;
    }

    .header-members {
        display: none;
    }

    .header-menu-btn {
        display: flex;
    }

    .header-actions {
        gap: var(--space-1);
    }

    .header-search-btn,
    .header-theme-btn {
        width: 36px;
        height: 36px;
    }

    /* Hero */
    .hero {
        min-height: 50vh;
        padding: var(--space-12) 0;
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .hero-description {
        font-size: var(--text-base);
    }

    .hero-cta {
        flex-direction: column;
        gap: var(--space-3);
    }

    .hero-cta .btn {
        width: 100%;
    }

    /* Posts */
    .posts-feed--cards {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .post-card {
        margin-inline: 0;
    }

    .post-card-title {
        font-size: var(--text-base);
    }

    .post-card-excerpt {
        font-size: var(--text-sm);
    }

    /* Article */
    .article-header {
        padding-inline: var(--space-4);
    }

    .article-title {
        font-size: var(--text-2xl);
    }

    .article-excerpt {
        font-size: var(--text-base);
    }

    .article-image {
        padding-inline: 0;
        margin-inline: 0;
    }

    .article-image img {
        border-radius: 0;
        max-height: 300px;
    }

    .article-wrapper {
        padding-inline: var(--space-4);
    }

    .article-content {
        font-size: var(--text-base);
    }

    .article-footer {
        padding-inline: var(--space-4);
    }

    /* Author box */
    .author-box {
        flex-direction: column;
        text-align: center;
        padding: var(--space-6);
    }

    .author-box-avatar {
        margin-inline: auto;
    }

    /* Post navigation */
    .post-navigation {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .post-nav-next {
        text-align: right;
    }

    /* Related posts */
    .related-feed {
        grid-template-columns: 1fr;
    }

    /* Featured */
    .featured-section {
        padding: var(--space-10) 0;
    }

    .featured-header {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    .featured-grid {
        gap: var(--space-4);
    }

    .featured-card-title {
        font-size: var(--text-lg);
    }

    /* Newsletter */
    .newsletter-cta {
        padding: var(--space-12) var(--space-4);
    }

    .newsletter-title {
        font-size: var(--text-2xl);
    }

    .newsletter-description {
        font-size: var(--text-base);
    }

    /* Footer */
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .footer-brand {
        text-align: center;
    }

    .footer-description {
        margin-inline: auto;
    }

    .footer-social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    /* Pagination */
    .pagination-inner {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .pagination-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
    }

    /* Tag/Author pages */
    .tag-header,
    .author-header {
        padding: var(--space-10) var(--space-4);
    }

    .tag-name,
    .author-name {
        font-size: var(--text-2xl);
    }

    .author-avatar-large {
        width: 80px;
        height: 80px;
    }

    .author-meta {
        flex-direction: column;
        gap: var(--space-3);
    }

    /* Page */
    .page-header {
        padding-inline: var(--space-4);
    }

    .page-title {
        font-size: var(--text-2xl);
    }

    .page-image {
        padding-inline: 0;
    }

    .page-image img {
        border-radius: 0;
    }

    .page-content {
        padding-inline: var(--space-4);
    }

    /* Error page */
    .error-content {
        padding-inline: var(--space-4);
    }

    .error-code {
        font-size: var(--text-4xl);
    }

    /* Posts header */
    .posts-header {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

    /* Site content */
    .site-content {
        padding: var(--space-8) 0;
    }

    .gh-inner {
        padding-inline: var(--space-4);
    }

    /* Breadcrumb */
    .breadcrumb {
        margin-block-end: var(--space-4);
    }

    .breadcrumb-list {
        flex-wrap: wrap;
        font-size: var(--text-xs);
    }

    /* Article meta */
    .article-meta {
        flex-direction: column;
        gap: var(--space-4);
    }

    /* Share buttons */
    .article-share {
        width: 100%;
    }

    .share-buttons {
        justify-content: center;
    }

    /* TOC mobile */
    .article-toc {
        margin-block-end: var(--space-6);
    }
}

/* ==========================================================================
   SMALL MOBILE - Below 480px
   ========================================================================== */
@media (max-width: 480px) {
    :root {
        --space-6: 1rem;
        --space-7: 1.25rem;
        --space-8: 1.5rem;
        --space-10: 2rem;
        --space-12: 2.5rem;
        --space-14: 2.75rem;
        --space-16: 3rem;
    }

    .header-logo img {
        height: 24px;
    }

    .hero-title {
        font-size: var(--text-2xl);
    }

    .article-title {
        font-size: var(--text-xl);
    }

    .post-card-content {
        padding: var(--space-4);
    }

    .post-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .btn-lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-sm);
    }

    .newsletter-form .form-input,
    .newsletter-form .form-submit {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
}

/* ==========================================================================
   MOBILE MENU - Full Responsive
   ========================================================================== */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    visibility: hidden;
    pointer-events: none;
}

.mobile-menu.is-open {
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.mobile-menu.is-open .mobile-menu-overlay {
    opacity: 1;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--color-surface);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
}

.mobile-menu.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-block-end: 1px solid var(--color-border);
    min-height: var(--header-height);
}

.mobile-menu-logo img {
    height: 24px;
    width: auto;
}

.mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.mobile-nav-list {
    flex: 1;
    list-style: none;
    padding: var(--space-4);
    margin: 0;
    overflow-y: auto;
}

.mobile-nav-item {
    margin-block-end: var(--space-1);
}

.mobile-nav-link {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-lg);
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
}

.mobile-menu-actions {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    border-block-start: 1px solid var(--color-border);
}

.mobile-menu-footer {
    padding: var(--space-4);
    border-block-start: 1px solid var(--color-border);
}

.mobile-social {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
}

.mobile-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.mobile-social a:hover {
    color: var(--color-primary);
}

/* ==========================================================================
   SEARCH MODAL - Responsive
   ========================================================================== */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-4);
    padding-block-start: 15vh;
}

.search-modal[hidden] {
    display: none;
}

.search-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.search-header {
    padding: var(--space-4);
    border-block-end: 1px solid var(--color-border);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    direction: rtl;
}

.search-icon {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    padding: var(--space-2);
    font-size: var(--text-lg);
    font-family: inherit;
    border: none;
    background: none;
    color: var(--color-text);
    outline: none;
    text-align: right;
    direction: rtl;
}

.search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-bg-secondary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-text-secondary);
    cursor: pointer;
    flex-shrink: 0;
}

.search-results {
    max-height: 50vh;
    overflow-y: auto;
    padding: var(--space-4);
}

.search-empty {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-secondary);
}

@media (max-width: 480px) {
    .search-modal {
        padding: 0;
        padding-block-start: 0;
        align-items: stretch;
    }

    .search-container {
        max-width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .search-results {
        max-height: none;
        flex: 1;
    }
}

/* ==========================================================================
   TABLE OF CONTENTS - Top of Article Style
   ========================================================================== */
.article-toc-wrapper {
    max-width: 720px;
    margin-inline: auto;
    margin-block-end: var(--space-10);
}

.article-toc {
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-tertiary) 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: relative;
    overflow: hidden;
}

.article-toc::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
    padding-block-end: var(--space-4);
    border-block-end: 1px solid var(--color-border);
}

.toc-icon {
    font-size: var(--text-xl);
}

.toc-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
}

.toc-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-2);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: contents;
}

.toc-item {
    display: block;
}

.toc-item a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.toc-item a::before {
    content: '←';
    font-size: var(--text-xs);
    opacity: 0;
    transform: translateX(5px);
    transition: all var(--transition-fast);
}

.toc-item a:hover {
    color: var(--color-primary);
    background: white;
    border-color: var(--color-primary);
    transform: translateX(-4px);
}

.toc-item a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 600px) {
    .toc-content {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   HOMEPAGE - Beautiful Design
   ========================================================================== */

/* Hero Section Enhancement */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-16) var(--space-6);
    background: linear-gradient(135deg, #7C6AEB 0%, #4F46E5 50%, #C026D3 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    color: white;
}

.hero-logo {
    margin-block-end: var(--space-6);
}

.hero-logo img {
    height: 80px;
    width: auto;
    margin-inline: auto;
    filter: brightness(0) invert(1);
}

.hero-title {
    font-size: var(--text-5xl);
    font-weight: 800;
    margin-block-end: var(--space-4);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.hero-description {
    font-size: var(--text-xl);
    opacity: 0.95;
    margin-block-end: var(--space-8);
    max-width: 600px;
    margin-inline: auto;
}

.hero-cta {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.hero-cta .btn-primary {
    background: white;
    color: #7C6AEB;
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-cta .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.hero-cta .btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    backdrop-filter: blur(10px);
}

.hero-cta .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.hero-scroll {
    position: absolute;
    bottom: var(--space-8);
    left: 50%;
    transform: translateX(-50%);
    color: white;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-15px);
    }

    60% {
        transform: translateX(-50%) translateY(-7px);
    }
}

/* Featured Section Enhancement */
.featured-section {
    padding: var(--space-16) 0;
    background: var(--color-bg);
}

.featured-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--space-10);
}

.featured-header-content {
    text-align: right;
}

.featured-label {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-block-end: var(--space-2);
}

.featured-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--color-text);
}

.featured-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary);
    transition: gap var(--transition-fast);
}

.featured-link:hover {
    gap: var(--space-3);
}

.featured-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-6);
}

.featured-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.featured-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.featured-card--large {
    grid-row: span 2;
}

.featured-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.featured-card--large .featured-card-image {
    aspect-ratio: auto;
    height: 100%;
}

.featured-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.featured-card:hover .featured-card-image img {
    transform: scale(1.08);
}

.featured-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
}

.featured-card-content {
    position: absolute;
    bottom: 0;
    inset-inline: 0;
    padding: var(--space-6);
    color: white;
    text-align: right;
}

.featured-card--large .featured-card-content {
    padding: var(--space-8);
}

.featured-card-tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: var(--radius-full);
    margin-block-end: var(--space-3);
}

.featured-card-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-block-end: var(--space-2);
    line-height: var(--leading-snug);
}

.featured-card--large .featured-card-title {
    font-size: var(--text-2xl);
}

.featured-card-title a {
    color: inherit;
}

.featured-card-meta {
    font-size: var(--text-sm);
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

@media (max-width: 900px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-card--large {
        grid-row: span 1;
    }

    .featured-card--large .featured-card-image {
        aspect-ratio: 16/10;
    }
}

/* Posts Section */
.site-content {
    padding: var(--space-16) 0;
}

.posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-block-end: var(--space-10);
    padding-block-end: var(--space-6);
    border-block-end: 1px solid var(--color-border);
}

.posts-title {
    font-size: var(--text-2xl);
    font-weight: 800;
}

.posts-count {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
}

.posts-feed--cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

/* Post Card Enhancement */
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border);
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.post-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.post-card-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
}

.post-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-6);
    text-align: right;
}

.post-card-tag {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-block-end: var(--space-3);
}

.post-card-title {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: var(--leading-snug);
    margin-block-end: var(--space-3);
}

.post-card-title a {
    color: inherit;
    transition: color var(--transition-fast);
}

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

.post-card-excerpt {
    flex: 1;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-block-end: var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block-start: var(--space-4);
    border-block-start: 1px solid var(--color-border);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.post-card-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.post-card-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Article Image */
.article-image {
    max-width: 800px;
    margin-inline: auto;
    margin-block-end: var(--space-10);
}

.article-image img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* Related Posts */
.related-posts {
    padding: var(--space-16) 0;
    background: var(--color-bg-secondary);
}

.related-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    text-align: center;
    margin-block-end: var(--space-10);
}

.related-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

@media (max-width: 900px) {
    .related-feed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .related-feed {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 60vh;
        padding: var(--space-10) var(--space-4);
    }

    .hero-title {
        font-size: var(--text-3xl);
    }

    .posts-feed--cards {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FIXES - All Issues
   ========================================================================== */

/* ==========================================================================
   1. TABLE OF CONTENTS - Full Width + RTL
   ========================================================================== */
.article-toc-wrapper {
    max-width: 720px;
    width: 100%;
    margin-inline: auto;
    margin-block-end: var(--space-10);
    padding-inline: var(--space-4);
}

.article-toc {
    width: 100%;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    direction: rtl;
    text-align: right;
}

.toc-header {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
    padding-block-end: var(--space-4);
    border-block-end: 1px solid var(--color-border);
}

.toc-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
}

.toc-content {
    direction: rtl;
    text-align: right;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.toc-item a {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-align: right;
    direction: rtl;
}

.toc-item a:hover {
    color: var(--color-primary);
    background: rgba(0, 113, 227, 0.08);
    padding-inline-end: var(--space-6);
}

/* ==========================================================================
   2. NEWSLETTER - Fix Subscribed State + Better Style
   ========================================================================== */
.newsletter-cta {
    padding: var(--space-16) var(--space-6);
    background: linear-gradient(135deg, #7C6AEB 0%, #4F46E5 100%);
    color: white;
    text-align: center;
    direction: rtl;
}

.newsletter-inner {
    max-width: 550px;
    margin-inline: auto;
}

.newsletter-content {
    margin-block-end: var(--space-6);
}

.newsletter-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    margin-block-end: var(--space-3);
}

.newsletter-description {
    font-size: var(--text-base);
    opacity: 0.9;
}

.newsletter-form {
    width: 100%;
}

.newsletter-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.newsletter-form .form-input {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    font-family: inherit;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    outline: none;
    direction: ltr;
}

.newsletter-form .form-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-form .form-input:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.25);
}

.newsletter-form .form-submit {
    width: 100%;
    padding: var(--space-4);
    font-size: var(--text-base);
    font-weight: 700;
    font-family: inherit;
    background: white;
    color: #7C6AEB;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.newsletter-form .form-submit:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Ghost Members forms (Portal toggles .loading/.success/.error on the <form>) */
.newsletter-form-element {
    width: 100%;
}

.newsletter-form-element .btn-success {
    display: none;
}

.newsletter-form-element .form-error {
    display: none;
}

.newsletter-form-element.error .form-error {
    display: block;
}

.newsletter-form-element .form-error:not(:empty) {
    display: block;
}

.newsletter-form-element .form-success-message {
    display: none;
}

.newsletter-form-element:is(.loading, .success) .btn-text {
    display: none;
}

.newsletter-form-element.loading .btn-loading {
    display: inline-flex;
}

.newsletter-form-element.success .btn-success {
    display: inline-flex;
}

.newsletter-form-element.success .form-group {
    display: none;
}

.newsletter-form-element.success .form-success-message {
    display: block;
}

.gh-portal-triggerbtn-container {
    display: none !important;
}

/* ==========================================================================
   3. FOOTER - Remove Powered by Ghost
   ========================================================================== */
.footer-powered {
    display: none !important;
}

.footer-copyright {
    text-align: center;
    width: 100%;
}

.footer-bottom {
    justify-content: center;
    text-align: center;
}

/* ==========================================================================
   4. TAGS - RTL Direction
   ========================================================================== */
.article-tags {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    direction: rtl;
}

.article-footer-tags {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    direction: rtl;
    text-align: right;
}

.footer-tags-list {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.footer-tag {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
    color: var(--color-text);
    transition: all var(--transition-fast);
}

.footer-tag:hover {
    background: var(--color-primary);
    color: white;
}

/* ==========================================================================
   5. ARTICLE META - Compact Single Row
   ========================================================================== */
.article-meta {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-block-start: var(--space-6);
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
}

.article-author {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: var(--space-2);
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    color: white;
    font-size: var(--text-xs);
    font-weight: 600;
}

.author-info {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: var(--space-2);
}

.author-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
}

.article-date-reading {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.separator {
    opacity: 0.5;
}

.article-share {
    display: flex;
    flex-direction: row-reverse;
}

.share-buttons {
    display: flex;
    flex-direction: row-reverse;
    gap: var(--space-2);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ==========================================================================
   6. GHOST PORTAL - Custom Styling for Mobile + Colors
   ========================================================================== */

/* Portal iframe container */
.gh-portal-root {
    direction: rtl !important;
}

/* Override Ghost Portal colors */
[data-gh-portal],
.gh-portal-popup-wrapper,
.gh-portal-popup-container {
    --brandcolor: #7C6AEB !important;
}

/* Mobile Portal fixes */
@media (max-width: 480px) {
    .gh-portal-popup-container {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .gh-portal-popup-wrapper {
        padding: 0 !important;
    }
}

/* ==========================================================================
   7. COMMENTS SECTION - Custom Styling
   ========================================================================== */
.article-comments {
    padding: var(--space-10) 0;
    margin-block-start: var(--space-10);
    border-block-start: 1px solid var(--color-border);
    direction: rtl;
    text-align: right;
}

.comments-title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-block-end: var(--space-6);
    text-align: right;
}

/* Ghost Comments Styling */
.gh-comments,
[data-ghost-comments] {
    direction: rtl !important;
    text-align: right !important;
}

/* Comments container */
.ghost-comments-root,
.gh-comment-list {
    direction: rtl;
    text-align: right;
}

/* Comment form */
.gh-comment-form {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-block-end: var(--space-6);
    direction: rtl;
    text-align: right;
}

/* Comment box styling */
[data-testid="comment-component"],
.gh-comment {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-block-end: var(--space-4);
    direction: rtl;
    text-align: right;
}

/* Comment header */
.gh-comment-header {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-3);
}

/* Comment author avatar */
.gh-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.gh-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Comment content */
.gh-comment-content {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-text);
    direction: rtl;
    text-align: right;
}

/* Comment actions */
.gh-comment-actions {
    display: flex;
    flex-direction: row-reverse;
    gap: var(--space-3);
    margin-block-start: var(--space-3);
}

/* Comment buttons */
.gh-comment-btn,
.gh-comment-reply-btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-family: inherit;
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gh-comment-btn:hover,
.gh-comment-reply-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Comments CTA for non-members */
.gh-comments-cta,
.gh-comment-signup {
    background: linear-gradient(135deg, #7C6AEB 0%, #4F46E5 100%);
    color: white;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    text-align: center;
    direction: rtl;
}

.gh-comments-cta h4,
.gh-comment-signup h4 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-block-end: var(--space-3);
    color: white;
}

.gh-comments-cta p,
.gh-comment-signup p {
    font-size: var(--text-base);
    opacity: 0.9;
    margin-block-end: var(--space-4);
    color: white;
}

.gh-comments-cta a,
.gh-comment-signup a,
.gh-comments-cta button,
.gh-comment-signup button {
    display: inline-block;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    font-family: inherit;
    background: white;
    color: #7C6AEB;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.gh-comments-cta a:hover,
.gh-comment-signup a:hover,
.gh-comments-cta button:hover,
.gh-comment-signup button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* No comments state */
.gh-comments-empty {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-secondary);
}

/* Comment count */
.gh-comment-count {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-block-end: var(--space-4);
}

/* Textarea for comments */
.gh-comment-textarea,
[data-ghost-comments] textarea {
    width: 100%;
    min-height: 120px;
    padding: var(--space-4);
    font-size: var(--text-base);
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    resize: vertical;
    direction: rtl;
    text-align: right;
    outline: none;
    transition: border-color var(--transition-fast);
}

.gh-comment-textarea:focus,
[data-ghost-comments] textarea:focus {
    border-color: var(--color-primary);
}

/* Submit comment button */
.gh-comment-submit,
[data-ghost-comments] button[type="submit"] {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    font-family: inherit;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.gh-comment-submit:hover,
[data-ghost-comments] button[type="submit"]:hover {
    background: var(--color-primary-hover);
    transform: scale(1.02);
}

/* Login link in comments */
.gh-comment-login-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
}

/* ==========================================================================
   8. ADDITIONAL RTL FIXES
   ========================================================================== */

/* Breadcrumb */
.breadcrumb-list {
    direction: rtl;
    flex-direction: row-reverse;
}

.breadcrumb-item::after {
    content: '/';
    margin-inline-start: var(--space-2);
    opacity: 0.5;
}

/* Post navigation */
.post-navigation {
    direction: rtl;
}

.post-nav-prev {
    text-align: right;
}

.post-nav-next {
    text-align: left;
}

/* Author box */
.author-box {
    direction: rtl;
    text-align: right;
    flex-direction: row-reverse;
}

/* Related posts */
.related-posts {
    direction: rtl;
}

.related-feed {
    direction: rtl;
}

/* Footer navigation */
.footer-nav-list {
    direction: rtl;
    text-align: right;
}

/* Mobile menu */
.mobile-menu-panel {
    direction: rtl;
    text-align: right;
}

.mobile-nav-list {
    direction: rtl;
}

/* Search */
.search-input-wrapper {
    direction: rtl;
}

.search-input {
    direction: rtl;
    text-align: right;
}

/* Pagination */
.pagination {
    direction: rtl;
}

.pagination-inner {
    direction: rtl;
    flex-direction: row-reverse;
}

/* ==========================================================================
   FINAL RTL + APPLE STYLE ALIGNMENTS
   ========================================================================== */

/* Header: logo on the right, actions on the left */
[dir="rtl"] .header-inner {
    flex-direction: row;
    direction: rtl;
}

[dir="rtl"] .header-actions {
    flex-direction: row;
    direction: rtl;
}

[dir="rtl"] .nav-list {
    flex-direction: row;
    direction: rtl;
}

/* Table of contents: rebuilt full-width block (single column) */
.article-toc-wrapper {
    max-width: var(--content-width);
    width: min(100%, var(--content-width));
    margin-inline: auto;
    margin-block-end: var(--space-8);
    padding-inline: var(--space-4);
}

#article-toc {
    position: static;
    width: 100%;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    direction: rtl;
    text-align: right;
    box-shadow: var(--shadow-sm);
}

#article-toc .toc-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
    padding-block-end: var(--space-3);
    border-block-end: 1px solid var(--color-border);
    direction: rtl;
    text-align: right;
}

#article-toc .toc-title {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text);
}

#article-toc .toc-content {
    display: block;
    direction: rtl;
    text-align: right;
    max-height: none;
    overflow: visible;
}

#article-toc .toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: block;
}

#article-toc .toc-item {
    margin: 0 0 var(--space-2);
}

#article-toc .toc-item:last-child {
    margin-block-end: 0;
}

#article-toc .toc-item a {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    text-align: right;
    direction: rtl;
    transition: all var(--transition-fast);
}

#article-toc .toc-item a::before {
    content: none;
}

#article-toc .toc-item a:hover,
#article-toc .toc-item a.active {
    color: var(--color-primary);
    background: var(--color-bg-tertiary);
    border-color: var(--color-primary);
}

#article-toc .toc-h3 a {
    padding-inline-start: calc(var(--space-4) + var(--space-3));
    font-size: var(--text-sm);
}

/* Newsletter: card container (article-width) */
[dir="rtl"] .newsletter-cta {
    padding: var(--space-12) 0;
    background: transparent;
    color: var(--color-text);
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .newsletter-cta::before {
    content: none;
}

[dir="rtl"] .newsletter-inner {
    width: min(100%, var(--content-width));
    max-width: var(--content-width);
    margin-inline: auto;
    padding: var(--space-6);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
}

[dir="rtl"] .newsletter-content {
    flex: 1 1 auto;
    min-width: 0;
    text-align: right;
}

[dir="rtl"] .newsletter-title {
    font-size: var(--text-xl);
    color: var(--color-text);
    margin-block-end: var(--space-2);
}

[dir="rtl"] .newsletter-description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

[dir="rtl"] .newsletter-form {
    flex: 0 0 360px;
    max-width: 420px;
    width: 100%;
}

[dir="rtl"] .newsletter-form .form-group {
    display: flex;
    flex-direction: row;
    gap: var(--space-2);
    align-items: stretch;
}

[dir="rtl"] .newsletter-form .form-input {
    flex: 1;
    width: auto;
    min-width: 180px;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-family: inherit;
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    text-align: left;
    direction: ltr;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

[dir="rtl"] .newsletter-form .form-input::placeholder {
    color: var(--color-text-tertiary);
}

[dir="rtl"] .newsletter-form .form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
    background: var(--color-surface);
}

[dir="rtl"] .newsletter-form .form-submit {
    width: auto;
    flex: 0 0 auto;
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: 700;
    font-family: inherit;
    background: var(--color-primary);
    color: var(--color-text-inverted);
    border: none;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}

[dir="rtl"] .newsletter-form .form-submit:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
    [dir="rtl"] .newsletter-cta {
        padding: var(--space-10) 0;
    }

    [dir="rtl"] .newsletter-inner {
        padding: var(--space-5);
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-4);
    }

    [dir="rtl"] .newsletter-form {
        flex: 1 1 auto;
        max-width: none;
    }

    [dir="rtl"] .newsletter-form .form-group {
        flex-direction: column;
    }

    [dir="rtl"] .newsletter-form .form-input {
        width: 100%;
        min-width: 0;
    }

    [dir="rtl"] .newsletter-form .form-submit {
        width: 100%;
    }
}

/* Tags: right-to-left order */
[dir="rtl"] .article-tags {
    direction: rtl;
    flex-direction: row;
    justify-content: flex-start;
    text-align: right;
}

.article-tag {
    text-transform: none;
    letter-spacing: 0;
}

[dir="rtl"] .article-footer-tags {
    direction: rtl;
    flex-direction: row;
    justify-content: flex-start;
    text-align: right;
}

[dir="rtl"] .footer-tags-list {
    direction: rtl;
    flex-direction: row;
    justify-content: flex-start;
}

.footer-tag {
    text-transform: none;
    letter-spacing: 0;
}

/* Article meta: compact, single-row */
[dir="rtl"] .article-meta {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    direction: rtl;
    text-align: right;
    overflow: hidden;
}

[dir="rtl"] .article-author {
    flex-direction: row;
    gap: var(--space-2);
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 0;
}

.author-avatar {
    width: 28px;
    height: 28px;
}

.author-avatar-placeholder {
    font-size: var(--text-xs);
}

[dir="rtl"] .author-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
    min-width: 0;
}

[dir="rtl"] .article-meta .author-name {
    font-size: var(--text-sm);
    line-height: 1.2;
    margin: 0;
    display: inline-block;
    max-width: min(38vw, 24ch);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[dir="rtl"] .article-date-reading {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    white-space: nowrap;
    line-height: 1.2;
}

[dir="rtl"] .article-share {
    margin-inline-start: auto;
}

.share-buttons {
    gap: var(--space-2);
}

.share-btn {
    width: 28px;
    height: 28px;
}

.share-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    [dir="rtl"] .article-meta {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
    }

    .author-avatar {
        width: 24px;
        height: 24px;
    }

    .share-btn {
        width: 26px;
        height: 26px;
    }
}

/* Ghost Portal: align popup style with theme */
[data-gh-portal],
.gh-portal-popup-wrapper,
.gh-portal-popup-container {
    --brandcolor: var(--color-primary) !important;
    --brandcolor-dark: var(--color-primary) !important;
}

.gh-portal-popup-wrapper {
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(8px);
}

.gh-portal-popup-container {
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-xl) !important;
    border: 1px solid var(--color-border) !important;
    overflow: hidden;
}

/* Portal popup: prevent clipping on mobile */
@media (max-width: 768px) {
    .gh-portal-popup-wrapper {
        padding: 0 !important;
    }

    .gh-portal-popup-container {
        position: fixed !important;
        inset: 0 !important;
        inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left) !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        transform: none !important;
    }
}

/* Comments CTA: match theme */
.gh-comments-cta,
.gh-comment-signup {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    text-align: right;
    direction: rtl;
}

.gh-comments-cta h4,
.gh-comment-signup h4 {
    color: var(--color-text);
}

.gh-comments-cta p,
.gh-comment-signup p {
    color: var(--color-text-secondary);
}

.gh-comments-cta a,
.gh-comment-signup a,
.gh-comments-cta button,
.gh-comment-signup button {
    background: var(--color-primary);
    color: var(--color-text-inverted);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.gh-comments-cta a:hover,
.gh-comment-signup a:hover,
.gh-comments-cta button:hover,
.gh-comment-signup button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   CLEAN TABLE OF CONTENTS (Rebuilt)
   ========================================================================== */

.ar-toc {
    margin-block-end: var(--space-8);
}

.ar-toc-details {
    width: 100%;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    direction: rtl;
    text-align: right;
    overflow: hidden;
}

.ar-toc-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.ar-toc-summary::-webkit-details-marker {
    display: none;
}

.ar-toc-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--color-text);
}

.ar-toc-chevron {
    width: 10px;
    height: 10px;
    border-inline-end: 2px solid var(--color-text-secondary);
    border-block-end: 2px solid var(--color-text-secondary);
    transform: rotate(45deg);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    flex-shrink: 0;
}

.ar-toc-details[open] .ar-toc-chevron {
    transform: rotate(225deg);
    border-color: var(--color-text);
}

.ar-toc-summary:focus-visible {
    outline: 2px solid rgba(0, 113, 227, 0.35);
    outline-offset: -2px;
}

.ar-toc-content {
    padding: var(--space-4) var(--space-5) var(--space-5);
    border-block-start: 1px solid var(--color-border);
    direction: rtl;
    text-align: right;
}

.ar-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.ar-toc-item {
    margin: 0;
}

.ar-toc-link {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    text-decoration: none;
    border: 1px solid transparent;
    border-inline-start: 2px solid transparent;
    background: transparent;
    transition: all var(--transition-fast);
}

.ar-toc-link:hover,
.ar-toc-link.is-active {
    color: var(--color-text);
    background: var(--color-surface);
    border-color: var(--color-border);
    border-inline-start-color: var(--color-primary);
}

.ar-toc-h3 .ar-toc-link {
    padding-inline-start: calc(var(--space-3) + var(--space-4));
    font-size: var(--text-sm);
}

@media (max-width: 768px) {
    .ar-toc-summary {
        padding: var(--space-3) var(--space-4);
    }

    .ar-toc-content {
        padding: var(--space-3) var(--space-4) var(--space-4);
    }

    .ar-toc-link {
        padding: var(--space-2) var(--space-3);
    }

    .ar-toc-h3 .ar-toc-link {
        padding-inline-start: calc(var(--space-3) + var(--space-3));
    }
}

/* ==========================================================================
   GHOST COMMENTS UI - Simple Apple-Style Wrapper + RTL Fixes
   ========================================================================== */

[dir="rtl"] .article-comments #comments-root,
[dir="rtl"] .article-comments #ghost-comments-root,
[dir="rtl"] .article-comments .ghost-comments-root {
    font-family: var(--font-arabic);
    direction: rtl !important;
}

[dir="rtl"] .article-comments #comments-root *,
[dir="rtl"] .article-comments #ghost-comments-root *,
[dir="rtl"] .article-comments .ghost-comments-root * {
    font-family: var(--font-arabic) !important;
}

[dir="rtl"] .article-comments #comments-root,
[dir="rtl"] .article-comments #ghost-comments-root,
[dir="rtl"] .article-comments .ghost-comments-root {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-xs);
}

@media (max-width: 768px) {

    [dir="rtl"] .article-comments #comments-root,
    [dir="rtl"] .article-comments #ghost-comments-root,
    [dir="rtl"] .article-comments .ghost-comments-root {
        padding: var(--space-4);
    }
}

/* Fix "Already a member? Sign in" spacing in RTL */
[dir="rtl"] .article-comments #comments-root [data-testid="signin-button"],
[dir="rtl"] .article-comments #ghost-comments-root [data-testid="signin-button"],
[dir="rtl"] .article-comments .ghost-comments-root [data-testid="signin-button"] {
    margin-inline-start: var(--space-2);
}

/* Make CTA buttons closer to theme style */
[dir="rtl"] .article-comments #comments-root button,
[dir="rtl"] .article-comments #ghost-comments-root button,
[dir="rtl"] .article-comments .ghost-comments-root button {
    font-family: inherit;
    border-radius: var(--radius-full) !important;
}

/* Override Ghost comments CTA accent (pink) */
[dir="rtl"] .article-comments #comments-root [data-testid="signup-button"],
[dir="rtl"] .article-comments #ghost-comments-root [data-testid="signup-button"],
[dir="rtl"] .article-comments .ghost-comments-root [data-testid="signup-button"] {
    background-color: var(--color-primary) !important;
    color: var(--color-text-inverted) !important;
    border-radius: var(--radius-full) !important;
    box-shadow: var(--shadow-sm) !important;
}

[dir="rtl"] .article-comments #comments-root [data-testid="signin-button"],
[dir="rtl"] .article-comments #ghost-comments-root [data-testid="signin-button"],
[dir="rtl"] .article-comments .ghost-comments-root [data-testid="signin-button"] {
    color: var(--color-primary) !important;
    font-weight: 700 !important;
}

/* ==========================================================================
   HOMEPAGE - Professional Layout
   ========================================================================== */

.home-template .hero {
    min-height: 56vh;
    padding: var(--space-16) 0;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 20% 20%, rgba(0, 113, 227, 0.12), transparent 45%),
        radial-gradient(circle at 80% 60%, rgba(0, 113, 227, 0.06), transparent 40%),
        var(--color-bg);
}

.home-template .hero::before {
    content: none;
}

.home-template .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.home-template .hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.12);
    filter: saturate(0.4) contrast(0.95) brightness(1.08) blur(22px);
}

.home-template .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(245, 245, 247, 0.94) 0%,
            rgba(245, 245, 247, 0.97) 55%,
            rgba(255, 255, 255, 0.995) 100%);
}

.theme-dark .home-template .hero-overlay,
[data-theme="dark"] .home-template .hero-overlay {
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.55) 0%,
            rgba(0, 0, 0, 0.72) 60%,
            rgba(0, 0, 0, 0.9) 100%);
}

.home-template .hero-inner {
    position: static;
}

.home-template .hero-content {
    max-width: 860px;
    margin-inline: auto;
    padding: var(--space-12) var(--space-10);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    color: var(--color-text);
    text-align: center;
}

.home-template .hero--بسيط .hero-content {
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: var(--space-10) 0;
}

.theme-dark .home-template .hero:not(.hero--بسيط) .hero-content,
[data-theme="dark"] .home-template .hero:not(.hero--بسيط) .hero-content {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.12);
}

.home-template .hero-logo img {
    height: 64px;
    width: auto;
    margin-inline: auto;
    filter: none;
}

.home-template .hero-title {
    font-size: var(--text-4xl);
}

.home-template .hero-description {
    color: var(--color-text-secondary);
    margin-block-end: var(--space-6);
}

.home-template .hero-cta {
    gap: var(--space-3);
}

.home-template .hero-cta .btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverted);
    box-shadow: var(--shadow-sm);
}

.home-template .hero-cta .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.home-template .hero-cta .btn-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.home-template .hero-cta .btn-secondary:hover {
    background: var(--color-bg-tertiary);
}

.home-template .hero-scroll {
    display: none;
}

@media (max-width: 768px) {
    .home-template .hero {
        min-height: 48vh;
        padding: var(--space-12) 0;
    }

    .home-template .hero-content {
        padding: var(--space-8) var(--space-6);
        border-radius: var(--radius-lg);
    }

    .home-template .hero-logo img {
        height: 56px;
    }
}

/* Homepage posts */
.home-template .home-posts {
    padding-block: var(--space-12) var(--space-16);
    background: var(--color-bg);
    border-block-start: 1px solid var(--color-border);
}

.home-template .home-posts__inner {
    width: 100%;
}

.home-template .posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-block-end: var(--space-8);
    padding-block-end: var(--space-5);
    border-block-end: 1px solid var(--color-border);
}

.home-template .posts-title {
    font-size: var(--text-2xl);
    font-weight: 800;
}

.home-template .posts-count {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.home-template .posts-feed--rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.home-template .posts-feed--rows .adsense-block--feed {
    margin-block: var(--space-4);
}

.home-template .post-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--space-6);
    align-items: center;
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    direction: rtl;
    text-align: right;
}

.home-template .post-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 113, 227, 0.25);
}

.home-template .post-row--no-image {
    grid-template-columns: 1fr;
}

.home-template .post-row-image {
    display: block;
    width: 160px;
    height: 104px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.home-template .post-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-template .post-row-content {
    min-width: 0;
}

.home-template .post-row-top {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-2);
    flex-wrap: wrap;
}

.home-template .post-row-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-3);
    border-radius: var(--radius-full);
    background: rgba(0, 113, 227, 0.08);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 800;
    text-decoration: none;
}

.home-template .post-row-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-3);
    border-radius: var(--radius-full);
    background: rgba(255, 159, 10, 0.12);
    color: #b45309;
    font-size: var(--text-xs);
    font-weight: 900;
    white-space: nowrap;
}

.theme-dark .home-template .post-row-badge,
[data-theme="dark"] .home-template .post-row-badge {
    background: rgba(255, 159, 10, 0.18);
    color: #fbbf24;
}

.home-template .post-row-title {
    font-size: var(--text-lg);
    font-weight: 900;
    line-height: var(--leading-snug);
    margin: 0 0 var(--space-2);
}

.home-template .post-row-title a {
    color: inherit;
    text-decoration: none;
}

.home-template .post-row-title a:hover {
    color: var(--color-primary);
}

.home-template .post-row-excerpt {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-3);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-template .post-row-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

.home-template .posts-feed--cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-8);
}

.home-template .posts-feed--list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.home-template .posts-feed--magazine {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: var(--space-8);
}

.home-template .posts-feed--magazine .post-card:first-child {
    grid-row: span 2;
}

@media (max-width: 1024px) {
    .home-template .posts-feed--cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-template .posts-feed--magazine {
        grid-template-columns: 1fr;
    }

    .home-template .posts-feed--magazine .post-card:first-child {
        grid-row: auto;
    }
}

@media (max-width: 600px) {
    .home-template .posts-feed--cards {
        grid-template-columns: 1fr;
    }

    .home-template .post-row {
        grid-template-columns: 110px 1fr;
        gap: var(--space-4);
        padding: var(--space-4);
    }

    .home-template .post-row-image {
        width: 110px;
        height: 80px;
    }

    .home-template .post-row-title {
        font-size: var(--text-base);
    }

    .home-template .post-row-excerpt {
        display: none;
    }
}

/* Post cards (homepage) */
.home-template .post-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    direction: rtl;
    text-align: right;
}

.home-template .post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 113, 227, 0.25);
}

.home-template .post-card-image {
    aspect-ratio: 16/9;
}

.home-template .post-card-image img {
    transition: transform var(--transition-slow);
}

.home-template .post-card:hover .post-card-image img {
    transform: scale(1.03);
}

.home-template .post-card-content {
    padding: var(--space-6);
}

.home-template .post-card-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    margin-block-end: var(--space-3);
    border-radius: var(--radius-full);
    background: rgba(0, 113, 227, 0.08);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.home-template .post-card-title {
    font-size: var(--text-lg);
    font-weight: 800;
    line-height: var(--leading-snug);
    margin-block-end: var(--space-3);
}

.home-template .post-card-excerpt {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    margin-block-end: var(--space-5);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-template .post-card-meta {
    border-block-start: 1px solid var(--color-border);
    padding-block-start: var(--space-4);
    gap: var(--space-4);
}

.home-template .post-card-author-avatar {
    width: 26px;
    height: 26px;
}

.home-template .post-card-author-name {
    font-weight: 600;
}

.home-template .post-card-info {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

/* Magazine highlight */
.home-template .posts-feed--magazine .post-card:first-child .post-card-title {
    font-size: var(--text-xl);
}

.home-template .posts-feed--magazine .post-card:first-child .post-card-excerpt {
    -webkit-line-clamp: 3;
}

/* List layout */
.home-template .posts-feed--list .post-card {
    display: grid;
    grid-template-columns: 240px 1fr;
}

.home-template .posts-feed--list .post-card-image {
    aspect-ratio: auto;
    height: 100%;
}

.home-template .posts-feed--list .post-card-image img {
    height: 100%;
}

@media (max-width: 768px) {
    .home-template .posts-feed--list .post-card {
        grid-template-columns: 1fr;
    }

    .home-template .post-card-content {
        padding: var(--space-5);
    }
}

/* ==========================================================================
   Policy Pages (Privacy, Terms) & Legal Links
   ========================================================================== */

/* Page Header */
.page-template .page-header {
    text-align: center;
    padding: var(--space-16) 0 var(--space-12);
    background: linear-gradient(135deg, var(--color-bg-secondary), var(--color-bg));
    border-block-end: 1px solid var(--color-border);
}

.page-template .page-title {
    font-size: var(--text-4xl);
    font-weight: 800;
    margin-block-end: var(--space-3);
    background: linear-gradient(135deg, var(--color-text), var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-template .page-subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

/* Policy Content */
.page-privacy .page-content,
.page-terms .page-content {
    padding: var(--space-12) 0 var(--space-20);
    max-width: var(--content-width);
}

.policy-section {
    margin-block-end: var(--space-10);
    padding-block-end: var(--space-10);
    border-block-end: 1px solid var(--color-border);
}

.policy-section:last-child {
    border-block-end: none;
    margin-block-end: 0;
    padding-block-end: 0;
}

.policy-section h2 {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-block-end: var(--space-4);
    color: var(--color-text);
}

.policy-section h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-block-start: var(--space-6);
    margin-block-end: var(--space-3);
    color: var(--color-text);
}

.policy-section p {
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-block-end: var(--space-4);
}

.policy-section ul {
    list-style: none;
    padding: 0;
    margin-block-end: var(--space-4);
}

.policy-section li {
    position: relative;
    padding-inline-start: var(--space-6);
    margin-block-end: var(--space-3);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

.policy-section li::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    border-radius: 50%;
}

.policy-section a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: rgba(0, 113, 227, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color var(--transition-fast);
}

.policy-section a:hover {
    text-decoration-color: var(--color-primary);
}

/* Footer Legal Links */
.footer-legal {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: var(--space-3);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.footer-legal a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--color-primary);
}

.footer-legal .separator {
    color: var(--color-text-tertiary);
    font-size: 0.8em;
}

/* Footer Bottom Updates */
.footer-bottom {
    padding-block-start: var(--space-6);
    border-block-start: 1px solid var(--color-border);
}

.footer-bottom-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-6);
}

.footer-copyright {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* Contact Page Styles (inline styles backup) */
.page-contact .page-content {
    padding: var(--space-12) 0 var(--space-20);
}

.page-contact .contact-intro {
    text-align: center;
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-10);
}

@media (max-width: 768px) {
    .page-template .page-header {
        padding: var(--space-10) 0 var(--space-8);
    }

    .page-template .page-title {
        font-size: var(--text-3xl);
    }

    .page-privacy .page-content,
    .page-terms .page-content,
    .page-contact .page-content {
        padding: var(--space-8) 0 var(--space-12);
    }

    .footer-legal {
        flex-wrap: wrap;
        white-space: normal;
        gap: var(--space-2);
        justify-content: center;
    }

    .footer-legal .separator {
        display: none;
    }

    .footer-bottom-row {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: var(--space-3);
    }

    .footer-copyright {
        white-space: normal;
        width: auto;
    }
}

/* ==========================================================================
   Mobile Fixes - Header + Portal
   ========================================================================== */

:root {
    --viewport-height: 100vh;
}

@supports (height: 100dvh) {
    :root {
        --viewport-height: 100dvh;
    }
}

/* Prevent horizontal "wiggle" on mobile */
html,
body {
    overflow-x: hidden;
}

@supports (overflow-x: clip) {

    html,
    body {
        overflow-x: clip;
    }
}

@media (max-width: 768px) {

    /* Header: prevent logo/title from pushing actions off-screen */
    .header-brand {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-logo {
        min-width: 0;
        max-width: 100%;
    }

    .header-logo img {
        max-width: min(46vw, 150px);
    }

    .header-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }

    .header-actions {
        flex-shrink: 0;
    }

    /* iOS Safari: reduce sticky/backdrop jitter */
    .site-header {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        padding-top: env(safe-area-inset-top);
    }

    /* Ghost Portal: keep signup/signin popup fully visible on mobile */
    .gh-portal-popup-wrapper {
        height: var(--viewport-height) !important;
        max-height: var(--viewport-height) !important;
    }

    .gh-portal-popup-container {
        position: fixed !important;
        top: env(safe-area-inset-top) !important;
        right: env(safe-area-inset-right) !important;
        bottom: env(safe-area-inset-bottom) !important;
        left: env(safe-area-inset-left) !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   PAGINATED PAGES STYLES (page/2, page/3, etc.)
   Duplicate of home-template styles to ensure consistency on all pages
   ========================================================================== */

/* Paginated posts section */
.paged .home-posts {
    padding-block: var(--space-12) var(--space-16);
    background: var(--color-bg);
    border-block-start: 1px solid var(--color-border);
}

.paged .home-posts__inner {
    width: 100%;
}

.paged .posts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-block-end: var(--space-8);
    padding-block-end: var(--space-5);
    border-block-end: 1px solid var(--color-border);
}

.paged .posts-title {
    font-size: var(--text-2xl);
    font-weight: 800;
}

.paged .posts-count {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.paged .posts-feed--rows {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.paged .posts-feed--rows .adsense-block--feed {
    margin-block: var(--space-4);
}

.paged .post-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--space-6);
    align-items: center;
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    direction: rtl;
    text-align: right;
}

.paged .post-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 113, 227, 0.25);
}

.paged .post-row--no-image {
    grid-template-columns: 1fr;
}

.paged .post-row-image {
    display: block;
    width: 160px;
    height: 104px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.paged .post-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.paged .post-row-content {
    min-width: 0;
}

.paged .post-row-top {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-2);
    flex-wrap: wrap;
}

.paged .post-row-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-3);
    border-radius: var(--radius-full);
    background: rgba(0, 113, 227, 0.08);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 800;
    text-decoration: none;
}

.paged .post-row-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-3);
    border-radius: var(--radius-full);
    background: rgba(255, 159, 10, 0.12);
    color: #b45309;
    font-size: var(--text-xs);
    font-weight: 900;
    white-space: nowrap;
}

.theme-dark .paged .post-row-badge,
[data-theme="dark"] .paged .post-row-badge {
    background: rgba(255, 159, 10, 0.18);
    color: #fbbf24;
}

.paged .post-row-title {
    font-size: var(--text-lg);
    font-weight: 900;
    line-height: var(--leading-snug);
    margin: 0 0 var(--space-2);
}

.paged .post-row-title a {
    color: inherit;
    text-decoration: none;
}

.paged .post-row-title a:hover {
    color: var(--color-primary);
}

.paged .post-row-excerpt {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-3);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paged .post-row-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

/* Paginated page mobile styles */
@media (max-width: 600px) {
    .paged .post-row {
        grid-template-columns: 110px 1fr;
        gap: var(--space-4);
        padding: var(--space-4);
    }

    .paged .post-row-image {
        width: 110px;
        height: 80px;
    }

    .paged .post-row-title {
        font-size: var(--text-base);
    }

    .paged .post-row-excerpt {
        display: none;
    }
}

/* Pagination styling for paged */
.paged .pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    margin-block-start: var(--space-10);
    padding-block-start: var(--space-8);
    border-block-start: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Redesign Updates (2025)
   -------------------------------------------------------------------------- */

/* Topics Navigation */
.topics-nav {
    margin-bottom: var(--space-8);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
}

.topics-list {
    display: flex;
    gap: var(--space-3);
    list-style: none;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

.topic-item {
    display: inline-flex;
    padding: var(--space-2) var(--space-5);
    background: var(--color-bg-secondary);
    color: var(--color-text);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.topic-item:hover {
    background: var(--color-primary);
    color: var(--color-text-inverted);
    text-decoration: none;
}

/* Grid Layout */
.posts-feed--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-8);
}

@media (max-width: 600px) {
    .posts-feed--grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
}

/* Post Card */
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    height: 100%;
    border: 1px solid var(--color-border);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.post-card-image-link {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-bg-secondary);
}

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

.post-card:hover .post-card-image {
    transform: scale(1.03);
}

.post-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
}

.post-card-tags {
    margin-bottom: var(--space-3);
}

.post-card-tag {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-2);
    line-height: var(--leading-snug);
}

.post-card-title a {
    color: var(--color-text);
}

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

.post-card-excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    font-weight: 500;
}

/* Hero Redesign */
.hero-visual {
    width: 100%;
    margin-top: var(--space-8);
    display: flex;
    justify-content: center;
}

.hero-gradient-card {
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-secondary) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    max-width: 600px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.hero-gradient-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 113, 227, 0.1), transparent 60%);
    animation: rotate 20s linear infinite;
    z-index: 0;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-card-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
}

.hero-icon-grid {
    display: flex;
    gap: var(--space-6);
    justify-content: center;
}

.hero-icon-item {
    width: 64px;
    height: 64px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--color-primary);
    animation: float 4s ease-in-out infinite;
    animation-delay: var(--d);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.hero-card-text h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.hero-card-text p {
    color: var(--color-text-secondary);
    margin: 0;
}

/* Partner Logos Grayscale */
.partner-logo img {
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all var(--transition-base);
}

.partner-logo:hover img {
    filter: none;
    opacity: 1;
    transform: scale(1.05);
}

/* Newsletter CTA Redesign */
.newsletter-cta {
    background: var(--color-bg-secondary);
    padding: var(--space-8) 0;
    margin-top: var(--space-12);
    border-top: 1px solid var(--color-border);
}

.newsletter-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-6);
}

.newsletter-title {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-2);
}

.newsletter-description {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form-element {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    gap: var(--space-2);
}

.form-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: var(--text-base);
    background: var(--color-surface);
}

.form-submit {
    background: var(--color-primary);
    color: var(--color-text-inverted);
    border: none;
    border-radius: var(--radius-full);
    padding: var(--space-3) var(--space-6);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.form-submit:hover {
    background: var(--color-primary-hover);
}

/* ==========================================================================
   HOMEPAGE REDESIGN - Professional Layout
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero Simple (Split Layout)
   -------------------------------------------------------------------------- */
.hero-simple {
    position: relative;
    padding: var(--space-16) 0 var(--space-12);
    background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg) 100%);
    overflow: hidden;
}

/* Decorative floating orbs */
.hero-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.6;
    z-index: 0;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: floatGentle 8s ease-in-out infinite;
}

.floating-orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.15), transparent 70%);
    top: 10%;
    right: 15%;
    animation-delay: 0s;
}

.floating-orb-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.12), transparent 70%);
    bottom: 20%;
    left: 10%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.floating-orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0, 113, 227, 0.1), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 4s;
    animation-duration: 12s;
}

/* Shimmer button effect */
.shimmer-btn {
    position: relative;
    overflow: hidden;
}

.shimmer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 100%);
    animation: shimmer 3s infinite;
}

/* Floating card animation */
.floating-card {
    animation: floatGentle 6s ease-in-out infinite;
    animation-delay: 0.5s;
}

.hero-simple__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
    align-items: center;
}

.hero-simple__content {
    max-width: 560px;
}

.hero-simple__logo img {
    height: 64px;
    width: auto;
    margin-block-end: var(--space-6);
}

.hero-simple__title {
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: var(--leading-tight);
    margin-block-end: var(--space-4);
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-simple__description {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin-block-end: var(--space-8);
}

.hero-simple__cta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-block-end: var(--space-10);
}

.hero-simple__cta .btn {
    gap: var(--space-3);
}

.hero-simple__cta .btn svg {
    flex-shrink: 0;
}

.hero-simple__stats {
    display: flex;
    gap: var(--space-8);
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.hero-stat__number {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-primary);
}

.hero-stat__label {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

/* Hero Visual Card */
.hero-simple__visual {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.hero-visual-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: rotateY(-5deg) rotateX(2deg);
    transition: transform var(--transition-base);
}

.hero-visual-card:hover {
    transform: rotateY(0) rotateX(0);
}

.hero-visual-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.hero-visual-card__dots {
    display: flex;
    gap: 6px;
}

.hero-visual-card__dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.hero-visual-card__dots span:nth-child(1) {
    background: #ff5f57;
}

.hero-visual-card__dots span:nth-child(2) {
    background: #febc2e;
}

.hero-visual-card__dots span:nth-child(3) {
    background: #28c840;
}

.hero-visual-card__title {
    flex: 1;
    text-align: center;
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

.hero-visual-card__body {
    padding: var(--space-8);
}

.hero-visual-typing {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
}

.typing-cursor {
    width: 2px;
    height: 20px;
    background: var(--color-primary);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.typing-text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.hero-visual-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.hero-feature-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

/* Hero Simple Mobile */
@media (max-width: 900px) {
    .hero-simple__inner {
        grid-template-columns: 1fr;
        gap: var(--space-10);
        text-align: center;
    }

    .hero-simple__content {
        max-width: 100%;
        order: 1;
    }

    .hero-simple__visual {
        order: 2;
    }

    .hero-simple__cta {
        justify-content: center;
    }

    .hero-simple__stats {
        justify-content: center;
    }

    .hero-visual-card {
        transform: none;
        max-width: 360px;
    }
}

@media (max-width: 600px) {
    .hero-simple {
        padding: var(--space-10) 0 var(--space-8);
    }

    .hero-simple__stats {
        gap: var(--space-6);
    }

    .hero-stat__number {
        font-size: var(--text-xl);
    }

    .hero-simple__visual {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Categories Navigation Strip
   -------------------------------------------------------------------------- */
.categories-nav {
    padding: var(--space-6) 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: var(--header-height);
    z-index: 50;
}

.categories-nav__inner {
    position: relative;
}

.categories-nav__scroll {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-inline: var(--space-2);
}

.categories-nav__scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.category-chip:hover {
    background: var(--color-bg-tertiary);
    color: var(--color-text);
    border-color: var(--color-border);
}

.category-chip--active {
    background: var(--color-primary);
    color: var(--color-text-inverted);
}

.category-chip--active:hover {
    background: var(--color-primary-hover);
    color: var(--color-text-inverted);
    border-color: transparent;
}

.category-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 var(--space-2);
    background: rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.theme-dark .category-chip__count,
[data-theme="dark"] .category-chip__count {
    background: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   Bento Featured Grid
   -------------------------------------------------------------------------- */
.bento-featured {
    padding: var(--space-12) 0;
    background: var(--color-bg);
}

.bento-featured__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}

.bento-featured__title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
}

.bento-featured__title svg {
    color: var(--color-warning);
}

.bento-featured__link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
}

.bento-featured__link:hover {
    text-decoration: underline;
}

[dir="rtl"] .bento-featured__link svg {
    transform: scaleX(-1);
}

/* Bento Grid Layout */
.bento-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    grid-template-rows: repeat(2, 200px);
    gap: var(--space-6);
}

.bento-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.bento-card--large {
    grid-row: span 2;
}

.bento-card__image-link {
    display: block;
    position: absolute;
    inset: 0;
}

.bento-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bento-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
}

.bento-card__content {
    position: absolute;
    inset: auto 0 0 0;
    padding: var(--space-6);
    color: #fff;
    z-index: 1;
}

.bento-card__tag {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    margin-bottom: var(--space-3);
}

.bento-card__tag:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.bento-card__title {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: var(--leading-snug);
    margin: 0;
}

.bento-card--large .bento-card__title {
    font-size: var(--text-2xl);
}

.bento-card__title a {
    color: inherit;
    text-decoration: none;
}

.bento-card__title a:hover {
    text-decoration: underline;
}

.bento-card__excerpt {
    font-size: var(--text-sm);
    opacity: 0.9;
    margin: var(--space-3) 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-card__meta {
    font-size: var(--text-xs);
    opacity: 0.7;
    margin-top: var(--space-3);
}

/* Bento Grid Mobile */
@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bento-card {
        height: 280px;
    }

    .bento-card--large {
        grid-row: span 1;
        height: 320px;
    }
}

/* --------------------------------------------------------------------------
   Posts Grid Section
   -------------------------------------------------------------------------- */
.posts-grid-section {
    padding: var(--space-12) 0 var(--space-16);
    background: var(--color-bg-secondary);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
}

.section-title svg {
    color: var(--color-primary);
}

.section-meta {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

@media (max-width: 1000px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Post Card (Grid Item)
   -------------------------------------------------------------------------- */
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 113, 227, 0.2);
}

.post-card-image-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.post-card-image-wrapper {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 aspect ratio */
    background: var(--color-bg-secondary);
}

.post-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

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

.post-card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.post-card:hover .post-card-image-overlay {
    opacity: 1;
}

.post-card--no-image .post-card-image-link {
    display: none;
}

.post-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
}

.post-card-meta-top {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.post-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px var(--space-3);
    background: rgba(0, 113, 227, 0.08);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.post-card-tag:hover {
    background: rgba(0, 113, 227, 0.15);
    color: var(--color-primary);
}

.post-card-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-3);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.post-card-title {
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: var(--leading-snug);
    margin: 0 0 var(--space-3);
    flex-grow: 0;
}

.post-card-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.post-card-excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin: 0 0 var(--space-4);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.post-card-author {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.post-card-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.post-card-author-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

.post-card-author-name {
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text);
}

.post-card-meta-info {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

.post-card-meta-info .separator {
    opacity: 0.5;
}

/* AdSense in grid */
.adsense-block--grid {
    grid-column: 1 / -1;
}

/* ==========================================================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet (max-width: 900px)
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {

    /* Hero Simple */
    .hero-simple {
        padding: var(--space-12) 0 var(--space-10);
    }

    .hero-simple__inner {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .hero-simple__content {
        max-width: 100%;
        order: 1;
    }

    .hero-simple__logo img {
        margin-inline: auto;
    }

    .hero-simple__cta {
        justify-content: center;
    }

    .hero-simple__stats {
        justify-content: center;
    }

    .hero-simple__visual {
        order: 2;
        display: none;
    }

    /* Bento Grid */
    .bento-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .bento-card--large {
        grid-column: span 2;
        grid-row: span 1;
        height: 300px;
    }

    .bento-card:not(.bento-card--large) {
        height: 240px;
    }

    /* Posts Grid */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-5);
    }
}

/* --------------------------------------------------------------------------
   Mobile (max-width: 600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {

    /* General spacing */
    .gh-inner {
        padding-inline: var(--space-4);
    }

    /* Hero Simple */
    .hero-simple {
        padding: var(--space-8) 0 var(--space-6);
    }

    .hero-simple__title {
        font-size: var(--text-2xl);
    }

    .hero-simple__description {
        font-size: var(--text-base);
        margin-block-end: var(--space-6);
    }

    .hero-simple__cta {
        flex-direction: column;
        width: 100%;
        gap: var(--space-3);
        margin-block-end: var(--space-8);
    }

    .hero-simple__cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-simple__stats {
        flex-direction: row;
        justify-content: space-around;
        gap: var(--space-4);
        width: 100%;
    }

    .hero-stat {
        align-items: center;
        text-align: center;
    }

    .hero-stat__number {
        font-size: var(--text-lg);
    }

    .hero-stat__label {
        font-size: var(--text-xs);
    }

    /* Categories Navigation */
    .categories-nav {
        padding: var(--space-4) 0;
    }

    .categories-nav__scroll {
        gap: var(--space-2);
        padding-inline: var(--space-1);
    }

    .category-chip {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }

    .category-chip__count {
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }

    /* Bento Featured */
    .bento-featured {
        padding: var(--space-8) 0;
    }

    .bento-featured__header {
        margin-bottom: var(--space-6);
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    .bento-featured__title {
        font-size: var(--text-lg);
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: var(--space-4);
    }

    .bento-card,
    .bento-card--large {
        grid-column: span 1;
        grid-row: span 1;
        height: 260px;
    }

    .bento-card__content {
        padding: var(--space-4);
    }

    .bento-card__title {
        font-size: var(--text-base);
    }

    .bento-card--large .bento-card__title {
        font-size: var(--text-lg);
    }

    .bento-card__excerpt {
        display: none;
    }

    /* Posts Grid Section */
    .posts-grid-section {
        padding: var(--space-8) 0 var(--space-12);
    }

    .section-header {
        margin-bottom: var(--space-6);
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .section-title {
        font-size: var(--text-lg);
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    /* Post Card */
    .post-card {
        border-radius: var(--radius-lg);
    }

    .post-card-content {
        padding: var(--space-4);
    }

    .post-card-title {
        font-size: var(--text-base);
    }

    .post-card-excerpt {
        font-size: var(--text-sm);
        -webkit-line-clamp: 2;
    }

    .post-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    /* Partners Strip */
    .partners-strip {
        padding: var(--space-6) 0;
    }

    .partners-strip__title {
        font-size: var(--text-sm);
    }

    .partner-logo img {
        height: 24px;
    }

    .partner-logo__label {
        font-size: 10px;
    }
}

/* --------------------------------------------------------------------------
   Small Mobile (max-width: 400px)
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
    .hero-simple__title {
        font-size: var(--text-xl);
    }

    .hero-simple__stats {
        flex-direction: column;
        gap: var(--space-3);
    }

    .hero-stat {
        flex-direction: row;
        gap: var(--space-2);
    }

    .bento-card,
    .bento-card--large {
        height: 220px;
    }

    .post-card-image-wrapper {
        padding-top: 50%;
        /* Shorter aspect ratio on small screens */
    }
}

/* --------------------------------------------------------------------------
   Touch Device Optimizations
   -------------------------------------------------------------------------- */
@media (hover: none) and (pointer: coarse) {
    .post-card:hover {
        transform: none;
    }

    .post-card:hover .post-card-image {
        transform: none;
    }

    .bento-card:hover {
        transform: none;
    }

    .hero-visual-card {
        transform: none;
    }

    .hero-visual-card:hover {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Landscape Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 900px) and (orientation: landscape) {
    .hero-simple {
        padding: var(--space-8) 0;
        min-height: auto;
    }

    .hero-simple__visual {
        display: none;
    }

    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 200px;
    }

    .bento-card--large {
        grid-column: span 1;
        height: 200px;
    }
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {

    .hero-simple,
    .categories-nav,
    .partners-strip,
    .bento-featured {
        display: none;
    }

    .posts-grid {
        display: block;
    }

    .post-card {
        page-break-inside: avoid;
        margin-bottom: 1rem;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   HOMEPAGE PRODUCT + TOOLS + PRICING (Landing Sections)
   ========================================================================== */
.ar-section-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 900;
    color: var(--color-primary);
    background: rgba(0, 113, 227, 0.08);
    border: 1px solid rgba(0, 113, 227, 0.18);
}

.product-section,
.tools-section,
.pricing-preview {
    padding: var(--space-16) 0;
}

.product-inner,
.tools-inner,
.pricing-preview__inner {
    max-width: var(--max-width);
}

.product-header,
.tools-header,
.pricing-preview__header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.product-header .ar-section-pill,
.tools-header .ar-section-pill,
.pricing-preview__header .ar-section-pill {
    margin-bottom: var(--space-4);
}

.product-title,
.tools-title,
.pricing-preview__title {
    font-size: var(--text-3xl);
    font-weight: 900;
    margin: 0 0 var(--space-4);
    letter-spacing: -0.01em;
}

.product-subtitle,
.tools-subtitle,
.pricing-preview__subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 64ch;
    margin: 0 auto;
    line-height: var(--leading-relaxed);
}

/* Product cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6);
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-7);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    text-decoration: none;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 113, 227, 0.35);
}

.product-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 113, 227, 0.08);
    color: var(--color-primary);
}

.product-card__title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: 900;
    color: var(--color-text);
}

.product-card__desc {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

.product-card__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--space-2);
    color: var(--color-text-secondary);
    font-weight: 700;
    font-size: var(--text-sm);
}

.product-card__list li {
    position: relative;
    padding-inline-start: 18px;
}

.product-card__list li::before {
    content: "✓";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    color: var(--color-primary);
    font-weight: 900;
}

.product-card__cta {
    margin-top: auto;
    font-weight: 900;
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.product-card__cta::after {
    content: "←";
    font-weight: 900;
    opacity: 0.9;
}

.product-actions,
.tools-actions,
.pricing-preview__actions {
    margin-top: var(--space-10);
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.product-note {
    margin: var(--space-6) auto 0;
    max-width: 75ch;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
}

/* Tools cards (gradient) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
}

.tool-card {
    position: relative;
    border-radius: var(--radius-xl);
    padding: var(--space-7);
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.tool-card::after {
    content: "";
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(900px circle at 18% 22%, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 55%),
        radial-gradient(900px circle at 82% 62%, rgba(0, 0, 0, 0.22) 0%, rgba(0, 0, 0, 0) 60%);
    pointer-events: none;
    opacity: 0.9;
}

.tool-card>* {
    position: relative;
    z-index: 1;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.tool-card--writer {
    background: linear-gradient(135deg, #7C6AEB 0%, #4F46E5 40%, #3730A3 100%);
}

.tool-card--editor {
    background: linear-gradient(135deg, #4F46E5 0%, #7C6AEB 40%, #020817 100%);
}

.tool-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.tool-card__icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.tool-card__pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 900;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    white-space: nowrap;
}

.tool-card__title {
    margin: 0 0 var(--space-3);
    font-size: var(--text-2xl);
    font-weight: 900;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.tool-card__desc {
    margin: 0 0 var(--space-5);
    color: rgba(255, 255, 255, 0.92);
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
}

.tool-card__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: var(--space-2);
    color: rgba(255, 255, 255, 0.92);
    font-weight: 700;
    font-size: var(--text-sm);
}

.tool-card__list li {
    position: relative;
    padding-inline-start: 18px;
}

.tool-card__list li::before {
    content: "✓";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.95);
}

.tool-card__cta {
    margin-top: var(--space-6);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 900;
    color: rgba(255, 255, 255, 0.98);
}

.tool-card__cta::after {
    content: "←";
    opacity: 0.9;
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 600px) {

    .product-section,
    .tools-section,
    .pricing-preview {
        padding: var(--space-10) 0;
    }

    .product-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .product-card,
    .tool-card {
        padding: var(--space-6);
    }

    .product-title,
    .tools-title,
    .pricing-preview__title {
        font-size: var(--text-2xl);
    }
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */
.features-section {
    padding: var(--space-16) 0;
    background: var(--color-bg);
}

.features-inner {
    max-width: var(--max-width);
}

.features-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.features-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: var(--space-4);
}

.features-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.feature-card {
    padding: var(--space-8);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--icon-bg);
    color: var(--icon-color);
    margin-bottom: var(--space-4);
}

.feature-title {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.feature-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    margin: 0;
}

@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .features-section {
        padding: var(--space-10) 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .feature-card {
        padding: var(--space-6);
    }

    .features-title {
        font-size: var(--text-2xl);
    }
}

/* ==========================================================================
   TEMPLATES SECTION
   ========================================================================== */
.templates-section {
    padding: var(--space-16) 0;
    background: var(--color-bg-secondary);
}

.templates-inner {
    max-width: var(--max-width);
}

.templates-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.templates-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    margin-bottom: var(--space-4);
}

.templates-subtitle {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
}

.template-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-base);
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.template-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

.template-name {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-1);
}

.template-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.template-card--cta {
    background: linear-gradient(135deg, var(--color-primary), #4F46E5);
    border-color: transparent;
}

.template-card--cta .template-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.template-card--cta .template-name,
.template-card--cta .template-desc {
    color: #fff;
}

.template-card--cta:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

@media (max-width: 900px) {
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .templates-section {
        padding: var(--space-10) 0;
    }

    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    .template-card {
        padding: var(--space-4);
    }

    .template-icon {
        width: 48px;
        height: 48px;
    }

    .templates-title {
        font-size: var(--text-2xl);
    }
}

/* ==========================================================================
   COMPACT POSTS SECTION (3 posts only)
   ========================================================================== */
.posts-grid-section--compact {
    padding: var(--space-12) 0 var(--space-16);
}

.posts-grid--three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.section-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
}

.section-link:hover {
    text-decoration: underline;
}

[dir="rtl"] .section-link svg {
    transform: scaleX(-1);
}

@media (max-width: 900px) {
    .posts-grid--three {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .posts-grid-section--compact {
        padding: var(--space-8) 0 var(--space-12);
    }

    .posts-grid--three {
        display: flex;
        flex-direction: column;
        gap: var(--space-4);
    }

    .posts-grid--three .post-card {
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================================
   HOMEPAGE SEAMLESS GRADIENT (Classy & Bright) - FINAL VERSION
   ========================================================================== */

/* 1. Master Background - Bright & Fresh */
.home-template .site-wrapper {
    background-color: #ffffff;
    background-image:
        /* Soft blue light from top left */
        radial-gradient(circle at 10% 10%, rgba(0, 113, 227, 0.05) 0%, transparent 40%),
        /* Soft purple/warm light from bottom right */
        radial-gradient(circle at 90% 90%, rgba(94, 92, 230, 0.05) 0%, transparent 40%),
        /* Main subtle vertical flow - mainly white */
        linear-gradient(180deg,
            #ffffff 0%,
            #fdfdfd 40%,
            #f7faff 100%);
    background-attachment: scroll;
}

/* 2. Force Transparency on ALL Homepage Sections */
.home-template .hero-simple,
.home-template .partners-strip,
.home-template .product-section,
.home-template .tools-section,
.home-template .features-section,
.home-template .templates-section,
.home-template .pricing-preview,
.home-template .posts-grid-section-compact,
.home-template .posts-grid-section,
.home-template .categories-nav {
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* 3. Refine Spacing for Flow */
.home-template .features-section,
.home-template .templates-section,
.home-template .product-section,
.home-template .tools-section,
.home-template .pricing-preview,
.home-template .posts-grid-section-compact {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.home-template .partners-strip {
    padding-top: 0;
    padding-bottom: var(--space-8);
}

/* 4. Cleaner Cards - White with subtle shadow */
.home-template .feature-card,
.home-template .product-card,
.home-template .template-card:not(.template-card--cta),
.home-template .pricing-card,
.home-template .post-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    /* Softer, more spread shadow */
    backdrop-filter: none;
    /* No need for blur on solid white */
}

/* 5. Sticky Nav - Clean White */
.home-template .categories-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
    margin: 0 !important;
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

/* DARK MODE ADJUSTMENTS */
@media (prefers-color-scheme: dark) {
    .home-template .site-wrapper {
        background-color: #000000;
        background-image:
            radial-gradient(circle at 10% 10%, rgba(0, 113, 227, 0.1) 0%, transparent 40%),
            linear-gradient(180deg, #000000 0%, #111 100%);
    }

    .home-template .feature-card,
    .home-template .product-card,
    .home-template .template-card:not(.template-card--cta),
    .home-template .pricing-card,
    .home-template .post-card {
        background: rgba(28, 28, 30, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
        backdrop-filter: blur(10px);
    }

    .home-template .categories-nav {
        background: rgba(0, 0, 0, 0.8) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
}

[data-theme="dark"] .home-template .site-wrapper {
    background-color: #000000;
    background-image:
        radial-gradient(circle at 10% 10%, rgba(0, 113, 227, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #000000 0%, #111 100%);
}

[data-theme="dark"] .home-template .feature-card,
[data-theme="dark"] .home-template .product-card,
[data-theme="dark"] .home-template .template-card:not(.template-card--cta),
[data-theme="dark"] .home-template .pricing-card,
[data-theme="dark"] .home-template .post-card {
    background: rgba(28, 28, 30, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .home-template .categories-nav {
    background: rgba(0, 0, 0, 0.8) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Mobile Adjustments */
@media (max-width: 600px) {

    .home-template .hero-simple,
    .home-template .features-section,
    .home-template .templates-section,
    .home-template .posts-grid-section-compact {
        padding-top: var(--space-8);
        padding-bottom: var(--space-8);
    }
}

/* ==========================================================================
   FOOTER REFRESH (Clean & Modern)

/* ==========================================================================
   SEAMLESS FOOTER (Transparent & Integrated)
   ========================================================================== */

/* 1. Make footer transparent to continue the page flow */
.site-footer {
    background: transparent !important;
    border-top: none !important;
    /* No line */
    box-shadow: none !important;
    padding-top: var(--space-16) !important;
    padding-bottom: var(--space-8) !important;
    margin-top: 0 !important;
}

/* 2. Adjust text colors for contrast on the continuous background */
.site-footer-content {
    background: transparent !important;
    color: var(--color-text-secondary);
}

.site-footer a {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.site-footer a:hover {
    color: var(--color-primary);
}

/* 3. Subtle copyright text */
.site-footer .copyright {
    color: var(--color-text-tertiary);
    opacity: 0.6;
}

/* 4. Ensure it works in Dark Mode too */
@media (prefers-color-scheme: dark) {
    .site-footer {
        background: transparent !important;
        border-top: none !important;
    }
}

[data-theme="dark"] .site-footer {
    background: transparent !important;
    border-top: none !important;
}

/* ==========================================================================
   HEADER NAVIGATION ENHANCEMENT (Professional & Clear)
   ========================================================================== */

/* 1. Refined Navigation Links */
.header-nav .nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    /* Tighter gap for compact professional look */
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav .nav-link {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header-nav .nav-link:hover {
    color: var(--color-primary);
    background: rgba(0, 113, 227, 0.05);
}

.header-nav .nav-link.active {
    color: var(--color-primary);
    font-weight: 600;
}




/* 2. Ensure the header is on white background */
.site-header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* 3. Mobile Menu Enhancements */
@media (max-width: 900px) {
    .header-nav .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    .header-nav .nav-link {
        padding: var(--space-3) var(--space-4);
        justify-content: flex-start;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .site-header {
        background: rgba(0, 0, 0, 0.95) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .header-nav .nav-link:hover {
        background: rgba(0, 113, 227, 0.15);
    }
}

[data-theme="dark"] .site-header {
    background: rgba(0, 0, 0, 0.95) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .header-nav .nav-link:hover {
    background: rgba(0, 113, 227, 0.15);
}

/* ==========================================================================
   MEGA MENU (Rich Dropdown Navigation)
   ========================================================================== */

/* Dropdown Trigger */
.nav-item--dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: none;
    border: none;
    cursor: pointer;
}

.nav-dropdown-trigger svg {
    transition: transform 0.2s ease;
}

.nav-item--dropdown:hover .nav-dropdown-trigger svg,
.nav-dropdown-trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Dropdown Panel */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    --nav-icon-bg: rgba(0, 113, 227, 0.08);
    --nav-icon-color: var(--color-primary);
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    padding: var(--space-2);
}

.nav-item--dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
}

/* RTL Adjustment */
[dir="rtl"] .nav-dropdown {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* Dropdown columns (Platform menu) */
.nav-dropdown--grid {
    width: 640px;
    max-width: calc(100vw - 32px);
}

.nav-dropdown--grid .nav-dropdown-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-1);
}

/* Dropdown Inner */
.nav-dropdown-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* Dropdown Item */
.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: background 0.2s ease;
}

.nav-dropdown-item:hover {
    background: rgba(0, 113, 227, 0.05);
}

.nav-dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--icon-bg, var(--nav-icon-bg));
    color: var(--icon-color, var(--nav-icon-color));
    flex-shrink: 0;
}

.nav-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-dropdown-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.nav-dropdown-desc {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

/* CTA Link Special Style */
.nav-link--cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-primary) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: var(--space-2) var(--space-5) !important;
}

.nav-link--cta:hover {
    background: #5B48D0 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.nav-link--cta svg {
    transition: transform 0.2s ease;
}

.nav-link--cta:hover svg {
    transform: translateX(2px);
}

[dir="rtl"] .nav-link--cta:hover svg {
    transform: translateX(-2px);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .nav-dropdown {
        background: #1c1c1e;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
        --nav-icon-bg: rgba(0, 113, 227, 0.2);
    }

    .nav-dropdown-item:hover {
        background: rgba(0, 113, 227, 0.15);
    }
}

[data-theme="dark"] .nav-dropdown {
    background: #1c1c1e;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    --nav-icon-bg: rgba(0, 113, 227, 0.2);
}

[data-theme="dark"] .nav-dropdown-item:hover {
    background: rgba(0, 113, 227, 0.15);
}

/* Mobile - Convert to Accordion */
@media (max-width: 900px) {
    .nav-dropdown {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: transparent;
        padding: 0;
        margin-top: var(--space-2);
        display: none;
    }

    .nav-item--dropdown.is-open .nav-dropdown {
        display: block;
    }

    .nav-dropdown-item {
        background: rgba(0, 0, 0, 0.02);
    }

    [data-theme="dark"] .nav-dropdown-item {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Small mobile adjustments */
@media (max-width: 600px) {
    .nav-dropdown-icon {
        width: 36px;
        height: 36px;
    }

    .nav-dropdown-title {
        font-size: 13px;
    }

    .nav-dropdown-desc {
        font-size: 11px;
    }
}

/* ==========================================================================
   HEADER FIXES (Font & Mobile Consistency)
   ========================================================================== */

/* 1. Fix font for dropdown triggers to match the rest */
.nav-dropdown-trigger {
    font-family: 'Almarai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* 2. Start Now button in header actions */
.btn-start-now {
    display: inline-flex;
    align-items: center;
    padding: var(--space-2) var(--space-5);
    background: var(--color-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-start-now:hover {
    background: #5B48D0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

/* 3. Mobile consistency - remove duplicate CTA in nav */
@media (max-width: 900px) {

    /* Hide the nav CTA on mobile since we have one in header-actions */
    .nav-item--cta {
        display: none;
    }

    /* Make the header actions button more prominent on mobile */
    .btn-start-now {
        padding: var(--space-2) var(--space-4);
        font-size: 13px;
    }

    /* Ensure dropdown triggers are styled correctly */
    .nav-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        text-align: right;
        padding: var(--space-3) var(--space-4);
    }

    [dir="ltr"] .nav-dropdown-trigger {
        text-align: left;
    }
}

/* 4. Small mobile tweaks */
@media (max-width: 600px) {
    .btn-start-now {
        padding: var(--space-2) var(--space-3);
        font-size: 12px;
    }

    .header-actions {
        gap: var(--space-2);
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .nav-dropdown-trigger {
        color: var(--color-text-secondary);
    }
}

[data-theme="dark"] .nav-dropdown-trigger {
    color: var(--color-text-secondary);
}

/* ==========================================================================
   FIX: Remove button styling from direct links
   ========================================================================== */

/* Remove any button/background styling from direct nav links */
.header-nav .nav-item:not(.nav-item--dropdown):not(.nav-item--cta) .nav-link {
    background: none !important;
    padding: var(--space-2) var(--space-3);
}

.header-nav .nav-item:not(.nav-item--dropdown):not(.nav-item--cta) .nav-link:hover {
    background: rgba(0, 113, 227, 0.05) !important;
}

/* ==========================================================================
   FIX: Unify all nav links styling
   ========================================================================== */

/* Force all nav links to use the same font and styling */
.header-nav .nav-link,
.header-nav .nav-dropdown-trigger {
    font-family: 'Almarai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--color-text-secondary) !important;
}

/* Ensure hover states are consistent */
.header-nav .nav-link:hover,
.header-nav .nav-dropdown-trigger:hover {
    color: var(--color-primary) !important;
}

/* Active state */
.header-nav .nav-link.active {
    color: var(--color-primary) !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   MOBILE MENU ACCORDION (Updated for Mega Menu)
   ========================================================================== */

/* Parent items with submenu */
.mobile-nav-item--parent {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-4);
    background: none;
    border: none;
    font-family: 'Almarai', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    text-align: right;
    cursor: pointer;
}

[dir="ltr"] .mobile-nav-toggle {
    text-align: left;
}

.mobile-nav-toggle svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.mobile-nav-item--parent.is-open .mobile-nav-toggle svg {
    transform: rotate(180deg);
}

/* Submenu */
.mobile-nav-submenu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.02);
}

.mobile-nav-item--parent.is-open .mobile-nav-submenu {
    display: block;
}

.mobile-nav-submenu li {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-nav-submenu .mobile-nav-link {
    padding: var(--space-3) var(--space-6);
    font-size: 14px;
    font-weight: 500;
}

/* Mobile CTA */
.mobile-menu-cta {
    padding: var(--space-6) var(--space-4);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-4);
    background: var(--color-primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-mobile-cta:hover {
    background: #5B48D0;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 113, 227, 0.3);
}

.btn-mobile-cta svg {
    transition: transform 0.2s ease;
}

.btn-mobile-cta:hover svg {
    transform: translateX(2px);
}

[dir="rtl"] .btn-mobile-cta:hover svg {
    transform: translateX(-2px);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .mobile-nav-item--parent {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-nav-submenu {
        background: rgba(255, 255, 255, 0.03);
    }

    .mobile-nav-submenu li {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mobile-menu-cta {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

[data-theme="dark"] .mobile-nav-item--parent {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .mobile-nav-submenu {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .mobile-nav-submenu li {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .mobile-menu-cta {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   FLOATING HEADER (Contained Width with Rounded Corners)
   ========================================================================== */

.site-header {
    padding: var(--space-4) var(--space-6) !important;
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* When scrolled - make it sticky */
.site-header.is-scrolled {
    position: sticky;
    top: var(--space-4);
    z-index: 1000;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .header-inner {
        background: rgba(28, 28, 30, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

[data-theme="dark"] .header-inner {
    background: rgba(28, 28, 30, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile - Full Width */
@media (max-width: 900px) {
    .site-header {
        padding: var(--space-3) var(--space-4) !important;
    }

    .header-inner {
        border-radius: var(--radius-lg);
        padding: var(--space-2) var(--space-4);
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: var(--space-2) var(--space-3) !important;
    }

    .header-inner {
        max-width: 100%;
        margin: 0 var(--space-2);
        border-radius: var(--radius-md);
    }
}

/* ==========================================================================
   ABOUT PAGE STYLES (Apple-style Clean Layout)
   ========================================================================== */

/* Hero */
.about-hero {
    padding: var(--space-16) 0 var(--space-8);
    text-align: center;
}

.about-hero-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-4);
    letter-spacing: -1px;
}

.about-hero-description {
    font-size: 20px;
    color: var(--color-text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Vision/Values Cards */
.about-values {
    padding: var(--space-8) 0 var(--space-16);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    max-width: 1000px;
    margin: 0 auto;
}

.value-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.value-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.value-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 113, 227, 0.08);
    /* Apple Blue subtle */
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

.value-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--color-text);
}

.value-card p {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Content Section adjustments */
.about-content .gh-article-image {
    margin: var(--space-8) auto;
    max-width: 1000px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

/* CTA Box */
.about-cta {
    padding: var(--space-12) 0;
    text-align: center;
}

.cta-box {
    background: linear-gradient(135deg, var(--color-primary) 0%, #4F46E5 100%);
    border-radius: var(--radius-2xl);
    padding: var(--space-12) var(--space-6);
    color: #ffffff;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1h2v2H1V1zm4 0h2v2H5V1zm4 0h2v2H9V1z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.cta-box h2 {
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--space-4);
    position: relative;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    margin-bottom: var(--space-8);
    position: relative;
}

.btn-primary-large {
    display: inline-flex;
    padding: var(--space-4) var(--space-10);
    background: #ffffff;
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.btn-primary-large:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .value-card {
        background: rgba(28, 28, 30, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .value-icon {
        background: rgba(0, 113, 227, 0.2);
    }
}

[data-theme="dark"] .value-card {
    background: rgba(28, 28, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .value-icon {
    background: rgba(0, 113, 227, 0.2);
}

/* Responsive */
@media (max-width: 900px) {
    .about-hero-title {
        font-size: 36px;
    }

    .values-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .cta-box {
        padding: var(--space-8) var(--space-4);
    }
}

/* ==========================================================================
   ABOUT PAGE STYLES (Modern & Clean)
   ========================================================================== */

.about-hero {
    padding: var(--space-16) 0 var(--space-12);
    text-align: center;
}

.about-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.about-title .gradient-text {
    background: linear-gradient(135deg, var(--color-primary), #5E5CE6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.about-description {
    font-size: 20px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Mission & Vision Cards */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-16);
}

.mission-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease;
}

.mission-card:hover {
    transform: translateY(-5px);
}

.mission-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 113, 227, 0.05);
    color: var(--color-primary);
}

.mission-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.mission-card p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* Values Section */
.about-values {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.02) 0%, transparent 100%);
    padding: var(--space-12) 0;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-16);
}

.about-values .section-title {
    text-align: center;
    margin-bottom: var(--space-10);
    font-size: 32px;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

.value-item {
    text-align: center;
}

.value-number {
    display: block;
    font-family: monospace;
    /* Monospaced for tech feel */
    font-size: 14px;
    color: var(--color-primary);
    opacity: 0.6;
    margin-bottom: var(--space-2);
}

.value-item h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.value-item p {
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

/* Stats */
.about-stats {
    margin-bottom: var(--space-16);
}

.stats-container {
    display: flex;
    justify-content: space-around;
    padding: var(--space-8);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-box {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 42px;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: var(--space-1);
    background: linear-gradient(135deg, var(--color-text), var(--color-text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 14px;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CTA */
.about-cta {
    margin-bottom: var(--space-16);
    text-align: center;
}

.cta-box {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-xl);
    padding: var(--space-12);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cta-box h2 {
    font-size: 32px;
    margin-bottom: var(--space-2);
}

.cta-box p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-6);
    font-size: 18px;
}

.btn-primary-large {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 16px 32px;
    border-radius: var(--radius-full);
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 113, 227, 0.2);
    background: #5B48D0;
}

/* Responsive */
@media (max-width: 900px) {
    .mission-grid {
        grid-template-columns: 1fr;
    }

    .values-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .about-title {
        font-size: 36px;
    }

    .stats-container {
        flex-direction: column;
        gap: var(--space-6);
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .mission-card {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

    .mission-icon {
        background: rgba(0, 113, 227, 0.15);
    }

    .about-values {
        background: rgba(255, 255, 255, 0.02);
    }

    .cta-box {
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
}

[data-theme="dark"] .mission-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .mission-icon {
    background: rgba(0, 113, 227, 0.15);
}

[data-theme="dark"] .about-values {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .cta-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   FIX: About Page Numbers & CTA Visibility
   ========================================================================== */

/* 1. Value Numbers Styling - Bigger & Bolder */
.value-number {
    display: block;
    font-size: 64px !important;
    font-weight: 900;
    line-height: 1;
    color: rgba(0, 113, 227, 0.1) !important;
    /* Subtle giant number background */
    margin-bottom: -20px !important;
    /* Overlap with title */
    position: relative;
    z-index: 0;
    opacity: 1 !important;
    /* Ensure visibility */
    font-family: 'Inter', sans-serif;
    /* Use number-friendly font */
}

.value-item h4 {
    position: relative;
    z-index: 1;
    font-size: 24px !important;
    margin-bottom: var(--space-4) !important;
}

.value-item {
    position: relative;
    overflow: hidden;
    padding-top: var(--space-4);
}

/* 2. CTA Title Visibility */
.cta-box h2 {
    color: var(--color-text) !important;
    /* Ensure dark text on light bg */
}

/* Dark mode adjustment for CTA title */
@media (prefers-color-scheme: dark) {
    .cta-box h2 {
        color: #ffffff !important;
    }
}

[data-theme="dark"] .cta-box h2 {
    color: #ffffff !important;
}

/* ==========================================================================
   FOOTER GRID & ARCHIVE STYLES
   ========================================================================== */

/* Footer Grid */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.brand-column {
    padding-inline-end: var(--space-8);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    margin-bottom: var(--space-2);
}

.footer-logo img {
    height: 32px;
    width: auto;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text-secondary);
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: var(--space-4);
}

.footer-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-links a {
    font-size: 14px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: var(--space-8);
    text-align: center;
}

/* Archive Template Styles */
.archive-section {
    padding: var(--space-12) 0;
}

.archive-header {
    text-align: center;
    margin-bottom: var(--space-12);
}

.archive-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, var(--color-text), var(--color-text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.archive-description {
    font-size: 18px;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-10);
    }

    .brand-column {
        grid-column: span 2;
        padding-inline-end: 0;
        text-align: center;
        align-items: center;
    }

    .footer-desc {
        max-width: 100%;
    }
}

@media (max-width: 500px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .brand-column {
        grid-column: span 1;
    }

    .footer-column {
        align-items: center;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .footer-bottom {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
}

[data-theme="dark"] .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --------------------------------------------------------------------------
   Hide Ghost's default English subscription/paywall CTA
   We use our own Arabic CTA in post.hbs
   -------------------------------------------------------------------------- */
.gh-post-upgrade-cta,
.gh-post-upgrade-cta-content,
[data-gh-member-cta],
.gh-signup-cta,
.kg-nft-card,
.gh-public-signup-cta {
    display: none !important;
}

/* Also hide any English text that might appear from Ghost Portal */
.gh-article-content>.gh-signup-cta,
.gh-content>.gh-post-upgrade-cta,
.article-content>.gh-post-upgrade-cta {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Ghost Portal - Full Screen on Mobile Fix
   Fix Portal popup to display as full-screen modal on mobile devices
   IMPORTANT: Only apply when Portal is actually open (has iframe visible)
   -------------------------------------------------------------------------- */

/* Mobile specific - force full screen only when Portal iframe exists */
@media (max-width: 768px) {

    /* Portal popup iframe - make it true full-screen on mobile (avoid "half sidebar" layout) */
    #ghost-portal-root iframe[data-testid="portal-popup-frame"],
    #ghost-portal-root iframe[title="portal-popup"] {
        position: fixed !important;
        inset: 0 !important;
        z-index: 3999999 !important;
        width: 100vw !important;
        height: var(--viewport-height) !important;
        max-width: 100vw !important;
        max-height: var(--viewport-height) !important;
        min-width: 100vw !important;
        min-height: var(--viewport-height) !important;
        border: none !important;
        border-radius: 0 !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Ensure RTL support for Portal */
[dir="rtl"] #ghost-portal-root iframe {
    direction: rtl;
}

/* --------------------------------------------------------------------------
   Article-to-Posts Tool Widget (end of article)
   -------------------------------------------------------------------------- */
.arw-a2p {
    margin-block-start: var(--space-6);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #059669 0%, #0d9488 50%, #0891b2 100%);
    color: #fff;
    box-shadow: 0 4px 24px rgba(5, 150, 105, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.arw-a2p::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(700px circle at 15% -15%, rgba(255, 255, 255, 0.14) 0%, transparent 60%),
        radial-gradient(500px circle at 85% 110%, rgba(0, 0, 0, 0.12) 0%, transparent 55%);
    pointer-events: none;
}

.arw-a2p > * {
    position: relative;
    z-index: 1;
}

/* Header */
.arw-a2p__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
}

.arw-a2p__icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.arw-a2p__info {
    flex: 1 1 auto;
}

.arw-a2p__title {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 900;
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
}

.arw-a2p__desc {
    display: block;
    margin-block-start: 2px;
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.85);
    line-height: var(--leading-relaxed);
}

/* Generate button */
.arw-a2p__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.95);
    color: #065f46;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.arw-a2p__btn:hover:not(:disabled) {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.arw-a2p__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Spinner */
.arw-a2p__spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(5, 150, 105, 0.25);
    border-top-color: #059669;
    border-radius: 50%;
    animation: arw-a2p-spin 0.7s linear infinite;
}

.arw-a2p__spinner[style*="inline-flex"] {
    display: inline-flex !important;
}

@keyframes arw-a2p-spin {
    to { transform: rotate(360deg); }
}

/* Result area */
.arw-a2p__result {
    margin-block-start: var(--space-4);
    background: rgba(0, 0, 0, 0.18);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.arw-a2p__result-content {
    padding: var(--space-4);
    font-size: var(--text-sm);
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.95);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
}

.arw-a2p__copy {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--text-sm);
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}

.arw-a2p__copy:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* Error */
.arw-a2p__error {
    margin-block-start: var(--space-3);
    padding: var(--space-3);
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.35);
    border-radius: var(--radius-md);
    color: #fecaca;
    font-size: var(--text-sm);
    font-weight: 600;
}

/* Upgrade notice */
.arw-a2p__upgrade {
    margin-block-start: var(--space-3);
    padding: var(--space-3);
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

.arw-a2p__upgrade a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 900;
}

.arw-a2p__upgrade a:hover {
    text-decoration-thickness: 2px;
}

/* Platforms section */
.arw-a2p__platforms {
    margin-block-start: var(--space-4);
    padding-block-start: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
}

.arw-a2p__platforms-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 800;
    margin-block-end: var(--space-3);
    color: rgba(255, 255, 255, 0.95);
}

.arw-a2p__platforms-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-block-end: var(--space-3);
}

.arw-a2p__platforms-row svg {
    width: 28px;
    height: 28px;
    fill: rgba(255, 255, 255, 0.8);
    transition: fill 0.15s ease, transform 0.15s ease;
}

.arw-a2p__platforms-row svg:hover {
    fill: #fff;
    transform: scale(1.12);
}

.arw-a2p__social-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 800;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.arw-a2p__social-cta:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Mobile */
@media (max-width: 520px) {
    .arw-a2p {
        padding: var(--space-4);
    }

    .arw-a2p__icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .arw-a2p__title {
        font-size: var(--text-lg);
    }

    .arw-a2p__platforms-row svg {
        width: 24px;
        height: 24px;
    }
}

/* --------------------------------------------------------------------------
   Keyword Tool (Tools pages)
   -------------------------------------------------------------------------- */
.keyword-premium-blur {
    filter: blur(6px);
    opacity: 0.9;
    user-select: none;
}

/* --------------------------------------------------------------------------
   Keyword Tool Widget (In-content)
   -------------------------------------------------------------------------- */
.arwriter-keyword-widget {
    margin-block: var(--space-10);
}

.arwriter-keyword-widget__inner {
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
    padding: var(--space-7);
    box-shadow: var(--shadow-sm);
}

.arwriter-keyword-widget__title {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xl);
    font-weight: 900;
}

.arwriter-keyword-widget__subtitle {
    margin: 0 0 var(--space-5);
    color: var(--color-text-secondary);
    font-size: var(--text-base);
    line-height: 1.8;
}

.arwriter-keyword-widget__form {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: stretch;
}

.arwriter-keyword-widget__input {
    min-width: 220px;
    flex: 1;
}

.arwriter-keyword-widget__btn,
.arwriter-keyword-widget__link {
    white-space: nowrap;
}

@media (max-width: 520px) {
    .arwriter-keyword-widget__inner {
        padding: var(--space-5);
    }

    .arwriter-keyword-widget__form {
        gap: var(--space-2);
    }

    .arwriter-keyword-widget__btn,
    .arwriter-keyword-widget__link {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   Header Theme Consistency (force white header in explicit light mode)
   -------------------------------------------------------------------------- */
:root.theme-light .site-header,
:root[data-theme="light"] .site-header {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

:root.theme-light .header-inner,
:root[data-theme="light"] .header-inner {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

:root.theme-light .header-nav .nav-link,
:root[data-theme="light"] .header-nav .nav-link {
    color: var(--color-text-secondary) !important;
}

:root.theme-light .header-nav .nav-link:hover,
:root[data-theme="light"] .header-nav .nav-link:hover {
    background: rgba(0, 113, 227, 0.05) !important;
}
