/* Public pages of the Rekaz product site (FAQ and topic pages); see app/public_site.php. */
:root {
    --ps-ink: #21140d;
    --ps-muted: #6b5a50;
    --ps-primary: #ff5a2f;
    --ps-primary-dark: #d9431c;
    --ps-soft: #fff7ed;
    --ps-page: #fdf8f4;
    --ps-surface: #ffffff;
    --ps-border: #efd8c8;
    --ps-dark: #2a1910;
    --ps-radius: 18px;
    --ps-font: "Droid Arabic Kufi", "Droid Kufi", Tahoma, Arial, sans-serif;
}

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

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

body.ps-body {
    margin: 0;
    background: var(--ps-page);
    color: var(--ps-ink);
    font-family: var(--ps-font);
    font-size: 16px;
    line-height: 1.9;
    direction: rtl;
}

.ps-body a {
    color: var(--ps-primary-dark);
}

.ps-body img {
    max-width: 100%;
}

.ps-container {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

.ps-narrow {
    width: min(860px, 100%);
}

.ps-icon {
    flex: none;
    width: 1.25em;
    height: 1.25em;
}

/* Header */
.ps-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--ps-border);
    backdrop-filter: blur(8px);
}

.ps-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 68px;
}

.ps-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ps-ink) !important;
    text-decoration: none;
}

.ps-brand img {
    border-radius: 12px;
    border: 1px solid var(--ps-border);
    background: #fff;
}

.ps-brand span {
    display: grid;
    line-height: 1.35;
}

.ps-brand strong {
    font-size: 1.2rem;
}

.ps-brand small {
    color: var(--ps-muted);
    font-size: .75rem;
}

.ps-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-nav__link {
    padding: 8px 10px;
    color: var(--ps-ink) !important;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.ps-nav__link:hover {
    color: var(--ps-primary-dark) !important;
}

/* Buttons */
.ps-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.ps-button--primary {
    background: var(--ps-primary);
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(255, 90, 47, .22);
}

.ps-button--primary:hover {
    background: var(--ps-primary-dark);
}

.ps-button--ghost {
    background: var(--ps-soft);
    border-color: var(--ps-border);
    color: var(--ps-primary-dark);
}

.ps-button--ghost:hover {
    border-color: var(--ps-primary);
}

.ps-button--light {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .35);
    color: #fff !important;
}

.ps-button--light:hover {
    background: rgba(255, 255, 255, .18);
}

.ps-button--large {
    min-height: 50px;
    padding: 0 22px;
    font-size: 1rem;
}

.ps-button:focus-visible,
.ps-topics__link:focus-visible,
.ps-faq__item summary:focus-visible {
    outline: 3px solid rgba(255, 90, 47, .45);
    outline-offset: 2px;
}

/* Hero */
.ps-hero {
    position: relative;
    overflow: hidden;
    padding: 44px 0 52px;
    background:
        radial-gradient(ellipse at 10% 0%, rgba(255, 90, 47, .28), transparent 55%),
        linear-gradient(160deg, #21140d, #4d2a19 70%, #6b3518);
    color: #fff;
}

.ps-hero h1 {
    max-width: 820px;
    margin: 10px 0 12px;
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    line-height: 1.45;
}

.ps-hero__lead {
    max-width: 780px;
    margin: 0;
    color: rgba(255, 255, 255, .86);
    font-size: clamp(.98rem, 2vw, 1.12rem);
}

.ps-hero__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: 14px;
    border-radius: 16px;
    background: rgba(255, 90, 47, .2);
    color: #ffb59c;
    font-size: 1.4rem;
}

.ps-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.ps-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: rgba(255, 255, 255, .7);
    font-size: .82rem;
}

.ps-breadcrumb li + li::before {
    content: "‹";
    margin-left: 6px;
}

.ps-breadcrumb a {
    color: rgba(255, 255, 255, .85) !important;
}

/* Topics strip */
.ps-topics {
    background: var(--ps-surface);
    border-bottom: 1px solid var(--ps-border);
}

