/*
 * HiCanadian — styles du site (thème enfant Kadence).
 * Tokens, mise en page, composants et états d'accessibilité.
 */

:root {
	--hc-red: #d62828;
	--hc-navy: #102a43;
	--hc-bg: #f6f8fa;
	--hc-surface: #ffffff;
	--hc-text: #24313d;
	--hc-muted: #5a6b7b;
	--hc-border: #dde3ea;
	--hc-radius: 12px;
	--hc-radius-sm: 8px;
	--hc-wrap: 1200px;
	--hc-wrap-wide: 1320px;
	--hc-gap: clamp(1rem, 2.5vw, 2rem);
	--hc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--hc-focus: 0 0 0 3px #fff, 0 0 0 6px var(--hc-navy);
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--hc-bg);
	color: var(--hc-text);
	font-family: var(--hc-font);
	font-size: 1.0625rem;
	line-height: 1.65;
}

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

a {
	color: var(--hc-navy);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	color: var(--hc-red);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: none;
	box-shadow: var(--hc-focus);
	border-radius: var(--hc-radius-sm);
}

.hc-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	padding: 0.75rem 1.25rem;
	background: var(--hc-navy);
	color: #fff;
	border-radius: 0 0 var(--hc-radius) 0;
}

.hc-skip-link:focus {
	left: 0;
	color: #fff;
}

.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;
}

.hc-wrap {
	width: 100%;
	max-width: var(--hc-wrap);
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
}

.hc-wrap--wide {
	max-width: var(--hc-wrap-wide);
}

/* ── En-tête ─────────────────────────────────────────────── */

.hc-header {
	background: var(--hc-surface);
	border-bottom: 1px solid var(--hc-border);
}

.hc-header__inner {
	display: flex;
	align-items: center;
	gap: var(--hc-gap);
	/* Desktop : bandeau sur une seule ligne, hauteur contenue (≤ 80 px). */
	min-height: 72px;
	flex-wrap: nowrap;
}

.hc-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--hc-navy);
	text-decoration: none;
}

.hc-brand__mark {
	width: 10px;
	height: 26px;
	border-radius: 3px;
	background: var(--hc-red);
}

.hc-header__end {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-left: auto;
}

.hc-menu-toggle {
	display: none;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.9rem;
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
	background: var(--hc-surface);
	color: var(--hc-navy);
	font: inherit;
	cursor: pointer;
}

.hc-menu-toggle__bars,
.hc-menu-toggle__bars::before,
.hc-menu-toggle__bars::after {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
	content: "";
}

.hc-menu-toggle__bars {
	position: relative;
}

.hc-menu-toggle__bars::before {
	position: absolute;
	top: -6px;
}

.hc-menu-toggle__bars::after {
	position: absolute;
	top: 6px;
}

