/* Akmal Pure — base styles.
   Written with CSS logical properties so RTL works with no rtl.css flipping.
   Deliberately light: Elementor handles page design. */

:root {
	--ak-primary: #900;
	--ak-primary-dark: #6d0000;
	--ak-text: #1f2328;
	--ak-muted: #6b7280;
	--ak-bg: #ffffff;
	--ak-surface: #f7f8fa;
	--ak-border: #e5e7eb;
	--ak-radius: 10px;
	--ak-container: 1200px;
	--ak-gap: 24px;
	--ak-header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	color: var(--ak-text);
	background: var(--ak-bg);
	font-family: "Cairo", "Tajawal", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--ak-primary); text-decoration: none; }
a:hover { color: var(--ak-primary-dark); }

h1, h2, h3, h4 { line-height: 1.35; margin-block: 0 0.5em; }

/* Accessibility */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip-path: inset(50%);
	white-space: nowrap;
}
.skip-link {
	position: absolute;
	inset-block-start: -100px;
	inset-inline-start: 8px;
	z-index: 100000;
	background: #fff;
	padding: 10px 16px;
}
.skip-link:focus { inset-block-start: 8px; }

/* Layout */
.ak-container {
	inline-size: 100%;
	max-inline-size: var(--ak-container);
	margin-inline: auto;
	padding-inline: 20px;
}
.ak-content { padding-block: 48px; }
.ak-content--full { max-inline-size: 100%; padding-inline: 0; }

.ak-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 40px;
	align-items: start;
}
.ak-layout__aside { position: sticky; inset-block-start: 90px; }
@media (max-width: 900px) {
	.ak-layout { grid-template-columns: 1fr; }
	.ak-layout__aside { position: static; }
}

/* Buttons */
.ak-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 20px;
	border-radius: var(--ak-radius);
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: .2s;
	white-space: nowrap;
}
.ak-btn--primary { background: var(--ak-primary, #990000); color: #fff; }
.ak-btn--primary:hover { background: var(--ak-primary-dark, #6d0000); color: #fff; }
.ak-btn--outline { border-color: var(--ak-primary); color: var(--ak-primary); background: transparent; }
.ak-btn--outline:hover { background: var(--ak-primary); color: #fff; }


/* Post grid */
.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: var(--ak-gap);
}
.post-card {
	background: #fff;
	border: 1px solid var(--ak-border);
	border-radius: var(--ak-radius);
	overflow: hidden;
	transition: .25s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.08); }
.post-card__thumb img { inline-size: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.post-card__body { padding: 18px; }
.post-card__title { font-size: 1.1rem; margin-block-end: 6px; }
.post-card__title a { color: var(--ak-text); }
.post-card__title a:hover { color: var(--ak-primary); }
.entry-meta { color: var(--ak-muted); font-size: .85rem; }
.post-card__excerpt { color: var(--ak-muted); font-size: .95rem; }

/* Entry */
.entry-title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.entry-thumb img { inline-size: 100%; border-radius: var(--ak-radius); }
.entry-content { font-size: 1.05rem; }
.page-header { margin-block-end: 32px; }

/* Widgets */
.widget {
	background: var(--ak-surface);
	border: 1px solid var(--ak-border);
	border-radius: var(--ak-radius);
	padding: 20px;
	margin-block-end: 20px;
}
.widget-title { font-size: 1.05rem; margin-block-end: 12px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding-block: 6px; border-block-end: 1px solid var(--ak-border); }
.widget li:last-child { border-block-end: 0; }

/* Search form */
.ak-search { display: flex; gap: 8px; }
.ak-search input[type="search"] {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid var(--ak-border);
	border-radius: var(--ak-radius);
	font: inherit;
}

/* Tutor LMS: let Tutor own its layout */
.akmal-tutor-course .ak-content,
.akmal-tutor-dashboard .ak-content { padding-block: 0; }
.akmal-tutor-single-widgets { margin-block-start: 24px; }

/* Numbers/prices stay LTR inside RTL text */
[dir="rtl"] .price,
[dir="rtl"] .tutor-course-price { direction: ltr; unicode-bidi: embed; }

.ak-404 { text-align: center; padding-block: 100px; }

/* =====================================================================
   ELEMENTOR CO-EXISTENCE
   The homepage and inner pages here are built in Elementor. The theme must
   NOT fight it: no container padding, no width caps, no forced backgrounds.
   ===================================================================== */

/* Elementor pages render full-bleed — the theme adds no wrapper padding. */
.elementor-page .ak-content,
.elementor-template-full-width .ak-content { padding-block: 0; }

.elementor-page .ak-container.ak-content,
body.elementor-page .site-main > .ak-container {
	max-inline-size: 100%;
	padding-inline: 0;
}

/* Elementor sections must be allowed to go edge to edge. */
.elementor-section-wrap > .elementor-section,
.elementor-section.elementor-section-full_width { inline-size: 100%; }

/* Don't let theme link colours override Elementor button styling. */
.elementor a.elementor-button { text-decoration: none; }

/* Elementor's own container width should win over the theme's. */
.elementor-widget-container img { max-inline-size: 100%; height: auto; }

/* =====================================================================
   GENERAL POLISH
   ===================================================================== */

/* Smooth scroll, but respect motion preferences. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}

/* Anchor links shouldn't hide under the sticky header. */
:target { scroll-margin-block-start: calc(var(--ak-header-h) + 20px); }

/* Visible focus ring for keyboard users. */
:focus-visible {
	outline: 2px solid var(--ak-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Selection colour on brand. */
::selection { background: color-mix(in srgb, var(--ak-primary) 22%, transparent); }

/* Images never overflow. */
img, svg, video, iframe { max-inline-size: 100%; }

/* Tables don't break layout. */
table { inline-size: 100%; border-collapse: collapse; }

/* Long words / URLs wrap instead of overflowing (matters a lot in Arabic). */
body, p, h1, h2, h3, h4, li, td { overflow-wrap: break-word; }

/* Kill the layout shift from the scrollbar on modal open. */
body { scrollbar-gutter: stable; }

/* Third-party floats (push-notification bar, chat widgets) shouldn't sit on
   top of our floating buttons. */
.ak-float { z-index: 9980; }

/* FAQ page — native <details> accordion, no JS needed. */
.ak-faq { max-inline-size: 820px; margin-inline: auto; }
.ak-faq__intro { color: #667085; margin-block-end: 28px; }
.ak-faq__section { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ak-primary, #990000); margin-block: 34px 12px; }
.ak-faq__item { border: 1px solid #e9eaee; border-radius: 12px; margin-block-end: 10px; background: #fff; }
.ak-faq__item[open] { border-color: #e3c7c7; box-shadow: 0 6px 20px rgba(16, 24, 40, .06); }
.ak-faq__q { cursor: pointer; padding: 16px 18px; font-weight: 700; color: #101828; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ak-faq__q::-webkit-details-marker { display: none; }
.ak-faq__q::after { content: "+"; font-weight: 400; font-size: 1.4rem; line-height: 1; color: var(--ak-primary, #990000); }
.ak-faq__item[open] .ak-faq__q::after { content: "−"; }
.ak-faq__a { padding: 0 18px 18px; color: #475467; line-height: 1.8; }
.ak-faq__a a { color: var(--ak-primary, #990000); text-decoration: underline; }
