/*
Theme Name: CFMOTO Media VT9
Theme URI: https://medias.cfmoto.ca/
Author: vt9 - Web Agency
Author URI: https://vt9.agency/
Description: Lightweight, native WordPress theme for the CFMOTO media library.
Version: 1.0.2
Requires at least: 7.1
Requires PHP: 8.2
Text Domain: cfmoto-vt9
Tags: custom-logo, featured-images, translation-ready
*/

:root {
	--cfmoto-blue: #00a7e1;
	--cfmoto-blue-dark: #007eaa;
	--cfmoto-ink: #17191b;
	--cfmoto-muted: #636b71;
	--cfmoto-line: #dfe3e6;
	--cfmoto-surface: #f4f5f6;
	--cfmoto-white: #fff;
	--cfmoto-width: 1240px;
}

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

html {
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	margin: 0;
	background: var(--cfmoto-white);
	color: var(--cfmoto-ink);
	font-family: Arial, Helvetica, sans-serif;
	font-size: 16px;
	line-height: 1.55;
}

body.admin-bar .site-header {
	top: 32px;
}

a {
	color: var(--cfmoto-blue-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

a:hover,
a:focus {
	color: var(--cfmoto-blue);
}

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

button,
input,
select,
textarea {
	font: inherit;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	width: auto;
	height: auto;
	padding: 12px 16px;
	clip: auto;
	background: var(--cfmoto-white);
	color: var(--cfmoto-ink);
}

.site-header {
	position: sticky;
	z-index: 1000;
	top: 0;
	background: var(--cfmoto-white);
	color: var(--cfmoto-ink);
	border-bottom: 1px solid var(--cfmoto-line);
	box-shadow: 0 4px 12px rgb(20 31 38 / 8%);
}

.header-inner,
.content-wrap,
.footer-inner {
	width: min(calc(100% - 40px), var(--cfmoto-width));
	margin-inline: auto;
}

.header-inner {
	display: grid;
	grid-template-columns: 190px 1fr auto;
	align-items: center;
	min-height: 82px;
	gap: 28px;
}

.site-brand {
	display: inline-flex;
	align-items: center;
}

.site-brand img,
.custom-logo {
	display: block;
	width: 164px;
	max-height: 44px;
}

.site-header .site-brand img {
	filter: brightness(0);
}

.site-title {
	margin: 0;
	color: var(--cfmoto-ink);
	font-size: clamp(1rem, 1.8vw, 1.35rem);
	font-weight: 600;
	letter-spacing: 0.015em;
	text-transform: uppercase;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 22px;
}

.primary-menu,
.footer-menu {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.primary-menu a,
.language-switcher {
	color: var(--cfmoto-ink);
	font-size: 0.84rem;
	font-weight: 700;
	letter-spacing: 0.055em;
	text-decoration: none;
	text-transform: uppercase;
}

.language-switcher {
	text-transform: none;
}

.primary-menu a:hover,
.primary-menu a:focus,
.primary-menu .current-menu-item > a,
.language-switcher:hover,
.language-switcher:focus {
	color: var(--cfmoto-blue);
}

.language-switcher {
	padding-left: 20px;
	border-left: 1px solid var(--cfmoto-line);
}

.menu-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 10px;
	border: 1px solid var(--cfmoto-line);
	background: transparent;
	color: var(--cfmoto-ink);
	cursor: pointer;
}

.menu-toggle span {
	display: block;
	height: 2px;
	margin: 5px 0;
	background: currentcolor;
}

.site-main {
	min-height: 58vh;
	padding-block: clamp(34px, 5vw, 72px);
}

.content-wrap {
	padding: 0;
	background: var(--cfmoto-white);
}

.entry-header {
	margin-bottom: 28px;
	border-bottom: 1px solid var(--cfmoto-line);
}

.entry-title,
.page-title {
	margin: 0 0 24px;
	font-size: clamp(1.7rem, 4vw, 2.75rem);
	line-height: 1.12;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content > :last-child {
	margin-bottom: 0;
}

.entry-content::after {
	display: table;
	clear: both;
	content: '';
}

.entry-content .alignwide {
	width: min(110%, calc(100vw - 40px));
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.entry-content .alignfull {
	width: 100vw;
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
}

.wp-block-image img {
	display: block;
}

.wp-caption,
.gallery-caption {
	color: var(--cfmoto-muted);
	font-size: 0.875rem;
}

.wpfd-content,
.wpfd-search {
	max-width: 100%;
}

.wpfd-content a,
.wpfd-search a {
	text-underline-offset: initial;
}

/*
 * Preserve image proportions in the WP File Download lightbox.
 * The plugin injects width, height and max-height as inline styles via JavaScript,
 * so !important is required here to keep previews inside the viewport.
 */
#wpfd-box-player img.video-js {
	width: auto !important;
	height: auto !important;
	max-width: 90vw !important;
	max-height: 90vh !important;
	object-fit: contain;
	background: #333;
}

#wpfd-dropblock-close,
#wpfd-dropblock-close:hover,
#wpfd-dropblock-close:focus {
	text-decoration: none;
}

.site-footer {
	margin-top: auto;
	background: var(--cfmoto-ink);
	color: rgb(255 255 255 / 75%);
}

.footer-main {
	padding-block: 38px;
	border-bottom: 1px solid rgb(255 255 255 / 12%);
}

.footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
}

.footer-brand img {
	display: block;
	width: 145px;
}

.footer-menu {
	flex-wrap: wrap;
	justify-content: flex-end;
}

.footer-menu a {
	color: var(--cfmoto-white);
	font-size: 0.88rem;
	text-decoration: none;
}

.footer-menu a:hover,
.footer-menu a:focus {
	color: var(--cfmoto-blue);
}

.site-info {
	padding-block: 18px;
	background: #101214;
	font-size: 0.84rem;
}

.site-info p {
	margin: 0;
}

.posts-list article + article {
	padding-top: 30px;
	margin-top: 30px;
	border-top: 1px solid var(--cfmoto-line);
}

.pagination {
	margin-top: 36px;
}

.error-404,
.no-results {
	text-align: center;
}

@media (max-width: 960px) {
	.header-inner {
		grid-template-columns: 160px 1fr 44px;
		gap: 16px;
	}

	.menu-toggle {
		display: block;
	}

	.header-actions {
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		display: none;
		align-items: stretch;
		padding: 22px max(20px, calc((100vw - var(--cfmoto-width)) / 2));
		background: var(--cfmoto-white);
		box-shadow: 0 10px 20px rgb(0 0 0 / 18%);
	}

	.header-actions.is-open {
		display: block;
	}

	.primary-menu {
		align-items: stretch;
		flex-direction: column;
		gap: 0;
	}

	.primary-menu a {
		display: block;
		padding: 12px 0;
		border-bottom: 1px solid var(--cfmoto-line);
	}

	.language-switcher {
		display: inline-block;
		padding: 14px 0 2px;
		border-left: 0;
	}
}

@media (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

@media (max-width: 640px) {
	.header-inner,
	.content-wrap,
	.footer-inner {
		width: min(calc(100% - 28px), var(--cfmoto-width));
	}

	.header-inner {
		grid-template-columns: 125px 1fr 42px;
		min-height: 70px;
	}

	.site-brand img,
	.custom-logo {
		width: 122px;
	}

	.site-title {
		text-align: center;
	}

	.footer-inner {
		align-items: flex-start;
		flex-direction: column;
	}

	.footer-menu {
		justify-content: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
