/*
Theme Name: VeloVista
Theme URI: https://velovista.ch
Author: Marketamine Sàrl
Description: Thème magazine pour un site d'information sur le vélo et la mobilité. Mobile d'abord, logo multicolore à formes superposées et décalées, une couleur par rubrique, barre de navigation au pouce sur mobile. Sans jQuery.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: velovista
*/

/* ---------- Jetons ---------- */
:root {
	--encre: #17193b;
	--bleu: #2d4bff;
	--rose: #ff4f79;
	--jaune: #ffc42e;
	--menthe: #12c6a0;
	--violet: #8a4dff;
	--papier: #ffffff;
	--brume: #f1f3f9;
	--gris: #5c6079;
	--trait: #dfe2ee;
	--r: 14px;
	--decal: 8px;
	--marge: 20px;
	--large: 1240px;
	--titre: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
	--texte: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
	--barre: 62px;
	--cat: var(--bleu);
	--cat-ink: #fff;
}
.vv-c1 { --cat: var(--bleu); --cat-ink: #fff; }
.vv-c2 { --cat: var(--rose); --cat-ink: var(--encre); }
.vv-c3 { --cat: var(--jaune); --cat-ink: var(--encre); }
.vv-c4 { --cat: var(--menthe); --cat-ink: var(--encre); }
.vv-c5 { --cat: var(--violet); --cat-ink: #fff; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--papier);
	color: var(--encre);
	font-family: var(--texte);
	font-size: 1.0625rem;
	line-height: 1.6;
	overflow-x: clip;
	padding-bottom: calc(var(--barre) + env(safe-area-inset-bottom, 0px));
	-webkit-font-smoothing: antialiased;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .18em; }
h1, h2, h3, h4 {
	font-family: var(--titre);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -.025em;
	margin: 0;
	text-wrap: balance;
}
p { margin: 0 0 1em; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; border-radius: 4px; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip-path: inset(50%); white-space: nowrap;
}
.vv-skip:focus {
	position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip-path: none;
	background: var(--encre); color: #fff; padding: .6em 1em; border-radius: 8px;
}
.vv-wrap { width: 100%; max-width: var(--large); margin-inline: auto; padding-inline: var(--marge); }

/* ---------- Logo ---------- */
.vv-logo { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.vv-mark { display: block; width: 46px; height: auto; flex: none; overflow: visible; }
.vv-mark * { mix-blend-mode: multiply; }
.vv-mark--nuit * { mix-blend-mode: screen; }
.vv-word {
	font-family: var(--titre); font-weight: 800; font-size: 1.5rem;
	letter-spacing: -.045em; line-height: 1;
}
.custom-logo { display: block; max-height: 40px; width: auto; }

/* ---------- En-tête ---------- */
.vv-header {
	position: sticky; top: 0; z-index: 40;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--trait);
}
.vv-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.vv-nav { display: none; }
.vv-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.vv-nav a {
	display: block; padding: .45em .8em; border-radius: 999px;
	font-weight: 600; font-size: .98rem; text-decoration: none;
}
.vv-nav a:hover, .vv-nav .current-menu-item > a, .vv-nav .current-cat > a { background: var(--brume); }
.vv-icon-btn {
	display: inline-grid; place-items: center; width: 44px; height: 44px;
	border: 0; border-radius: 50%; background: var(--brume); cursor: pointer;
}
.vv-icon-btn svg { width: 22px; height: 22px; }
.vv-header__actions { display: flex; gap: .5rem; }
.vv-only-desktop { display: none; }

/* ---------- Barre au pouce (mobile) ---------- */
.vv-tabbar {
	position: fixed; inset: auto 0 0 0; z-index: 45;
	display: grid; grid-template-columns: repeat(3, 1fr);
	height: calc(var(--barre) + env(safe-area-inset-bottom, 0px));
	padding-bottom: env(safe-area-inset-bottom, 0px);
	background: var(--encre); color: #fff;
}
.vv-tabbar a, .vv-tabbar button {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
	background: none; border: 0; color: inherit; text-decoration: none;
	font-size: .72rem; font-weight: 600; cursor: pointer;
}
.vv-tabbar svg { width: 24px; height: 24px; }
.vv-tabbar .is-active { color: var(--jaune); }

/* ---------- Panneau menu / recherche ---------- */
.vv-panel {
	position: fixed; inset: 0; z-index: 60;
	background: var(--papier); overflow-y: auto;
	padding: 16px var(--marge) calc(32px + env(safe-area-inset-bottom, 0px));
	transform: translateY(100%); visibility: hidden;
	transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s .28s;
}
.vv-panel.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.vv-panel__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.vv-panel__in { max-width: 640px; margin-inline: auto; }
.vv-panel h2 { font-size: 1.1rem; margin: 28px 0 12px; letter-spacing: -.01em; }
.vv-panel__menu ul { list-style: none; margin: 0; padding: 0; }
.vv-panel__menu a {
	display: block; padding: .5em 0; border-bottom: 1px solid var(--trait);
	font-family: var(--titre); font-weight: 800; font-size: 1.6rem; letter-spacing: -.03em; text-decoration: none;
}
.vv-panel__menu .sub-menu a { font-size: 1.1rem; padding-left: 1rem; }
body.vv-lock { overflow: hidden; }

.vv-search { display: flex; gap: 8px; }
.vv-search input[type="search"] {
	flex: 1; min-width: 0; height: 52px; padding: 0 18px;
	border: 2px solid var(--encre); border-radius: 999px; background: #fff; font-size: 1rem;
}
.vv-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 0 22px; border: 0; border-radius: 999px;
	background: var(--encre); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
	box-shadow: 4px 4px 0 var(--jaune); transition: box-shadow .15s, transform .15s;
}
.vv-btn:hover { box-shadow: 6px 6px 0 var(--rose); transform: translate(-1px, -1px); }

