/* =========================================================================
   Rahee Store
   One stylesheet. No framework.
   ========================================================================= */

/* --- Fonts -------------------------------------------------------------
   Self-hosted, subset to the scripts this store actually uses:
   Lora (Latin) for display, Vazirmatn (Arabic script) for Persian.
   The interface runs on the visitor's own system font — no download.
   ---------------------------------------------------------------------- */

@font-face {
	font-family: "Lora";
	src: url("../fonts/lora-latin-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
	font-family: "Lora";
	src: url("../fonts/lora-latin-400-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
	font-family: "Lora";
	src: url("../fonts/lora-latin-600-normal.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/vazirmatn-arabic-400-normal.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/vazirmatn-arabic-500-normal.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF;
}

/* --- Tokens ------------------------------------------------------------ */

:root {
	--ink:        #231F20;
	--ink-soft:   #4A4443;
	--ink-mute:   #756E6A;
	--gold:       #D2AB67;
	--gold-deep:  #A07C36;
	--paper:      #FBF8F3;
	--paper-2:    #F3EDE2;
	--paper-3:    #EBE3D5;
	--line:       #E0D7C6;
	--white:      #FFFFFF;
	--red:        #8C2F26;

	--font-display: "Lora", Georgia, "Times New Roman", serif;
	--font-ui:      system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-fa:      "Vazirmatn", Tahoma, sans-serif;

	--wrap: 1120px;
	--gutter: clamp(1.25rem, 4vw, 3rem);

	--s1: 0.5rem;
	--s2: 0.875rem;
	--s3: 1.25rem;
	--s4: 2rem;
	--s5: 3rem;
	--s6: 4.5rem;
	--s7: 7rem;

	--radius: 3px;
	--shadow-book: 0 1px 2px rgba(35,31,32,.10), 0 12px 28px -8px rgba(35,31,32,.28);
}

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

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-ui);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

figure { margin: 0; }

h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 0 0 var(--s3);
	color: var(--ink);
}

h1 { font-size: clamp(2rem, 4.2vw, 3.15rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 var(--s3); }

a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }

ul, ol { margin: 0 0 var(--s3); padding-inline-start: 1.2em; }

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

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px,1px,1px,1px);
	white-space: nowrap;
}

.skip-link {
	position: absolute; left: -9999px;
	background: var(--ink); color: var(--paper);
	padding: var(--s2) var(--s3); z-index: 100;
}
.skip-link:focus { left: var(--s3); top: var(--s3); }

:focus-visible {
	outline: 2px solid var(--gold-deep);
	outline-offset: 3px;
}

/* Persian copy */
[dir="rtl"], .is-rtl {
	font-family: var(--font-fa);
	direction: rtl;
	text-align: right;
	line-height: 2;
	font-size: 1.02em;
}

/* --- Eyebrow / small caps labels --------------------------------------- */

.eyebrow {
	font-family: var(--font-ui);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold-deep);
	margin: 0 0 var(--s2);
	display: block;
}

/* --- Buttons ----------------------------------------------------------- */

.button,
button.button,
input[type="submit"],
.wp-element-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	font-family: var(--font-ui);
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1;
	padding: 0.95em 1.6em;
	border: 1px solid var(--ink);
	border-radius: var(--radius);
	background: var(--ink);
	color: var(--paper);
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
input[type="submit"]:hover {
	background: var(--gold-deep);
	border-color: var(--gold-deep);
	color: var(--white);
}

.button--ghost,
.woocommerce a.button.wc-backward {
	background: transparent;
	color: var(--ink);
	border-color: var(--line);
}
.button--ghost:hover,
.woocommerce a.button.wc-backward:hover {
	background: var(--paper-2);
	border-color: var(--ink);
	color: var(--ink);
}

/* --- Forms ------------------------------------------------------------- */

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="search"], input[type="number"], select, textarea,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.select2-container .select2-selection--single {
	width: 100%;
	font-family: var(--font-ui);
	font-size: 1rem;
	color: var(--ink);
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 0.7em 0.85em;
	line-height: 1.4;
}

input:focus, select:focus, textarea:focus {
	border-color: var(--gold-deep);
	outline: none;
	box-shadow: 0 0 0 3px rgba(210,171,103,.25);
}

label { font-size: 0.9rem; font-weight: 500; color: var(--ink-soft); }

