/* ==========================================================================
   Arabic Lab — base layer, layer 3 of 3
   The element defaults every page of this site sits on: document, headings,
   copy, lists, rules, quotes, media, tables, code, form controls, the
   WordPress core classes, the vendor token bridges and the few corrections
   the theme's own stylesheets need.

   Print order, measured on a front-end page (`includes/Assets.php`, and see the
   header of tokens.css):
     theme fonts -> theme style.css -> theme Bootstrap -> theme bootstrap-theme.css
     -> arabiclab-fonts -> arabiclab-tokens -> arabiclab-public.css
     -> vendored bootstrap.min.css -> arabiclab-bootstrap-bridge.css
     -> this file (last, priority 99)

   What is deliberately here and what is not:
     - Here: element selectors, `.entry-content` / `.site-main` scoped copy
       rules, WordPress core classes, form controls, vendor tokens.
     - Not here: marketing components. `.al-band`, `.al-btn`, `.al-card`,
       `.al-eyebrow`, `.al-field` and the rest of the primitive layer ship in
       tokens.css; the header, footer and marketing bands ship in
       `assets/css/arabiclab-public.css`.
     - Not here: chrome. The header, drawer and footer buttons keep their own
       rules; a global `button` option in this layer repainted the language
       menu and turned it dark-on-dark. Element styling is scoped to reading
       content and to the controls a form owns.
     - Not here: component work on the signed-in app or the blog archive.
       Those are separate tickets; this layer only sets what they inherit.
     - The last section corrects the theme's `style.css` lesson colours. The
       theme file is left untouched, so those rules print from here instead.

   Colours and families are read from tokens.css. No literal hex value that a
   token already carries is written in this file.
   ========================================================================== */

/* ---------- document ---------------------------------------------------- */
html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--f-body);
	font-size: 1.0625rem; /* 17px: the system's body size, fixed */
	line-height: 1.6;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* The reading face changes with the language, never the size. */
html[lang="ar"] body {
	font-family: var(--f-ar-body);
	line-height: 1.85;
}
html[lang="bn"] body {
	font-family: var(--f-bn);
	line-height: 1.75;
}

/* ---------- headings ---------------------------------------------------- */
/* One display family, weight 500. Emphasis is size and italic, never colour.
   600 is reserved for the close-line scale and the gold CTA label. */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--f-display);
	font-weight: 500;
	font-optical-sizing: auto;
	line-height: 1.12;
	letter-spacing: -0.01em;
	text-wrap: balance;
	color: var(--forest);
	margin: 0 0 0.45em;
}

h1 {
	font-size: clamp(1.9rem, 5vw, 3rem);
}
h2 {
	font-size: clamp(1.75rem, 4.6vw, 2.7rem);
}
h3 {
	font-size: clamp(1.3rem, 3.4vw, 1.7rem);
}
h4 {
	font-size: clamp(1.15rem, 3vw, 1.35rem);
}
h5 {
	font-size: 1.05rem;
}
h6 {
	font-family: var(--f-body);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	line-height: 1.6;
	text-transform: uppercase;
	color: var(--muted);
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
	font-family: var(--f-ar);
	letter-spacing: 0;
	line-height: 1.35;
}
html[lang="bn"] h1,
html[lang="bn"] h2,
html[lang="bn"] h3,
html[lang="bn"] h4,
html[lang="bn"] h5,
html[lang="bn"] h6 {
	font-family: var(--f-bn-d);
	letter-spacing: 0;
	line-height: 1.3;
}

/* ---------- copy -------------------------------------------------------- */
/* Reading copy is scoped: `arabiclab-public.css` zeroes every paragraph
   margin to keep its marketing bands tight, and a global `p` rule here would
   reopen that spacing on bands that do not want it. */
:where(.entry-content, .site-main, .comment-content, .widget) p {
	margin: 0 0 1em;
}
:where(.entry-content, .site-main, .comment-content, .widget) p:last-child {
	margin-bottom: 0;
}

strong,
b {
	font-weight: 600;
}
small {
	font-size: 0.86em;
	color: var(--muted);
}
sup,
sub {
	line-height: 0;
}
abbr[title] {
	text-decoration: underline dotted;
	cursor: help;
}

/* The lede: the first paragraph of an entry is a size larger and secondary. */
.entry-content > p:first-of-type {
	font-size: 1.08rem;
	color: var(--muted);
}

