/**
 * Organisational Event — attendee "My Events" portal styles ([oe_my_events]).
 *
 * AISG brand: navy #0B1F3A, coral #E8352A (darkened to #C62B21 for text / behind
 * white to satisfy WCAG-AA). Token names mirror oe-events.css / oe-registration.css.
 * Everything is scoped under `.oe-portal`. Dark mode mirrors the sibling
 * stylesheets so the portal never renders as a white box inside a dark theme.
 *
 * @package AISG\OrgEvent
 */

.oe-portal {
	--oe-navy: #0b1f3a;
	--oe-coral: #e8352a;
	--oe-coral-text: #c62b21;
	--oe-coral-strong: #c62b21;
	--oe-heading: #0b1f3a;
	--oe-ink: #1c2733;
	--oe-muted: #5a6a82;
	--oe-line: #d7dce3;
	--oe-surface: #ffffff;
	--oe-subtle: #f4f6f9;
	--oe-ok-bg: #e6f4ea;
	--oe-ok-text: #1b5e2a;
	--oe-err-bg: #fdecea;
	--oe-err-text: #a11c14;
	--oe-radius: 12px;
	--oe-radius-sm: 8px;
	--oe-shadow: 0 1px 2px rgba(11, 31, 58, 0.08), 0 8px 24px rgba(11, 31, 58, 0.06);
	max-width: 100%;
	margin: 1.5rem auto;
	color: var(--oe-ink);
	font-size: 16px;
	line-height: 1.5;
}

:root[data-theme="dark"] .oe-portal {
	--oe-coral-text: #ff8078;
	--oe-heading: #cdd9ea;
	--oe-ink: #e8edf5;
	--oe-muted: #9fb0c8;
	--oe-line: #2a3d5c;
	--oe-surface: #12233d;
	--oe-subtle: #0e1c31;
	--oe-ok-bg: #123322;
	--oe-ok-text: #9fe6b4;
	--oe-err-bg: #3a1512;
	--oe-err-text: #ffb0a8;
}

:root[data-theme="light"] .oe-portal {
	--oe-coral-text: #c62b21;
	--oe-heading: #0b1f3a;
	--oe-ink: #1c2733;
	--oe-muted: #5a6a82;
	--oe-line: #d7dce3;
	--oe-surface: #ffffff;
	--oe-subtle: #f4f6f9;
}

.oe-portal *,
.oe-portal *::before,
.oe-portal *::after {
	box-sizing: border-box;
}

.oe-portal__title {
	color: var(--oe-heading);
	font-size: 1.6rem;
	margin: 0 0 1rem;
}

.oe-portal__group-title {
	color: var(--oe-heading);
	font-size: 1.15rem;
	margin: 1.75rem 0 0.75rem;
	padding-bottom: 0.35rem;
	border-bottom: 2px solid var(--oe-line);
}

.oe-portal__group--past {
	opacity: 0.92;
}

.oe-portal__empty,
.oe-portal__guidance {
	background: var(--oe-subtle);
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius);
	padding: 1.25rem 1.5rem;
}

.oe-portal__guidance p {
	margin: 0 0 0.75rem;
}

.oe-portal__guidance p:last-child {
	margin-bottom: 0;
}

.oe-portal__signin {
	color: var(--oe-coral-text);
	font-weight: 600;
}

/* --------------------------------------------------------------- */
/* Status / notice (aria-live region)                              */
/* --------------------------------------------------------------- */

.oe-portal__status:empty {
	display: none;
}

.oe-portal__notice {
	border-radius: var(--oe-radius-sm);
	padding: 0.85rem 1.1rem;
	margin-bottom: 1rem;
	font-weight: 500;
}

.oe-portal__notice:focus {
	outline: 2px solid var(--oe-coral-text);
	outline-offset: 2px;
}

.oe-portal__notice--success {
	background: var(--oe-ok-bg);
	color: var(--oe-ok-text);
}

