/**
 * Audio (Dioendang) widget — frontend styles.
 *
 * The WIDGET WRAPPER is what gets fixed to a viewport corner — not the button
 * inside it. That is how the legacy templates were built: their audio widget
 * had no positioning of its own, the Elementor wrapper was the button
 * (Advanced → Position: fixed, background, radius, padding), and the
 * templates' cover scripts slide that wrapper in with
 * `#tombolMusik { transform: translateY(100vh) → translateY(0) }`. A
 * `transform` on an ancestor turns any `position: fixed` inside it into
 * "fixed relative to that ancestor", so fixing the inner button instead left
 * TS01–TS09's button sitting at the bottom of the page content, centred.
 * With the wrapper fixed, the same transform just slides the button off and
 * back onto the corner — the legacy behaviour.
 *
 * Two more rules keep the button where a guest can find it (assets/js/di-audio.js):
 *
 * - di-audio.js moves the fixed wrapper out of its section to the end of the
 *   page's Elementor root. Templates give their sections a z-index (TA01-TA08
 *   use 999, the TA11 family 9998), and a fixed element inside such a section
 *   can never paint above that section's later siblings: the footer covered
 *   the button on TA11-TA17, TC, TP and TS12+, a 999 section on TA01-TA08.
 *   At the root, z-index 9999 puts it above every template section, while
 *   Elementor's lightbox and popups (9999, appended to body later) still
 *   cover it.
 * - When the widget has a trigger (the "Buka Undangan" button), the wrapper
 *   stays hidden until that trigger is clicked, so it never floats over the
 *   closed cover. The :has() rule hides it before any script runs; the
 *   di-audio--waiting class is the same rule for browsers without :has().
 *
 * Which corner comes from the widget's Position control (prefix class
 * di-audio-pos-* on the wrapper); the distance from the corner comes from
 * the --di-audio-offset-x/-y custom properties set by the Offset controls.
 * Size, colors, border, radius and shadow are all controlled from the
 * Elementor Style panel — the values below are only sensible defaults.
 */

.di-audio-player {
	display: none;
}

/* The wrapper is the fixed, shrink-to-fit element (see header). `width:auto`
   and `max-width:none` undo the container-child width Elementor gives every
   widget (`--container-widget-width`), which would otherwise stretch the
   fixed box across the viewport and park the button at its left edge. */
.elementor-widget-di-audio[class*="di-audio-pos-"] {
	position: fixed;
	z-index: 9999;
	width: auto;
	max-width: none;
	margin: 0;
}

/* Hidden until the guest opens the invitation (see header). Two rules, not
   one selector list: a browser without :has() drops the whole list. */
.elementor-widget-di-audio.di-audio--waiting {
	visibility: hidden;
}

.elementor-widget-di-audio:has(.di-audio[data-trigger]):not(.di-audio--open) {
	visibility: hidden;
}

.elementor-widget-di-audio.di-audio--revealed {
	animation: di-audio-reveal 0.5s ease both;
}

@keyframes di-audio-reveal {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.elementor-widget-di-audio.di-audio--revealed {
		animation: none;
	}
}

.di-audio-toggle {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	border: 0;
	border-radius: 50%;
	background-color: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.di-audio-toggle svg {
	display: block;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.di-audio-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Play icon shows while paused; pause icon shows while playing. */
.di-audio-icon--pause {
	display: none;
}

.di-audio--playing .di-audio-icon--play {
	display: none;
}

.di-audio--playing .di-audio-icon--pause {
	display: inline-flex;
}

/* Corner positions (Position control → prefix class on the widget wrapper). */
.elementor-widget-di-audio.di-audio-pos-top-left {
	top: var(--di-audio-offset-y, 24px);
	left: var(--di-audio-offset-x, 24px);
}

.elementor-widget-di-audio.di-audio-pos-top-right {
	top: var(--di-audio-offset-y, 24px);
	right: var(--di-audio-offset-x, 24px);
}

.elementor-widget-di-audio.di-audio-pos-bottom-left {
	bottom: var(--di-audio-offset-y, 24px);
	left: var(--di-audio-offset-x, 24px);
}

.elementor-widget-di-audio.di-audio-pos-bottom-right {
	bottom: var(--di-audio-offset-y, 24px);
	right: var(--di-audio-offset-x, 24px);
}

/* Editor-only placeholder when no audio file is selected. */
.di-audio-empty {
	padding: 10px 14px;
	border: 1px dashed #bbbbbb;
	border-radius: 4px;
	color: #777777;
	font-size: 13px;
	text-align: center;
}
