/**
 * Base look for the di-rsvp and di-wishes Elementor widgets.
 *
 * This is what a template shows when it sets no style on the widgets, and it
 * is neutral on purpose (ADR 0013): text color and font come from the page,
 * fields are transparent with a thin border in the text color, and the Kirim
 * button is filled with the text color. On a light section, 37 of the 49
 * templates, that reads well untouched. A dark section needs its per-template
 * style values, written into the template from the style file in git.
 *
 * Nothing here may be moved into a control default: Elementor prints a
 * control's default into every saved page (see the plugin CLAUDE.md).
 *
 * Specificity budget. Elementor's control selectors are {{WRAPPER}} (three
 * classes: .elementor-N .elementor-element.elementor-element-ID) plus the
 * part, so four classes and up. Rules here stay at two or three, so a value
 * set in the editor always wins, whichever file the browser loads last. They
 * still need two classes (.di-rsvp .di-rsvp-x): hello-elementor's reset
 * styles bare `label`, `fieldset`, `input[type=text]`, and `button`,
 * `[type=submit]:hover` and `button:focus` in its pink #c36.
 *
 * Deliberate exceptions, counting a state (`:checked`) or an attribute as a
 * class the way specificity does. tests/di-invitation-widgets.test.js holds
 * this list; a new rule above three belongs here first, with its reason.
 *
 *   - The attendance colors. A ticked Hadir, Tidak Hadir or Masih Ragu and a
 *     wish badge are drawn from six custom properties, and the ticked rules
 *     sit at five and six classes so that a template's normal-state choice
 *     controls (border and text color, four classes) cannot paint over the
 *     green, red or yellow. A template tunes them through the Attendance
 *     Colors controls, which redefine the properties, never the rules.
 *   - A ticked choice's mark and text (`.di-rsvp-choice-input:checked +
 *     .di-rsvp-choice-box > .di-rsvp-choice-mark`, four), and the radio dot
 *     and the checkbox tick (the same with `.di-rsvp-choice--radio` or
 *     `--checkbox` in front, five). The checked state lives on the hidden
 *     input, a sibling of the box, so the selector has to name the input, its
 *     state, the box and the part, and the dot and the tick need the choice
 *     type on top. No template value is lost to them: the one control that
 *     reaches these parts while ticked, Selected Text Color, writes at nine,
 *     and no control sets the dot's background image or the tick's ::after.
 *   - The focus outline taken back after a tap
 *     (`.di-rsvp-choice-input:focus:not(:focus-visible) + .di-rsvp-choice-box`,
 *     four): it has to name both states of the input. No control sets an
 *     outline.
 *   - The current page number in the Wishes pagination
 *     (`.di-wishes .di-wishes-page[aria-current="page"] .di-wishes-page-text`,
 *     four). The attribute is what tells the current page from the others,
 *     and the root class scopes it to the widget like every rule here. The
 *     Kirim Text Color control writes it at six, so a template's value still
 *     wins.
 *
 * Spacing between rows is an adjacent-sibling margin, never flex `gap`: flex
 * gap is Chrome 84 / iOS Safari 14.5, above the device floor these
 * invitations are opened on, and it degrades to zero there. Grid gap is far
 * older and is used for the counts bar only.
 *
 * `color-mix()` is Chrome 111 / iOS Safari 16.2. Every use sits after a
 * plain declaration of the same property, so an older browser keeps the
 * plain one.
 *
 * @package Dioendang_Id_Render_Engine
 */

/*
 * Elementor's wrapper around each widget takes the full width of its
 * container. A template section that centres its children (a flex column
 * with `align-items: center`, as ta01, ta02, ta04, ta06 and ta08 do) sizes a
 * child with no width of its own to its content, which shrank the forms to
 * about 240px. One class per selector on purpose: Elementor writes a widget's
 * own Width control (`_element_width`, `_element_custom_width`) at
 * `.elementor-N .elementor-element.elementor-element-ID`, which beats it.
 */
.elementor-widget-di-rsvp,
.elementor-widget-di-wishes {
	width: 100%;
	max-width: 100%;
}