/* ---------- Pastilles de rubrique ---------- */
.vv-chip {
	display: inline-block; padding: .28em .75em; border-radius: 999px;
	background: var(--cat); color: var(--cat-ink);
	font-size: .8rem; font-weight: 700; line-height: 1.3; text-decoration: none; white-space: nowrap;
}
.vv-rail {
	display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity;
	padding: 4px var(--marge) 12px; margin-inline: calc(var(--marge) * -1);
	scroll-padding-inline: var(--marge); scrollbar-width: none;
}
.vv-rail::-webkit-scrollbar { display: none; }
.vv-rail > * { scroll-snap-align: start; flex: none; }
.vv-rail .vv-chip { font-size: .95rem; padding: .55em 1.1em; }

/* ---------- Image + plaques décalées ---------- */
.vv-media { position: relative; display: block; isolation: isolate; margin: 0 var(--decal) var(--decal) 0; }
.vv-media::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: var(--cat); border-radius: var(--r);
	transform: translate(var(--decal), var(--decal));
	transition: transform .2s ease;
}
.vv-media img, .vv-media .vv-art {
	display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
	border-radius: var(--r); background: var(--brume);
}
a:hover > .vv-media::before, .vv-card:hover .vv-media::before { transform: translate(calc(var(--decal) + 5px), calc(var(--decal) + 5px)); }
.vv-art * { mix-blend-mode: multiply; }

/* ---------- Cartes ---------- */
.vv-card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.vv-card__link { text-decoration: none; }
.vv-card__title { font-size: clamp(1.25rem, 1rem + 1vw, 1.5rem); margin-top: 8px; }
.vv-card__link:hover .vv-card__title { text-decoration: underline; text-decoration-color: var(--cat); text-decoration-thickness: 3px; }
.vv-card__excerpt { color: var(--gris); margin: 8px 0 0; font-size: .98rem; }
.vv-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--gris); font-size: .86rem; margin-top: 8px; }

.vv-card--hero { --decal: 12px; }
.vv-card--hero .vv-media { margin-left: 8px; margin-top: 8px; }
.vv-card--hero .vv-media::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: var(--jaune); border-radius: var(--r);
	transform: translate(-8px, -8px); mix-blend-mode: multiply;
}
.vv-c3.vv-card--hero .vv-media::after { background: var(--rose); }
.vv-card--hero .vv-media img, .vv-card--hero .vv-media .vv-art { aspect-ratio: 16 / 11; }
.vv-card--hero .vv-card__title { font-size: clamp(2rem, 1.2rem + 4.2vw, 4rem); letter-spacing: -.035em; line-height: .98; }
.vv-card--hero .vv-card__excerpt { font-size: 1.1rem; max-width: 56ch; }

.vv-card--row { flex-direction: row; align-items: flex-start; gap: 16px; --decal: 5px; }
.vv-card--row .vv-card__fig { flex: 0 0 112px; }
.vv-card--row .vv-media img, .vv-card--row .vv-media .vv-art { aspect-ratio: 1; }
.vv-card--row .vv-card__title { font-size: 1.15rem; line-height: 1.12; }
.vv-card--row .vv-card__excerpt { display: none; }

