/* FAQ: home section (index.html #faq) and FAQs.html — self-contained; no Tailwind rebuild needed */

:root {
    --faq-green: #008b2c;
    --faq-green-700: #006b22;
    --faq-green-50: #f1f9f3;
    --faq-green-100: #dcefe2;
    --faq-ink: #16202a;
    --faq-text: #4b5563;
    --faq-muted: #5b6770;
    --faq-line: #e8edea;
    --faq-header-h: 61px;
    --faq-chips-h: 56px;
    --faq-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Classes below set their own display, so [hidden] needs to win explicitly */
.faq-section [hidden],
.faq-page main [hidden] { display: none !important; }

.faq-sr {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Home section ---------- */
.faq-section {
    padding: 88px 0;
    background: linear-gradient(180deg, #f3faf5 0%, #ffffff 100%);
    font-family: 'Cairo', sans-serif;
}
.faq-wrap { max-width: 820px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .faq-wrap { padding: 0 32px; } }
.faq-head { text-align: center; margin-bottom: 32px; }
.faq-title { font-size: 30px; font-weight: 800; line-height: 1.3; color: var(--faq-ink); margin: 0; }
@media (min-width: 768px) { .faq-title { font-size: 38px; } }
.faq-title-line {
    display: block;
    width: 48px; height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: var(--faq-green);
}

/* ---------- Accordion: one quiet list, rows split by hairlines ---------- */
.faq-list {
    background: #ffffff;
    border: 1px solid var(--faq-line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03), 0 12px 32px -24px rgba(16, 24, 40, 0.18);
}
/* Every row draws its top line; the first visible one tucks under the list border */
.faq-item {
    position: relative;
    margin-top: -1px;
    border-top: 1px solid var(--faq-line);
    scroll-margin-top: 84px;
    transition: background-color 0.25s ease;
}
.faq-item::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    inset-inline-start: 0;
    width: 3px;
    background: var(--faq-green);
    transform: scaleY(0);
    transition: transform 0.3s var(--faq-ease);
}
.faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--faq-ink);
    text-align: start;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}
@media (min-width: 768px) { .faq-q { font-size: 17px; padding: 18px 26px; } }
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--faq-green-700); }
.faq-q:focus-visible { outline: 3px solid rgba(0, 139, 44, 0.45); outline-offset: -3px; }
.faq-q-text { flex: 1 1 auto; min-width: 0; }
.faq-icon {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    color: #9aa5ad;
    transition: transform 0.3s var(--faq-ease), color 0.2s ease;
}
.faq-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.faq-q:hover .faq-icon { color: var(--faq-green); }
.faq-a { overflow: hidden; }
.faq-a-inner { padding: 0 20px 20px; }
@media (min-width: 768px) { .faq-a-inner { padding: 0 26px 24px; } }
.faq-a-text { margin: 0; max-width: 68ch; font-size: 15px; line-height: 1.9; color: var(--faq-text); text-align: start; }
@media (min-width: 768px) { .faq-a-text { font-size: 16px; } }
.faq-a-text a {
    color: var(--faq-green-700);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(0, 139, 44, 0.4);
    text-underline-offset: 4px;
}
.faq-a-text a:hover { text-decoration-color: currentColor; }

/* Open state: .is-open is driven by faq.js; [open] covers the no-JS <details> fallback */
.faq-item.is-open,
html:not(.faq-js) .faq-item[open] { background: var(--faq-green-50); }
.faq-item.is-open::before,
html:not(.faq-js) .faq-item[open]::before { transform: scaleY(1); }
.faq-item.is-open .faq-q,
html:not(.faq-js) .faq-item[open] .faq-q { color: var(--faq-green-700); }
.faq-item.is-open .faq-icon,
html:not(.faq-js) .faq-item[open] .faq-icon { transform: rotate(45deg); color: var(--faq-green); }

html.faq-js .faq-a { transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
html.faq-js .faq-a-inner { opacity: 0; transition: opacity 0.2s ease; }
html.faq-js .faq-item.is-open .faq-a-inner { opacity: 1; transition: opacity 0.25s ease 0.08s; }

/* ---------- Scroll reveal (hidden state only exists once faq.js has run) ---------- */
html.faq-js .faq-reveal { opacity: 0; transform: translateY(16px); }
html.faq-js .faq-reveal--head { transform: translateX(-20px); }
html.faq-js[dir="rtl"] .faq-reveal--head { transform: translateX(20px); }
html.faq-js .faq-reveal.is-in {
    opacity: 1;
    transform: none;
    transition: opacity 0.5s var(--faq-ease), transform 0.5s var(--faq-ease);
    transition-delay: calc(var(--faq-i, 0) * 60ms);
}

/* ---------- Buttons & links ---------- */
.faq-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; margin-top: 28px; }
.faq-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px;
    padding: 11px 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.faq-btn svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.faq-btn svg.faq-fill { fill: currentColor; stroke: none; }
