/*
 Theme Name:   RAK Movers Astra Child
 Theme URI:    https://rakmoversuae.com
 Description:  Custom child theme for RAK Movers UAE, built on Astra, matching the approved HTML/Tailwind design.
 Author:       RAK Movers UAE
 Template:     astra
 Version:      1.0.0
 Text Domain:  rak-movers-astra-child
*/

/*
 * Astra's base stylesheet sets plain (unlayered) margins on bare element
 * selectors — `ol,ul{margin:0 0 1.5em 3em}`, `h2{margin-bottom:.7em}`, etc.
 * Tailwind's own Preflight resets the same properties via `:where(...)` /
 * the universal selector, which carries ZERO specificity by design — so
 * even after un-layering (see note below) Astra's plain element-selector
 * rules still win on specificity alone, adding unwanted margins/indents
 * everywhere (footer list indents, gaps under every heading, etc).
 *
 * These are plain element-selector resets at the same specificity as
 * Astra's, so normal cascade applies: any real Tailwind margin/padding
 * utility class on a given element (higher specificity) still wins over
 * this — it only fills the gap where no utility is set, matching the
 * approved design's zero-margin intent.
 */
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, blockquote, figure {
	margin: 0;
	padding: 0;
}

/*
 * Astra also hardcodes every heading level to gray — `h1{color:#808285}`,
 * `h2{color:#808285}`, … through `h6` — as a plain element selector. The
 * approved design never sets an explicit heading color; headings are meant
 * to inherit the ambient text color of their section (white on red/dark
 * CTA and hero-style sections, dark on plain white sections). Astra's rule
 * wins by specificity, so every heading sitewide renders gray/dark even
 * inside sections meant to show white text. Restoring the intended
 * inheritance here at matching specificity.
 */
h1, h2, h3, h4, h5, h6 {
	color: inherit;
}
ul, ol {
	list-style: none;
}

/*
 * NOTE: Astra prints its own unlayered `button{background-color:var(--ast-global-color-0)}`
 * rule, and the approved design's compiled CSS originally reset buttons inside
 * Tailwind v4's `@layer base`/`@layer utilities` — per the CSS Cascade Layers
 * spec, ANY unlayered rule beats a layered one regardless of source order or
 * specificity, so Astra's blue button background was winning over every
 * Tailwind bg-* utility applied to a <button> sitewide. Fixed at the source by
 * stripping the `@layer` wrappers from assets/css/tailwind.css (see inc/enqueue.php
 * comment) so it cascades as plain CSS against Astra's plain CSS — no
 * per-button overrides needed here.
 */

/*
 * Astra prints `body,button,input,select,textarea,.ast-button,.ast-custom-button
 * { line-height: var(--ast-body-line-height,1.65) }`. The approved design's base
 * line-height is 1.5 (Tailwind's default), but nothing ever sets
 * --ast-body-line-height, so every element without its own Tailwind text-size/
 * leading-* utility (plain footer widget text, nav items, form controls at
 * some breakpoints, etc.) falls back to Astra's 1.65 instead — looser spacing
 * than the approved design everywhere that isn't explicitly overridden.
 * Defining the variable here (last stylesheet loaded) fixes it at the source
 * for every element that rule targets, without touching Astra's rule itself.
 */
:root {
	--ast-body-line-height: 1.5;
}

/*
 * Astra also prints a plain `li{margin:0}` reset (specificity 0,0,1). Tailwind's
 * `space-y-*` utilities that target <li> children (footer nav columns, service
 * lists, terms/privacy pages) are compiled as `:where(.space-y-* > :not(:last-child))`
 * — `:where()` always carries ZERO specificity by design — so Astra's real-
 * specificity `li` rule silently wins and the vertical gap between list items
 * collapses to 0 everywhere, even though the approved Next.js build (which has
 * no such reset) shows the intended spacing. Re-declared here with real
 * specificity, using the same --tw-space-y-reverse variable Tailwind already
 * sets, for every space-y-* value actually used on a <ul>/<ol> of <li> in this
 * theme (1.5, 2.5, 3 — see template-parts for usage).
 */
.space-y-1\.5 > li:not(:last-child) {
	margin-block-end: calc(0.375rem * calc(1 - var(--tw-space-y-reverse, 0)));
}
.space-y-2\.5 > li:not(:last-child) {
	margin-block-end: calc(0.625rem * calc(1 - var(--tw-space-y-reverse, 0)));
}
.space-y-3 > li:not(:last-child) {
	margin-block-end: calc(0.75rem * calc(1 - var(--tw-space-y-reverse, 0)));
}

/*
 * Astra's dynamic customizer CSS also prints a plain `button{padding:15px 30px}`
 * (its inline block loads right after astra-parent-style, before this
 * stylesheet). Tailwind's own button padding reset is the universal `*{padding:0}`
 * selector — the LOWEST possible specificity, so it can never beat a real
 * `button` element selector regardless of load order. Real <button> elements
 * (e.g. the quote form's submit button) end up with 15px of unwanted
 * top/bottom padding fighting their fixed Tailwind height (h-10/h-9), squashing
 * their content — <a>-tag "buttons" are unaffected since Astra's rule only
 * targets the `button` element. Re-zeroed here with matching specificity so
 * height plus Tailwind's own horizontal/vertical padding utilities are what
 * determine button padding.
 */
button {
	padding: 0;
}

/*
 * assets/css/tailwind.css is a static copy of the approved Next.js build's
 * compiled CSS (see inc/enqueue.php), not a real Tailwind build run against
 * these WP templates — so it only contains utility rules for classes the
 * original Next.js app actually used. Our custom <select> markup (services
 * dropdown) carries an `appearance-none` class to hide the native OS arrow
 * behind our own SVG chevron, but that exact utility was never generated
 * (the original app apparently didn't need it), so selects show BOTH the
 * native browser arrow and our custom chevron. Declared directly here since
 * the compiled bundle can't supply it.
 */
select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

/*
 * Privacy Policy / Terms — this content used to be hardcoded HTML per
 * section directly in the template file, with no admin UI to edit it at
 * all. It's now real page content (post_content), editable in the normal
 * block editor, rendered via get_the_content() — these rules restore the
 * original numbered-section look (counter-based "01/02/…" prefixes,
 * section dividers) that the hardcoded markup previously hand-wrote per
 * heading, since the block editor no longer outputs those by hand.
 */
.rmc-legal-content {
	counter-reset: rmc-legal-section;
}
.rmc-legal-content h2 {
	counter-increment: rmc-legal-section;
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	font-family: var(--font-display, inherit);
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	color: var(--foreground, #1a1a1a);
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}
.rmc-legal-content h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}
.rmc-legal-content h2::before {
	content: counter(rmc-legal-section, decimal-leading-zero);
	color: color-mix(in srgb, var(--primary, #f03038) 40%, transparent);
	flex-shrink: 0;
}
.rmc-legal-content .rmc-legal-body {
	margin-top: 1rem;
}
.rmc-legal-content .rmc-legal-body p {
	margin-top: 1rem;
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--muted-foreground, #6b7280);
}
.rmc-legal-content .rmc-legal-body p:first-child {
	margin-top: 0;
}
.rmc-legal-content .rmc-legal-body ul {
	margin: 1rem 0 0 1rem;
	list-style: disc;
}
.rmc-legal-content .rmc-legal-body li {
	margin-top: 0.375rem;
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--muted-foreground, #6b7280);
}
.rmc-legal-content .rmc-legal-body a {
	color: var(--primary, #f03038);
	font-weight: 500;
}
.rmc-legal-content .rmc-legal-body a:hover {
	text-decoration: underline;
}