/* ---------- Mise en page accueil ---------- */
.vv-main { padding-block: 24px 56px; }
.vv-une { display: grid; gap: 36px; }
.vv-aside { display: grid; gap: 22px; align-content: start; }
.vv-section { margin-top: 56px; }
.vv-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.vv-h {
	position: relative; display: inline-block; isolation: isolate;
	font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem);
}
.vv-h::after {
	content: ""; position: absolute; left: -4px; right: -10px; bottom: .02em; height: .42em; z-index: -1;
	background: var(--cat); border-radius: 4px; opacity: .9;
}
.vv-more { font-weight: 700; white-space: nowrap; text-decoration-color: var(--cat); }
.vv-grid { display: grid; gap: 34px 24px; }
.vv-scroller {
	display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 18px;
	overflow-x: auto; scroll-snap-type: x mandatory;
	padding: 0 var(--marge) 14px; margin-inline: calc(var(--marge) * -1);
	scroll-padding-inline: var(--marge); scrollbar-width: none;
}
.vv-scroller::-webkit-scrollbar { display: none; }
.vv-scroller > * { scroll-snap-align: start; }

/* ---------- En-tête d'archive ---------- */
.vv-archive-head { background: var(--cat); color: var(--cat-ink); padding: 36px 0 40px; margin-bottom: 32px; }
.vv-archive-head h1 { font-size: clamp(2.4rem, 1.4rem + 5vw, 5rem); letter-spacing: -.04em; }
.vv-archive-head p { margin: 12px 0 0; max-width: 60ch; }
.vv-archive-head--neutre { background: var(--brume); color: var(--encre); }