/* --- Header ------------------------------------------------------------ */

.site-header {
	background: var(--paper);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 40;
	backdrop-filter: saturate(160%) blur(6px);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s3);
	min-height: 74px;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	text-decoration: none;
	color: var(--ink);
}
.brand:hover { color: var(--ink); }

.brand__mark {
	display: grid;
	place-items: center;
	width: 40px; height: 40px;
	border: 1px solid var(--ink);
	border-radius: 50%;
	color: var(--ink);
	flex: none;
}

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
	font-family: var(--font-display);
	font-size: 1.12rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}
.brand__tag {
	font-size: 0.7rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.primary-nav { display: flex; align-items: center; gap: var(--s4); }

.primary-nav__list {
	display: flex;
	align-items: center;
	gap: var(--s4);
	list-style: none;
	margin: 0; padding: 0;
}

.primary-nav__list a {
	font-size: 0.93rem;
	font-weight: 500;
	text-decoration: none;
	color: var(--ink-soft);
	padding-block: 0.4rem;
	border-bottom: 1px solid transparent;
}
.primary-nav__list a:hover {
	color: var(--ink);
	border-bottom-color: var(--gold);
}

.cart-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	color: var(--ink);
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 0.45rem 0.9rem;
}
.cart-link:hover { border-color: var(--ink); color: var(--ink); }
.cart-link__count {
	display: grid; place-items: center;
	min-width: 1.35rem; height: 1.35rem;
	border-radius: 999px;
	background: var(--ink);
	color: var(--paper);
	font-size: 0.75rem;
	padding-inline: 0.35rem;
}

.nav-toggle { display: none; }

/* --- Hero (home) ------------------------------------------------------- */

.hero {
	padding-block: clamp(var(--s5), 7vw, var(--s7));
	border-bottom: 1px solid var(--line);
	background:
		radial-gradient(1200px 420px at 78% -8%, rgba(210,171,103,.17), transparent 65%),
		var(--paper);
}

.hero__inner {
	display: grid;
	grid-template-columns: minmax(260px, 400px) 1fr;
	gap: clamp(var(--s4), 6vw, var(--s6));
	align-items: center;
}

.hero__figure { position: relative; margin: 0; width: 100%; }

.hero__figure img,
.book-cover img {
	width: 100%;
	border-radius: 2px 5px 5px 2px;
	box-shadow: var(--shadow-book);
}

/* WooCommerce wraps the image in two divs; make them carry the width. */
.book-cover .woocommerce-product-gallery,
.book-cover .woocommerce-product-gallery__wrapper,
.book-cover .woocommerce-product-gallery__image,
.book-cover .woocommerce-product-gallery__image a {
	width: 100%;
	margin: 0;
	float: none;
	display: block;
}
.book-cover .woocommerce-product-gallery__trigger { display: none; }

/* the spine edge */
.hero__figure::before,
.book-cover::before {
	content: "";
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: 9px;
	border-radius: 2px 0 0 2px;
	background: linear-gradient(90deg, rgba(35,31,32,.30), rgba(35,31,32,.06) 60%, transparent);
	z-index: 2;
	pointer-events: none;
}

.hero__title {
	margin-bottom: var(--s3);
	max-width: 18ch;
}

.hero__title-fa {
	display: block;
	font-family: var(--font-fa);
	font-size: 0.58em;
	font-weight: 500;
	color: var(--ink-soft);
	direction: rtl;
	margin-top: 0.45em;
	line-height: 1.7;
}

.hero__byline {
	font-family: var(--font-display);
	font-size: 1.08rem;
	font-style: italic;
	color: var(--ink-mute);
	margin-bottom: var(--s3);
}

.hero__lede {
	font-size: 1.1rem;
	color: var(--ink-soft);
	max-width: 46ch;
	margin-bottom: var(--s4);
}

.hero__buy {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--s3);
	padding-top: var(--s3);
	border-top: 1px solid var(--line);
}

.hero__price {
	font-family: var(--font-display);
	font-size: 1.9rem;
	font-weight: 600;
	letter-spacing: -0.02em;
}
.hero__price small {
	display: block;
	font-family: var(--font-ui);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.hero__note {
	font-size: 0.85rem;
	color: var(--ink-mute);
	flex-basis: 100%;
	margin: 0;
}

/* --- Sections ---------------------------------------------------------- */

.section { padding-block: clamp(var(--s5), 6vw, var(--s6)); }
.section--tint { background: var(--paper-2); border-block: 1px solid var(--line); }

.section__head { max-width: 62ch; margin-bottom: var(--s4); }

.prose { max-width: 66ch; }
.prose p { color: var(--ink-soft); }
.prose > :last-child { margin-bottom: 0; }

.columns-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: clamp(var(--s4), 5vw, var(--s5));
}

