/* Owner: WP-B. Front-end styles for [member_raffles]. Plain CSS; made for Twenty Ten (classic), works on any theme. */

.mr-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.mr-raffles { margin: 0 0 1.5em; }
.mr-section { margin: 0 0 2em; }
#content .mr-section__title,
.mr-section__title { margin: 0 0 0.4em; }
.mr-empty,
.mr-note { margin: 0 0 1em; color: #4a4a4a; }

/* List: modelled on mw-event-sync's .mw-es-list (Twenty Ten gives ul/li margins under #content; beat them). */
.mr-list { list-style: none; margin: 0 0 1.5em; padding: 0; }
#content .mr-list { margin-left: 0; }
.mr-list__item,
#content .mr-list li.mr-list__item {
	margin: 0;
	padding: 0.65em 0;
	list-style: none;
	border-bottom: 1px solid #ececec;
}
.mr-list__item:last-child,
#content .mr-list li.mr-list__item:last-child { border-bottom: 0; }

/* Card: lead | content | actions. The flash message and the panels span the whole row. */
.mr-card {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	column-gap: 14px;
	row-gap: 0.3em;
	align-items: center;
	box-sizing: border-box;
	padding-right: 6px; /* the buttons sit fully inside the column, never on its edge */
}
.mr-card__lead { grid-column: 1; align-self: start; }
.mr-card__content { grid-column: 2; min-width: 0; }
.mr-card__side {
	grid-column: 3;
	align-self: center;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.2em;
	max-width: 15em;
	text-align: right;
}
.mr-status,
.mr-card > .mr-panel { grid-column: 1 / -1; }
/* Inline consent: full width under the content, in small text. */
.mr-card__consent { grid-column: 2 / -1; margin: 0; }