/* ---------- Article ---------- */
.vv-progress { position: fixed; top: 0; left: 0; z-index: 50; width: 100%; height: 4px; background: transparent; pointer-events: none; }
.vv-progress span { display: block; height: 100%; width: 100%; background: var(--cat); transform: scaleX(0); transform-origin: 0 50%; }
.vv-article__head { max-width: 900px; margin-inline: auto; padding-top: 12px; }
.vv-article__title { font-size: clamp(2.1rem, 1.3rem + 4.4vw, 4.2rem); letter-spacing: -.035em; line-height: 1; margin: 14px 0 16px; }
.vv-article__chapo { font-size: 1.25rem; line-height: 1.45; color: var(--gris); max-width: 62ch; }
.vv-article__media { --decal: 12px; max-width: 1040px; margin: 28px auto 0; padding-inline: 0 var(--decal); }
.vv-article__media .vv-media { margin: 0; }
.vv-article__media img { aspect-ratio: 16 / 9; }
.vv-content { max-width: 68ch; margin: 40px auto 0; font-size: 1.14rem; line-height: 1.72; }
.vv-content > * { margin-block: 0 1.25em; }
.vv-content h2 { font-size: 1.9rem; margin-top: 1.8em; margin-bottom: .5em; }
.vv-content h3 { font-size: 1.4rem; margin-top: 1.6em; margin-bottom: .4em; }
.vv-content a { text-decoration-color: var(--cat); font-weight: 600; }
.vv-content a:hover { background: color-mix(in srgb, var(--cat) 22%, transparent); }
.vv-content img, .vv-content figure img { border-radius: var(--r); }
.vv-content figcaption, .wp-caption-text { color: var(--gris); font-size: .88rem; margin-top: .5em; }
.vv-content blockquote {
	margin-inline: 0; padding: 22px 24px; border-radius: var(--r);
	background: var(--brume); box-shadow: var(--decal) var(--decal) 0 var(--cat);
	font-family: var(--titre); font-weight: 600; font-size: 1.35rem; line-height: 1.3;
}
.vv-content blockquote p:last-child { margin-bottom: 0; }
.vv-content ul, .vv-content ol { padding-left: 1.3em; }
.vv-content li { margin-bottom: .4em; }
.vv-content li::marker { color: var(--cat); font-weight: 800; }
.vv-content table { width: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.vv-content th, .vv-content td { padding: .6em .8em; border-bottom: 1px solid var(--trait); text-align: left; }
.vv-content th { font-family: var(--titre); }
.vv-content pre { background: var(--encre); color: #fff; padding: 18px; border-radius: var(--r); overflow-x: auto; font-size: .92rem; }
.vv-content .alignwide { width: min(1040px, 100vw - 2 * var(--marge)); max-width: none; margin-inline: calc((min(1040px, 100vw - 2 * var(--marge)) - 100%) / -2); }
.vv-content .alignfull { width: 100vw; max-width: none; margin-inline: calc((100vw - 100%) / -2); }
.vv-content .alignfull img { border-radius: 0; }
.aligncenter { display: block; margin-inline: auto; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.wp-block-button__link { border-radius: 999px; background: var(--encre); color: #fff; font-weight: 700; }
.vv-article__foot { max-width: 68ch; margin: 40px auto 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vv-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.vv-tags a { padding: .3em .8em; border: 2px solid var(--encre); border-radius: 999px; font-size: .85rem; font-weight: 600; text-decoration: none; }
.vv-tags a:hover { background: var(--encre); color: #fff; }
.vv-share { margin-left: auto; }
.vv-postnav { max-width: 900px; margin: 48px auto 0; display: grid; gap: 14px; }
.vv-postnav a { display: block; padding: 18px 20px; border-radius: var(--r); background: var(--brume); text-decoration: none; }
.vv-postnav a:hover { box-shadow: 6px 6px 0 var(--cat); }
.vv-postnav small { display: block; color: var(--gris); font-size: .85rem; margin-bottom: 4px; }
.vv-postnav strong { font-family: var(--titre); font-size: 1.2rem; line-height: 1.15; }

/* ---------- Pagination, commentaires, formulaires ---------- */
.pagination, .comments-pagination { margin-top: 48px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers {
	display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 14px;
	border-radius: 999px; background: var(--brume); font-weight: 700; text-decoration: none;
}
.page-numbers.current { background: var(--encre); color: #fff; box-shadow: 4px 4px 0 var(--jaune); }
.vv-comments { max-width: 68ch; margin: 56px auto 0; }
.vv-comments h2 { font-size: 1.7rem; margin-bottom: 20px; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: 20px; border-left: 3px solid var(--trait); }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--trait); }
.comment-author img { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-metadata { font-size: .85rem; color: var(--gris); }
.comment-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 2px solid var(--encre); border-radius: 12px; background: #fff;
}
.comment-form .submit {
	min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px;
	background: var(--encre); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 4px 4px 0 var(--menthe);
}

/* ---------- Vide / 404 ---------- */
.vv-empty { max-width: 640px; margin: 40px auto; text-align: left; }
.vv-empty h1 { font-size: clamp(2.4rem, 1.5rem + 5vw, 4.5rem); margin-bottom: 16px; }
.vv-empty .vv-mark { width: 150px; margin-bottom: 28px; }
.vv-empty .vv-search { margin-top: 24px; }

/* ---------- Pied de page ---------- */
.vv-footer { background: var(--encre); color: #fff; padding: 56px 0 32px; }
.vv-footer a { color: #fff; }
.vv-footer__brand {
	font-family: var(--titre); font-weight: 800; letter-spacing: -.055em; line-height: .9;
	font-size: clamp(3.4rem, 17vw, 12rem); margin: 0 0 28px;
	text-shadow: .035em .035em 0 var(--rose), .07em .07em 0 var(--bleu);
}
.vv-footer__cols { display: grid; gap: 28px; }
.vv-footer__desc { color: #c5c8de; max-width: 44ch; }
.vv-footer ul { list-style: none; margin: 0; padding: 0; }
.vv-footer li { margin-bottom: .5em; }
.vv-footer h2, .vv-footer h3 { font-size: 1.05rem; letter-spacing: 0; margin-bottom: 12px; color: var(--jaune); }
.vv-footer__bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .18); color: #c5c8de; font-size: .88rem; }

/* ---------- Tablette ---------- */
@media (min-width: 640px) {
	:root { --marge: 32px; }
	.vv-grid { grid-template-columns: repeat(2, 1fr); }
	.vv-scroller { grid-auto-columns: 42%; }
	.vv-postnav { grid-template-columns: 1fr 1fr; }
	.vv-postnav .vv-next { text-align: right; }
	.vv-footer__cols { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---------- Bureau ---------- */
@media (min-width: 960px) {
	body { padding-bottom: 0; }
	.vv-tabbar, .vv-only-mobile { display: none; }
	.vv-only-desktop { display: inline-grid; }
	.vv-nav { display: block; }
	.vv-header__in { min-height: 72px; }
	.vv-mark { width: 54px; }
	.vv-word { font-size: 1.75rem; }
	.vv-main { padding-block: 40px 88px; }
	.vv-une { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 56px; }
	.vv-grid { grid-template-columns: repeat(3, 1fr); gap: 48px 32px; }
	.vv-scroller {
		grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 28px;
		overflow: visible; padding: 0; margin: 0;
	}
	.vv-section { margin-top: 88px; }
	.vv-rail { flex-wrap: wrap; overflow: visible; }
	.vv-panel { background: rgba(23, 25, 59, .5); transform: none; opacity: 0; transition: opacity .2s, visibility 0s .2s; padding: 6vh var(--marge); }
	.vv-panel.is-open { opacity: 1; }
	.vv-panel__in { background: var(--papier); border-radius: 22px; padding: 24px 32px 36px; box-shadow: 12px 12px 0 var(--bleu); }
	.vv-archive-head { padding: 64px 0 68px; margin-bottom: 48px; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