/* --- Spec list --------------------------------------------------------- */

.specs {
	list-style: none;
	margin: 0; padding: 0;
	border-top: 1px solid var(--line);
}
.specs li {
	display: grid;
	grid-template-columns: 10.5rem 1fr;
	gap: var(--s3);
	padding-block: 0.72rem;
	border-bottom: 1px solid var(--line);
	font-size: 0.93rem;
}
.specs dt, .specs .specs__label {
	color: var(--ink-mute);
	font-weight: 500;
}
.specs .specs__value { color: var(--ink); }

@media (max-width: 480px) {
	.specs li { grid-template-columns: 1fr; gap: 0.15rem; }
}

/* --- Pull quote -------------------------------------------------------- */

.pullquote {
	border-inline-start: 3px solid var(--gold);
	padding-inline-start: var(--s4);
	margin: var(--s4) 0;
	font-family: var(--font-display);
	font-size: 1.25rem;
	line-height: 1.5;
	color: var(--ink);
}
.pullquote cite {
	display: block;
	margin-top: var(--s2);
	font-family: var(--font-ui);
	font-size: 0.85rem;
	font-style: normal;
	color: var(--ink-mute);
}

/* --- Product grid ------------------------------------------------------ */

.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--s5) var(--s4);
	list-style: none;
	margin: 0; padding: 0;
}
.woocommerce ul.products li.product { margin: 0; text-align: left; }
.woocommerce ul.products li.product a img {
	margin-bottom: var(--s3);
	border-radius: 2px 4px 4px 2px;
	box-shadow: var(--shadow-book);
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
	font-family: var(--font-display);
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 0.35rem;
	padding: 0;
}
.woocommerce ul.products li.product .price {
	display: block;
	font-size: 0.95rem;
	color: var(--ink-soft);
	margin-bottom: var(--s2);
}

/* --- Single product ---------------------------------------------------- */

.product-hero {
	display: grid;
	grid-template-columns: minmax(220px, 360px) 1fr;
	gap: clamp(var(--s4), 6vw, var(--s6));
	align-items: start;
	padding-block: var(--s5);
}

.book-cover { position: relative; }

.product-hero__title { margin-bottom: var(--s2); }
.product-hero__title-fa {
	display: block;
	font-family: var(--font-fa);
	font-size: 0.56em;
	font-weight: 500;
	color: var(--ink-soft);
	direction: rtl;
	margin-top: 0.45em;
	line-height: 1.7;
}

.product-hero .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
	font-family: var(--font-display);
	font-size: 1.85rem;
	font-weight: 600;
	color: var(--ink);
	letter-spacing: -0.02em;
	margin: 0 0 var(--s1);
}

.woocommerce div.product form.cart {
	display: flex;
	align-items: center;
	gap: var(--s2);
	margin: var(--s3) 0 var(--s3);
}

.woocommerce .quantity input.qty {
	width: 4.5rem;
	text-align: center;
	padding: 0.85em 0.4em;
}

.stock-line {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.88rem;
	color: var(--ink-mute);
	margin-bottom: var(--s3);
}
.stock-line::before {
	content: "";
	width: 7px; height: 7px;
	border-radius: 50%;
	background: #3F7D4E;
}
.stock-line.is-out::before { background: var(--red); }

.woocommerce div.product .woocommerce-product-details__short-description {
	font-size: 1.05rem;
	color: var(--ink-soft);
	max-width: 48ch;
}

.breadcrumb {
	font-size: 0.82rem;
	color: var(--ink-mute);
	padding-block: var(--s3) 0;
}
.breadcrumb a { color: var(--ink-mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb .sep { padding-inline: 0.45em; color: var(--line); }

/* --- Cart & checkout --------------------------------------------------- */

.woocommerce table.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: 0;
	margin-bottom: var(--s4);
}
.woocommerce table.shop_table th {
	text-align: left;
	font-family: var(--font-ui);
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--ink-mute);
	padding: 0 0 0.75rem;
	border-bottom: 1px solid var(--ink);
}
.woocommerce table.shop_table td {
	padding: var(--s3) 0;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}