.oe-portal__notice--error {
	background: var(--oe-err-bg);
	color: var(--oe-err-text);
}

/* --------------------------------------------------------------- */
/* Cards                                                            */
/* --------------------------------------------------------------- */

.oe-mev-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.oe-mev-card {
	background: var(--oe-surface);
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius);
	box-shadow: var(--oe-shadow);
	padding: 1.15rem 1.25rem;
}

.oe-mev-card.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

.oe-mev-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
}

.oe-mev-card__title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.3;
	color: var(--oe-heading);
}

.oe-mev-card__title a {
	color: inherit;
	text-decoration: none;
}

.oe-mev-card__title a:hover,
.oe-mev-card__title a:focus {
	text-decoration: underline;
}

.oe-mev-card__meta {
	margin: 0.75rem 0 0;
	display: grid;
	gap: 0.3rem;
	font-size: 0.95rem;
}

.oe-mev-card__meta-row {
	display: flex;
	gap: 0.5rem;
}

.oe-mev-card__meta dt {
	flex: 0 0 4.5rem;
	margin: 0;
	font-weight: 600;
	color: var(--oe-muted);
}

.oe-mev-card__meta dd {
	margin: 0;
}

.oe-mev-tz {
	color: var(--oe-muted);
	font-size: 0.85em;
}

/* --------------------------------------------------------------- */
/* State badge                                                      */
/* --------------------------------------------------------------- */

.oe-mev-badge {
	flex: 0 0 auto;
	display: inline-block;
	padding: 0.25rem 0.65rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	border: 1px solid transparent;
}

.oe-mev-badge--going,
.oe-mev-badge--attended {
	background: var(--oe-ok-bg);
	color: var(--oe-ok-text);
}

.oe-mev-badge--maybe,
.oe-mev-badge--pending,
.oe-mev-badge--waitlisted {
	background: #fff4e5;
	color: #8a4b00;
}

.oe-mev-badge--not_going,
.oe-mev-badge--cancelled {
	background: var(--oe-err-bg);
	color: var(--oe-err-text);
}

:root[data-theme="dark"] .oe-mev-badge--maybe,
:root[data-theme="dark"] .oe-mev-badge--pending,
:root[data-theme="dark"] .oe-mev-badge--waitlisted {
	background: #3a2a10;
	color: #ffcf8f;
}

/* --------------------------------------------------------------- */
/* RSVP segmented toggle                                            */
/* --------------------------------------------------------------- */

.oe-mev-rsvp {
	margin: 1rem 0 0;
}

.oe-mev-toggle {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0;
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius-sm);
	overflow: hidden;
}

.oe-mev-toggle__btn {
	appearance: none;
	-webkit-appearance: none;
	background: var(--oe-surface);
	color: var(--oe-ink);
	border: 0;
	border-right: 1px solid var(--oe-line);
	padding: 0.55rem 1rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
}

.oe-mev-toggle__btn:last-child {
	border-right: 0;
}

.oe-mev-toggle__btn:hover {
	background: var(--oe-subtle);
}

.oe-mev-toggle__btn:focus-visible {
	outline: 2px solid var(--oe-coral-text);
	outline-offset: -2px;
	z-index: 1;
}

.oe-mev-toggle__btn[aria-pressed="true"] {
	background: var(--oe-navy);
	color: #ffffff;
}

.oe-mev-toggle__btn--not_going[aria-pressed="true"] {
	background: var(--oe-coral-strong);
	color: #ffffff;
}

/* --------------------------------------------------------------- */
/* Actions: ticket + cancel                                         */
/* --------------------------------------------------------------- */

.oe-mev-card__actions {
	margin-top: 1rem;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.75rem 1.25rem;
}

.oe-mev-ticket {
	flex: 1 1 auto;
	min-width: 0;
}

.oe-mev-ticket__summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--oe-coral-text);
	padding: 0.35rem 0;
	list-style: revert;
}

