/**
 * FAQ SEO/IA — front styles
 * Z Digital · Creative Elements widget
 *
 * Modern, minimalist accordion. The answer is animated open/closed with the
 * grid-template-rows 0fr→1fr technique, so height transitions are smooth and
 * the content always stays in the DOM (readable by search engines & AI).
 */

.zdf {
    --zdf-border: #e5e9f0;
    --zdf-icon: #64748b;
    --zdf-icon-open: #2563eb;
    --zdf-accent: #2563eb;
    --zdf-pad: 20px;
    width: 100%;
    box-sizing: border-box;
}

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

.zdf-inner {
    box-sizing: border-box;
}

/* ---- heading ---- */

.zdf-head {
    text-align: center;
    margin-bottom: 28px;
}

.zdf-title {
    margin: 0;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
}

.zdf-subtitle {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: #64748b;
}

/* ---- search ---- */

.zdf-search {
    position: relative;
    max-width: 520px;
    margin: 0 auto 20px;
}

.zdf--single .zdf-search {
    max-width: 520px;
}

.zdf-search-ic {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.zdf-search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid var(--zdf-border);
    border-radius: 10px;
    font-size: 15px;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.zdf-search-input:focus {
    border-color: var(--zdf-icon-open);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.zdf-noresults {
    margin: 0 0 8px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* ---- list ---- */

.zdf-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* two columns: masonry-ish flow with CSS columns keeps markup semantic */
@media (min-width: 768px) {
    .zdf--two .zdf-list {
        display: block;
        column-count: 2;
        column-gap: 20px;
    }

    .zdf--two .zdf-item {
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        margin-bottom: 12px;
    }
}

/* ---- item ---- */

.zdf-item {
    position: relative;
    overflow: hidden;
}

/* skin: cards */
.zdf--skin-card .zdf-item {
    background: #fff;
    border: 1px solid var(--zdf-border);
    border-radius: 12px;
    transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.zdf--skin-card.zdf--shadow-sm .zdf-item {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.zdf--skin-card.zdf--shadow-md .zdf-item {
    box-shadow: 0 4px 12px rgba(15, 23, 42, .07);
}

.zdf--skin-card.zdf--shadow-lg .zdf-item {
    box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

/* skin: separated by lines */
.zdf--skin-line .zdf-list {
    gap: 0;
    border-top: 1px solid var(--zdf-border);
}

.zdf--skin-line .zdf-item {
    border-bottom: 1px solid var(--zdf-border);
}

/* skin: plain */
.zdf--skin-plain .zdf-item + .zdf-item {
    border-top: 1px solid var(--zdf-border);
}

/* accent bar on the open item */
.zdf--accent .zdf-item::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--zdf-accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .3s ease;
}

.zdf--accent .zdf-item.is-open::before {
    transform: scaleY(1);
}

/* ---- question (trigger) ---- */

.zdf-q {
    margin: 0;
    font: inherit;
}

.zdf-trigger {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    margin: 0;
    padding: var(--zdf-pad);
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .2s ease;
}

.zdf--iconpos-left .zdf-trigger {
    flex-direction: row-reverse;
}

.zdf-q-text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.4;
    color: #0f172a;
    transition: color .2s ease;
}

.zdf--iconpos-left .zdf-q-text {
    text-align: left;
}

.zdf-trigger:focus-visible {
    outline: 2px solid var(--zdf-icon-open);
    outline-offset: -2px;
    border-radius: 8px;
}

/* ---- toggle icon ---- */

.zdf-icon {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6em;
    height: 1.6em;
    font-size: 20px;
    color: var(--zdf-icon);
    border-radius: 50%;
    transition: color .25s ease, background-color .25s ease, transform .3s ease;
}

.zdf-item.is-open .zdf-icon {
    color: var(--zdf-icon-open);
}

/* Plus / minus — drawn with two pseudo bars */
.zdf--icon-plus .zdf-icon::before,
.zdf--icon-plus .zdf-icon::after {
    content: "";
    position: absolute;
    background: currentColor;
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
}

.zdf--icon-plus .zdf-icon::before {
    width: 2px;
    height: .8em;
}

.zdf--icon-plus .zdf-icon::after {
    width: .8em;
    height: 2px;
}

.zdf--icon-plus .zdf-item.is-open .zdf-icon::before {
    transform: rotate(90deg);
    opacity: 0;
}

/* Chevron — drawn with a rotated border corner */
.zdf--icon-chevron .zdf-icon::before {
    content: "";
    width: .5em;
    height: .5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .3s ease;
}

.zdf--icon-chevron .zdf-item.is-open .zdf-icon::before {
    transform: translateY(2px) rotate(-135deg);
}

/* Arrow — a chevron that rotates 180deg */
.zdf--icon-arrow .zdf-icon::before {
    content: "";
    width: .5em;
    height: .5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .3s ease;
}

.zdf--icon-arrow .zdf-item.is-open .zdf-icon::before {
    transform: rotate(-135deg);
}

/* ---- answer (grid-rows collapse) ---- */

.zdf-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s ease;
}

.zdf-item.is-open .zdf-a {
    grid-template-rows: 1fr;
}

.zdf-a-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 var(--zdf-pad);
    color: #475569;
    font-size: 15px;
    line-height: 1.65;
    opacity: 0;
    transition: opacity .3s ease, padding-bottom .3s ease;
}

.zdf-item.is-open .zdf-a-inner {
    padding-bottom: var(--zdf-pad);
    opacity: 1;
}

.zdf-a-inner > :first-child {
    margin-top: 0;
}

.zdf-a-inner > :last-child {
    margin-bottom: 0;
}

.zdf-a-inner p {
    margin: 0 0 .8em;
}

.zdf-a-inner a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.zdf-a-inner ul,
.zdf-a-inner ol {
    margin: 0 0 .8em;
    padding-left: 1.25em;
}

.zdf-a-inner li {
    margin: 0 0 .3em;
}

/* When JS hasn't run yet, don't hide answers (crawlers / no-JS). */
.no-js .zdf-a,
.zdf:not([data-zdf-ready]) .zdf-item.is-open .zdf-a {
    grid-template-rows: 1fr;
}

/* ---- entrance animation (added by JS when scrolled into view) ---- */

.zdf--anim .zdf-item {
    opacity: 0;
    transition: opacity .6s ease, transform .6s ease;
    will-change: opacity, transform;
}

.zdf--anim.zdf-inview .zdf-item {
    opacity: 1;
    transform: none;
}

.zdf--anim[data-entrance="fade-up"] .zdf-item {
    transform: translateY(24px);
}

.zdf--anim[data-entrance="fade-down"] .zdf-item {
    transform: translateY(-24px);
}

.no-js .zdf--anim .zdf-item,
.zdf--anim.zdf-inview .zdf-item {
    opacity: 1;
}

/* ---- empty (editor only) ---- */

.zdf-empty {
    padding: 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

/* ---- reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
    .zdf-a,
    .zdf-a-inner,
    .zdf-icon,
    .zdf-icon::before,
    .zdf-icon::after,
    .zdf--anim .zdf-item,
    .zdf--accent .zdf-item::before {
        transition: none !important;
    }
}

/* ---- responsive ---- */

@media (max-width: 767px) {
    .zdf--two .zdf-list {
        column-count: 1;
    }

    .zdf-trigger {
        gap: 12px;
    }
}
