/**
 * AI Content Publisher - Professional Article Styling
 * High-contrast, magazine-editorial layout with modern typography and full RTL support.
 */

.saicp-generated-article {
	max-width: 880px;
	margin-inline: auto;
	line-height: 1.95;
	color: #1e293b !important;
	direction: rtl;
	text-align: start;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Cairo", "Tajawal", "Helvetica Neue", Arial, sans-serif;
	font-size: 1.05rem;
}

.saicp-generated-article *,
.saicp-generated-article *::before,
.saicp-generated-article *::after {
	box-sizing: border-box;
}

/* Force dark, crisp typography so no theme renders text white */
.saicp-generated-article p,
.saicp-generated-article li,
.saicp-generated-article span,
.saicp-generated-article div,
.saicp-generated-article td,
.saicp-generated-article th {
	color: #1e293b !important;
}

.saicp-generated-article p {
	margin: 0 0 1.25rem;
}

/* Headings with distinct weights and accent lines */
.saicp-generated-article h1,
.saicp-generated-article h2,
.saicp-generated-article h3,
.saicp-generated-article h4 {
	color: #0f172a !important;
	font-weight: 800 !important;
	line-height: 1.4;
}

.saicp-generated-article h2 {
	margin: 2.4rem 0 1.1rem;
	font-size: clamp(1.4rem, 2.2vw, 1.85rem);
	padding-inline-start: 14px;
	border-inline-start: 4px solid #0284c7;
}

.saicp-generated-article h3 {
	margin: 1.8rem 0 0.85rem;
	font-size: clamp(1.15rem, 1.8vw, 1.4rem);
	color: #1e293b !important;
}

/* Hero / Featured Article Image */
.has-post-thumbnail .saicp-article-hero,
article.has-post-thumbnail .saicp-article-hero,
body.single .has-post-thumbnail .saicp-article-hero {
	display: none !important;
}

.saicp-article-hero {
	margin: 1.5rem 0 2rem;
	overflow: hidden;
	border-radius: 16px;
	background: #0f172a;
	border: 1px solid #e2e8f0;
	box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

.saicp-article-hero img,
.saicp-article-hero-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.saicp-article-hero figcaption {
	padding: 0.75rem 1rem;
	font-size: 0.92rem;
	color: #64748b !important;
	background: #f8fafc;
	border-top: 1px solid #f1f5f9;
	text-align: center;
}

/* Introduction Callout */
.saicp-article-intro {
	padding: 1.5rem 1.75rem;
	margin: 0 0 2rem;
	border-radius: 16px;
	background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
	border: 1px solid #bbf7d0;
	border-inline-start: 5px solid #10b981;
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
	font-size: 1.08rem;
	color: #064e3b !important;
}

.saicp-article-intro p {
	color: #064e3b !important;
	margin-bottom: 0.75rem;
}

.saicp-article-intro p:last-child {
	margin-bottom: 0;
}

/* Table of Contents (TOC) */
.saicp-article-toc {
	padding: 1.5rem 1.75rem;
	margin: 2rem 0;
	border-radius: 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.saicp-toc-header {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 1.1rem;
	border-bottom: 2px solid #e2e8f0;
	padding-bottom: 0.75rem;
}

.saicp-toc-header h2 {
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	font-size: 1.25rem !important;
	color: #0f172a !important;
}

.saicp-toc-icon {
	font-size: 1.35rem;
}

.saicp-article-toc ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.65rem 1.5rem;
}

.saicp-article-toc li {
	margin: 0;
	padding: 0;
	line-height: 1.6;
}

.saicp-article-toc a {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: #0369a1 !important;
	text-decoration: none !important;
	font-weight: 600;
	transition: color 0.15s ease, transform 0.15s ease;
}

.saicp-article-toc a:hover {
	color: #0284c7 !important;
	transform: translateX(-3px);
}

.saicp-toc-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	background: #e2e8f0;
	color: #0f172a !important;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 700;
}

.saicp-article-toc ul ul {
	display: block;
	margin-top: 0.35rem;
	margin-inline-start: 1.25rem;
	gap: 0;
}

