
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Tajawal', 'Poppins', sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.9;
    direction: rtl;
}
a { color: inherit; }
.guide-topbar {
    background: rgba(15, 23, 42, 0.96);
    color: white;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}
.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.brand-link { font-weight: 800; text-decoration: none; color: white; }
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}
.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    transition: all 0.2s ease;
}
.nav-links a:hover, .nav-links a.active {
    background: rgba(59, 130, 246, 0.18);
    color: white;
}
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    padding: 5.5rem 1.5rem 4.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -45%;
    right: -8%;
    width: 520px;
    height: 520px;
    background: rgba(59, 130, 246, 0.12);
    border-radius: 50%;
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}
.kicker {
    display: inline-block;
    color: #93c5fd;
    background: rgba(147, 197, 253, 0.12);
    border: 1px solid rgba(147, 197, 253, 0.24);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
h1 {
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    line-height: 1.25;
    margin: 0 0 1rem;
    color: white;
    font-weight: 800;
}
.hero-lead {
    color: #cbd5e1;
    font-size: 1.13rem;
    max-width: 850px;
    margin: 0 auto 1.8rem;
}
.meta-line {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: #bfdbfe;
    font-weight: 600;
}
.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    justify-content: center;
    margin-top: 2rem;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.9rem 1.4rem;
    border-radius: 0.7rem;
    text-decoration: none;
    font-weight: 800;
    transition: all 0.2s ease;
}
.btn-primary { background: #3b82f6; color: white; border: 2px solid #3b82f6; }
.btn-primary:hover { background: #2563eb; transform: translateY(-2px); }
.btn-secondary { background: white; color: #1e40af; border: 2px solid white; }
.btn-secondary:hover { background: #eff6ff; transform: translateY(-2px); }
main { max-width: 1120px; margin: 0 auto; padding: 3.8rem 1.5rem; }
.section-block {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1.2rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    padding: clamp(1.4rem, 3vw, 2.4rem);
    margin-bottom: 1.6rem;
}
.section-title {
    font-size: clamp(1.45rem, 3vw, 2rem);
    color: #0f172a;
    margin: 0 0 1.35rem;
    font-weight: 800;
    padding-bottom: 0.7rem;
    border-bottom: 3px solid #3b82f6;
}
.section-block h3 {
    color: #1e40af;
    font-size: 1.25rem;
    margin: 1.8rem 0 0.7rem;
    font-weight: 800;
}
.section-block p { color: #475569; margin: 0 0 1.05rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.35rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: #3b82f6; box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08); }
.card h3, .card h4 { margin-top: 0; color: #0f172a; }
.card p { margin-bottom: 0.7rem; }
.card-link { color: #2563eb; text-decoration: none; font-weight: 800; }
.card-link:hover { text-decoration: underline; }
.source-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    margin: 0.9rem 0 1.4rem;
}
.source-title { font-weight: 800; color: #334155; margin-bottom: 0.4rem; }
.source-link {
    direction: ltr;
    unicode-bidi: embed;
    text-align: left;
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.86rem;
    color: #1d4ed8;
    line-height: 1.55;
    text-decoration: none;
    font-family: 'Poppins', Arial, sans-serif;
}
.source-link:hover { text-decoration: underline; }
ul, ol { padding-right: 1.3rem; color: #475569; }
li { margin-bottom: 0.55rem; }
.table-wrap { overflow-x: auto; border-radius: 1rem; border: 1px solid #e2e8f0; }
table { width: 100%; border-collapse: collapse; min-width: 720px; background: white; }
th, td { padding: 1rem; border-bottom: 1px solid #e2e8f0; text-align: right; vertical-align: top; }
th { background: #eff6ff; color: #0f172a; font-weight: 800; }
tr:last-child td { border-bottom: 0; }
.note {
    border-right: 4px solid #3b82f6;
    background: #eff6ff;
    padding: 1rem 1.1rem;
    border-radius: 0.85rem;
    color: #334155;
    margin: 1rem 0;
}
.warning { border-right-color: #f59e0b; background: #fffbeb; }
.page-nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin: 2rem 0 0;
}
.page-nav a {
    background: #0f172a;
    color: white;
    text-decoration: none;
    border-radius: 0.7rem;
    padding: 0.8rem 1rem;
    font-weight: 800;
}
.page-nav a:hover { background: #1e40af; }
.footer {
    background: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 3rem 1.5rem;
}
.footer a { color: #93c5fd; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.ltr { direction: ltr; unicode-bidi: embed; font-family: 'Poppins', Arial, sans-serif; }
@media (max-width: 860px) {
    .topbar-inner { align-items: flex-start; flex-direction: column; }
    .nav-links { justify-content: flex-start; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    main { padding: 2.5rem 1rem; }
    .hero-section { padding-top: 4rem; }
}


/* Updated reading experience: inline links + page-end sources */
.inline-link, .section-block a.inline-link {
    color: #1d4ed8;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(29, 78, 216, 0.35);
}
.inline-link:hover { color: #1e40af; border-bottom-color: #1e40af; }
.intro-block { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); }
.sources-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1.2rem;
    padding: clamp(1.2rem, 2.5vw, 2rem);
    margin-top: 1.8rem;
}
.sources-section h2 {
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 800;
    margin: 0 0 0.9rem;
}
.sources-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.45rem;
}
.sources-list li { margin: 0; }
.sources-list a {
    direction: ltr;
    unicode-bidi: embed;
    text-align: left;
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
    color: #1d4ed8;
    line-height: 1.55;
    text-decoration: none;
    font-family: 'Poppins', Arial, sans-serif;
}
.sources-list a:hover { text-decoration: underline; }
.hero-section.compact { padding: 4.5rem 1.5rem 3.8rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.quick-actions a { font-size: 0.95rem; }
.badge-list { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1rem 0 0; }
.badge-list span {
    display: inline-flex;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    color: #1e40af;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
}


/* Bilingual guide refinements */
html[dir="ltr"] body {
    direction: ltr;
    font-family: 'Poppins', 'Tajawal', sans-serif;
}
html[dir="ltr"] .nav-links { justify-content: flex-start; }
html[dir="ltr"] .section-title { text-align: left; }
html[dir="ltr"] .section-block h3 { text-align: left; }
html[dir="ltr"] ul, html[dir="ltr"] ol { padding-left: 1.3rem; padding-right: 0; }
html[dir="ltr"] th, html[dir="ltr"] td { text-align: left; }
html[dir="ltr"] .note { border-right: 0; border-left: 4px solid #3b82f6; }
html[dir="ltr"] .warning { border-left-color: #f59e0b; }
html[dir="ltr"] .hero-section::before { right: auto; left: -8%; }
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
}
.lang-switch:hover { background: rgba(59, 130, 246, 0.28); }
.nav-links a.ar-title { font-family: 'Tajawal', sans-serif; }
.nav-links a.en-title { font-family: 'Poppins', sans-serif; }
.kicker.en { font-family: 'Poppins', sans-serif; }
.sources-list.compact { grid-template-columns: 1fr; }
.inline-plain { font-weight: 800; color: #334155; }
.page-nav.en a { direction: ltr; }
