/*
=====================================================================
AMIABLE IMPEX — HOMEPAGE FAQ
Centered heading, two balanced columns of card accordions.
Only one answer open at a time (details[name="nx-faq"]).
Markup: resources/views/home.php (section.nx-faq)
=====================================================================
*/

.nx-faq { position: relative; isolation: isolate; overflow: hidden; }
.nx-faq::before { /* faint dot texture behind the heading */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(rgba(196, 31, 39, .16) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 55% 35% at 50% 0%, #000 0%, transparent 80%);
            mask-image: radial-gradient(ellipse 55% 35% at 50% 0%, #000 0%, transparent 80%);
    pointer-events: none;
}

/* ---------- Layout ---------- */
.nx-faq-layout { display: block; }

.nx-faq-head {
    position: static;
    display: grid;
    justify-items: center;
    gap: 16px;
    margin: 0 auto 56px;
    text-align: center;
}
html body.nx-ui main .nx-faq-head .nx-h2 {
    --h-fs: clamp(30px, 3vw, 42px);
    --h-lh: 1.1;
    color: var(--nx-ink);
}

.nx-faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    align-items: start;
    border: 0;
}
.nx-faq-col { display: grid; gap: 14px; align-content: start; }

/* ---------- Accordion card ---------- */
.nx-faq-item {
    position: relative;
    overflow: hidden;
    background: var(--nx-paper);
    border: 1px solid var(--nx-line);
    border-radius: 16px;
    transition: border-color .4s var(--nx-ease), box-shadow .4s var(--nx-ease);
}
.nx-faq-item::before { /* copper accent rail on the open card */
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--nx-copper-grad);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .5s var(--nx-ease);
}
.nx-faq-item:hover { border-color: rgba(229, 52, 59, .4); }
.nx-faq-item[open] {
    background: #fff;
    border-color: rgba(229, 52, 59, .45);
    box-shadow: 0 26px 50px -34px rgba(11, 12, 15, .4);
}
.nx-faq-item[open]::before { transform: scaleY(1); }

.nx-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 18px 18px 22px;
    list-style: none;
    cursor: pointer;
}
.nx-faq-item summary::-webkit-details-marker { display: none; }
.nx-faq-item summary span {
    font: 500 15.5px/1.45 var(--nx-sans);
    color: var(--nx-ink);
    transition: color .3s var(--nx-ease);
}
.nx-faq-item summary:hover span,
.nx-faq-item[open] summary span { color: var(--nx-copper-3); }
.nx-faq-item summary:focus-visible { outline: 2px solid var(--nx-copper); outline-offset: -2px; border-radius: 16px; }

/* Plus / minus toggle */
.nx-faq-item summary b {
    position: relative;
    flex: none;
    width: 34px; height: 34px;
    background: #fff;
    border: 1px solid var(--nx-line);
    border-radius: 10px;
    transition: background .4s var(--nx-ease), border-color .4s var(--nx-ease), transform .5s var(--nx-ease);
}
.nx-faq-item summary b::before,
.nx-faq-item summary b::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 12px; height: 1.5px;
    margin: -.75px 0 0 -6px;
    background: var(--nx-ink);
    border-radius: 2px;
    transition: transform .4s var(--nx-ease), background .4s var(--nx-ease);
}
.nx-faq-item summary b::after { transform: rotate(90deg); }
.nx-faq-item summary:hover b { border-color: rgba(229, 52, 59, .5); }
.nx-faq-item[open] summary b { background: var(--nx-copper-grad); border-color: transparent; transform: rotate(180deg); }
.nx-faq-item[open] summary b::before,
.nx-faq-item[open] summary b::after { background: #fff; }
.nx-faq-item[open] summary b::after { transform: rotate(0deg); }

/* ---------- Answer ---------- */
.nx-faq-answer {
    margin: 0 22px;
    padding: 18px 0 22px;
    font-size: 14.5px;
    line-height: 1.8;
    color: var(--nx-muted);
    border-top: 1px dashed rgba(196, 31, 39, .25);
    animation: nx-faq-in .45s var(--nx-ease);
}
.nx-faq-answer ol, .nx-faq-answer ul { margin: 6px 0 12px; padding-left: 20px; display: grid; gap: 6px; }
.nx-faq-answer ol { list-style: decimal; }
.nx-faq-answer ul { list-style: none; padding-left: 0; }
.nx-faq-answer ul li { position: relative; padding-left: 18px; }
.nx-faq-answer ul li::before { content: ""; position: absolute; left: 0; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: var(--nx-copper); }
.nx-faq-answer ol li::marker { color: var(--nx-copper-3); font-weight: 600; }
.nx-faq-answer strong { color: var(--nx-ink); font-weight: 600; }
.nx-faq-answer p + p, .nx-faq-answer ol + p, .nx-faq-answer ul + p { margin-top: 10px; }
@keyframes nx-faq-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .nx-faq-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .nx-faq-head { margin-bottom: 40px; }
    .nx-faq-item summary { padding: 16px 14px 16px 18px; }
    .nx-faq-item summary span { font-size: 15px; }
    .nx-faq-answer { margin: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .nx-faq-item, .nx-faq-item::before, .nx-faq-item summary b, .nx-faq-answer { transition: none !important; animation: none !important; }
}
