/*
 * Alba form styling for UltraLav.
 *
 * Kept apart from template.css because that file is a faithful port of the legacy Joomla
 * stylesheet and should stay one. Everything the legacy file says about forms is written
 * against ChronoForms' own markup - `.form-group.gcore-form-row`,
 * `label.control-label.gcore-label-top`, `input#button16` - and Alba emits none of those.
 * Without this file the contact form renders as unstyled browser defaults: black labels
 * instead of blue, one field per row instead of three, and a grey default submit button.
 *
 * The class names below are what HoltBosse\Form actually emits:
 *   Form::display()      .form_field.field wrapping every field
 *   Input/Textarea       .field > label.label + .control > .input
 *   Select               .field > label.label + .control > .select > select
 *   FormInstance widget  button.button.is-primary
 */

.article form .field {
	margin-bottom: 18px;
}

/* the blue labels the legacy sheet gave label.control-label.gcore-label-top */
.article form .field > label.label {
	display: block;
	font-family: 'Open Sans', sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: #1176bb;
	margin-bottom: 4px;
}

/* required fields got a red asterisk in chronoforms; Alba marks them with a class only */
.article form .field.required > label.label::after {
	content: ' *';
	color: #ff0000;
	font-size: 9px;
	vertical-align: top;
}

.article form .control {
	position: relative;
}

.article form .input,
.article form select,
.article form textarea {
	width: 100%;
	box-sizing: border-box;
	font-family: 'Open Sans', sans-serif;
	font-size: 14px;
	color: #696a6a;
	padding: 8px;
	border: 1px solid #ccc;
	border-radius: 0;
	background-color: #fff;
}

.article form textarea {
	min-height: 90px;
	resize: vertical;
}

.article form .input:focus,
.article form select:focus,
.article form textarea:focus {
	outline: none;
	border-color: #1176bb;
}

.article form .help {
	font-size: 12px;
	color: #888;
	margin: 4px 0 0;
}

/* the submit button, styled like the legacy input#button16 */
.article form button[type="submit"] {
	font-family: 'Open Sans', sans-serif;
	color: #fff;
	font-size: .9em;
	font-weight: 700;
	text-decoration: none;
	padding: 20px;
	background-color: #167abe;
	background-image: none;
	text-shadow: none;
	height: auto;
	border: 0;
	border-radius: 0;
	margin-bottom: 22px;
	cursor: pointer;
}

.article form button[type="submit"]:hover {
	background-color: rgba(22, 122, 190, 0.8);
}

/*
 * Three across on a wide screen, matching `.form-group.gcore-form-row { width: 33% }` at
 * the same breakpoint the legacy sheet used. The comments box and the submit button take
 * the full width, as they did.
 */
@media screen and (min-width: 768px) {
	.article form .form_field {
		float: left;
		width: 33%;
		padding-right: 20px;
		box-sizing: border-box;
	}

	.article form .form_field.field_id_comments,
	.article form .form_field.field_id_website {
		float: none;
		clear: both;
		width: 100%;
		padding-right: 0;
	}

	.article form button[type="submit"] {
		clear: both;
		display: block;
	}
}

/*
 * The message shown after a submit: "Form submitted successfully", or the list of fields
 * that failed validation.
 *
 * The form does not print these itself. The FormInstance widget queues a flash message and
 * redirects, and index.php prints the queue above the controller through
 * CMS::display_messages(). Alba's Messages class writes Bulma markup for it:
 *
 *   <div class='alert notification is-success' role='alert'>
 *     <button type='button' class='close delete' aria-label='Close'></button>
 *     <p>Form submitted successfully</p>
 *   </div>
 *
 * This template loads no Bulma, so without the rules below that is plain grey text with an
 * empty, invisible close button. The type class is one of is-success, is-danger, is-warning
 * or is-info (Alba's MessageType). Every queued message on this domain uses the same
 * markup, not only the contact form's, so these rules cover all four types.
 *
 * Styled as a white panel on the grey article band, with a coloured bar down the left in
 * the site's blue for success and info.
 */
.article .notification {
	position: relative;
	margin: 0 0 24px;
	padding: 18px 52px 18px 22px;
	background-color: #fff;
	border-left: 6px solid #1176bb;
	font-family: 'Open Sans', sans-serif;
	font-size: 15px;
	line-height: 1.5;
}

.article .notification p {
	margin: 0;
	color: #696a6a;
	font-family: 'Open Sans', sans-serif;
}

.article .notification p + p {
	margin-top: 6px;
}

/* the success line is the whole message, so give it the heading treatment the site uses */
.article .notification.is-success p {
	font-family: 'Yanone Kaffeesatz', sans-serif;
	font-size: 28px;
	line-height: 1.2;
	color: #1176bb;
}

.article .notification.is-danger {
	border-left-color: #c0392b;
}

.article .notification.is-danger p {
	color: #a33024;
}

.article .notification.is-warning {
	border-left-color: #d8893c;
}

/*
 * The close button. Bulma draws the X with pseudo-elements on .delete; the button itself
 * is empty, so it is drawn here the same way.
 */
.article .notification .delete {
	position: absolute;
	top: 50%;
	right: 16px;
	width: 24px;
	height: 24px;
	margin-top: -12px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: transparent;
	cursor: pointer;
}

.article .notification .delete::before,
.article .notification .delete::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 2px;
	margin: -1px 0 0 -7px;
	background-color: #b1b1b1;
	transform: rotate(45deg);
}

.article .notification .delete::after {
	transform: rotate(-45deg);
}

.article .notification .delete:hover,
.article .notification .delete:focus-visible {
	background-color: #dedede;
	outline: none;
}

.article .notification .delete:hover::before,
.article .notification .delete:hover::after,
.article .notification .delete:focus-visible::before,
.article .notification .delete:focus-visible::after {
	background-color: #696a6a;
}
