/**
 * Floratek – Accordion
 * Frontend styles — v1.0.1
 *
 * Structure:
 *   .flk-acc
 *     └ .flk-acc__item (repeated, .is-open when expanded)
 *         ├ button.flk-acc__header (icon + title + plus indicator)
 *         └ div.flk-acc__desc (panel, [hidden] when closed, max-height driven by JS)
 *
 * The right-side toggle indicator is a CSS-drawn "+" using the ::before
 * (horizontal bar) and ::after (vertical bar) pseudo-elements on
 * .flk-acc__arrow. Stroke thickness is driven by --flk-acc-stroke and the
 * whole thing inherits its color from currentColor (set by Elementor's
 * inactive/active color controls).
 */

.flk-acc {
    --flk-acc-duration: 400ms;
    width: 100%;
    box-sizing: border-box;
}

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

/* =========================================================================
   ITEM
   ========================================================================= */

.flk-acc__item {
    background-color: #F5F7FB;
    border-radius: 20px;
    /* Optional separator borders — width defaulted to 0 in PHP controls.
       Kept here for users who prefer a flat list style. */
    border-top: 0 solid #E5E7EB;
    transition: background-color var(--flk-acc-duration) ease;
}

.flk-acc__item:not(:last-child) {
    margin-bottom: 12px;
}

.flk-acc__item:last-child {
    border-bottom: 0 solid #E5E7EB;
}

.flk-acc__item.is-open {
    background-color: #0C1E3E;
}

/* =========================================================================
   HEADER (clickable button)
   ========================================================================= */

.flk-acc__header {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 22px 28px;
    background: transparent;
    border: 0;
    border-radius: inherit;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
    color: inherit;
}

.flk-acc__header:focus {
    outline: none;
}

.flk-acc__header:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* --- Icon slot --- */

.flk-acc__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: #0C1E3E;
    line-height: 0;
    transition: color var(--flk-acc-duration) ease;
}

.flk-acc__icon i,
.flk-acc__icon svg {
    width: 100%;
    height: 100%;
    color: inherit;
    display: block;
}

/* Only fill for SVGs that explicitly opt in — outline icons stay outline */
.flk-acc__icon svg [fill="currentColor"],
.flk-acc__icon svg[fill="currentColor"] {
    fill: currentColor;
}

/* Reserve the slot even when no icon, so titles stay aligned */
.flk-acc__icon--empty {
    visibility: hidden;
}

/* --- Title --- */

.flk-acc__title {
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    font-weight: 600;
    line-height: 1.25;
    color: #0C1E3E;
    min-width: 0;
    word-break: break-word;
    transition: color var(--flk-acc-duration) ease;
}

/* --- Indicator (CSS-drawn + symbol) --- */

.flk-acc__arrow {
    --flk-acc-stroke: 1.5px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    color: #0C1E3E;
    transform-origin: center;
    transition:
        color var(--flk-acc-duration) ease,
        transform var(--flk-acc-duration) ease;
}

/* Horizontal bar */
.flk-acc__arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: var(--flk-acc-stroke);
    background-color: currentColor;
    border-radius: 1px;
    transform: translateY(-50%);
}

/* Vertical bar */
.flk-acc__arrow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--flk-acc-stroke);
    height: 100%;
    background-color: currentColor;
    border-radius: 1px;
    transform: translateX(-50%);
}

/* =========================================================================
   DESCRIPTION PANEL

   The panel uses a two-layer trick for a smooth open/close animation:
   - The outer .flk-acc__desc has max-height transitioned (0 → content height,
     set inline by JS from scrollHeight measurement).
   - The inner .flk-acc__desc-inner holds the actual padding, so closing the
     outer max-height doesn't affect padding interpolation.
   ========================================================================= */

.flk-acc__desc {
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--flk-acc-duration) ease;
}

/* When fully closed, the [hidden] attribute removes it from a11y tree
   and disables its tabbable children. JS removes it on open. */
.flk-acc__desc[hidden] {
    display: none;
}

.flk-acc__desc-inner {
    padding: 0 28px 24px 80px;
    color: #FFFFFF;
    line-height: 1.5;
}

/* Reset margins of WYSIWYG children so padding above controls spacing */
.flk-acc__desc-inner > *:first-child { margin-top: 0; }
.flk-acc__desc-inner > *:last-child  { margin-bottom: 0; }

/* =========================================================================
   REDUCED MOTION
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
    .flk-acc,
    .flk-acc__item,
    .flk-acc__desc,
    .flk-acc__arrow,
    .flk-acc__icon,
    .flk-acc__title {
        transition-duration: 0ms !important;
    }
}
