/**
 * The Ebus model page.
 *
 * Two sections and nothing else: the seven-photograph album, and the
 * specification table, contacts and small print under it. Every value here —
 * size, colour, radius, breakpoint — is the reference's, kept as given rather
 * than pulled back to this site's 14/15/16 type scale, for the reason
 * assets/css/models/vf2.css states at length.
 *
 * Everything is scoped under `.ebus`, the wrapper each element prints. The
 * reference styles bare `section`, `img`, `p`, `ul` and `label` — loose on a page
 * that is nothing else, ruinous on a WordPress install where those selectors
 * would reach the header, the footer and every other page on the site.
 *
 * **Two of the reference's class names had to be given up, and the rest were
 * counted before being kept.** `.container` and `.row` are Flatsome's — 12 and 25
 * rules in flatsome.css — and scoping does not save them: `.ebus .row` wins only
 * on the properties it names, so Flatsome's negative margins and flex-wrap would
 * still land. They are one `.ebus-container` here, the same fix nerio.css and
 * vfmpv7.css record. `.album*`, `.swiper-*`, `.parameter-*`, `.contact-*`,
 * `.infomation-wrap` and `.homePageVF5-spec` all score zero matches in
 * flatsome.css, so they transfer verbatim — checked, not assumed, the same check
 * VF 6 made of `.btn`.
 *
 * The album half of this file is nerio.css's, and deliberately so: the two
 * references are the same block from the same shop stylesheet. A fix to the
 * slider here is worth carrying to that file, and the other way round.
 *
 * Loaded only where an ebus_* element is on the page, and everywhere inside the
 * builder — see vf_model_in_use() in inc/models/setup.php.
 */

/* ===================================================================== base */

.ebus {
	--ebus-blue: #1464f4;
	--ebus-ink: #1f2125;
	--ebus-body: #3c3c3c;
	--ebus-rule: #84a3b6;
	--ebus-card: #f7f9f9;

	font-family: 'Mulish', sans-serif;
	color: var(--ebus-ink);
}

.ebus section {
	position: relative;
	padding: 96px 0;
}

.ebus img {
	max-width: 100%;
	height: auto;
}

.ebus p {
	margin: 0 0 1rem;
	line-height: 1.5;
}

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

.ebus ul {
	margin: 0;
}

/**
 * Flatsome styles the bare `button` tag, and every control on this page is one.
 *
 * Its rule carries `min-height:2.5em; min-width:24px; margin-right:1em;
 * padding:0 1.2em; line-height:2.4em; text-transform:uppercase`, and the two
 * `min-*` are the dangerous half: a minimum beats the `height` and `width` a
 * later, more specific rule sets, so the 48px arrows and the 8px bullets below
 * would come out at whatever the font size makes 2.5em. The controls are
 * `<button>`s rather than the reference's `<div>`s on purpose — a div cannot be
 * focused, cannot be pressed from a keyboard and has no name — so the tag is
 * reset once here rather than fought in four places. Measured in the browser,
 * not read off the rules, as minio.css records at length.
 */
.ebus button {
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	font-size: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
}

/**
 * Off-screen, not display:none.
 *
 * The arrows and the bullets are buttons whose whole label is an icon, so the
 * name has to stay readable to a screen reader while being invisible on the
 * page. Flatsome ships `.screen-reader-text` but only inside its own scope.
 */
.ebus .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* -------------------------------------------------------------- buttons */

/* Both are commented out on the reference; these are what they look like when
   the site owner types a label and turns one on. See inc/models/ebus/specs.php. */
.ebus .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	min-height: 0;
	min-width: 204px;
	margin: 0;
	padding: 1rem;
	border-radius: 0;
	font-weight: 700;
	font-size: 12px;
	line-height: 15px;
	letter-spacing: 0.1rem;
	text-align: center;
	text-transform: uppercase;
	transition: background 0.35s ease, color 0.35s ease;
}

.ebus .btn--border--blue {
	border: 1px solid var(--ebus-blue);
}

.ebus .btn--primary--blue {
	background: var(--ebus-blue);
	color: #fff;
}

.ebus .btn--primary--blue:hover {
	background: #fff;
	color: var(--ebus-blue);
}

.ebus .btn--primary--white {
	background: #fff;
	color: var(--ebus-blue);
}

.ebus .btn--primary--white:hover {
	background: var(--ebus-blue);
	color: #fff;
}

/* ==================================================================== album */

.ebus--album .album-block {
	padding: 0;
}

.ebus--album .album {
	max-width: 1440px;
	margin: 0 auto;
}

/**
 * The viewport, and what it looks like before the script arrives.
 *
 * Unscripted, the track is a row of photographs that scrolls sideways — every
 * slide reachable, nothing hidden, which is the readable baseline. The script
 * adds `is-ready`, and only then does the box stop scrolling and start being
 * moved by a transform. The arrows and the dots stay hidden until that happens:
 * unscripted they are four controls that do nothing, which is worse than four
 * controls that are not there.
 */