.hc-menu {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hc-menu a {
	display: inline-block;
	padding: 0.5rem 0.75rem;
	border-radius: var(--hc-radius-sm);
	color: var(--hc-text);
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
}

.hc-menu a:hover,
.hc-menu .current-menu-item > a,
.hc-menu .current_page_item > a,
.hc-menu .current-menu-ancestor > a {
	background: var(--hc-bg);
	color: var(--hc-red);
}

.hc-menu .sub-menu {
	display: none;
	margin: 0;
	padding: 0 0 0 1rem;
	list-style: none;
}

.hc-menu .sub-menu a {
	font-weight: 500;
}

.hc-search {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.hc-search input[type="search"] {
	min-width: 10rem;
	padding: 0.45rem 0.7rem;
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
	background: var(--hc-surface);
	font: inherit;
	color: var(--hc-text);
}

.hc-search button {
	padding: 0.45rem 0.7rem;
	border: 0;
	border-radius: var(--hc-radius);
	background: var(--hc-navy);
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.hc-lang-switch ul {
	display: flex;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hc-lang-switch a,
.hc-lang-switch span {
	display: inline-block;
	padding: 0.3rem 0.55rem;
	border-radius: var(--hc-radius-sm);
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
}

.hc-lang-switch .current-lang span,
.hc-lang-switch span {
	color: var(--hc-muted);
}

/* ── Contenu ─────────────────────────────────────────────── */

.hc-main {
	display: block;
	padding-block: clamp(1.5rem, 4vw, 3rem);
}

.hc-main__inner {
	width: 100%;
}

body.single .hc-main__inner,
body.page:not(.home) .hc-main__inner,
body.error404 .hc-main__inner {
	max-width: 820px;
}

.hc-article,
.hc-page {
	background: var(--hc-surface);
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
	padding: clamp(1.25rem, 3vw, 2.5rem);
}

.hc-entry-title {
	margin: 0 0 0.75rem;
	color: var(--hc-navy);
	line-height: 1.2;
	font-size: clamp(1.75rem, 3.4vw, 2.5rem);
}

.hc-entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.25rem;
	margin: 0 0 1.5rem;
	color: var(--hc-muted);
	font-size: 0.95rem;
}

.hc-entry-meta a {
	color: inherit;
}

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

.hc-content :where(h2, h3) {
	color: var(--hc-navy);
	line-height: 1.25;
}

.hc-content blockquote {
	margin-inline: 0;
	padding: 0.75rem 1.25rem;
	border-left: 4px solid var(--hc-red);
	background: var(--hc-bg);
	border-radius: 0 var(--hc-radius) var(--hc-radius) 0;
}

.hc-content img,
.hc-content .wp-block-image img {
	border-radius: var(--hc-radius);
}

.hc-content :where(.wp-block-table, table) {
	width: 100%;
	border-collapse: collapse;
}

.hc-content :where(.wp-block-table, table) :where(th, td) {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--hc-border);
	text-align: start;
}

.hc-sources,
.hc-reviewed {
	margin-top: 2rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
	background: var(--hc-bg);
	font-size: 0.95rem;
}

.hc-sources__title,
.hc-reviewed__title {
	margin: 0 0 0.4rem;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--hc-red);
}

.hc-sources ul {
	margin: 0;
	padding-inline-start: 1.1rem;
}

/* ── Listes, cartes et archives ──────────────────────────── */

.hc-page-header {
	margin-bottom: var(--hc-gap);
}

.hc-page-header__title {
	margin: 0 0 0.35rem;
	color: var(--hc-navy);
	font-size: clamp(1.6rem, 3vw, 2.25rem);
	line-height: 1.2;
}

.hc-page-header__desc {
	margin: 0;
	color: var(--hc-muted);
}

.hc-grid {
	display: grid;
	gap: var(--hc-gap);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.hc-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--hc-surface);
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.hc-card:hover {
	border-color: var(--hc-navy);
	transform: translateY(-2px);
}

.hc-card__thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.hc-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem;
}

.hc-card__title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
}

.hc-card__title a {
	color: var(--hc-navy);
	text-decoration: none;
}

.hc-card__title a:hover {
	color: var(--hc-red);
}

.hc-card__meta {
	margin: 0;
	color: var(--hc-muted);
	font-size: 0.875rem;
}

.hc-card__excerpt {
	margin: 0;
	color: var(--hc-text);
}

.hc-section-title {
	margin: 0 0 1rem;
	color: var(--hc-navy);
	font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}

.hc-pagination {
	margin-top: var(--hc-gap);
}

.hc-pagination .page-numbers {
	display: inline-block;
	min-width: 2.25rem;
	margin: 0 0.15rem;
	padding: 0.35rem 0.6rem;
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius-sm);
	background: var(--hc-surface);
	text-align: center;
	text-decoration: none;
}

.hc-pagination .current {
	background: var(--hc-navy);
	border-color: var(--hc-navy);
	color: #fff;
}

.hc-empty {
	padding: clamp(1.5rem, 4vw, 3rem);
	background: var(--hc-surface);
	border: 1px dashed var(--hc-border);
	border-radius: var(--hc-radius);
	text-align: center;
}

.hc-empty__title {
	margin: 0 0 0.5rem;
	color: var(--hc-navy);
}

.hc-empty__text {
	margin: 0 auto 1rem;
	max-width: 44ch;
	color: var(--hc-muted);
}

.hc-empty .hc-search {
	justify-content: center;
	flex-wrap: wrap;
}

.hc-hero {
	margin-bottom: var(--hc-gap);
	padding: clamp(1.5rem, 4vw, 2.75rem);
	background: var(--hc-navy);
	color: #fff;
	border-radius: var(--hc-radius);
}

.hc-hero__title {
	margin: 0;
	color: #fff;
	font-size: clamp(1.9rem, 4vw, 3rem);
	line-height: 1.15;
}

.hc-hero__lede {
	margin: 0.6rem 0 0;
	max-width: 60ch;
	color: #dbe4ee;
}

/* ── Pied de page (thème clair) ──────────────────────────── */

.hc-footer {
	margin-top: clamp(2rem, 6vw, 4rem);
	background: var(--hc-surface);
	border-top: 1px solid var(--hc-border);
	color: var(--hc-text);
}

.hc-footer__inner {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding-block: clamp(1.5rem, 4vw, 2.5rem);
}

.hc-footer a {
	color: var(--hc-navy);
	text-decoration: none;
}

.hc-footer a:hover {
	color: var(--hc-red);
}