.saicp-article-toc ul ul li {
	margin-bottom: 0.35rem;
	font-size: 0.95em;
}

/* Sections */
.saicp-article-section {
	padding: 1.5rem 0;
	border-bottom: 1px solid #f1f5f9;
}

.saicp-article-section ul,
.saicp-article-section ol {
	padding-inline-start: 1.75rem;
	margin: 1rem 0 1.5rem;
}

.saicp-article-section li {
	margin-bottom: 0.5rem;
}

/* Quotes & Pro-Tip Callouts */
.saicp-generated-article blockquote {
	margin: 1.75rem 0;
	padding: 1.25rem 1.5rem;
	border-inline-start: 5px solid #2563eb;
	background: #eff6ff;
	border-radius: 12px;
	border: 1px solid #dbeafe;
	color: #1e40af !important;
}

.saicp-generated-article blockquote p {
	color: #1e40af !important;
	font-weight: 500;
	margin-bottom: 0.5rem;
}

.saicp-generated-article blockquote p:last-child {
	margin-bottom: 0;
}

/* Responsive Tables */
.saicp-generated-article table {
	width: 100%;
	margin: 1.75rem 0;
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 10px rgba(15, 23, 42, 0.02);
}

.saicp-generated-article th,
.saicp-generated-article td {
	padding: 0.85rem 1.1rem;
	text-align: start;
	border-bottom: 1px solid #f1f5f9;
}

.saicp-generated-article th {
	background: #f8fafc;
	color: #0f172a !important;
	font-weight: 700;
	border-bottom: 2px solid #e2e8f0;
}

.saicp-generated-article tr:nth-child(even) td {
	background: #fafbfc;
}

.saicp-generated-article tr:hover td {
	background: #f1f5f9;
}

/* Conclusion Card */
.saicp-article-conclusion {
	margin: 2.5rem 0;
	padding: 1.5rem 1.75rem;
	border-radius: 16px;
	background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
	border: 1px solid #fde68a;
	border-inline-start: 5px solid #d97706;
	box-shadow: 0 4px 12px rgba(217, 119, 6, 0.05);
}

.saicp-article-conclusion h2 {
	margin-top: 0 !important;
	border: none !important;
	padding: 0 !important;
	color: #92400e !important;
}

/* FAQ Module */
.saicp-article-faq {
	margin: 2.5rem 0;
}

.saicp-faq-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 1.25rem;
}

.saicp-faq-item {
	padding: 1.25rem 1.5rem;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 3px 8px rgba(15, 23, 42, 0.03);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.saicp-faq-item:hover {
	border-color: #cbd5e1;
	box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}

.saicp-faq-question {
	margin: 0 0 0.6rem !important;
	font-size: 1.15rem !important;
	color: #0f172a !important;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.saicp-faq-question::before {
	content: "❓";
	font-size: 1.1rem;
}

.saicp-faq-answer {
	color: #334155 !important;
	line-height: 1.8;
}

.saicp-faq-answer p:last-child {
	margin-bottom: 0;
}

/* Related Links & Sources */
.saicp-article-links,
.saicp-article-sources {
	margin: 2rem 0;
	padding: 1.25rem 1.5rem;
	background: #f8fafc;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
}

.saicp-article-links h2,
.saicp-article-sources h2 {
	margin-top: 0 !important;
	font-size: 1.2rem !important;
	border: none !important;
	padding: 0 !important;
}

.saicp-article-links ul,
.saicp-article-sources ul {
	margin: 0.75rem 0 0;
	padding-inline-start: 1.5rem;
}

.saicp-article-links a,
.saicp-article-sources a {
	color: #0284c7 !important;
	text-decoration: none;
	font-weight: 600;
}

.saicp-article-links a:hover,
.saicp-article-sources a:hover {
	text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
	.saicp-generated-article {
		font-size: 1rem;
		line-height: 1.85;
	}

	.saicp-article-intro,
	.saicp-article-conclusion,
	.saicp-article-toc {
		padding: 1.15rem 1.25rem;
	}

	.saicp-article-toc ul {
		grid-template-columns: 1fr;
	}

	.saicp-generated-article table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}

/* ==========================================================================
   Global Dynamic CTA Button & High-Converting Banner Card
   ========================================================================== */
.saicp-global-cta {
	margin: 2.2rem 0;
	clear: both;
	box-sizing: border-box;
	direction: rtl;
	text-align: right;
	font-family: inherit;
}

/* Card Outer Wrap (Banner Mode) */
.saicp-global-cta.saicp-cta-layout-banner {
	border-radius: 16px;
	padding: 1.5rem 1.75rem;
	position: relative;
	overflow: hidden;
	box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.saicp-global-cta.saicp-cta-layout-banner:hover {
	transform: translateY(-2px);
	box-shadow: 0 15px 30px -5px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.06);
}

.saicp-cta-card-inner {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.saicp-cta-card-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.3px;
}

.saicp-cta-badge-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	display: inline-block;
}