.mr-list__thumb {
	display: block;
	width: 96px;
	height: 54px;
	overflow: hidden;
	background: #e9eef3;
	line-height: 0;
}
.mr-list__thumb img.mr-list__img,
#content .mr-list .mr-list__thumb img {
	display: block;
	width: 96px;
	height: 54px;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	object-fit: cover;
}
/* No image: a date tile for the end date (same size as a thumbnail). */
.mr-list__thumb--placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	line-height: 1.1;
	color: #1a1a1a;
	background: #fafafa;
	border: 1px solid #e0e0e0;
	border-top: 3px solid #0b4f8a;
}
.mr-list__mon { font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.06em; color: #0b4f8a; }
.mr-list__day { font-size: 22px; font-weight: bold; }

.mr-list__title,
#content h3.mr-list__title,
#content h4.mr-list__title,
#content h5.mr-list__title { display: block; margin: 0 0 0.1em; padding: 0; font-size: 1.1em; font-weight: bold; line-height: 1.3; }
#content .mr-list__summary,
.mr-list__summary { margin: 0 0 0.3em; line-height: 1.4; }
#content .mr-list__meta,
.mr-list__meta { margin: 0; color: #4a4a4a; font-size: 0.85em; line-height: 1.6; }
/* Separator dots are attached to the item before them, so a wrapped line never starts with one. */
.mr-list__meta > span:not(:last-child):not(.mr-badge)::after { content: "\00b7"; margin: 0 0.4em; color: #8a8a8a; }
.mr-list__more,
.mr-list__meta > span { white-space: nowrap; }

/* Mode chip. Text #0b4f8a on #eef4fa = 7.7:1. */
.mr-badge {
	margin-right: 0.6em;
	display: inline-block;
	padding: 0 0.6em;
	border: 1px solid #b6cbe0;
	border-radius: 10px;
	background: #eef4fa;
	color: #0b4f8a;
	font-size: 0.85em;
	font-weight: bold;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.6;
}

/* Detail sentence under the meta line. */
#content .mr-state,
.mr-state { margin: 0.25em 0 0; font-size: 0.85em; color: #4a4a4a; }
.mr-state--won { color: #0a5c1f; font-weight: bold; }
.mr-state--blocked { color: #5c0000; }

/* Right-hand status line (>= 4.5:1 on white). */
#content .mr-side__status,
.mr-side__status { margin: 0; font-size: 0.85em; font-weight: bold; line-height: 1.3; }
.mr-side__status--ok { color: #0a5c1f; }
.mr-side__status--muted { color: #4a4a4a; }
.mr-side__status--warn { color: #7a3b00; }

#content .mr-side__since,
.mr-side__since { margin: 0; font-size: 0.75em; color: #595959; line-height: 1.2; }

/* Flash message (live region). */
#content .mr-status,
.mr-status { margin: 0; font-size: 0.9em; }
.mr-status:empty { display: none; }
.mr-status:focus { outline: 3px solid #1a1a1a; outline-offset: 2px; }
.mr-status--ok { padding: 0.4em 0.8em; border-left: 4px solid #0a5c1f; background: #eaf6ec; color: #0b3d16; }
.mr-status--error { padding: 0.4em 0.8em; border-left: 4px solid #a00; background: #fbeaea; color: #5c0000; }
.mr-status a { color: inherit; text-decoration: underline; }

/* Buttons: white on #0b4f8a = 8.6:1. Small by default in the action area; the panel buttons are regular size. */
.mr-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4em; margin: 0; }
.mr-quick { margin: 0; }
.mr-card__side .mr-form-error { text-align: right; }
#content .mr-button,
.mr-button {
	display: inline-block;
	margin: 0 0.5em 0.5em 0;
	padding: 0.5em 1.1em;
	background: #0b4f8a;
	color: #fff;
	font-family: inherit;
	font-size: inherit;
	font-weight: bold;
	line-height: 1.3;
	text-decoration: none;
	text-align: center;
	border-radius: 3px;
	border: 2px solid #0b4f8a;
	cursor: pointer;
}
#content .mr-button--small,
.mr-button--small { margin: 0; padding: 0.3em 0.9em; font-size: 0.875em; white-space: nowrap; }
#content .mr-button:hover,
.mr-button:hover { background: #083a66; border-color: #083a66; color: #fff; }
/* Quiet secondary: outlined, #0b4f8a on white. */
#content .mr-button--secondary,
.mr-button--secondary { background: #fff; color: #0b4f8a; border-color: #b6cbe0; }
#content .mr-button--secondary:hover,
.mr-button--secondary:hover { background: #eef4fa; color: #083a66; border-color: #0b4f8a; }
#content .mr-button[disabled],
.mr-button[disabled],
.mr-button[aria-disabled="true"] { background: #f1f1f1; border-color: #d4d4d4; color: #4a4a4a; cursor: not-allowed; }
.mr-button.is-busy { opacity: 0.7; cursor: progress; }
.mr-button:focus-visible,
.mr-list a:focus-visible,
.mr-textarea:focus-visible,
.mr-consent input:focus-visible {
	outline: 3px solid #1a1a1a;
	outline-offset: 2px;
}

/* Confirm panel (applications): a light box under the row, not a modal. */
.mr-panel {
	margin: 0.2em 0 0;
	padding: 0.8em 1em;
	border: 1px solid #d7dde3;
	background: #f6f8fa;
}
.mr-panel[hidden] { display: none; }
#content .mr-panel__lead,
.mr-panel__lead { margin: 0 0 0.7em; }
.mr-panel__buttons { margin: 0.5em 0 0; }
.mr-form { margin: 0; }
.mr-form-error { margin: 0.3em 0 0; color: #5c0000; font-weight: bold; font-size: 0.85em; }
.mr-form-error:empty { display: none; }

/* Application textarea. */
.mr-field { margin: 0 0 0.8em; }
.mr-field label { display: block; margin: 0 0 0.3em; font-weight: bold; }
.mr-required { font-weight: normal; color: #4a4a4a; }
#content .mr-textarea,
.mr-textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0.5em;
	border: 1px solid #8a8a8a;
	font-family: inherit;
	font-size: inherit;
	line-height: 1.4;
	resize: vertical;
}
.mr-textarea[aria-invalid="true"] { border-color: #a00; border-width: 2px; }
.mr-field__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3em 1em; margin-top: 0.25em; color: #4a4a4a; font-size: 0.9em; }
.mr-counter { font-variant-numeric: tabular-nums; }
.mr-counter.is-over { color: #a00; font-weight: bold; }

/* Social consent: the explanation is CSS-only (shown while the box is unticked), so it works without JS. */
.mr-consent { margin: 0 0 0.8em; }
/* Inline on the card (one-click join, save-on-change): small text, compact note. */
.mr-card__consent .mr-consent { margin: 0; font-size: 0.8em; line-height: 1.4; color: #4a4a4a; }
.mr-card__consent .mr-consent label { font-weight: normal; }
.mr-card__consent .mr-consent__why,
#content .mr-card__consent .mr-consent__why { margin: 0.3em 0 0; padding: 0.25em 0.6em; font-size: 0.95em; text-align: left; }
#content .mr-consent input[type="checkbox"],
.mr-consent input[type="checkbox"] { width: 1.1em; height: 1.1em; margin: 0 0.4em 0 0; vertical-align: -0.15em; }
.mr-consent label { display: inline; font-weight: bold; }
.mr-consent__why,
#content .mr-consent__why { display: none; margin: 0.5em 0 0; padding: 0.5em 0.8em; border-left: 4px solid #8a5a00; background: #fff6e0; color: #3d2800; }
/* Only the checkbox counts (the hidden consent=0 input never matches :checked), and #content keeps it above the hide rule on Twenty Ten. */
.mr-consent input[type="checkbox"]:not(:checked) ~ .mr-consent__why,
#content .mr-consent input[type="checkbox"]:not(:checked) ~ .mr-consent__why { display: block; }

/* Touch targets >= 44px. */
@media (pointer: coarse) {
	.mr-button { min-height: 44px; min-width: 44px; }
	.mr-consent input[type="checkbox"] { width: 1.5em; height: 1.5em; }
}

/* Phones: the action area stacks under the content, right-aligned. */
@media (max-width: 480px) {
	.mr-card { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; }
	.mr-card__side { grid-column: 1 / -1; align-items: flex-end; max-width: none; margin-top: 0.1em; }
	.mr-card__consent { grid-column: 1 / -1; }
	.mr-list__thumb { width: 64px; height: 40px; }
	.mr-list__thumb img.mr-list__img,
	#content .mr-list .mr-list__thumb img { width: 64px; height: 40px; }
	.mr-list__day { font-size: 18px; }
	.mr-panel { padding: 0.7em; }
}