/* Inline links carry the underline. Chrome and components set their own
   colour and weight on top of this; this is the reading-copy default. */
.entry-content a,
.site-main p a,
.site-main li a,
.comment-content a,
.widget a {
	color: var(--emerald);
	text-decoration: underline;
	text-decoration-thickness: 0.06em;
	text-underline-offset: 0.18em;
}
.entry-content a:hover,
.site-main p a:hover,
.site-main li a:hover,
.comment-content a:hover,
.widget a:hover {
	color: var(--forest);
	text-decoration-thickness: 0.12em;
}

/* ---------- lists, rules, quotes ---------------------------------------- */
:where(.entry-content, .site-main, .comment-content, .widget) ul,
:where(.entry-content, .site-main, .comment-content, .widget) ol {
	margin: 0 0 1em;
	padding-inline-start: 1.25em;
}
:where(.entry-content, .site-main, .comment-content, .widget) li {
	margin-block: 0.25em;
}
:where(.entry-content, .site-main, .comment-content, .widget) li > ul,
:where(.entry-content, .site-main, .comment-content, .widget) li > ol {
	margin-bottom: 0;
}
:where(.entry-content, .site-main, .comment-content, .widget) ul ul,
:where(.entry-content, .site-main, .comment-content, .widget) ol ol {
	list-style-type: circle;
}

hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin-block: 28px;
}

:where(.entry-content, .site-main, .comment-content, .widget) blockquote {
	margin: 28px 0;
	padding-inline-start: 18px;
	border-inline-start: 3px solid var(--gold);
	font-family: var(--f-display);
	font-size: 1.25rem;
	font-style: italic;
	line-height: 1.45;
	color: var(--forest);
}
:where(.entry-content, .site-main, .comment-content, .widget) blockquote p:last-child {
	margin-bottom: 0;
}
:where(.entry-content, .site-main, .comment-content, .widget) blockquote cite {
	display: block;
	margin-top: 10px;
	font-family: var(--f-body);
	font-size: 0.86rem;
	font-style: normal;
	color: var(--muted);
}

/* ---------- media -------------------------------------------------------- */
img,
video,
iframe,
embed,
object {
	max-width: 100%;
}
img,
video {
	height: auto;
}
figure {
	margin: 28px 0;
}
figcaption,
.wp-caption-text,
.gallery-caption {
	margin-top: 8px;
	font-size: 0.86rem;
	line-height: 1.6;
	color: var(--muted);
}
.wp-caption {
	max-width: 100%;
}

/* ---------- tables ------------------------------------------------------- */
table {
	width: 100%;
	margin-block: 28px;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}
th,
td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--line);
	text-align: start;
	vertical-align: top;
}
thead th {
	font-family: var(--f-body);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--muted);
	border-bottom: 1px solid var(--line-strong);
}
tbody tr:hover {
	background: var(--ivory);
}

/* ---------- code --------------------------------------------------------- */
code,
kbd,
samp,
pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.92em;
}
code,
kbd {
	padding: 0.12em 0.38em;
	border-radius: 6px;
	background: var(--ivory);
	color: var(--forest);
}
pre {
	margin-block: 28px;
	padding: 16px 18px;
	border-radius: 10px;
	background: var(--ivory);
	color: var(--ink);
	overflow-x: auto;
}
pre code {
	padding: 0;
	background: none;
}

/* ---------- selection ---------------------------------------------------- */
/* The focus ring is defined once, in tokens.css (`:focus-visible`). */
::selection {
	background: var(--gold-pale);
	color: var(--forest-deep);
}

/* ---------- form controls ------------------------------------------------ */
/* Font inheritance only. Painting a bare `button` is what repainted the header
   language menu, so no background, colour, border or padding is set here: a
   control is styled by its own class (`.al-btn`, `.langbtn`, `.menu-toggle`). */
input,
select,
textarea {
	font: inherit;
	color: inherit;
}
button {
	font: inherit;
}