.ebus--album .album-swiper {
	position: relative;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
}

.ebus--album .album-swiper.is-ready {
	overflow: hidden;
	scroll-snap-type: none;
}

/**
 * The track is the viewport's width, and the slides overflow it.
 *
 * `flex: 0 0 100%` is the obvious spelling and the wrong one: flex-basis beats
 * the pixel width the script sets on each slide, so the track would be moved by
 * a measurement nothing was laid out to. `width` with `flex-shrink: 0` is what
 * Swiper itself does, and it leaves the script's measurement in charge.
 */
.ebus--album .swiper-wrapper {
	display: flex;
	align-items: flex-start;
	width: 100%;
}

.ebus--album .album-swiper.is-ready .swiper-wrapper {
	transition: transform 0.5s ease;
	will-change: transform;
	user-select: none;
	-webkit-user-drag: none;   /* A drag must not also select the photograph. */
}

.ebus--album .swiper-slide {
	flex-shrink: 0;
	width: 100%;
	scroll-snap-align: start;
}

.ebus--album .swiper-slide picture {
	display: block;
}

.ebus--album .album-img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

/* -------------------------------------------------------------- controls */

.ebus--album .swiper-button-prev,
.ebus--album .swiper-button-next,
.ebus--album .swiper-pagination {
	display: none;
}

.ebus--album .album-swiper.is-ready .swiper-button-prev,
.ebus--album .album-swiper.is-ready .swiper-button-next {
	position: absolute;
	bottom: 20px;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(129, 127, 127, 0.459);
	box-shadow: 1px 0 5px 0 rgba(0, 0, 0, 0.5);
	color: #fff;
	cursor: pointer;
}

.ebus--album .swiper-button-prev {
	left: 40px;
}

.ebus--album .swiper-button-next {
	right: 40px;
}

.ebus--album .swiper-button-prev svg,
.ebus--album .swiper-button-next svg {
	width: 20px;
	height: 20px;
}

.ebus--album .album-swiper.is-ready .swiper-pagination {
	position: absolute;
	bottom: 33px;
	left: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
}

/**
 * White dots that can be found on a white photograph.
 *
 * The reference draws these as `background:#fff` with `opacity:.2` inactive and
 * `1` active, and this album ends on studio shots of the bus on plain white —
 * where the whole pagination goes invisible. The same defect Nerio Green's twelve
 * slides have, and it is fixed the same way and for the same reason: with the
 * reference's own idiom rather than a new one. Its arrows are a pale grey circle
 * that would vanish on those photographs too, and it keeps them legible with
 * `box-shadow: 1px 0 5px rgba(0,0,0,.5)`. So the bullets get a shadow. The
 * dim/bright difference moves from `opacity` to the fill, because opacity fades a
 * box-shadow along with the box it was drawn for — a 20% shadow is no more
 * visible than the 20% dot it was drawn for.
 */
.ebus--album .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.45);
	cursor: pointer;
	transition: background 0.3s ease;
}

.ebus--album .swiper-pagination-bullet.is-active {
	background: #fff;
}

/* ==================================================================== specs */

.ebus--specs .homePageVF5-spec {
	padding-bottom: 96px;
}

/* The reference's `.container` + `.row` + the wrap inside them, in one box. */
.ebus--specs .ebus-container {
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 30px;
}

.ebus--specs .infomation-wrap {
	max-width: 1128px;
	margin: 0 auto;
}

.ebus--specs .parameter-header {
	margin-bottom: 16px;
}

.ebus--specs .parameter-logo {
	max-height: 20px;
	max-width: 100%;
	width: auto;
}

/* ---------------------------------------------------------------- the table */

.ebus--specs .parameter-content {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 30px;
	width: 100%;
}

.ebus--specs .parameter-list {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 30px;
	width: 100%;
}

.ebus--specs .parameter-item {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	gap: 8px;
	width: 100%;
	color: var(--ebus-body);
}

/**
 * A short row must not stretch its cells.
 *
 * The rows are chunks of four, so the last one is whatever is left over — one
 * figure, or two. `width:100%` on a flex child under `justify-content:
 * space-between` would spread those across the whole table and put the last
 * figure of a twenty-first-item list in a column the width of the page. The
 * flex-basis pins every cell to a quarter however many share the row.
 */
.ebus--specs .parameter-list > .parameter-item {
	flex: 0 1 calc((100% - 90px) / 4);
}

.ebus--specs .parameter-item label {
	display: block;
	margin: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--ebus-body);
}

.ebus--specs .parameter-item span {
	display: block;
	font-size: 20px;
	font-weight: 600;
	line-height: 25px;
}

/* The reference draws these only from 992px up, where the table is rows. */
.ebus--specs .parameter-rule {
	display: none;
	width: 100%;
	margin: 0;
	border: 0;
	border-top: 1px solid var(--ebus-rule);
}