.ps-topics__inner {
    display: flex;
    gap: 6px;
    padding-top: 10px;
    padding-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.ps-topics__link {
    flex: none;
    padding: 6px 12px;
    border: 1px solid var(--ps-border);
    border-radius: 999px;
    background: var(--ps-soft);
    color: var(--ps-ink) !important;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.ps-topics__link[aria-current="page"],
.ps-topics__link:hover {
    border-color: var(--ps-primary);
    background: #fff;
    color: var(--ps-primary-dark) !important;
}

/* Sections */
.ps-section {
    padding: 44px 0;
}

.ps-section--soft {
    background: #fbefe6;
}

.ps-section__title {
    margin: 0 0 18px;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    line-height: 1.5;
}

.ps-section__title:not(:first-child) {
    margin-top: 36px;
}

.ps-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ps-card {
    padding: 20px;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: var(--ps-surface);
    box-shadow: 0 12px 30px rgba(95, 50, 25, .06);
}

.ps-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ps-soft);
    color: var(--ps-primary-dark);
}

.ps-card h3 {
    margin: 12px 0 6px;
    font-size: 1.05rem;
    line-height: 1.5;
}

.ps-card p {
    margin: 0;
    color: var(--ps-muted);
    font-size: .93rem;
}

/* Law notes, example, checklist */
.ps-notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    align-items: start;
}

.ps-note {
    padding: 22px;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: var(--ps-surface);
}

.ps-note h2 {
    margin: 0 0 10px;
    font-size: 1.15rem;
    line-height: 1.5;
}

.ps-note ul {
    margin: 0;
    padding-right: 20px;
}

.ps-note li + li {
    margin-top: 8px;
}

.ps-note--example {
    border-color: rgba(255, 90, 47, .4);
    background: var(--ps-soft);
}

.ps-note__source {
    margin: 12px 0 0;
    color: var(--ps-muted);
    font-size: .8rem;
}

/* FAQ */
.ps-faq {
    display: grid;
    gap: 10px;
}

.ps-faq__item {
    border: 1px solid var(--ps-border);
    border-radius: 14px;
    background: var(--ps-surface);
}

.ps-faq__item summary {
    position: relative;
    padding: 14px 18px 14px 44px;
    font-weight: 700;
    line-height: 1.7;
    cursor: pointer;
    list-style: none;
}

.ps-faq__item summary::-webkit-details-marker {
    display: none;
}

.ps-faq__item summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--ps-primary-dark);
    font-size: 1.3rem;
    font-weight: 700;
}

.ps-faq__item[open] summary::after {
    content: "−";
}

.ps-faq__item p {
    margin: 0;
    padding: 0 18px 16px;
    color: var(--ps-muted);
}

.ps-faq__direct-link {
    display: inline-block;
    margin: 0 18px 16px;
    font-size: .8rem;
    font-weight: 700;
}

.ps-faq-controls { margin-bottom: 14px; }

.ps-faq-search {
    display: grid;
    gap: 6px;
    font-size: .9rem;
    font-weight: 700;
}

.ps-faq-search input {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #d9c1b1;
    border-radius: 10px;
    background: #fff;
    color: var(--ps-ink);
    font: inherit;
}

.ps-faq-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.ps-faq-filter {
    padding: 7px 12px;
    border: 1px solid var(--ps-border);
    border-radius: 999px;
    background: var(--ps-surface);
    color: var(--ps-ink);
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.ps-faq-filter.is-active,
.ps-faq-filter:hover,
.ps-faq-filter:focus-visible {
    border-color: var(--ps-primary);
    color: var(--ps-primary-dark);
}

.ps-faq-count {
    min-height: 1.5em;
    margin: 6px 0 0;
    color: var(--ps-muted);
    font-size: .85rem;
}

.ps-faq-group + .ps-faq-group { margin-top: 36px; }

.ps-related {
    margin: 18px 0 0;
    font-size: .92rem;
}

/* Call to action */
.ps-cta {
    padding: 40px 0;
    background: var(--ps-dark);
    color: #fff;
}

.ps-cta__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.ps-cta h2 {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    line-height: 1.5;
}

.ps-cta p {
    margin: 0;
    color: rgba(255, 255, 255, .78);
}

/* Footer */
.ps-footer {
    padding: 36px 0 90px;
    background: #170d08;
    color: rgba(255, 255, 255, .75);
    font-size: .9rem;
}

.ps-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 24px;
}