.hc-footer :where(a, button):focus-visible {
	box-shadow: var(--hc-focus);
}

.hc-footer .hc-menu a {
	padding-inline: 0;
}

.hc-footer .hc-menu a:hover {
	background: transparent;
	color: var(--hc-red);
}

.hc-footer__legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--hc-border);
}

.hc-footer__note {
	margin: 0;
	color: var(--hc-muted);
	font-size: 0.9rem;
}

.hc-footer__affiliation {
	max-width: 68ch;
}

.hc-footer__end {
	margin-left: auto;
	text-align: end;
}

/* ── Accueil éditable (hc_home_content) ──────────────────── */

.hc-home > .hc-section {
	margin: 0 0 var(--hc-gap);
	padding: clamp(1.25rem, 3.5vw, 2.5rem);
	border-radius: var(--hc-radius);
}

.hc-home > .hc-section:last-child {
	margin-bottom: 0;
}

.hc-home .hc-section > :first-child {
	margin-top: 0;
}

.hc-home .hc-section > :last-child {
	margin-bottom: 0;
}

.hc-home h2 {
	color: var(--hc-navy);
	line-height: 1.2;
}

/* Hero : texte à gauche, photographie réelle à droite. */
.hc-home-hero {
	background: #eef2f7;
}

.hc-home-hero__cols {
	gap: var(--hc-gap);
}

.hc-home-hero__title {
	margin: 0 0 0.5rem;
	color: var(--hc-navy);
	font-size: clamp(1.9rem, 3.6vw, 2.75rem);
	line-height: 1.12;
	text-wrap: balance;
}

.hc-home-hero__lede {
	max-width: 52ch;
	margin: 0 0 1.25rem;
	color: var(--hc-muted);
}

.hc-home-hero__media img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.hc-home-hero__media figcaption {
	color: var(--hc-muted);
	font-size: 0.85rem;
}

/* Desktop : le titre hero tient sur deux lignes au maximum. */
@media (min-width: 1024px) {
	.hc-home-hero__title {
		max-width: 18ch;
	}
}

/* Recherche et thèmes. */
.hc-home-search__form {
	max-width: 34rem;
	margin-bottom: 1rem;
}

.hc-home-search__form .wp-block-search__inside-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.hc-home-search__form .wp-block-search__input {
	flex: 1 1 12rem;
	min-width: 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
	background: var(--hc-surface);
	font: inherit;
	color: var(--hc-text);
}

.hc-home-search__form .wp-block-search__button {
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: var(--hc-radius);
	background: var(--hc-navy);
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.hc-home-topics {
	margin: 0;
}

/* Villes : quatre cartes identiques, photo recadrée par la CSS. */
.hc-home-cities {
	background: var(--hc-bg);
}

.hc-home-cities__grid {
	align-items: stretch;
}

.hc-city-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 0.75rem;
	background: var(--hc-surface);
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
}

.hc-city-card__media img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--hc-radius-sm);
}

.hc-city-card__name {
	margin: 0;
	font-size: 1.1rem;
}

.hc-city-card__name a {
	color: var(--hc-navy);
	text-decoration: none;
}

.hc-city-card__name a:hover {
	color: var(--hc-red);
	text-decoration: underline;
}

/* Budget : deux colonnes, carte des six catégories. */
.hc-home-budget__cols {
	align-items: center;
}

.hc-budget-card {
	padding: clamp(1rem, 2.5vw, 1.5rem);
	background: var(--hc-surface);
	border: 1px solid var(--hc-border);
	border-radius: var(--hc-radius);
}

.hc-budget-card h3 {
	margin-top: 0;
}

.hc-budget-card .wp-block-list {
	margin: 0;
	padding-inline-start: 1.1rem;
}

/* Parcours : trois cartes, lien aligné en bas. */
.hc-home-paths {
	background: var(--hc-bg);
}

.hc-home-paths__grid {
	align-items: stretch;
}

.hc-path-card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: clamp(1rem, 2.5vw, 1.5rem);
	background: var(--hc-surface);
	border: 1px solid var(--hc-border);
	border-top: 3px solid var(--hc-red);
	border-radius: var(--hc-radius);
}

.hc-path-card .wp-block-buttons {
	margin-top: auto;
}

