/* MCR Femmes Bike Because: entry form and gallery. Deliberately light-touch, so it inherits Station South's theme
   typography and colours rather than fighting them; only layout, spacing and the lightbox need real rules. */

/* The browser's own [hidden] rule has low specificity, so any later, more specific selector (e.g. the "label"
   rule below) silently overrides it and shows the element anyway. Everything this plugin toggles with the
   `hidden` attribute (the under-18 labels and notice, the guardian's consent, the photo preview) relies
   on this staying in force. */
[hidden] {
	display: none !important;
}

.mcr-wb-entry-form {
	max-width: 40em;
	margin: 0 auto;
}

.mcr-wb-field,
.mcr-wb-field-group {
	margin-bottom: 1.5em;
}

.mcr-wb-field label,
.mcr-wb-field-group legend {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4em;
}

.mcr-wb-field input[type="text"],
.mcr-wb-field input[type="email"],
.mcr-wb-field input[type="url"],
.mcr-wb-field input[type="file"],
.mcr-wb-field textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.5em;
}

.mcr-wb-field-group label {
	display: inline-block;
	font-weight: normal;
	margin-right: 1.5em;
}

.mcr-wb-help {
	font-size: 0.9em;
	opacity: 0.8;
	margin: 0.3em 0;
}

.mcr-wb-checkbox label {
	font-weight: normal;
	display: flex;
	gap: 0.6em;
	align-items: flex-start;
}

.mcr-wb-checkbox input {
	margin-top: 0.25em;
}

.mcr-wb-privacy-notice {
	font-size: 0.85em;
	opacity: 0.8;
	border-top: 1px solid rgba( 0, 0, 0, 0.15 );
	padding-top: 1em;
}

.mcr-wb-photo-preview img {
	max-width: 12em;
	max-height: 12em;
	margin-top: 0.6em;
	display: block;
}

/* Under the send button, where the person is looking when they press it. */
.mcr-wb-form-message {
	padding: 0.75em 1em;
	margin-top: 1em;
	border-radius: 4px;
	background: rgba( 0, 128, 0, 0.1 );
}

.mcr-wb-form-message--error {
	background: rgba( 200, 0, 0, 0.1 );
}

.mcr-wb-error-summary {
	padding: 0.75em 1em;
	margin-bottom: 1em;
	border: 3px solid #b3261e;
	border-radius: 4px;
}

.mcr-wb-error-summary:focus {
	outline: 3px solid #ffbf47;
	outline-offset: 2px;
}

.mcr-wb-error-summary-title {
	font-weight: 600;
	margin: 0 0 0.4em;
}

.mcr-wb-error-summary ul {
	margin: 0;
	padding-left: 1.2em;
}

.mcr-wb-error-summary a {
	color: #b3261e;
	font-weight: 600;
}

/* Each message says in words what is wrong, so the red is never the only cue. */
.mcr-wb-field-error {
	color: #b3261e;
	font-weight: 600;
	margin: 0.4em 0 0;
}

.mcr-wb-field input[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]),
.mcr-wb-field textarea[aria-invalid="true"] {
	border: 2px solid #b3261e;
}

.mcr-wb-submit {
	cursor: pointer;
}

/* Hidden from people (and from screen readers, by aria-hidden), but not display:none, which some bots skip. */
.mcr-wb-honeypot {
	position: absolute !important;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Gallery */

.mcr-wb-gallery-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 1em;
}

.mcr-wb-gallery-item {
	margin: 0;
}

.mcr-wb-gallery-photo {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
}

.mcr-wb-gallery-photo img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.mcr-wb-gallery-empty,
.mcr-wb-gallery-error {
	text-align: center;
	opacity: 0.8;
}

/* Lightbox */

body.mcr-wb-lightbox-open {
	overflow: hidden;
}

.mcr-wb-lightbox {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, 0.85 );
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 2em;
	box-sizing: border-box;
}

.mcr-wb-lightbox img {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
}

.mcr-wb-lightbox-caption {
	color: #fff;
	margin-top: 1em;
	text-align: center;
}

.mcr-wb-lightbox-link {
	color: #fff;
	text-decoration: underline;
	overflow-wrap: anywhere;
}

.mcr-wb-lightbox-close,
.mcr-wb-lightbox-nav {
	position: absolute;
	background: #fff;
	color: #000;
	border: none;
	border-radius: 4px;
	padding: 0.5em 1em;
	cursor: pointer;
}

.mcr-wb-lightbox-close {
	top: 1em;
	right: 1em;
}

.mcr-wb-lightbox-nav {
	top: 50%;
	transform: translateY( -50% );
	font-size: 1.5em;
	line-height: 1;
}

.mcr-wb-lightbox-previous {
	left: 0.5em;
}

.mcr-wb-lightbox-next {
	right: 0.5em;
}

.mcr-wb-lightbox button:focus-visible,
.mcr-wb-lightbox-link:focus-visible {
	outline: 3px solid #ffbf47;
	outline-offset: 2px;
}