.ps-footer__brand,
.ps-footer__title {
    margin: 0 0 8px;
    color: #fff;
    font-weight: 700;
}

.ps-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ps-footer li + li {
    margin-top: 4px;
}

.ps-footer a,
.ps-footer__link {
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .8) !important;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.ps-footer a:hover,
.ps-footer__link:hover {
    color: #fff !important;
    text-decoration: underline;
}

.ps-footer__bottom {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .8rem;
}

@media (max-width: 900px) {
    .ps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ps-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .ps-footer__grid > :first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .ps-container {
        padding: 0 16px;
    }

    .ps-header__inner {
        min-height: 60px;
    }

    .ps-brand small,
    .ps-nav__link,
    .ps-header .ps-button--ghost {
        display: none;
    }

    .ps-hero {
        padding: 28px 0 36px;
    }

    .ps-hero__actions .ps-button {
        flex: 1 1 100%;
    }

    .ps-grid {
        grid-template-columns: 1fr;
    }

    .ps-section {
        padding: 32px 0;
    }

    .ps-cta .ps-button {
        width: 100%;
    }
}

/* Free calculators (/hr-tools/ and the calculator pages) */
.ps-topics__link--tool {
    border-style: dashed;
}

.ps-footer__title--next {
    margin-top: 18px !important;
}

.ps-tool-promo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 90, 47, .4);
    border-radius: var(--ps-radius);
    background: var(--ps-soft);
    color: var(--ps-ink) !important;
    text-decoration: none;
}

.ps-tool-promo .ps-icon {
    color: var(--ps-primary-dark);
}

.ps-tool-promo span {
    flex: 1;
}

.ps-tool-promo strong {
    display: block;
    color: var(--ps-primary-dark);
}

.ps-tool-promo:hover {
    border-color: var(--ps-primary);
    background: #fff;
}

.ps-card--link {
    display: block;
    color: var(--ps-ink) !important;
    text-decoration: none;
}

.ps-card--link h2 {
    margin: 12px 0 6px;
    font-size: 1.1rem;
    line-height: 1.5;
}

.ps-card--link p {
    margin: 0;
    color: var(--ps-muted);
    font-size: .92rem;
}

.ps-card--link:hover {
    border-color: var(--ps-primary);
}

.ps-card__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--ps-primary-dark);
    font-weight: 700;
}

.ps-tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.ps-tool__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.ps-form {
    display: grid;
    gap: 14px;
    padding: 22px;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: var(--ps-surface);
}

.ps-field {
    display: grid;
    gap: 5px;
}

.ps-field span {
    font-size: .92rem;
    font-weight: 700;
}

.ps-field small {
    color: var(--ps-muted);
    font-size: .8rem;
    line-height: 1.6;
}

.ps-field input,
.ps-field select {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    border: 1px solid #d9c1b1;
    border-radius: 10px;
    background: #fffaf7;
    color: var(--ps-ink);
    font: inherit;
    font-size: 1rem;
}

.ps-field input[dir="ltr"] {
    text-align: right;
}

.ps-field input:focus,
.ps-field select:focus {
    outline: none;
    border-color: var(--ps-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 90, 47, .12);
}

.ps-tool__result {
    scroll-margin-top: 90px;
}

.ps-tool__result > .ps-result {
    margin-top: 52px;
}

.ps-result {
    padding: 22px;
    border: 1px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: var(--ps-surface);
    box-shadow: 0 12px 30px rgba(95, 50, 25, .06);
}

.ps-result--empty {
    border-style: dashed;
    color: var(--ps-muted);
}

