/*
Theme Name: Aljadawel 2026
Theme URI: https://www.aljadawel.sa/
Author: Dar Al Jadawel Publishing
Description: Editorial catalogue theme for Dar Al Jadawel Publishing & Distribution. University textbooks with digital activation codes, university B2B portals, and Saudi e-invoicing. Bidirectional from a single stylesheet; no CSS framework and no build step.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aljadawel-2026
Tags: rtl-language-support, translation-ready, e-commerce, custom-colors
WC requires at least: 8.0
WC tested up to: 10.9
*/

/**
 * Base layer only. Tokens live in assets/css/tokens.css; components in
 * assets/css/*.css. Everything is written with LOGICAL properties
 * (margin-inline, padding-block, inset-inline, text-align: start) so Arabic RTL
 * and English LTR both render correctly from this one file. There is no rtl.css
 * and no direction-flipping library — adding either would be a regression.
 */

/* ---- Reset ------------------------------------------------------------- */

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
	margin: 0;
}

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

body {
	margin: 0;
	background-color: var(--jd-paper);
	color: var(--jd-ink);
	font-family: var(--jd-font-ui);
	font-size: var(--jd-fs-base);
	line-height: var(--jd-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
svg,
video {
	display: block;
	max-inline-size: 100%;
	block-size: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
}

ul,
ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---- Typography -------------------------------------------------------- */

h1, h2, h3, h4 {
	font-family: var(--jd-font-display);
	font-weight: 700;
	line-height: var(--jd-lh-title);
	color: var(--jd-navy);
}

h1 {
	font-size: var(--jd-fs-display);
}

/**
 * Latin runs inside Arabic text.
 *
 * Book titles, ISBNs, prices and activation codes stay Latin-script on an RTL page.
 * The prototype does this with 153 surgical dir="ltr" spans; these classes are the
 * reusable equivalent. `unicode-bidi: isolate` is what stops a Latin run from
 * reordering the Arabic around it.
 */
.jd-latin {
	font-family: var(--jd-font-latin);
	direction: ltr;
	unicode-bidi: isolate;
	text-align: start;
}

.jd-mono {
	font-family: var(--jd-font-mono);
	font-variant-numeric: tabular-nums;
	direction: ltr;
	unicode-bidi: isolate;
}

/* Bibliographic line: "Publisher · ISBN 978…" */
.jd-biblio {
	font-size: var(--jd-fs-2xs);
	letter-spacing: var(--jd-track-biblio);
	color: var(--jd-text-muted);
}

.jd-label {
	font-size: var(--jd-fs-2xs);
	font-weight: 600;
	letter-spacing: var(--jd-track-label);
	text-transform: uppercase;
	color: var(--jd-text-secondary);
}

/* ---- Layout ------------------------------------------------------------ */

.jd-container {
	inline-size: 100%;
	max-inline-size: var(--jd-container);
	margin-inline: auto;
	padding-inline: var(--jd-gutter);
}

.jd-container--wide {
	max-inline-size: var(--jd-container-wide);
}

/* Section separators are hairlines, never arbitrary whitespace. */
.jd-rule {
	border: 0;
	border-block-start: var(--jd-border);
	margin-block: var(--jd-space-16);
}

/* ---- Links & focus ----------------------------------------------------- */

a {
	color: var(--jd-navy);
	text-decoration: none;
	transition: color var(--jd-transition);
}

a:hover {
	color: var(--jd-navy-700);
	text-decoration: underline;
	text-underline-offset: 4px;
}

/**
 * Focus ring. :focus-visible only, so pointer users never see it but keyboard
 * users always do. Never remove this without a replacement — it is the primary
 * keyboard affordance on every interactive element in the theme.
 */
:focus-visible {
	outline: 2px solid var(--jd-navy);
	outline-offset: 2px;
	border-radius: var(--jd-radius-xs);
}

/* ---- Accessibility helpers -------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	inset-block-start: var(--jd-space-4);
	inset-inline-start: var(--jd-space-4);
	z-index: 999;
	padding: var(--jd-space-5) var(--jd-space-8);
	background-color: var(--jd-surface);
	border: var(--jd-border);
	border-radius: var(--jd-radius-btn);
	clip-path: none;
	inline-size: auto;
	block-size: auto;
}

/* Touch targets stay at or above 44px, per the QA gate. */
.jd-btn,
.jd-icon-btn {
	min-block-size: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--jd-space-4);
	border-radius: var(--jd-radius-btn);
	cursor: pointer;
	transition: background-color var(--jd-transition), border-color var(--jd-transition);
}

.jd-btn--primary {
	background-color: var(--jd-navy);
	color: var(--jd-on-navy);
	border: 1px solid var(--jd-navy);
	padding-inline: var(--jd-space-12);
	font-weight: 600;
}

.jd-btn--primary:hover {
	background-color: var(--jd-navy-700);
	border-color: var(--jd-navy-700);
	color: var(--jd-on-navy);
	text-decoration: none;
}

.jd-btn--hairline {
	background-color: transparent;
	color: var(--jd-navy);
	border: var(--jd-border);
	padding-inline: var(--jd-space-12);
}

.jd-btn--hairline:hover {
	border-color: var(--jd-hairline-strong);
	text-decoration: none;
}

/* Cards deepen their hairline on hover. They never lift and never gain a shadow. */
.jd-card {
	background-color: var(--jd-surface);
	border: var(--jd-border);
	border-radius: var(--jd-radius-card);
	transition: border-color var(--jd-transition);
}

.jd-card:hover {
	border-color: var(--jd-hairline-strong);
}
