.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.animate-delay-100 { transition-delay: 0.1s; }
.animate-delay-200 { transition-delay: 0.2s; }
.animate-delay-300 { transition-delay: 0.3s; }

.legal-article-content {
    font-family: 'Cairo', 'Tajawal', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    color: #2a1a12;
    line-height: 1.9;
    font-size: 1.125rem;
}

.legal-article-content p {
    margin-bottom: 1.75rem;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    line-height: 1.9;
    color: #2a1a12;
    font-size: 1.125rem;
}

.legal-article-content h1 {
    font-family: 'Cairo', 'Tajawal', 'Noto Serif Arabic', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #3c271a;
    margin-top: 3rem;
    margin-bottom: 2rem;
    line-height: 1.3;
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 3px solid #d4af37;
}

.legal-article-content h1::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, #d4af37, transparent);
}

.legal-article-content h2 {
    font-family: 'Cairo', 'Tajawal', 'Noto Serif Arabic', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #3c271a;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    position: relative;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(212, 175, 55, 0.2);
}

.legal-article-content h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, #d4af37, transparent);
}

.legal-article-content h3 {
    font-family: 'Cairo', 'Tajawal', 'Noto Serif Arabic', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #3c271a;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    position: relative;
    padding-inline-start: 1rem;
    border-inline-start: 4px solid #d4af37;
}

.legal-article-content h4 {
    font-family: 'Cairo', 'Tajawal', 'Noto Serif Arabic', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #3c271a;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Scoped list reset fix: restores markers removed by global resets */
.legal-article-content ul,
.legal-article-content ol {
    margin: 1.5rem 0;
    list-style: none !important;
    overflow: visible;
    text-align: start;
}

.legal-article-content ul {
    padding-inline-start: 1.75rem;
}

.legal-article-content ol {
    padding-inline-start: 2.25rem;
    counter-reset: legal-ordered-counter;
}

.legal-article-content ul li,
.legal-article-content ol li {
    display: block !important;
    position: relative !important;
    margin-bottom: 0.75rem;
    line-height: 1.9;
    color: #2a1a12;
    padding: 0;
    text-align: start;
}

/* Neutralize pseudo-element bullets from plugins/themes if present */
.legal-article-content ul li::before,
.legal-article-content ol li::before {
    position: absolute;
    top: 0;
    inset-inline-start: -1.25rem;
    color: hsl(0deg 0% 0%);
    line-height: 1.9;
    font-weight: 600;
}

.legal-article-content ul li::before {
    content: '•';
    font-size: 1.15em;
}

.legal-article-content ol li::before {
    counter-increment: legal-ordered-counter;
    content: counter(legal-ordered-counter) '.';
    inset-inline-start: -1.75rem;
    font-size: 0.95em;
}

.legal-article-content ul ul { list-style-type: circle !important; }
.legal-article-content ul ul ul { list-style-type: square !important; }
.legal-article-content ol ol { list-style-type: lower-alpha !important; }
.legal-article-content ol ol ol { list-style-type: lower-roman !important; }
.legal-article-content ul ul,
.legal-article-content ol ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-inline-start: 1.5rem;
}

.legal-article-content blockquote {
    position: relative;
    margin: 2.5rem 0;
    padding: 2rem 2.5rem;
    background: linear-gradient(to right, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.02));
    border-inline-start: 4px solid #d4af37;
    border-radius: 0.5rem;
    font-style: italic;
    color: #3c271a;
    font-size: 1.125rem;
    line-height: 1.8;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.legal-article-content blockquote::before {
    content: '"';
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 4rem;
    line-height: 1;
    color: #d4af37;
    opacity: 0.3;
    font-family: serif;
}

.legal-article-content blockquote p { margin-bottom: 0; position: relative; z-index: 1; }
.legal-article-content blockquote p:last-child { margin-bottom: 0; }

.legal-article-content a {
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.legal-article-content a:hover {
    color: #3c271a;
    border-bottom-color: #d4af37;
    background: linear-gradient(to bottom, transparent 0%, rgba(212, 175, 55, 0.1) 100%);
}

.legal-article-content img {
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin: 2.5rem auto;
    display: block;
    max-width: 100%;
    height: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.legal-article-content img.animate-in { opacity: 1; transform: translateY(0); }
.legal-article-content img:hover {
    transform: scale(1.02) translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.legal-article-content strong { font-weight: 700 !important; color: #3c271a; }
.legal-article-content em { font-style: italic; color: #2a1a12; }

.legal-article-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.3), transparent);
    margin: 3rem 0;
}

.legal-article-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.legal-article-content th {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
    color: #3c271a;
    font-weight: 700;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
    font-family: 'Cairo', 'Tajawal', serif;
}

.legal-article-content td {
    padding: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    color: #2a1a12;
}

.legal-article-content tr:hover td { background: rgba(212, 175, 55, 0.05); }
.legal-article-content tr:last-child td { border-bottom: none; }

.legal-article-content code {
    background: rgba(212, 175, 55, 0.1);
    color: #3c271a;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.legal-article-content pre {
    background: linear-gradient(135deg, #3c271a 0%, #2a1a12 100%);
    color: #faf8f5;
    padding: 1.5rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.legal-article-content pre code { background: transparent; color: inherit; padding: 0; }

[dir="rtl"] .legal-article-content { text-align: right; }
[dir="rtl"] .legal-article-content p { text-align: justify; }
[dir="rtl"] .legal-article-content h1::before,
[dir="rtl"] .legal-article-content h2::before {
    right: 0;
    left: auto;
    background: linear-gradient(to left, #d4af37, transparent);
}
[dir="rtl"] .legal-article-content blockquote {
    border-right: 4px solid #d4af37;
    border-left: none;
    background: linear-gradient(to left, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.02));
}
[dir="rtl"] .legal-article-content blockquote::before { right: 1rem; left: auto; }
[dir="rtl"] .legal-article-content hr {
    background: linear-gradient(to left, transparent, rgba(212, 175, 55, 0.3), transparent);
}
[dir="rtl"] .legal-article-content th { text-align: right; }

@media (max-width: 768px) {
    .legal-article-content { font-size: 1rem; }
    .legal-article-content h1 { font-size: 2rem; margin-top: 2rem; margin-bottom: 1.5rem; }
    .legal-article-content h2 { font-size: 1.75rem; margin-top: 2rem; margin-bottom: 1rem; }
    .legal-article-content h3 { font-size: 1.375rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }
    .legal-article-content p { font-size: 1rem; margin-bottom: 1.5rem; }
    .legal-article-content blockquote { padding: 1.5rem; margin: 2rem 0; }
    .legal-article-content ul,
    .legal-article-content ol { padding-inline-start: 1.5rem; }
    .legal-article-content img { margin: 1.5rem 0; border-radius: 0.75rem; }
    .legal-article-content table { font-size: 0.9rem; }
    .legal-article-content th,
    .legal-article-content td { padding: 0.75rem 0.5rem; }
}

@media print {
    .legal-article-content { color: #000; }
    .legal-article-content a { color: #000; text-decoration: underline; }
    .legal-article-content img { box-shadow: none; page-break-inside: avoid; }
    .legal-article-content blockquote { page-break-inside: avoid; border: 1px solid #ccc; }
}