.ps-result--empty p {
    margin: 0;
}

.ps-result--error {
    border-color: #f2b8b5;
    background: #fff5f4;
}

.ps-result--error h2 {
    margin: 0 0 6px;
    color: #b42318;
    font-size: 1.05rem;
}

.ps-result--error ul {
    margin: 0;
    padding-right: 20px;
    color: #7a271a;
}

.ps-result__label {
    margin: 0;
    color: var(--ps-muted);
    font-weight: 700;
}

.ps-result__total {
    margin: 2px 0 14px;
    color: var(--ps-primary-dark);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    line-height: 1.3;
}

.ps-result__rows {
    display: grid;
    gap: 8px;
    margin: 0;
}

.ps-result__rows div {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--ps-soft);
}

.ps-result__rows dt {
    color: var(--ps-muted);
    font-size: .84rem;
}

.ps-result__rows dd {
    margin: 2px 0 0;
    font-weight: 700;
}

.ps-result__note {
    margin: 14px 0;
    color: var(--ps-muted);
    font-size: .8rem;
}

@media (max-width: 900px) {
    .ps-tool {
        grid-template-columns: 1fr;
    }

    .ps-tool__result > .ps-result {
        margin-top: 0;
    }
}

/* Language switch in the header */
.ps-nav__lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--ps-border);
    border-radius: 999px;
    color: var(--ps-ink) !important;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

.ps-nav__lang:hover {
    border-color: var(--ps-primary);
    color: var(--ps-primary-dark) !important;
}

/* English pages (/en/): left to right, system font */
body.ps-body.ps-ltr {
    direction: ltr;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
}

.ps-ltr .ps-breadcrumb li + li::before {
    content: "›";
    margin-left: 0;
    margin-right: 6px;
}

.ps-ltr .ps-faq__item summary {
    padding: 14px 44px 14px 18px;
}

.ps-ltr .ps-faq__item summary::after {
    left: auto;
    right: 16px;
}

.ps-ltr .ps-note ul,
.ps-ltr .ps-result--error ul {
    padding-right: 0;
    padding-left: 20px;
}

.ps-ltr .ps-field input[dir="ltr"] {
    text-align: left;
}

.ps-ltr .ps-icon--arrow {
    transform: scaleX(-1);
}

/* «دخول» menu: employee and administration sign-in */
.ps-login {
    position: relative;
}

.ps-login > summary {
    list-style: none;
}

.ps-login > summary::-webkit-details-marker {
    display: none;
}

.ps-login__menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 6px);
    display: grid;
    min-width: 180px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--ps-border);
    border-radius: 12px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}

.ps-login__menu a {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--ps-ink) !important;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
}

.ps-login__menu a:hover,
.ps-login__menu a:focus-visible {
    background: var(--ps-soft);
    color: var(--ps-primary-dark) !important;
}

/* Calculator pages: what Rekaz does in place of the calculation */
.ps-section__lead {
    max-width: 760px;
    margin: -6px 0 22px;
    color: var(--ps-muted);
}

.ps-pitch__actions {
    margin-top: 22px;
}

/* Newsletter sign-up under each calculator (posts to /newsletter/) */
.ps-newsletter {
    display: grid;
    gap: 14px;
}

.ps-newsletter__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 14px;
}

.ps-newsletter__consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: .9rem;
    line-height: 1.8;
    color: var(--ps-muted);
}

.ps-newsletter__consent input {
    flex: none;
    width: 20px;
    height: 20px;
    margin-top: 4px;
    accent-color: var(--ps-primary);
}

.ps-newsletter__msg {
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
}

.ps-newsletter__msg--ok {
    background: #e8f5ee;
    color: #1f6b46;
}

.ps-newsletter__msg--error {
    background: #fdecea;
    color: #a3311a;
}

.ps-hp {
    /* hidden without moving it off-page (an offset would widen the RTL page) */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 700px) {
    .ps-newsletter__fields {
        grid-template-columns: 1fr;
    }
}
