/* ==========================================================================
   GF Sections Accordion – FULL CSS (updated for direct .gfmc-column children)
   ========================================================================== */

/* -----------------------------
   Accordion Header + Toggle
   ----------------------------- */

.gf-accordion-header {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gf-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    color: inherit;
    box-sizing: border-box;
}

.gf-accordion-toggle:hover,
.gf-accordion-toggle:focus {
    background-color: rgba(0,0,0,0.04);
    outline: none;
}

.gf-accordion-title {
    font-weight: 600;
    letter-spacing: 0.2px;
}

.gf-accordion-icon {
    display: inline-block;
    margin-left: 12px;
    transition: transform .22s ease, opacity .18s ease;
    font-size: 24px;
    opacity: 0.85;
}

.gf-accordion-toggle.open .gf-accordion-icon {
    transform: rotate(180deg);
    opacity: 1;
}

/* -----------------------------
   Panel Container
   ----------------------------- */

.gf-accordion-panel {
    display: none;
    padding: 14px 16px 20px 16px;
    margin: 0 0 20px 0;
    background: rgba(0,0,0,0.02);
    border-left: 3px solid rgba(0,0,0,0.08);
    border-radius: 4px;
    box-sizing: border-box;
}

@media (min-width: 720px) {
    .gf-accordion-panel {
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
}

/* -----------------------------
   Standard Gravity Fields inside panel
   ----------------------------- */

.gf-accordion-panel .gfield {
    display: block;
    margin: 0 0 14px 0;
    padding: 0;
    list-style: none;
}

.gf-accordion-panel .gfield_label {
    display: block;
    margin: 0 0 6px 0;
    font-weight: 500;
}

/* -----------------------------
   Section / Field Descriptions
   ----------------------------- */

.gf-accordion-panel .gfield_description,
.gf-accordion-panel .gsection_description,
.gf-accordion-panel .description {
    margin: 0 0 14px 0 !important;
    padding: 0;
    font-size: 16px;
    line-height: 1.45;
    color: rgba(0,0,0,0.8);
    opacity: 0.95;
}

/* Prevent description-above styles from interfering */
.gf-accordion-header.field_description_above,
.gf-accordion-header.description_above,
.gf-accordion-header.gfield_description_above {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure moved description elements are not floated or absolutely positioned */
.gf-accordion-panel .gfield_description,
.gf-accordion-panel .gsection_description {
    float: none !important;
    position: relative !important;
}

/* -----------------------------
   MULTI-COLUMN SUPPORT (all variants)
   - Supports:
     1) .gfmc-row > .gfmc-column (row-based)
     2) direct .gfmc-column siblings inside .gf-accordion-panel (your case)
   ----------------------------- */

/* If there is a .gfmc-row wrapper, prefer flex rows (keeps backward compatibility) */
.gf-accordion-panel .gfmc-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px;
    align-items: flex-start;
    margin: 0 0 14px 0;
}

/* Default column rules when columns are children of a row or direct children of the panel */
.gf-accordion-panel .gfmc-column,
.gf-accordion-panel > .gfmc-column {
    box-sizing: border-box;
    display: inline-block !important;
    vertical-align: top !important;
    margin: 0 12px 12px 0 !important;
    min-width: 120px;
    width: auto !important;
    float: none !important;
}

/* If plugin uses inline width attribute (e.g. style="width:50%"), let it govern */
.gf-accordion-panel .gfmc-column[style],
.gf-accordion-panel > .gfmc-column[style] {
    display: inline-block !important;
    width: auto !important; /* allow inline style width to take effect */
}

/* If the plugin adds explicit classes for widths like gfmc-column50, gfmc-column33 etc. handle them */
.gf-accordion-panel > .gfmc-column.gfmc-column50,
.gf-accordion-panel .gfmc-column.gfmc-column50 {
    width: calc(50% - 12px) !important; /* subtract a little to account for gap/margin */
}

/* Mobile — force full width so layout doesn't collapse */
@media (max-width: 800px) {
    .gf-accordion-panel > .gfmc-column.gfmc-column50,
    .gf-accordion-panel .gfmc-column.gfmc-column50 {
        width: 100% !important;
        margin-right: 0 !important;
    }
}

.gf-accordion-panel > .gfmc-column.gfmc-column33,
.gf-accordion-panel .gfmc-column.gfmc-column33 {
    width: calc(33.333% - 8px) !important;
}

.gf-accordion-panel > .gfmc-column.gfmc-column25,
.gf-accordion-panel .gfmc-column.gfmc-column25 {
    width: calc(25% - 9px) !important;
}

.gf-accordion-panel > .gfmc-column.gfmc-column66,
.gf-accordion-panel .gfmc-column.gfmc-column66 {
    width: calc(66.666% - 8px) !important;
}

/* Generic fallback: if many columns and no explicit class, let them share available space */
.gf-accordion-panel > .gfmc-column.flex-equal,
.gf-accordion-panel .gfmc-column.flex-equal {
    display: inline-block !important;
    width: auto !important;
}

/* Make inner ULs behave nicely (your markup shows <ul class="flex-wrapper"> inside columns) */
.gf-accordion-panel .gfmc-column ul.flex-wrapper,
.gf-accordion-panel > .gfmc-column ul.flex-wrapper {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* If you want the inner list items to be vertically stacked (typical), ensure that */
.gf-accordion-panel .gfmc-column ul.flex-wrapper > li,
.gf-accordion-panel > .gfmc-column ul.flex-wrapper > li {
    display: block;
    margin: 0 0 12px 0;
    padding: 0;
}

/* If the plugin expects the inner UL to be a flex column, we can support that too */
.gf-accordion-panel .gfmc-column ul.flex-wrapper.flex-as-col,
.gf-accordion-panel > .gfmc-column ul.flex-wrapper.flex-as-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* -----------------------------
   MOBILE: stack columns
   ----------------------------- */

@media (max-width: 640px) {
    .gf-accordion-panel .gfmc-row {
        display: block !important;
    }
    .gf-accordion-panel .gfmc-column,
    .gf-accordion-panel > .gfmc-column {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin-right: 0 !important;
    }

    /* inner lists keep spacing */
    .gf-accordion-panel .gfmc-column ul.flex-wrapper > li,
    .gf-accordion-panel > .gfmc-column ul.flex-wrapper > li {
        margin-bottom: 10px;
    }
}

/* -----------------------------
   Accessibility & cosmetic
   ----------------------------- */

.gf-accordion-panel[aria-hidden="false"] {
    overflow: visible;
}

.gf-accordion-toggle,
.gf-accordion-panel {
    transition: background 0.15s ease;
}

/* Slight shadow for panels on larger screens */
@media (min-width: 720px) {
    .gf-accordion-panel {
        box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }
}
