/* Own to invitation-website-builder-react — additions with no PHP-form
   equivalent to match. Loaded after IWB's accordion.css (see
   WebsiteFormAssets::maybe_swap_assets()), so the --iw-* custom properties
   from .iw-builder's scope are already available here. */

/* --- Show/Hide switch for optional sections (Couple Photos, Photo Gallery)
   — AccordionSection.jsx splits the header into two buttons (icon+title,
   chevron) plus this switch as a plain sibling in between, since a real
   <button> switch can't nest inside the header's own <button>. Sized/spaced
   to sit flush in the same header row as the non-toggleable variant. --- */
.iwbr-accordion-header-row {
	/* Reuses .iw-accordion-header's own flex/gap/padding/hover styling as-is
	   (same class stays on this element) — only the descendants differ. */
}

.iwbr-accordion-header-hit {
	display: flex;
	align-items: center;
	gap: 12px;
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: left;
	-webkit-tap-highlight-color: transparent;
}

.iwbr-accordion-header-hit:first-child {
	flex: 1;
	min-width: 0;
}

.iwbr-accordion-chevron-hit {
	order: -1; /* matches .iw-accordion-chevron's own order:-1 in the non-toggleable header */
	flex: 0 0 auto;
}

.iwbr-section-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.iwbr-section-toggle-label {
	font-size: var(--iw-fs-small);
	font-weight: var(--iw-fw-medium);
	color: var(--iw-muted);
	min-width: 28px;
}

.iwbr-toggle-switch {
	position: relative;
	width: 40px;
	height: 22px;
	border-radius: 999px;
	border: none;
	background: #d0d3da;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
	transition: background 0.2s ease;
}

.iwbr-toggle-switch.is-on {
	background: var(--iw-accent);
}

.iwbr-toggle-knob {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease;
}

.iwbr-toggle-switch.is-on .iwbr-toggle-knob {
	transform: translateX(18px);
}

.iwbr-section-skipped {
	margin: 0;
	padding: 4px 0 8px;
	font-size: var(--iw-fs-secondary);
	color: var(--iw-muted);
}

/* --- Inline field error text (Events section) — the original only ever
   red-bordered an invalid field via the .error class, with no text
   explaining what's actually wrong. --- */
.iwbr-field-error {
	margin: 6px 0 0;
	font-size: var(--iw-fs-small);
	color: #d33a5a;
}

/* --- Passive autosave indicator --- */
.iw-save-status {
	transition: color 0.15s ease;
}

/* --- Preview loading spinner — replaces the old scripted step list/fake
   progress bar with an honest indeterminate indicator tied to the real
   iframe 'load' event (see PreviewOverlay.jsx). --- */
.iwbr-preview-spinner {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 28px 0 4px;
}

.iwbr-preview-spinner__ring {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 3px solid var(--iw-accent-tint-strong, #ffe1eb);
	border-top-color: var(--iw-accent, #ff5c82);
	animation: iwbr-spin 0.8s linear infinite;
}

@keyframes iwbr-spin {
	to {
		transform: rotate(360deg);
	}
}

/* --- Custom song list (Background Music) — replaces the native <select>,
   which committed the instant an option was chosen with no way to audition
   a few songs first. Reuses .iw-music-play-btn as-is for the per-row play
   button so it's visually identical to the "already picked" status row's. --- */
.iwbr-song-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	max-height: 260px;
	overflow-y: auto;
	border: 1.5px solid var(--iw-input-border);
	border-radius: 12px;
}

.iwbr-song-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
}

.iwbr-song-row + .iwbr-song-row {
	border-top: 1px solid var(--iw-border);
}

.iwbr-song-row.is-playing {
	background: var(--iw-accent-tint);
}

.iwbr-song-row-name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: var(--iw-fs-secondary);
	color: var(--iw-ink);
}

.iwbr-song-row-choose {
	flex-shrink: 0;
	padding: 5px 14px;
	border: 1.5px solid var(--iw-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--iw-accent-dark);
	font-family: inherit;
	font-size: var(--iw-fs-small);
	font-weight: var(--iw-fw-semibold);
	cursor: pointer;
}

.iwbr-song-row-choose:hover {
	background: var(--iw-accent);
	border-color: var(--iw-accent);
	color: #ffffff;
}
