/* =========================================================
 * Al-Jathnan — Base Reset + RTL
 * Low-specificity foundation
 * ======================================================= */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 100px;
}

body.aj-site {
    margin: 0;
    padding: 0;
    direction: inherit;
    text-align: start;
    background: var(--aj-cream);
    color: var(--aj-charcoal);
    font-family: var(--aj-font-body);
    font-size: var(--aj-text-base);
    font-weight: var(--aj-weight-regular);
    line-height: var(--aj-leading-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* =========================================================
 * Low-specificity element defaults
 * Components/modules must always be able to override these.
 * ======================================================= */

:where(body.aj-site) ::selection {
    background: var(--aj-gold);
    color: var(--aj-navy-deep);
}

:where(body.aj-site) :where(h1, h2, h3, h4, h5, h6) {
    margin: 0;
    font-family: var(--aj-font-display);
    font-weight: var(--aj-weight-extrabold);
    line-height: var(--aj-leading-heading);
    color: var(--aj-navy);
    text-wrap: balance;
}

:where(body.aj-site) p {
    margin: 0;
    text-wrap: pretty;
}

:where(body.aj-site) :where(img, picture, svg, video) {
    display: block;
    max-width: 100%;
    height: auto;
}

:where(body.aj-site) a {
    color: inherit;
    text-decoration: none;
    transition: color var(--aj-duration-fast) var(--aj-ease-soft);
}

:where(body.aj-site) :where(button, input, textarea, select) {
    font: inherit;
    color: inherit;
}

:where(body.aj-site) button {
    cursor: pointer;
    border: 0;
    background: none;
}

:where(body.aj-site) :where(input, textarea, select) {
    direction: inherit;
    text-align: start;
}

:where(body.aj-site) :where(input::placeholder, textarea::placeholder) {
    color: var(--aj-muted-light);
    opacity: 1;
}

:where(body.aj-site) :focus-visible {
    outline: 3px solid rgba(201, 169, 97, 0.4);
    outline-offset: 4px;
    border-radius: var(--aj-radius-xs);
}

:where(body.aj-site) main {
    display: block;
}

/* IMPORTANT: zero specificity so module list spacing always wins. */
:where(body.aj-site) :where(ul, ol) {
    margin: 0;
    padding: 0;
    list-style: none;
}

:where(body.aj-site) strong {
    font-weight: var(--aj-weight-bold);
}

/* Screen reader text */
.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 {
    clip: auto !important;
    width: auto;
    height: auto;
    margin: 12px;
    padding: 12px 18px;
    overflow: visible;
    z-index: 99999;
    background: var(--aj-white);
    color: var(--aj-navy);
    border-radius: var(--aj-radius-xs);
    box-shadow: var(--aj-shadow);
}

/* Reduced 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;
    }
}

/* =========================================================
 * Astra Isolation
 * Intentional high specificity: Astra is hierarchy only.
 * ======================================================= */

body.aj-site #page,
body.aj-site .site,
body.aj-site .site-content,
body.aj-site .content-area,
body.aj-site .site-main,
body.aj-site .ast-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.aj-site #primary,
body.aj-site #primary.aj-main {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

body.aj-site .ast-separate-container,
body.aj-site .ast-plain-container {
    background: transparent !important;
}

body.aj-site #ast-scroll-top,
body.aj-site .ast-scroll-to-top-right,
body.aj-site .ast-scroll-to-top-left {
    display: none !important;
}

body.aj-home .entry-header,
body.aj-home .entry-title {
    display: none !important;
}