.faq-btn:focus-visible, .faq-link:focus-visible, .faq-chip:focus-visible { outline: 3px solid rgba(0, 139, 44, 0.45); outline-offset: 3px; }
.faq-btn--primary { background: #00872b; color: #ffffff; }
.faq-btn--primary:hover { background: var(--faq-green-700); }
.faq-btn--outline { background: #ffffff; color: var(--faq-ink); border-color: var(--faq-line); }
.faq-btn--outline:hover { border-color: var(--faq-green); color: var(--faq-green-700); }
.faq-link {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 44px;
    font-size: 15px; font-weight: 700;
    color: var(--faq-green-700);
    text-decoration: none;
}
.faq-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
[dir="rtl"] .faq-link svg { transform: scaleX(-1); }
.faq-link:hover svg { transform: translateX(3px); }
[dir="rtl"] .faq-link:hover svg { transform: scaleX(-1) translateX(3px); }

/* ---------- FAQs.html ---------- */
.faq-page { background: #ffffff; color: var(--faq-ink); font-family: 'Cairo', sans-serif; line-height: 1.7; }
/* The page is light from the top, so the header keeps its solid (scrolled) look throughout */
.faq-page .hdr { background: rgba(13, 17, 23, 0.92); }
.faq-page .hdr-progress { display: none; }
.faq-container { max-width: 820px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .faq-container { padding: 0 32px; } }

.faq-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; pointer-events: none; }
.faq-progress span {
    display: block;
    height: 100%;
    background: var(--faq-green);
    transform: scaleX(0);
    transform-origin: left center;
}
[dir="rtl"] .faq-progress span { transform-origin: right center; }

.faq-hero {
    padding: 124px 0 44px;
    text-align: center;
    background: linear-gradient(180deg, #eef8f1 0%, #ffffff 100%);
}
@media (min-width: 1024px) { .faq-hero { padding: 156px 0 56px; } }
.faq-crumbs { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--faq-muted); }
.faq-crumbs a { color: var(--faq-green-700); text-decoration: none; }
.faq-crumbs a:hover { text-decoration: underline; }
.faq-hero-title { font-size: 32px; font-weight: 800; line-height: 1.3; color: var(--faq-ink); margin: 0; }
@media (min-width: 768px) { .faq-hero-title { font-size: 44px; } }
.faq-search { position: relative; max-width: 520px; margin: 24px auto 0; }
.faq-search svg {
    position: absolute;
    top: 50%;
    inset-inline-start: 18px;
    width: 20px; height: 20px;
    margin-top: -10px;
    fill: none; stroke: #9aa5ad; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    pointer-events: none;
}
.faq-search input {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 20px;
    padding-inline-start: 50px;
    border: 1px solid var(--faq-line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--faq-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    text-align: start;
    box-shadow: 0 10px 28px -18px rgba(16, 24, 40, 0.28);
    -webkit-appearance: none;
            appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.faq-search input::placeholder { color: #9aa5ad; font-weight: 500; }
.faq-search input:focus { outline: none; border-color: var(--faq-green); box-shadow: 0 0 0 4px rgba(0, 139, 44, 0.12); }

/* Sticky topic chips */
.faq-chips {
    position: sticky;
    top: var(--faq-header-h);
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--faq-line);
    transition: top 0.35s ease;
}
body.hdr-hidden .faq-chips { top: 0; }
.faq-chips-track {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    height: var(--faq-chips-h);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.faq-chips-track::-webkit-scrollbar { display: none; }
.faq-chip {
    flex: 0 0 auto;
    display: inline-flex; align-items: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--faq-muted);
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.25s ease;
}
.faq-chip:hover { color: var(--faq-ink); }
.faq-chip.is-active { color: var(--faq-green-700); }
/* 1px bar positioned and stretched with a transform only, so moving it never causes layout */
.faq-chip-ind {
    position: absolute;
    left: 0; bottom: 0;
    width: 1px; height: 2px;
    background: var(--faq-green);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}
.faq-chip-ind.is-ready { transition: transform 0.35s var(--faq-ease); }

.faq-main { padding: 12px 0 72px; }
.faq-group { padding-top: 44px; }
.faq-page .faq-group { scroll-margin-top: calc(var(--faq-header-h) + var(--faq-chips-h) - 16px); }
.faq-page .faq-item { scroll-margin-top: calc(var(--faq-header-h) + var(--faq-chips-h) + 16px); }
.faq-group-title { margin: 0 0 14px; font-size: 20px; font-weight: 800; line-height: 1.4; color: var(--faq-ink); }
@media (min-width: 768px) { .faq-group-title { font-size: 22px; } }

.faq-empty { margin-top: 44px; padding: 40px 20px; text-align: center; }
.faq-empty-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 52px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: var(--faq-green-50);
    color: var(--faq-green);
}
.faq-empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.faq-empty-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--faq-ink); }
.faq-empty-text { margin: 6px 0 0; font-size: 15px; color: var(--faq-muted); }
.faq-empty .faq-actions { margin-top: 20px; }

/* Closing call to action: a soft card, not a dark band */
.faq-cta { padding: 0 20px 80px; background: #ffffff; text-align: center; }
.faq-cta .faq-container {
    padding: 40px 24px;
    border: 1px solid var(--faq-green-100);
    border-radius: 24px;
    background: var(--faq-green-50);
}
.faq-cta-title { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.3; color: var(--faq-ink); }
@media (min-width: 768px) { .faq-cta-title { font-size: 28px; } }
.faq-cta-text { margin: 6px 0 0; font-size: 16px; color: var(--faq-muted); }
.faq-cta .faq-actions { margin-top: 22px; }

@media (prefers-reduced-motion: reduce) {
    html.faq-js .faq-reveal,
    html.faq-js .faq-reveal--head,
    html.faq-js[dir="rtl"] .faq-reveal--head { opacity: 1; transform: none; transition: none; }
    html.faq-js .faq-a, html.faq-js .faq-a-inner,
    .faq-item, .faq-item::before, .faq-icon, .faq-chip-ind.is-ready, .faq-chips, .faq-btn, .faq-link svg { transition: none; }
}