.saicp-cta-card-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1.25rem;
}

.saicp-cta-card-text-block {
	flex: 1 1 300px;
}

.saicp-cta-card-title {
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.4;
	display: block;
	margin-bottom: 0.35rem;
}

.saicp-cta-card-desc {
	margin: 0 !important;
	font-size: 0.95rem;
	line-height: 1.55;
	opacity: 0.9;
}

.saicp-cta-card-action {
	flex-shrink: 0;
}

/* Button-Only Layout */
.saicp-global-cta.saicp-cta-layout-button_only {
	text-align: center;
	padding: 1rem 0;
}

.saicp-cta-button-wrap {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
}

.saicp-cta-btn-subtext {
	font-size: 0.85rem;
	color: #64748b;
	margin: 0 !important;
}

/* Master Button Styles */
.saicp-cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	padding: 0.85rem 1.85rem;
	border-radius: 12px;
	font-size: 1.05rem;
	font-weight: 700;
	text-decoration: none !important;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	border: 1px solid transparent;
}

.saicp-cta-btn:hover {
	transform: translateY(-2px) scale(1.02);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.saicp-cta-btn-arrow {
	transition: transform 0.2s ease;
	font-size: 1.15rem;
	line-height: 1;
}

.saicp-cta-btn:hover .saicp-cta-btn-arrow {
	transform: translateX(-4px);
}

/* ----------------------------------------------------
   Themes & Color Palettes
   ---------------------------------------------------- */
/* 1. Royal Blue Gradient */
.saicp-cta-theme-gradient_blue.saicp-cta-layout-banner {
	background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
	border: 1px solid #bfdbfe;
	color: #1e3a8a;
}
.saicp-cta-theme-gradient_blue .saicp-cta-card-title { color: #1e3a8a !important; }
.saicp-cta-theme-gradient_blue .saicp-cta-card-desc { color: #2563eb !important; }
.saicp-cta-theme-gradient_blue .saicp-cta-card-badge { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }
.saicp-cta-theme-gradient_blue .saicp-cta-badge-dot { background: #2563eb; }
.saicp-cta-theme-gradient_blue .saicp-cta-btn {
	background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	color: #ffffff !important;
	border-color: #1e40af;
}

/* 2. Emerald Green Gradient */
.saicp-cta-theme-gradient_green.saicp-cta-layout-banner {
	background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
	border: 1px solid #bbf7d0;
	color: #14532d;
}
.saicp-cta-theme-gradient_green .saicp-cta-card-title { color: #14532d !important; }
.saicp-cta-theme-gradient_green .saicp-cta-card-desc { color: #15803d !important; }
.saicp-cta-theme-gradient_green .saicp-cta-card-badge { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.saicp-cta-theme-gradient_green .saicp-cta-badge-dot { background: #16a34a; }
.saicp-cta-theme-gradient_green .saicp-cta-btn {
	background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
	color: #ffffff !important;
	border-color: #166534;
}

/* 3. Purple & Indigo Glow */
.saicp-cta-theme-gradient_purple.saicp-cta-layout-banner {
	background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
	border: 1px solid #e9d5ff;
	color: #581c87;
}
.saicp-cta-theme-gradient_purple .saicp-cta-card-title { color: #581c87 !important; }
.saicp-cta-theme-gradient_purple .saicp-cta-card-desc { color: #7e22ce !important; }
.saicp-cta-theme-gradient_purple .saicp-cta-card-badge { background: #f3e8ff; color: #7e22ce; border: 1px solid #d8b4fe; }
.saicp-cta-theme-gradient_purple .saicp-cta-badge-dot { background: #9333ea; }
.saicp-cta-theme-gradient_purple .saicp-cta-btn {
	background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
	color: #ffffff !important;
	border-color: #6b21a8;
}

/* 4. Sunset Amber / Gold */
.saicp-cta-theme-gradient_amber.saicp-cta-layout-banner {
	background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
	border: 1px solid #fde68a;
	color: #78350f;
}
.saicp-cta-theme-gradient_amber .saicp-cta-card-title { color: #78350f !important; }
.saicp-cta-theme-gradient_amber .saicp-cta-card-desc { color: #b45309 !important; }
.saicp-cta-theme-gradient_amber .saicp-cta-card-badge { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.saicp-cta-theme-gradient_amber .saicp-cta-badge-dot { background: #d97706; }
.saicp-cta-theme-gradient_amber .saicp-cta-btn {
	background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
	color: #ffffff !important;
	border-color: #92400e;
}

/* 5. Modern Dark Glass */
.saicp-cta-theme-dark_modern.saicp-cta-layout-banner {
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
	border: 1px solid #334155;
	color: #ffffff;
}
.saicp-cta-theme-dark_modern .saicp-cta-card-title { color: #ffffff !important; }
.saicp-cta-theme-dark_modern .saicp-cta-card-desc { color: #94a3b8 !important; }
.saicp-cta-theme-dark_modern .saicp-cta-card-badge { background: rgba(255,255,255,0.1); color: #38bdf8; border: 1px solid rgba(56,189,248,0.3); }
.saicp-cta-theme-dark_modern .saicp-cta-badge-dot { background: #38bdf8; }
.saicp-cta-theme-dark_modern .saicp-cta-btn {
	background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
	color: #0f172a !important;
	border-color: #0284c7;
	font-weight: 800;
}

/* 6. Flash Sale Crimson */
.saicp-cta-theme-gradient_red.saicp-cta-layout-banner {
	background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
	border: 1px solid #fecaca;
	color: #7f1d1d;
}
.saicp-cta-theme-gradient_red .saicp-cta-card-title { color: #7f1d1d !important; }
.saicp-cta-theme-gradient_red .saicp-cta-card-desc { color: #dc2626 !important; }
.saicp-cta-theme-gradient_red .saicp-cta-card-badge { background: #fee2e2; color: #b91c1c; border: 1px solid #f87171; }
.saicp-cta-theme-gradient_red .saicp-cta-badge-dot { background: #dc2626; }
.saicp-cta-theme-gradient_red .saicp-cta-btn {
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
	color: #ffffff !important;
	border-color: #b91c1c;
}

/* ----------------------------------------------------
   Animations
   ---------------------------------------------------- */
/* Shimmer */
@keyframes saicpShimmer {
	0% { transform: translateX(150%) skewX(-20deg); }
	100% { transform: translateX(-150%) skewX(-20deg); }
}

.saicp-cta-anim-shimmer .saicp-cta-btn::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 60%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
	animation: saicpShimmer 3s infinite ease-in-out;
	pointer-events: none;
}

/* Pulse */
@keyframes saicpPulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.03); }
}

.saicp-cta-anim-pulse .saicp-cta-btn {
	animation: saicpPulse 2.5s infinite ease-in-out;
}

/* Bounce */
@keyframes saicpSoftBounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

.saicp-cta-anim-bounce .saicp-cta-btn {
	animation: saicpSoftBounce 2s infinite ease-in-out;
}

/* Responsive */
@media (max-width: 640px) {
	.saicp-global-cta.saicp-cta-layout-banner {
		padding: 1.25rem;
	}
	.saicp-cta-card-content {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}
	.saicp-cta-card-badge {
		align-self: center;
	}
	.saicp-cta-btn {
		width: 100%;
	}
}