/*
 * Attendance colors, one set for a ticked answer in the RSVP form and for the
 * badge on a wish, so the two sections always agree. Each fill has its own
 * ink. The fills are strong enough to read as green, red and yellow on a
 * dark section and on a light one, and the ink, not the section, is what
 * the text is read against. WCAG 2 contrast of ink on fill:
 *
 *   Hadir        #27794A with #FFFFFF   5.36:1
 *   Tidak Hadir  #B3261E with #FFFFFF   6.54:1
 *   Masih Ragu   #E2A600 with #2B2100   7.34:1
 *
 * All three clear 4.5:1, the bar for body text. A template changes them
 * with the Attendance Colors controls (Di_Form_Style_Controls), which set
 * these properties on the same root; keep each pair at 4.5:1 or better.
 */
.di-rsvp,
.di-wishes {
	--di-attend-yes: #27794A;
	--di-attend-yes-ink: #FFFFFF;
	--di-attend-no: #B3261E;
	--di-attend-no-ink: #FFFFFF;
	--di-attend-maybe: #E2A600;
	--di-attend-maybe-ink: #2B2100;

	box-sizing: border-box;
	max-width: 100%;
	color: inherit;
}

/* A hidden part stays hidden whatever display a rule below gives it. */
.di-rsvp [hidden],
.di-wishes [hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- *
 * Title & intro
 * ---------------------------------------------------------------- */

.di-rsvp .di-rsvp-title,
.di-wishes .di-wishes-title {
	margin: 0 0 0.5em;
	color: inherit;
	font-family: inherit;
}

.di-rsvp .di-rsvp-intro {
	margin: 0 0 1.25em;
}

/* ---------------------------------------------------------------- *
 * Form and rows
 * ---------------------------------------------------------------- */

.di-rsvp .di-rsvp-form,
.di-wishes .di-wishes-form {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.di-rsvp .di-rsvp-form > * + *,
.di-rsvp .di-rsvp-fields > * + *,
.di-wishes .di-wishes-form > * + * {
	margin-top: 1.1em;
}

/* Rows never set margin-top themselves: the sibling rule above owns it. */
.di-rsvp .di-rsvp-field,
.di-wishes .di-wishes-field {
	display: block;
	min-width: 0;
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 0;
	padding: 0;
	border: 0;
}

.di-rsvp .di-rsvp-form.is-busy,
.di-wishes .di-wishes-form.is-busy {
	pointer-events: none;
}

/* ---------------------------------------------------------------- *
 * Labels
 * ---------------------------------------------------------------- */

/* `display: block` on the legends too: a legend is otherwise drawn into the
   fieldset's top border and ignores the label's alignment. */
.di-rsvp .di-rsvp-label,
.di-wishes .di-wishes-label {
	display: block;
	float: none;
	width: 100%;
	margin: 0 0 0.45em;
	padding: 0;
	color: inherit;
	font-size: 0.9em;
	line-height: 1.4;
	letter-spacing: 0.01em;
	vertical-align: baseline;
}

/* ---------------------------------------------------------------- *
 * Fields
 * ---------------------------------------------------------------- */

.di-rsvp .di-rsvp-input,
.di-wishes .di-wishes-input {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 2.9em;
	margin: 0;
	padding: 0.7em 0.9em;
	font: inherit;
	line-height: 1.4;
	color: inherit;
	background-color: transparent;
	border: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	border-radius: 0.5em;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* The placeholder is the text color, dimmed but still readable. */
.di-rsvp .di-rsvp-input::placeholder,
.di-wishes .di-wishes-input::placeholder {
	color: inherit;
	opacity: 0.6;
}

.di-rsvp .di-rsvp-input:focus,
.di-wishes .di-wishes-input:focus {
	border-color: currentColor;
	box-shadow: 0 0 0 1px currentColor;
	outline: none;
}

.di-rsvp .di-rsvp-input[readonly],
.di-wishes .di-wishes-input[readonly] {
	opacity: 0.75;
	cursor: default;
}

.di-wishes .di-wishes-message {
	min-height: 6.5em;
	resize: vertical;
}

/* ---------------------------------------------------------------- *
 * Guest-count stepper: minus, number, plus
 * ---------------------------------------------------------------- */

.di-rsvp .di-rsvp-stepper {
	display: flex;
	align-items: stretch;
}

.di-rsvp .di-rsvp-stepper > .di-rsvp-party {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	margin: 0 0.5em;
	text-align: center;
	-moz-appearance: textfield;
}

.di-rsvp .di-rsvp-party::-webkit-inner-spin-button,
.di-rsvp .di-rsvp-party::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* The :hover and :focus copies undo the theme reset's pink hover fill. */
.di-rsvp .di-rsvp-step,
.di-rsvp .di-rsvp-step:hover,
.di-rsvp .di-rsvp-step:focus {
	position: relative;
	flex: 0 0 auto;
	width: 2.9em;
	min-height: 2.9em;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	background-color: transparent;
	border: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	border-radius: 0.5em;
	box-shadow: none;
	outline: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.di-rsvp .di-rsvp-step:active {
	background-color: rgba(128, 128, 128, 0.15);
	background-color: color-mix(in srgb, currentColor 12%, transparent);
}

.di-rsvp .di-rsvp-step:focus-visible {
	border-color: currentColor;
	box-shadow: 0 0 0 1px currentColor;
}

/* Drawn, not typed: a "-" or "+" glyph sits off-center in many fonts. */
.di-rsvp .di-rsvp-step::before,
.di-rsvp .di-rsvp-step--plus::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0.8em;
	height: 2px;
	margin: -1px 0 0 -0.4em;
	background-color: currentColor;
	border-radius: 1px;
}

.di-rsvp .di-rsvp-step--plus::after {
	width: 2px;
	height: 0.8em;
	margin: -0.4em 0 0 -1px;
}

.di-rsvp .di-rsvp-step[aria-disabled="true"] {
	opacity: 0.35;
	cursor: default;
}

/* ---------------------------------------------------------------- *
 * Helper text
 * ---------------------------------------------------------------- */

.di-rsvp .di-rsvp-hint,
.di-wishes .di-wishes-counter {
	margin: 0.4em 0 0;
	font-size: 0.85em;
	line-height: 1.4;
	opacity: 0.75;
}

.di-wishes .di-wishes-counter {
	text-align: right;
}

/* ---------------------------------------------------------------- *
 * Choices: attendance radios and acara checkboxes, one look
 * ---------------------------------------------------------------- */

.di-rsvp .di-rsvp-choices {
	margin: 0;
	padding: 0;
}

.di-rsvp .di-rsvp-choices > * + * {
	margin-top: 0.5em;
}

.di-rsvp .di-rsvp-choice {
	position: relative;
	display: block;
	line-height: inherit;
	vertical-align: baseline;
	cursor: pointer;
}

/* The native input stays in the tree (focusable, keyboard-operable,
   announced, submitted) and only turns invisible. */
.di-rsvp .di-rsvp-choice-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	opacity: 0;
	pointer-events: none;
}

.di-rsvp .di-rsvp-choice-box {
	display: flex;
	align-items: center;
	min-height: 2.9em;
	padding: 0.65em 0.9em;
	color: inherit;
	line-height: 1.4;
	text-align: left;
	background-color: transparent;
	border: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	border-radius: 0.5em;
	-webkit-user-select: none;
	user-select: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Border-box, so Mark Size is the ring's outer size whatever the theme
   resets (Elementor's own frontend CSS already makes it border-box). */
.di-rsvp .di-rsvp-choice-mark {
	position: relative;
	flex: 0 0 auto;
	box-sizing: border-box;
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.75em;
	border: 2px solid currentColor;
	border-radius: 50%;
	background-repeat: no-repeat;
	--di-dot-edge: 0.5px;
}

/* The radio dot's soft edge, about one device pixel wide (see below). */
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx) {

	.di-rsvp .di-rsvp-choice-mark {
		--di-dot-edge: 0.25px;
	}
}

@media (-webkit-min-device-pixel-ratio: 2.5), (min-resolution: 2.5dppx) {

	.di-rsvp .di-rsvp-choice-mark {
		--di-dot-edge: 0.17px;
	}
}

.di-rsvp .di-rsvp-choice--checkbox .di-rsvp-choice-mark {
	border-radius: 0.25em;
}

.di-rsvp .di-rsvp-choice-text {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: break-word;
}

/*
 * Selected: the box fills with the text color, and the mark and text turn
 * black or white against that fill (the contrast filter under the Kirim
 * button below, written once for both). Three classes, one short of any
 * control, and the controls' normal background targets `:not(:checked)`, so
 * a template that styles the unticked look never paints over this one. A
 * ticked attendance answer then takes its own color, further down.
 */
.di-rsvp-choice-input:checked + .di-rsvp-choice-box {
	background-color: currentColor;
	border-color: currentColor;
}

.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-mark,
.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-text {
	color: var(--di-choice-fill, currentColor);
}

/*
 * The radio dot is painted inside the ring's own box, as a radial gradient,
 * rather than drawn as a second box placed in the middle of it. It used to be
 * an ::after at top: 50% and left: 50% pulled back by half its size. The
 * browser rounds the ring's edges and the dot's edges to device pixels
 * separately, from fractional positions, so the dot landed up to a whole
 * device pixel off center (1px at 1x, 0.5px at 2x) depending on where the
 * row happened to fall, and at a Mark Size like 17px or 1.1em it showed.
 * A gradient's center is the center of the box the ring is drawn on, after
 * rounding, so the two cannot drift at any size, zoom or pixel ratio.
 * `closest-side` makes 100% the inner radius; the dot is 55% of it. Its
 * edge is a soft band one device pixel wide (--di-dot-edge, set per pixel
 * ratio on the mark): a hard stop comes out jagged at 1x, and a whole CSS
 * pixel of blur shows at 2x and 3x.
 */
.di-rsvp-choice--radio .di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-mark {
	background-image: radial-gradient(circle closest-side, currentColor calc(55% - var(--di-dot-edge)), transparent calc(55% + var(--di-dot-edge)));
}

/*
 * The checkbox tick, for the same reason not a rotated half-border box: a box
 * that exactly covers the inside of the mark (so it rounds with the mark's
 * edges) filled in the mark's color and cut to a tick by an SVG mask. The
 * tick is centered inside the SVG's own coordinates and scales with the mark.
 */
.di-rsvp-choice--checkbox .di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-mark::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background-color: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.75 6.125 5 8.375l4.25-4.75' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.75 6.125 5 8.375l4.25-4.75' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}

/*
 * A ticked attendance answer: Hadir green, Tidak Hadir red, Masih Ragu
 * yellow, with the ink that reads on it, from the properties at the top of
 * this file. The state class picks the pair once, and one rule draws it.
 * Unticked answers keep the neutral look above. Five classes, see the
 * specificity note at the top; no !important, so forced colors below still
 * replaces all of it with the system Highlight pair.
 */
.di-rsvp .di-rsvp-choice--attending {
	--di-attend-fill: var(--di-attend-yes);
	--di-attend-fill-ink: var(--di-attend-yes-ink);
}

.di-rsvp .di-rsvp-choice--not_attending {
	--di-attend-fill: var(--di-attend-no);
	--di-attend-fill-ink: var(--di-attend-no-ink);
}

.di-rsvp .di-rsvp-choice--undecided {
	--di-attend-fill: var(--di-attend-maybe);
	--di-attend-fill-ink: var(--di-attend-maybe-ink);
}

.di-rsvp .di-rsvp-choice--attendance .di-rsvp-choice-input:checked + .di-rsvp-choice-box {
	background-color: var(--di-attend-fill);
	border-color: var(--di-attend-fill);
}

/* The ink is known, so the black-or-white filter is not needed. */
.di-rsvp .di-rsvp-choice--attendance .di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-mark,
.di-rsvp .di-rsvp-choice--attendance .di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-text {
	color: var(--di-attend-fill-ink);
	-webkit-filter: none;
	filter: none;
}

/* Keyboard focus shows on the box, since the input itself is invisible.
   `:focus` first for browsers without :focus-visible, then taken back for a
   tap or click where the browser supports telling them apart. */
.di-rsvp-choice-input:focus + .di-rsvp-choice-box {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.di-rsvp-choice-input:focus:not(:focus-visible) + .di-rsvp-choice-box {
	outline: none;
}

.di-rsvp-choice-input:focus-visible + .di-rsvp-choice-box {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- *
 * Kirim button
 * ---------------------------------------------------------------- */

/* The :hover and :focus copies undo the theme reset's pink fill. */
.di-rsvp .di-rsvp-submit,
.di-rsvp .di-rsvp-submit:hover,
.di-rsvp .di-rsvp-submit:focus,
.di-wishes .di-wishes-submit,
.di-wishes .di-wishes-submit:hover,
.di-wishes .di-wishes-submit:focus {
	display: block;
	align-self: stretch;
	width: auto;
	min-height: 2.9em;
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 0;
	padding: 0.75em 1.5em;
	font: inherit;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	color: inherit;
	background-color: currentColor;
	background-image: none;
	border: 1px solid currentColor;
	border-radius: 0.5em;
	box-shadow: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

/*
 * The button text has to contrast with a fill whose color this file cannot
 * know: currentColor is dark on a light section and light on a dark one.
 * The text is drawn in the fill color itself, then filtered: invert(1) flips
 * it to the opposite lightness, grayscale(1) drops the hue, and contrast(100)
 * pushes that gray to pure black or pure white. So a dark fill gets white
 * text and a light fill gets black, with no JavaScript and no color list.
 * Filters are Chrome 18 / iOS Safari 6 with the prefix, well under the device
 * floor. The one blind spot is a mid gray within a percent of 50%, which
 * nobody picks as a text color.
 *
 * The fill is read from --di-button-fill when the Background Color control
 * set one, so the text contrasts the real fill; otherwise from currentColor.
 * Filters keep alpha, so a translucent fill needs a Text Color, which turns
 * the filter off (see Di_Form_Style_Controls).
 *
 * The same filter draws a selected choice's mark and text, and the number of
 * the current page in the Wishes pagination, which is filled like Kirim, so
 * it is written once, for all three.
 */
.di-rsvp .di-rsvp-submit-text,
.di-wishes .di-wishes-submit-text,
.di-wishes .di-wishes-page[aria-current="page"] .di-wishes-page-text {
	display: inline-block;
	color: var(--di-button-fill, currentColor);
}

.di-rsvp .di-rsvp-submit-text,
.di-wishes .di-wishes-submit-text,
.di-wishes .di-wishes-page[aria-current="page"] .di-wishes-page-text,
.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-mark,
.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-text {
	-webkit-filter: invert(1) grayscale(1) contrast(100);
	filter: invert(1) grayscale(1) contrast(100);
}

/*
 * Windows High Contrast and every other forced-colors mode. The browser
 * replaces the fill with a system color but still runs the filter over the
 * text it forced, so the label comes out inverted onto its own background:
 * the Kirim button and a selected choice would read as blank. The filter goes,
 * and a selected choice, whose fill the browser has just thrown away, is
 * drawn in the system Highlight pair so the guest can still see which one is
 * ticked. That covers a ticked attendance answer too: its green, red or
 * yellow gives way to Highlight. `forced-color-adjust: none` is inherited by
 * the mark, which is what keeps its gradient dot and its masked tick, both
 * of which forced colors would otherwise strip.
 */
@media (forced-colors: active) {

	.di-rsvp .di-rsvp-submit-text,
	.di-wishes .di-wishes-submit-text,
	.di-wishes .di-wishes-page[aria-current="page"] .di-wishes-page-text,
	.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-mark,
	.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-text {
		-webkit-filter: none;
		filter: none;
	}

	/* `!important` because a template's selected-choice controls outrank
	   this file, and in this mode the user's colors must win over theirs. */
	.di-rsvp-choice-input:checked + .di-rsvp-choice-box {
		forced-color-adjust: none;
		color: HighlightText !important;
		background-color: Highlight !important;
		border-color: Highlight !important;
	}

	.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-mark,
	.di-rsvp-choice-input:checked + .di-rsvp-choice-box > .di-rsvp-choice-text {
		color: HighlightText !important;
	}

	/* The current page, like a ticked choice: its fill is thrown away too. */
	.di-wishes .di-wishes-page[aria-current="page"] {
		forced-color-adjust: none;
		color: HighlightText !important;
		background-color: Highlight !important;
		border-color: Highlight !important;
	}

	.di-wishes .di-wishes-page[aria-current="page"] .di-wishes-page-text {
		color: HighlightText !important;
	}

	/* The arrows are a mask over a background color, which this mode would
	   replace with the page background and so erase. */
	.di-wishes .di-wishes-page--prev::before,
	.di-wishes .di-wishes-page--next::before {
		forced-color-adjust: none;
		background-color: ButtonText;
	}
}

.di-rsvp .di-rsvp-submit:focus-visible,
.di-wishes .di-wishes-submit:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.di-rsvp .di-rsvp-submit:active,
.di-wishes .di-wishes-submit:active {
	opacity: 0.85;
}

.di-rsvp .di-rsvp-submit:disabled,
.di-wishes .di-wishes-submit:disabled {
	opacity: 0.5;
	cursor: wait;
}

/* Honeypot: visually removed, still submittable. Humans never see it. */
.di-rsvp-hp,
.di-wishes-hp {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

/* ---------------------------------------------------------------- *
 * Messages
 * ---------------------------------------------------------------- */

/* Success and error keep the text color: a green or red that reads on one
   template's section disappears on another. The line at the left marks the
   message; an error is set in bold. */
.di-rsvp .di-rsvp-status,
.di-wishes .di-wishes-status {
	margin: 1em 0 0;
	padding: 0.15em 0 0.15em 0.75em;
	font-size: 0.9em;
	line-height: 1.45;
	border-left: 3px solid currentColor;
}

.di-rsvp .di-rsvp-status.is-error,
.di-wishes .di-wishes-status.is-error {
	font-weight: 700;
}

/*
 * The line the guest sees between page load and the settings arriving
 * (issue #139), and the closed notice. It occupies the form's place for a
 * moment, so it must not look like an error.
 */
.di-rsvp .di-rsvp-loading,
.di-rsvp .di-rsvp-closed {
	margin: 0.75em 0 0;
	text-align: center;
	font-size: 0.9em;
	opacity: 0.75;
}

/* ---------------------------------------------------------------- *
 * RSVP attendance counts bar
 * ---------------------------------------------------------------- */

.di-rsvp .di-rsvp-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-gap: 0.6em;
	gap: 0.6em;
	margin: 0 0 1.25em;
}

.di-rsvp .di-rsvp-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.7em 0.5em;
	text-align: center;
	border: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 25%, transparent);
	border-radius: 0.5em;
}

.di-rsvp .di-rsvp-stat-value {
	font-size: 1.4em;
	font-weight: 700;
	line-height: 1.2;
}

.di-rsvp .di-rsvp-stat-label {
	margin-top: 0.15em;
	font-size: 0.8em;
	opacity: 0.8;
}

/* ---------------------------------------------------------------- *
 * Wishes feed
 * ---------------------------------------------------------------- */

.di-wishes .di-wishes-feed {
	margin-top: 1.75em;
}

.di-wishes .di-wishes-feed {
	/* A page change may bring the top of the feed back into view (the
	   script does, only when it is above the viewport); leave a little air. */
	scroll-margin-top: 1em;
}

.di-wishes .di-wishes-list {
	margin: 0;
	padding: 0;
	list-style: none;
	transition: opacity 0.15s ease;
}

/* The page being replaced stays in place, dimmed, until the next one is in. */
.di-wishes .di-wishes-list.is-loading {
	opacity: 0.45;
}

.di-wishes .di-wishes-list > * + * {
	margin-top: 0.75em;
}

.di-wishes .di-wishes-item {
	padding: 0.9em 1em;
	text-align: left;
	background-color: rgba(128, 128, 128, 0.08);
	background-color: color-mix(in srgb, currentColor 6%, transparent);
	border: 1px solid rgba(128, 128, 128, 0.25);
	border-color: color-mix(in srgb, currentColor 20%, transparent);
	border-radius: 0.6em;
}

.di-wishes .di-wishes-item-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-top: -0.1em;
	margin-bottom: 0.25em;
}

/*
 * Margins rather than `gap`, see the note at the top. The space sits on the
 * right of each part, not on the left of the next: when a long name fills the
 * line and the badge drops below it, the badge starts flush with the name
 * instead of indented. The small top and bottom margins keep wrapped lines
 * apart, and the head's negative top margin takes the first one back.
 */
.di-wishes .di-wishes-item-head > * {
	margin-top: 0.1em;
	margin-right: 0.5em;
	margin-bottom: 0.1em;
}

.di-wishes .di-wishes-item-head > :last-child {
	margin-right: 0;
}

/*
 * A guest types their own name, and it can be a whole family on one line or
 * one long word. A flex item will not shrink below its longest word, so that
 * word pushed the badge and the time out of the card and gave the page a
 * horizontal scrollbar. `min-width: 0` lets it shrink, and the name breaks
 * anywhere; `break-word` first for browsers without `anywhere`, and the
 * `word-break` for older Safari, which only lets that one shrink the item.
 */
.di-wishes .di-wishes-item-name {
	min-width: 0;
	max-width: 100%;
	font-weight: 700;
	overflow-wrap: break-word;
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* The label stays whole ("Tidak Hadir" never splits); the badge moves to the
   next line instead. */
.di-wishes .di-wishes-badge {
	display: inline-block;
	flex: 0 0 auto;
	padding: 0.1em 0.6em;
	font-size: 0.7em;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	border: 1px solid currentColor;
	border-color: color-mix(in srgb, currentColor 45%, transparent);
	border-radius: 999px;
}

/* Always colored by the answer, from the same properties as a ticked choice
   in the RSVP form. */
.di-wishes .di-wishes-badge--attending {
	color: var(--di-attend-yes-ink);
	background-color: var(--di-attend-yes);
	border-color: var(--di-attend-yes);
}

.di-wishes .di-wishes-badge--not_attending {
	color: var(--di-attend-no-ink);
	background-color: var(--di-attend-no);
	border-color: var(--di-attend-no);
}

.di-wishes .di-wishes-badge--undecided {
	color: var(--di-attend-maybe-ink);
	background-color: var(--di-attend-maybe);
	border-color: var(--di-attend-maybe);
}

.di-wishes .di-wishes-item-time {
	margin-left: auto;
	font-size: 0.75em;
	opacity: 0.7;
	white-space: nowrap;
}

.di-wishes .di-wishes-item-message {
	margin: 0;
	/* `anywhere` is Chrome 80 / iOS Safari 15.4; without the break-word
	   fallback one pasted URL in one wish overflows the card and gives the
	   whole invitation a horizontal scrollbar. */
	overflow-wrap: break-word;
	overflow-wrap: anywhere;
}

.di-wishes .di-wishes-item-reply {
	margin-top: 0.6em;
	padding: 0.35em 0 0.35em 0.8em;
	border-left: 2px solid currentColor;
	border-left-color: color-mix(in srgb, currentColor 45%, transparent);
}

.di-wishes .di-wishes-item-reply-label {
	display: block;
	margin-bottom: 0.2em;
	font-size: 0.75em;
	font-weight: 700;
}

.di-wishes .di-wishes-item-reply-text {
	margin: 0;
	font-size: 0.9em;
	/* Same pasted-URL fallback as the message above. */
	overflow-wrap: break-word;
	overflow-wrap: anywhere;
}

/* The :hover and :focus copies undo the theme reset's pink fill. */
.di-wishes .di-wishes-more,
.di-wishes .di-wishes-more:hover,
.di-wishes .di-wishes-more:focus {
	display: block;
	width: auto;
	margin: 1em auto 0;
	padding: 0.55em 1.5em;
	font: inherit;
	font-size: 0.9em;
	line-height: 1.3;
	white-space: normal;
	color: inherit;
	background-color: transparent;
	border: 1px solid currentColor;
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
}

.di-wishes .di-wishes-more:active {
	background-color: rgba(128, 128, 128, 0.15);
	background-color: color-mix(in srgb, currentColor 12%, transparent);
}

.di-wishes .di-wishes-more:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.di-wishes .di-wishes-more:disabled {
	opacity: 0.5;
	cursor: wait;
}

/* ---------------------------------------------------------------- *
 * Wishes pagination: prev, page numbers, next
 * ---------------------------------------------------------------- */

/*
 * One row under the list. Nine controls at the 36px touch target take about
 * 320px, more than a phone column holds (a template's side padding leaves
 * 216px to 280px of a 320px screen), so the script draws seven page slots,
 * then five, then three, whichever fits on one line. Wrapping is allowed
 * only as the last resort for a column narrower than even three, where two
 * lines beat a row running off the side of the invitation.
 *
 * Space between controls is a sibling margin, not flex `gap` (see the note
 * at the top of this file).
 */
.di-wishes .di-wishes-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	margin: 1.25em 0 0;
	padding: 0;
}

.di-wishes .di-wishes-pagination > * + * {
	margin-left: 4px;
}

/*
 * Every page button and both arrows: the outline look of Muat lebih banyak,
 * which the template's load more controls also paint. Fixed at a 36px
 * minimum both ways and growing only for a long number, so the row the
 * script measured is the row that stays. Border-box, so a template's thicker
 * border does not widen one button in the row. The :hover and :focus copies
 * undo the theme reset's pink fill; margin-left is left to the sibling rule.
 */
.di-wishes .di-wishes-page,
.di-wishes .di-wishes-page:hover,
.di-wishes .di-wishes-page:focus {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 36px;
	min-height: 36px;
	margin-top: 0;
	margin-right: 0;
	margin-bottom: 0;
	padding: 0 0.45em;
	font: inherit;
	font-size: 0.9em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: inherit;
	background-color: transparent;
	background-image: none;
	border: 1px solid currentColor;
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.di-wishes .di-wishes-page:active {
	background-color: rgba(128, 128, 128, 0.15);
	background-color: color-mix(in srgb, currentColor 12%, transparent);
}

.di-wishes .di-wishes-page:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.di-wishes .di-wishes-page:disabled {
	opacity: 0.35;
	cursor: default;
}

/*
 * The current page: filled with the text color like Kirim, its number drawn
 * black or white against that fill by the contrast filter above. Three
 * classes, the same as the :hover copy it follows, so it wins by order in
 * this file and a hover never empties it. A template's Kirim controls paint
 * it at five and more.
 */
.di-wishes .di-wishes-page[aria-current="page"] {
	background-color: currentColor;
	border-color: currentColor;
	cursor: default;
}

/*
 * The arrows are drawn, not typed: a "‹" sits off center in most display
 * fonts. A chevron cut from the text color by an SVG mask, centered by the
 * button's own flex box.
 */
.di-wishes .di-wishes-page--prev::before,
.di-wishes .di-wishes-page--next::before {
	content: "";
	display: block;
	width: 14px;
	height: 14px;
	background-color: currentColor;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}

.di-wishes .di-wishes-page--prev::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M8.75 2.75 4.5 7l4.25 4.25' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M8.75 2.75 4.5 7l4.25 4.25' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.di-wishes .di-wishes-page--next::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M5.25 2.75 9.5 7l-4.25 4.25' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M5.25 2.75 9.5 7l-4.25 4.25' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* An ellipsis takes as little of the row as it can and never shrinks. */
.di-wishes .di-wishes-page-gap {
	flex: 0 0 auto;
	min-width: 1em;
	font-size: 0.9em;
	line-height: 1;
	text-align: center;
	opacity: 0.75;
}

/*
 * The Mode demo note, printed only in the Elementor editor and its preview
 * (Di_Elementor::is_editor_view()), so staff can tell a template's form from
 * a live one. Dashed, in the text color, so it reads on light and dark
 * sections alike; a guest never gets this markup.
 */
.di-rsvp .di-demo-note,
.di-wishes .di-demo-note {
	margin: 0 0 1em;
	padding: 0.5em 0.75em;
	border: 1px dashed currentColor;
	border-radius: 6px;
	font-size: 0.8em;
	line-height: 1.4;
	opacity: 0.8;
}