/* Guides : requête native en grille, cartes complètes, état vide utile. */
.hc-home-guides__query .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: var(--hc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hc-home-guides__query .wp-block-post-template > li {
	margin: 0;
}

.hc-home-guides__query .hc-card {
	height: 100%;
}

/* Sections claires distinctes : confiance et infolettre préparée. */
.hc-home-trust {
	background: var(--hc-bg);
}

.hc-home-newsletter {
	background: var(--hc-surface);
	border: 1px dashed var(--hc-border);
}

/* Notes honnêtes : données absentes, placeholders, service non configuré. */
.hc-note {
	margin-inline: 0;
	padding: 0.75rem 1rem;
	border-left: 4px solid var(--hc-red);
	border-radius: 0 var(--hc-radius-sm) var(--hc-radius-sm) 0;
	background: #f0f4f8;
	color: var(--hc-muted);
	font-size: 0.95rem;
}

.hc-home-cities .hc-note,
.hc-home-paths .hc-note,
.hc-home-trust .hc-note {
	background: var(--hc-surface);
}

/* Boutons de l'accueil : rouge plein, contour bleu nuit. */
.hc-home .wp-block-button__link {
	border-radius: var(--hc-radius);
	font-weight: 600;
}

.hc-home .wp-block-button.is-style-fill .wp-block-button__link {
	background: var(--hc-red);
	color: #fff;
}

.hc-home .wp-block-button.is-style-fill .wp-block-button__link:hover {
	background: #b81f1f;
	color: #fff;
}

.hc-home .wp-block-button.is-style-outline .wp-block-button__link {
	border: 1px solid var(--hc-navy);
	background: transparent;
	color: var(--hc-navy);
}

.hc-home .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--hc-navy);
	color: #fff;
}

/* Dernières pages (404) : simple espacement sous le bloc vide. */
.hc-latest {
	margin-top: var(--hc-gap);
}

@media (max-width: 900px) {
	.hc-home-hero__cols {
		gap: 1.25rem;
	}

	.hc-home-hero__media {
		max-width: 34rem;
	}
}

/* ── Responsive 360 → 1440 ───────────────────────────────── */

/*
 * Bandeau desktop : la recherche d'en-tête s'efface quand la largeur ne
 * permet plus de garder nav + langues + recherche sur une seule ligne.
 */
@media (min-width: 901px) and (max-width: 1149px) {
	.hc-search-wrap {
		display: none;
	}
}

/* Seuil du menu mobile : identique à navigation.js (matchMedia 900px). */
@media (max-width: 900px) {
	.hc-header__inner {
		flex-wrap: wrap;
	}

	.hc-menu-toggle {
		display: inline-flex;
	}

	.hc-header__end {
		order: 2;
	}

	.hc-nav {
		order: 3;
		flex-basis: 100%;
	}

	.hc-nav .hc-menu {
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding-block: 0.5rem;
	}

	.hc-nav.is-open .hc-menu {
		display: flex;
	}

	.hc-nav .hc-menu .sub-menu {
		display: block;
	}
}

@media (max-width: 480px) {
	.hc-header__inner {
		gap: 0.75rem;
	}

	.hc-search input[type="search"] {
		min-width: 0;
		width: 100%;
	}

	.hc-search {
		flex-wrap: wrap;
	}

	.hc-footer__end {
		margin-left: 0;
		text-align: start;
	}
}

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

	.hc-card {
		transition: none;
	}
}

@media (min-width: 1440px) {
	.hc-wrap {
		max-width: var(--hc-wrap-wide);
	}
}

/* Keep long policy menus and translated labels inside small viewports. */
.hc-footer .hc-menu { flex-wrap: wrap; gap: .5rem 1.25rem; white-space: normal; }
.hc-footer__nav { min-width: 0; width: 100%; }
.hc-home-page .wp-block-button__link { border-radius: var(--hc-radius); font-weight: 600; }
.hc-home-page .is-style-fill .wp-block-button__link { background: var(--hc-red); color: #fff; }
.hc-home-page .is-style-outline .wp-block-button__link { background: transparent; color: var(--hc-navy); border-color: var(--hc-navy); }
.hc-home-search__form .wp-block-search__button { background: var(--hc-navy); color: #fff; border-radius: var(--hc-radius); }
.hc-footer__end a { text-decoration: underline; }

/* ── SEO : fil d'Ariane, filtres de catégories, image à la une ── */

.hc-breadcrumb {
	margin: 0 0 1rem;
	color: var(--hc-muted);
	font-size: 14px;
}

.hc-breadcrumb a {
	color: var(--hc-muted);
}

.hc-cat-filters {
	margin: 0 0 var(--hc-gap);
}

.hc-cat-filters ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hc-cat-filters a {
	font-weight: 600;
	text-decoration: none;
}

.hc-cat-filters a:hover,
.hc-cat-filters a[aria-current="page"] {
	color: var(--hc-red);
	text-decoration: underline;
}

.hc-featured {
	margin: 0 0 1.5rem;
}

.hc-featured img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
}
