* {
    box-sizing: border-box;
}

:root {
    --brand-blue-50: #eff6ff;
    --brand-blue-100: #dbeafe;
    --brand-blue-200: #bfdbfe;
    --brand-blue-500: #3b82f6;
    --brand-blue-600: #2563eb;
    --brand-blue-700: #1d4ed8;
    --brand-blue-800: #1e3a8a;
    --brand-blue-900: #0b1b4f;
    --ink-strong: #10244f;
    --ink-soft: #36507d;
    --surface: #ffffff;
    --surface-soft: #f8fbff;
    --border: #c7d8f8;
    --shadow-soft: 0 16px 34px rgba(17, 37, 84, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Alexandria', 'Outfit', sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 55%, #f8fbff 100%);
    color: var(--ink-strong);
    line-height: 1.75;
}

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

.page-container {
    width: min(1100px, 92vw);
    margin-inline: auto;
}

.topbar {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(199, 216, 248, 0.85);
    border-radius: 18px;
}

.footer-topbar {
    margin-bottom: 0.9rem;
}

.topbar-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    color: var(--brand-blue-900);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand-blue-500), var(--brand-blue-800));
}

.topbar-links {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.topbar-links a {
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 700;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.topbar-links a:hover,
.topbar-links a.active {
    border-color: var(--brand-blue-200);
    background: var(--brand-blue-50);
    color: var(--brand-blue-800);
}

.page-main {
    padding: 2.2rem 0 3.2rem;
}

.page-back-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(239, 246, 255, 0.9);
    color: var(--brand-blue-800);
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.page-back-arrow:hover {
    background: #ffffff;
    border-color: rgba(37, 99, 235, 0.5);
}

html[dir="rtl"] .page-back-arrow:hover {
    transform: translateX(2px);
}

html[dir="ltr"] .page-back-arrow:hover {
    transform: translateX(-2px);
}

.page-back-arrow-icon {
    line-height: 1;
    font-size: 1.02rem;
}

.hero-card {
    border-radius: 24px;
    padding: clamp(1.4rem, 3.5vw, 2.5rem);
    background: linear-gradient(135deg, var(--brand-blue-800), var(--brand-blue-600));
    color: #ffffff;
    box-shadow: var(--shadow-soft);
    margin-bottom: 1.2rem;
}

.hero-card h1 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    line-height: 1.2;
}

.hero-card p {
    margin: 0;
    max-width: 70ch;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.95rem, 2vw, 1.08rem);
}

.editable-note {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--ink-soft);
    background: rgba(219, 234, 254, 0.65);
    border: 1px dashed rgba(37, 99, 235, 0.34);
    border-radius: 14px;
    padding: 0.75rem 0.95rem;
}

.editable-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: clamp(1rem, 2.5vw, 1.4rem);
    box-shadow: 0 10px 24px rgba(17, 37, 84, 0.06);
    margin-bottom: 0.95rem;
}

.editable-section[data-editable="true"]::before {
    content: 'قسم قابل للتعديل';
    display: inline-block;
    margin-bottom: 0.65rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, 0.36);
    color: var(--brand-blue-700);
    background: var(--brand-blue-50);
    font-size: 0.72rem;
    font-weight: 700;
}

.editable-section h2,
.editable-section h3 {
    margin: 0 0 0.5rem;
    color: var(--brand-blue-900);
    line-height: 1.35;
}

.editable-section p,
.editable-section li {
    margin: 0;
    color: var(--ink-soft);
}

.editable-section p + p,
.editable-section ul,
.editable-section ol {
    margin-top: 0.7rem;
}

.editable-section ul,
.editable-section ol {
    padding-inline-start: 1.1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
}

.value-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.8rem;
}

.value-chip {
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: var(--surface-soft);
    padding: 0.6rem 0.75rem;
    color: var(--brand-blue-800);
    font-weight: 700;
    font-size: 0.9rem;
}

.page-footer {
    padding: 1rem 0 2rem;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.page-footer a {
    color: var(--brand-blue-700);
    font-weight: 700;
}

@media (max-width: 820px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 0.7rem 0.9rem;
    }

    .topbar-links {
        width: 100%;
        justify-content: flex-start;
    }

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