.oe-mev-ticket__summary:focus-visible {
	outline: 2px solid var(--oe-coral-text);
	outline-offset: 2px;
	border-radius: 4px;
}

.oe-mev-ticket__body {
	margin-top: 0.75rem;
}

.oe-mev-cancel {
	margin: 0;
	flex: 0 0 auto;
}

.oe-mev-cancel__btn {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	color: var(--oe-coral-text);
	border: 1px solid var(--oe-coral-text);
	border-radius: var(--oe-radius-sm);
	padding: 0.5rem 1rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	min-height: 44px;
}

.oe-mev-cancel__btn:hover {
	background: var(--oe-coral-strong);
	border-color: var(--oe-coral-strong);
	color: #ffffff;
}

.oe-mev-cancel__btn:focus-visible {
	outline: 2px solid var(--oe-coral-text);
	outline-offset: 2px;
}

/* --------------------------------------------------------------- */
/* Ticket / QR                                                      */
/* --------------------------------------------------------------- */

/* Premium ticket: full-width brand band + details / perforated QR stub. */
.oe-ptk {
	--oe-tk-accent: #0b1f3a;
	--oe-tk-notch: var(--oe-surface, #ffffff); /* matches the card behind the ticket */
	max-width: 640px;
	background: #ffffff;
	color: #1c2733;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(11, 31, 58, 0.10), 0 16px 36px rgba(11, 31, 58, 0.13);
}

.oe-ptk__brand {
	background: var(--oe-tk-accent);
	background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.18));
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.oe-ptk__logo {
	max-height: 40px;
	max-width: 200px;
	width: auto;
	object-fit: contain;
	display: block;
}

.oe-ptk__brandname {
	color: #ffffff;
	font-weight: 800;
	font-size: 1.05rem;
	letter-spacing: 0.01em;
}

.oe-ptk__kicker {
	color: rgba(255, 255, 255, 0.82);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Two-column body: details | perforation | stub. */
.oe-ptk__body {
	display: grid;
	grid-template-columns: 1fr 240px;
	align-items: stretch;
}

.oe-ptk__main {
	min-width: 0;
	padding: 1.35rem 1.5rem;
	display: flex;
	flex-direction: column;
}

.oe-ptk__event {
	margin: 0 0 0.85rem;
	font-size: 1.3rem;
	font-weight: 800;
	line-height: 1.2;
	color: #0b1f3a;
}

.oe-ptk__meta {
	margin: 0;
	display: grid;
	gap: 0.6rem;
}

.oe-ptk__row {
	display: grid;
	grid-template-columns: 84px 1fr;
	align-items: baseline;
	gap: 0.5rem;
}

.oe-ptk__row dt {
	margin: 0;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #5a6a82;
}

.oe-ptk__row dd {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: #1c2733;
	overflow-wrap: anywhere;
}

.oe-ptk__tz {
	color: #5a6a82;
	font-weight: 500;
	font-size: 0.85em;
}

.oe-ptk__footer {
	margin: auto 0 0;
	padding-top: 1rem;
	font-size: 0.78rem;
	color: #7a8aa0;
}

/* Stub — tinted panel with a dashed perforation + punched notches on its left edge. */
.oe-ptk__stub {
	position: relative;
	background: var(--oe-subtle);
	padding: 1.35rem 1.25rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 0.6rem;
	border-left: 2px dashed var(--oe-line);
}

.oe-ptk__stub::before,
.oe-ptk__stub::after {
	content: "";
	position: absolute;
	left: -11px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--oe-tk-notch);
}

.oe-ptk__stub::before { top: -10px; }
.oe-ptk__stub::after { bottom: -10px; }

.oe-ptk__qr {
	background: #ffffff;
	padding: 0.7rem;
	border-radius: 12px;
	line-height: 0;
	box-shadow: 0 1px 2px rgba(11, 31, 58, 0.08);
}