/* Text-like fields: the design system's field, one radius, one ring. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):not([type="hidden"]),
select,
textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid rgba(21, 69, 58, 0.3);
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
	font-size: 1rem;
}
textarea {
	min-height: 130px;
	resize: vertical;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="file"]):not([type="hidden"]):focus,
select:focus,
textarea:focus {
	border-color: var(--teal);
	outline: 3px solid rgba(44, 116, 110, 0.25);
	outline-offset: 0;
}
input:disabled,
select:disabled,
textarea:disabled {
	background: var(--ivory);
	color: var(--muted);
	cursor: not-allowed;
}
::placeholder {
	color: var(--muted);
	opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
	width: 18px;
	height: 18px;
	accent-color: var(--forest);
}
input[type="range"] {
	accent-color: var(--forest);
}

/* Submit controls are pentagon-free: one pill, forest fill, 44px. The list is
   deliberately narrow. A bare `button:not([class])` rule would also catch the
   chrome this plugin ships, and it did: the header's classless language-menu
   items turned into filled forest pills over their own mint highlight, while a
   `.langmenu button:hover` rule at (0,2,1) still painted mint behind, so the
   menu read as dark-on-dark. Chrome keeps its own rules; only a button inside
   reading content and a form's own submit/get the base styling. */
input[type="submit"],
input[type="button"],
input[type="reset"],
:where(.entry-content, .comment-content, .widget) button:not([class]) {
	min-height: 44px;
	padding: 12px 22px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	background: var(--forest);
	color: var(--on-dark);
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
:where(.entry-content, .comment-content, .widget) button:not([class]):hover {
	background: var(--forest-deep);
}
input[type="submit"]:disabled,
input[type="button"]:disabled,
input[type="reset"]:disabled,
:where(.entry-content, .comment-content, .widget) button:not([class]):disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

label {
	display: inline-block;
	margin-bottom: 6px;
	font-size: 0.94rem;
	font-weight: 600;
	color: var(--ink);
}

/* Label followed by a field, without a wrapper element. */
label + input,
label + select,
label + textarea {
	margin-top: 0;
}

fieldset {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}
legend {
	margin-bottom: 6px;
	font-size: 0.94rem;
	font-weight: 600;
}

/* ---------- WordPress core classes --------------------------------------- */
/* Theme check and the WordPress.org contract expect these to resolve. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.screen-reader-text:focus {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
}

/* Skip link: a gold pill with forest-deep text (6.04:1), the pairing 2.1 files
   the skip link under. `a.skip-link` rather than `.skip-link` on
   purpose: a third-party sheet on this install sets `a, a:focus, a:hover`
   colour at (0,1,1), which out-specifies a single class and turned the label
   cyan. */
a.skip-link {
	position: fixed;
	top: 8px;
	inset-inline-start: 8px;
	z-index: 100000;
	padding: 12px 20px;
	border-radius: 999px;
	background: var(--gold);
	color: var(--forest-deep);
	font-weight: 700;
	text-decoration: none;
	transform: translateY(-200%);
	transition: transform var(--dur-tap) var(--ease-brand);
}
a.skip-link:focus {
	transform: none;
	color: var(--forest-deep);
}

/* Focus ring: one ring, teal on paper, gold-soft on night, 3px at offset 3.
   The element-level selectors are load-bearing. A third-party sheet on this
   install (wpadscms-public.css, a Bootstrap theme) ships
   `a, a:focus, a:hover { outline: none }` at (0,1,1), which out-specifies the
   single-class `:focus-visible` rule in tokens.css. Measured before this rule:
   every focused link reported `outline-style: none` with the vendor's link
   colour, so the ring the design system promises did not exist anywhere. The
   component-level rules in tokens.css (`.al-field input:focus`) still win where
   they set their own ring. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--teal);
	outline-offset: 3px;
}
footer a:focus-visible,
footer button:focus-visible,
.al-band--forest a:focus-visible,
.al-band--forest button:focus-visible,
.al-band--night a:focus-visible,
.al-band--night button:focus-visible,
.al-card--featured a:focus-visible,
.al-card--featured button:focus-visible,
.al-callout--dark a:focus-visible,
.al-callout--dark button:focus-visible {
	outline-color: var(--gold-soft);
}

.alignleft {
	float: left;
	margin: 0 24px 16px 0;
}
.alignright {
	float: right;
	margin: 0 0 16px 24px;
}
.aligncenter {
	display: block;
	margin-inline: auto;
}
.alignwide,
.alignfull {
	max-width: none;
}
.wp-caption.alignleft,
.wp-caption.alignright {
	margin-bottom: 16px;
}

.sticky {
	/* Marker class only: the theme does not pin a sticky post. */
}
.bypostauthor {
	/* Marker class only: the comment list styles its own author block. */
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 12px;
	margin-block: 28px;
}
.gallery-item {
	margin: 0;
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

/* ---------- WooCommerce bridge ------------------------------------------- */
/* WooCommerce ships its own `.button` (a grey 4px slab), its own price colour
   and a circular `.onsale` badge. The shop, cart, checkout and account pages
   are theme surfaces, so they follow the same one-pill rule as everything
   else. No template is edited: these are vendor selectors only. */
.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	min-height: 44px;
	padding: 10px 22px;
	border: 1.5px solid var(--forest);
	border-radius: 999px;
	background: var(--paper);
	color: var(--forest);
	font-weight: 600;
	line-height: 1.2;
}
.woocommerce .button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
	background: var(--forest);
	border-color: var(--forest);
	color: var(--on-dark);
}