.woocommerce table.shop_table img { width: 58px; border-radius: 2px; box-shadow: var(--shadow-book); }

.woocommerce .cart-collaterals,
.woocommerce-cart .cart-collaterals .cart_totals {
	width: 100%;
	max-width: 420px;
	margin-inline-start: auto;
}

.woocommerce .cart_totals h2,
.woocommerce-checkout h3 {
	font-size: 1.15rem;
	padding-bottom: var(--s2);
	border-bottom: 1px solid var(--ink);
}

.woocommerce-checkout .col2-set {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: var(--s5);
}
.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 { width: auto; float: none; }

.woocommerce form .form-row { margin-bottom: var(--s3); padding: 0; }
.woocommerce form .form-row label { display: block; margin-bottom: 0.3rem; }

.woocommerce-message, .woocommerce-info, .woocommerce-error {
	list-style: none;
	background: var(--paper-2);
	border: 1px solid var(--line);
	border-inline-start: 3px solid var(--gold);
	border-radius: var(--radius);
	padding: var(--s3);
	margin: 0 0 var(--s4);
	font-size: 0.95rem;
}
.woocommerce-error { border-inline-start-color: var(--red); }

/* --- Page templates ---------------------------------------------------- */

.page-header { padding-block: var(--s5) var(--s3); }
.page-header h1 { margin: 0; }

.entry-content { max-width: 66ch; padding-bottom: var(--s6); }
.entry-content h2 { margin-top: var(--s5); }

/* --- Footer ------------------------------------------------------------ */

.site-footer {
	margin-top: auto;
	background: var(--ink);
	color: var(--paper-3);
	padding-block: var(--s5) var(--s3);
}
.site-footer a { color: var(--paper-2); text-decoration-color: var(--gold); }
.site-footer a:hover { color: var(--gold); }

.site-footer__inner {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: var(--s5);
	padding-bottom: var(--s4);
}

.site-footer__name {
	font-family: var(--font-display);
	font-size: 1.15rem;
	color: var(--white);
	margin-bottom: var(--s2);
}
.site-footer__blurb { max-width: 46ch; font-size: 0.93rem; color: #BCB2A2; }
.site-footer__contact { font-size: 0.93rem; margin: 0; }

.site-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-size: 0.93rem; }
.site-footer__list a { text-decoration: none; }
.site-footer__list a:hover { text-decoration: underline; }

.site-footer__legal {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--s2);
	padding-top: var(--s3);
	border-top: 1px solid rgba(255,255,255,.14);
	font-size: 0.8rem;
	color: #8E857A;
}
.site-footer__legal p { margin: 0; }

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

body { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1 0 auto; }

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 860px) {
	.hero__inner,
	.product-hero {
		grid-template-columns: 1fr;
		gap: var(--s4);
	}
	.hero__figure, .book-cover { max-width: 260px; }

	.site-footer__inner { grid-template-columns: 1fr; gap: var(--s4); }

	.nav-toggle {
		display: grid;
		place-items: center;
		width: 42px; height: 42px;
		background: none;
		border: 1px solid var(--line);
		border-radius: var(--radius);
		padding: 0;
		cursor: pointer;
	}
	.nav-toggle__bar,
	.nav-toggle__bar::before,
	.nav-toggle__bar::after {
		display: block;
		width: 18px; height: 1.5px;
		background: var(--ink);
		content: "";
		transition: transform .2s ease, opacity .2s ease;
	}
	.nav-toggle__bar { position: relative; }
	.nav-toggle__bar::before { position: absolute; top: -6px; }
	.nav-toggle__bar::after  { position: absolute; top: 6px; }

	.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(6px) rotate(45deg); }
	.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after  { transform: translateY(-6px) rotate(-45deg); }

	.primary-nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		top: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
		padding: var(--s3) var(--gutter) var(--s4);
	}
	.primary-nav.is-open { display: flex; }
	.primary-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.primary-nav__list li { border-bottom: 1px solid var(--line); }
	.primary-nav__list a { display: block; padding-block: 0.8rem; border: 0; }
	.cart-link { align-self: flex-start; margin-top: var(--s3); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		transition-duration: .01ms !important;
	}
}