.oe-ptk__qr svg {
	display: block;
	width: 160px;
	height: 160px;
	max-width: 100%;
}

.oe-ptk__scan {
	margin: 0;
	font-size: 0.8rem;
	font-weight: 600;
	color: #5a6a82;
}

.oe-ptk__code {
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.oe-ptk__code-label {
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #7a8aa0;
}

.oe-ptk__code-value {
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	/* Always dark & readable regardless of the ticket accent colour. */
	color: #0b1f3a;
	font-variant-numeric: tabular-nums;
}

.oe-ticket__unavailable {
	color: var(--oe-muted);
	font-style: italic;
	margin: 0;
}

@media (max-width: 560px) {
	.oe-ptk {
		max-width: 100%;
		margin: 0 auto;
	}

	.oe-ptk__body {
		grid-template-columns: 1fr;
	}

	/* Brand band: stack logo over "Admit one", centred (prevents the kicker
	   being clipped by the ticket's overflow:hidden on narrow screens). */
	.oe-ptk__brand {
		flex-direction: column;
		align-items: center;
		text-align: center;
		gap: 0.4rem;
		padding: 1rem 1.1rem;
	}

	.oe-ptk__logo {
		max-width: 78%;
		max-height: 40px;
	}

	.oe-ptk__kicker {
		white-space: normal;
	}

	/* Details: centre everything so the ticket isn't left-heavy on mobile. */
	.oe-ptk__main {
		padding: 1.25rem 1.1rem;
		align-items: center;
		text-align: center;
	}

	.oe-ptk__event {
		text-align: center;
	}

	.oe-ptk__meta {
		width: 100%;
		justify-items: center;
	}

	.oe-ptk__row {
		grid-template-columns: 1fr;
		justify-items: center;
		gap: 0.15rem;
		text-align: center;
	}

	.oe-ptk__footer {
		text-align: center;
	}

	/* Perforation runs horizontally, notches punch the side edges. */
	.oe-ptk__stub {
		border-left: 0;
		border-top: 2px dashed var(--oe-line);
	}

	.oe-ptk__stub::before,
	.oe-ptk__stub::after {
		top: -11px;
		bottom: auto;
		left: auto;
	}

	.oe-ptk__stub::before { left: -10px; }
	.oe-ptk__stub::after { right: -10px; }
}

@media (max-width: 560px) {
	.oe-mev-toggle {
		display: flex;
		width: 100%;
	}

	.oe-mev-toggle__btn {
		flex: 1 1 0;
		text-align: center;
	}

	.oe-mev-card__actions {
		flex-direction: column;
	}

	.oe-mev-cancel,
	.oe-mev-cancel__btn {
		width: 100%;
	}
}

/* Cancelled registration block (after "Not going") */
.oe-mev-cancelled { margin: 0.5rem 0 0.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.oe-mev-cancelled__note { margin: 0; font-weight: 600; color: var(--oe-err-text, #a11c14); flex: 1 1 100%; }
.oe-mev-cancelled__hint { color: var(--oe-muted); font-size: 0.85rem; }
.oe-mev-reregister {
	appearance: none; display: inline-block; text-decoration: none;
	background: var(--oe-navy); color: #fff; font-weight: 700;
	padding: 0.5rem 1.1rem; border-radius: var(--oe-radius-sm); min-height: 40px; line-height: 1.6;
}
.oe-mev-reregister:hover { background: var(--oe-coral-strong); color: #fff; }

/* Ended event block — read-only: no RSVP, no cancel. */
.oe-mev-ended {
	margin: 0.5rem 0 0.25rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.6rem 0.9rem;
	background: var(--oe-subtle);
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius-sm);
}
.oe-mev-ended__badge { font-size: 1.05rem; line-height: 1; }
.oe-mev-ended__note { margin: 0; font-weight: 600; color: var(--oe-muted); }
.oe-mev-ended__note--ok { color: var(--oe-ok-text, #1b5e2a); }