@media (min-width: 992px) {
	.ebus--specs .parameter-rule {
		display: block;
	}
}

/* ------------------------------------------------------------- the contacts */

/**
 * The reference gives this block no space above it at all.
 *
 * Its `.parameter-contacts` has margin and padding of nothing, so the first card
 * sits directly against the rule that closes the specification table — two
 * unrelated things touching. A margin is added here rather than copied away, the
 * same call nerio.css makes for its `.parameter-footer`, which has the identical
 * gap in the identical stylesheet.
 */
.ebus--specs .parameter-contacts {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 16px;
	margin-top: 40px;
}

.ebus--specs .contact-title {
	flex-basis: 100%;
	font-size: 18px;
	font-weight: 600;
	line-height: 150%;
	color: #000;
	text-align: center;
}

/**
 * `align-items: center` on the row, in the reference, means two cards holding a
 * different number of lines are different heights and float against each other's
 * middle. Both of its cards hold a name, an address and a number, so it never
 * shows — until the day someone adds a third with no e-mail. `stretch` above is
 * what keeps a row of cards a row of cards; nothing else about the box changes.
 */
.ebus--specs .parameter-contact {
	padding: 30px;
	background: var(--ebus-card);
}

.ebus--specs .contact-name {
	display: block;
	margin-bottom: 12px;
	font-size: 16px;
	font-weight: 600;
	line-height: 150%;
	color: var(--ebus-ink);
}

.ebus--specs .parameter-contact p {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.ebus--specs .parameter-contact p:last-child {
	margin-bottom: 0;
}

.ebus--specs .parameter-contact a {
	font-size: 16px;
	font-weight: 400;
	line-height: 150%;
	color: var(--ebus-blue);
	text-decoration: underline;
	/* An address is long and a phone is narrow: the card must not push the page
	   sideways rather than wrap. */
	overflow-wrap: anywhere;
}

.ebus--specs .parameter-contact a.phone {
	font-weight: 600;
	text-decoration: none;
}

/* The icon is the label's picture, not a thing that shrinks when the address
   beside it wraps onto two lines. */
.ebus--specs .contact-icon {
	flex: 0 0 auto;
	color: var(--ebus-body);
}

/* ----------------------------------------------------------------- the foot */

.ebus--specs .parameter-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 3rem;
	text-align: center;
}

.ebus--specs .parameter-note {
	padding-top: 1.5rem;
	color: var(--ebus-body);
}

.ebus--specs .parameter-txt {
	margin-bottom: 0.5rem;
}

.ebus--specs .parameter-note-list {
	margin: 0;
	padding-left: 20px;
	list-style: disc;
	line-height: 1.5;
}

/* ============================================================ 991 and down */

@media (max-width: 991px) {
	.ebus--specs .ebus-container {
		padding: 0 15px;
	}
}

/**
 * The specification table stops being rows.
 *
 * The reference turns `.parameter-content` into a three-column grid whose items
 * are the five groups of four, so each group becomes a column read downwards —
 * then two columns at 575, then a single stack at 475. Reproduced as given: it
 * is what keeps twenty figures readable on a phone without twenty full-width
 * rows of whitespace, and it is why the grouping into fours is load-bearing
 * rather than decorative.
 */
@media (max-width: 767px) {
	.ebus section {
		padding: 30px 0;
	}

	.ebus--specs .homePageVF5-spec {
		padding-bottom: 48px;
	}

	.ebus--specs .parameter-content {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 15px;
	}

	.ebus--specs .parameter-list {
		flex-direction: column;
		gap: 24px;
	}

	/* Back to a plain cell: the row is a column now, so there is no quarter. */
	.ebus--specs .parameter-list > .parameter-item {
		flex: 0 0 auto;
	}

	.ebus--specs .parameter-item span {
		font-size: 16px;
	}

	.ebus--specs .parameter-contact {
		width: 100%;
		padding: 12px;
	}

	.ebus--specs .btn {
		min-width: 0;
		flex: 1 1 100%;
	}
}

@media (max-width: 575px) {
	.ebus--specs .parameter-content {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 475px) {
	.ebus--specs .parameter-content {
		display: flex;
	}
}

/* ------------------------------------------------------------------ album */

@media (max-width: 768px) {
	.ebus--album .album-swiper.is-ready .swiper-button-prev,
	.ebus--album .album-swiper.is-ready .swiper-button-next {
		bottom: 10px;
		width: 32px;
		height: 32px;
	}

	.ebus--album .swiper-button-prev {
		left: 20px;
	}

	.ebus--album .swiper-button-next {
		right: 20px;
	}

	.ebus--album .swiper-button-prev svg,
	.ebus--album .swiper-button-next svg {
		width: 14px;
		height: 14px;
	}

	.ebus--album .album-swiper.is-ready .swiper-pagination {
		bottom: 16px;
	}
}