/* The one primary action of a Woo screen is the forest pill, not gold. */
.woocommerce .button.alt,
.woocommerce .single_add_to_cart_button,
.woocommerce #place_order,
.woocommerce .checkout-button,
.woocommerce .wc-forward {
	background: var(--forest);
	border-color: var(--forest);
	color: var(--on-dark);
}
.woocommerce .button.alt:hover,
.woocommerce .single_add_to_cart_button:hover,
.woocommerce #place_order:hover,
.woocommerce .checkout-button:hover {
	background: var(--forest-deep);
	border-color: var(--forest-deep);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .select2-container .select2-selection--single {
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid rgba(21, 69, 58, 0.3);
	border-radius: 10px;
	background: #fff;
}

/* Prices are forest and tabular; gold on paper is not a text colour. */
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce ul.products li.product .price {
	color: var(--forest);
	font-variant-numeric: tabular-nums;
}
.woocommerce ul.products li.product .price del {
	color: var(--muted);
}
.woocommerce ul.products li.product .price ins {
	color: var(--forest);
	text-decoration: none;
}

/* The offer tag: a gold pill with forest text, never a circle. */
.woocommerce span.onsale {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 0;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--sun);
	color: var(--forest-deep);
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.02em;
	text-transform: none;
}

/* ---------- theme lesson surfaces ---------------------------------------- */
/* The theme's `style.css` owns the transcript, the pinned player and the
** lesson title, and it prints before this file. Its colours are the pre-brand
** accents: `#ff5733` orange, `#f2f4f7` grey, `#ff8c00` focus rings, 4px
** corners. The theme repository is not edited, so these rules restate the
** same selectors and win on print order. */
.al-transcript-line {
	border-radius: 8px;
}
.al-transcript-num {
	color: var(--muted);
}
.al-transcript-line:hover {
	background: var(--ivory);
}
.al-transcript-line.is-active {
	background: var(--mint);
	border-left-color: var(--emerald);
}
.al-transcript-line:focus-visible,
.al-transcript-navbtn:focus-visible,
.al-transcript-floatbtn:focus-visible {
	outline: 3px solid var(--teal);
	outline-offset: 2px;
}
.al-transcript-navbtn {
	min-height: 44px;
	padding: 8px 16px;
	border-color: var(--line);
	border-radius: 999px;
	background: var(--paper);
}
.al-transcript-navbtn:hover {
	background: var(--ivory);
}
.al-transcript-floatbtn {
	border-color: var(--line);
	background: var(--paper);
	color: var(--ink);
	box-shadow: var(--shadow);
}
.al-transcript-floatbtn:hover {
	background: var(--ivory);
}
/* Two classes plus the wrapper in the theme's rule; the same shape here. */
.tutor-lesson-content .tutor-lesson-wrapper h1.al-lesson-title {
	font-weight: 500;
}
.al-lesson-host.al-pinned {
	box-shadow: var(--shadow-lg);
}

/* ---------- vendor token bridges ----------------------------------------- */
/* Tutor LMS reads its brand from these. Left alone, they resolve to #3E64DE
   (the plugin's semantic primary), so every Tutor button, tab, link and focus
   ring is blue. The names are the ones Tutor exposes; they could not be
   checked against a local install because Tutor is not installed in this one. */
:root {
	--tutor-button-primary: var(--forest);
	--tutor-surface-brand-primary: var(--forest);
	--tutor-border-brand: var(--forest);
	--tutor-text-brand: var(--forest);
}

/* Bootstrap's variables are mapped in arabiclab-bootstrap-bridge.css, which
   loads just
   before this file and depends on the same tokens. */

/* ---------- motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
