/**
 * rsvp-advanced.css
 * Base styles for the advanced RSVP form elements generated by rsvp-advanced.js.
 * Loaded automatically via rsvp-config-js.html.twig for all templates.
 * Template-specific overrides live in each template.html.twig.
 */

/* ─── Person card (each guest row) ─── */
.rsvp-person-card {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 4px;
}

.rsvp-person-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* ─── Number-of-persons wrapper ─── */
.rsvp-advanced-nop-wrapper label,
.rsvp-person-card label {
    display: block;
    margin-bottom: 4px;
}

/* ─── Person rows container ─── */
/* rsvp-advanced.js calls .show() on this container unconditionally, so with 0 persons
   selected it stays in the flow as an empty block and leaves a gap before the next
   question. Collapse it while empty; once person cards are appended it renders normally. */
#rsvp-persons-container:empty {
    display: none !important;
}

/* Some templates wrap the container in a `.row` / `.row.form-group` shared with the legacy
   name/partner fields (hidden in advanced mode). That wrapper keeps its bottom margin
   (Bootstrap's .form-group, or a theme rule like Glass's `.rsvp-form .row`) even when empty,
   leaving a gap. Collapse it while the container is empty — gated to the advanced form so
   legacy invitations keep their spacing. */
.rsvp-advanced-active .form-group:has(> #rsvp-persons-container:empty),
.rsvp-advanced-active .row:has(> #rsvp-persons-container:empty) {
    margin-bottom: 0 !important;
}

/* ─── Spacing between person rows ─── */
.rsvp-person-row {
    margin-bottom: 10px;
}

/* ─── Custom questions container ─── */
#rsvp-custom-questions {
    margin-top: 8px;
}

/* ─── Multiselect checkbox group ─── */
.rsvp-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.rsvp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: normal;
    padding: 6px 4px;
    line-height: 1.4;
}

.rsvp-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: currentColor;
    position: relative;
    top: 0;
}
