/*
Theme Name: KASIS Media
Theme URI: https://kasis.eu
Author: KASIS
Description: Thème de démonstration pour éditeurs (automobile / voyage) avec emplacements publicitaires intégrés, compatible Polylang (FR/NL). Fonctionne avec le plugin KASIS AdStack.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: kasis-media
*/

/* ---------- Tokens ---------- */
/*
 * Automotive: black top bar, white masthead, yellow (#ffc800) accent, black labels, light grey panels,
 *             Fira Sans + Fira Sans Condensed.
 * Travel:     white masthead, teal (#1e9eb4) accent, small uppercase teal labels and titles,
 *             dark teal footer, Libre Franklin.
 */
:root {
	--wrap: 1200px;
	--gutter: 16px;
	--gap: 40px;
	--side: 300px;
	--radius: 0;

	/* automotive (default) */
	--ink: #111111;
	--muted: #5f6368;
	--paper: #ffffff;
	--surface: #ededed;
	--line: #dedede;

	--top-bg: #000000;
	--top-ink: #ffffff;
	--mast-bg: #ffffff;
	--mast-ink: #111111;
	--nav-bg: #ffffff;
	--nav-ink: #4d4d4d;
	--nav-hover: #111111;

	--accent: #ffc800;
	--accent-ink: #111111;
	--accent-strong: #ffc800;
	--on-accent-strong: #111111;
	--label-bg: #111111;
	--label-ink: #ffffff;
	--title-ink: #111111;
	--link: #111111;
	--link-hover: #7a5f00;

	--feature-bg: #111111;
	--feature-ink: #ffffff;
	--foot-bg: #111111;
	--foot-ink: #f2f2f2;

	--font-display: "Fira Sans Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
	--font-body: "Fira Sans", "Helvetica Neue", Arial, sans-serif;
	--display-weight: 700;
	--display-tracking: 0;
}

body.vertical-travel {
	--radius: 4px;

	--ink: #1f2a2e;
	--muted: #5e6b70;
	--paper: #ffffff;
	--surface: #f2f4f5;
	--line: #e0e5e7;

	--top-bg: #f2f4f5;
	--top-ink: #1f2a2e;
	--mast-bg: #ffffff;
	--mast-ink: #1f2a2e;
	--nav-bg: #ffffff;
	--nav-ink: #1f2a2e;
	--nav-hover: #137487;

	--accent: #1e9eb4;
	--accent-ink: #ffffff;
	--accent-strong: #137487;
	--on-accent-strong: #ffffff;
	--label-bg: transparent;
	--label-ink: #137487;
	--title-ink: #137487;
	--link: #137487;
	--link-hover: #0c5563;

	--feature-bg: #0d3f4a;
	--feature-ink: #ffffff;
	--foot-bg: #0d3f4a;
	--foot-ink: #eef7f9;

	--font-display: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
	--font-body: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
	--display-weight: 600;
	--display-tracking: -0.015em;
}

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.55;
	overflow-x: hidden;
}

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.screen-reader-text,
.skip-link:not(:focus) {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; background: var(--paper); padding: 8px 12px; }

.wrap {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

h1, h2, h3 {
	font-family: var(--font-display);
	font-weight: var(--display-weight);
	letter-spacing: var(--display-tracking);
	line-height: 1.12;
	margin: 0;
}

/* ---------- Top bar & masthead ---------- */
.topbar {
	background: var(--top-bg);
	color: var(--top-ink);
	font-size: .8125rem;
}
.topbar__inner { display: flex; justify-content: space-between; align-items: center; min-height: 34px; }
.topbar__date { opacity: .8; }

.lang-switch { display: flex; gap: 2px; }
.lang-switch a {
	color: inherit;
	text-decoration: none;
	padding: 3px 8px;
	border-radius: var(--radius);
	font-weight: 600;
	letter-spacing: .04em;
	opacity: .7;
}
.lang-switch a:hover { opacity: 1; color: inherit; }
.lang-switch a.is-current { background: var(--accent-strong); color: var(--on-accent-strong); opacity: 1; }

.masthead { background: var(--mast-bg); color: var(--mast-ink); position: relative; }
.masthead__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 24px;
	padding-top: 22px;
	padding-bottom: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand__name {
	font-family: var(--font-display);
	font-weight: var(--display-weight);
	font-size: 2.25rem;
	line-height: 1;
	letter-spacing: var(--display-tracking);
}
.brand__mark { width: 30px; height: 30px; flex: none; }

/* Automotive: condensed uppercase name after a pair of yellow lane-marking slabs. */
body.vertical-automotive .brand__name { font-weight: 800; text-transform: uppercase; font-size: 2.5rem; letter-spacing: -.005em; }
body.vertical-automotive .brand__mark {
	background: var(--accent);
	transform: skewX(-18deg);
	width: 12px;
	height: 34px;
	box-shadow: 18px 0 0 var(--accent);
	margin-right: 18px;
}
/* Travel: a teal disc with a low sun. */
body.vertical-travel .brand__name { font-weight: 700; font-size: 2rem; letter-spacing: -.02em; }
body.vertical-travel .brand__mark {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background:
		linear-gradient(transparent 62%, rgba(255, 255, 255, .55) 62% 66%, transparent 66%),
		radial-gradient(circle at 50% 62%, #ffffff 0 22%, transparent 23%),
		var(--accent);
}

.masthead__tagline { margin: 0; color: var(--muted); font-size: .9375rem; }

.search input {
	width: 230px;
	font: inherit;
	font-size: .875rem;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 9px 12px;
}
.search input:focus { background: var(--paper); }

.nav { background: var(--nav-bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nav__list {
	list-style: none;
	margin: 0 auto;
	display: flex;
	gap: 4px;
	overflow-x: auto;
	scrollbar-width: none;
}
.nav__list::-webkit-scrollbar { display: none; }
.nav__list a {
	display: block;
	white-space: nowrap;
	color: var(--nav-ink);
	text-decoration: none;
	padding: 12px 12px 9px;
	font-weight: 500;
	border-bottom: 4px solid transparent;
}
.nav__list a:hover { color: var(--nav-hover); border-bottom-color: var(--line); }
.nav__list a[aria-current="page"] { color: var(--nav-hover); border-bottom-color: var(--accent); }
body.vertical-automotive .nav { border-bottom: 3px solid var(--ink); }
body.vertical-automotive .nav__list a { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
body.vertical-travel .nav__list { gap: 10px; }
body.vertical-travel .nav__list a {
	font-size: .8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .1em;
	padding: 14px 10px 11px;
	border-bottom-width: 3px;
}

/* ---------- Ad bands ---------- */
.ad-band { background: var(--surface); padding: 14px 0; }
.ad-band .wrap { display: flex; justify-content: center; }
.ad-band--footer { margin-top: 48px; }
.ad-inline { margin: 8px 0 40px; display: flex; justify-content: center; }
.ad-inline--grid { grid-column: 1 / -1; margin: 4px 0 12px; }

/* ---------- Layout ---------- */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--side);
	gap: var(--gap);
	padding-top: 32px;
	align-items: start;
}
.sidebar { display: flex; flex-direction: column; gap: 32px; }
.sidebar__sticky { position: sticky; top: 16px; }

/* ---------- Titles ---------- */
.block-title {
	font-size: 1.5rem;
	display: flex;
	align-items: center;
	gap: 10px;
}
.block-title a { color: inherit; text-decoration: none; }
.block-title a:hover { color: var(--link-hover); }
body.vertical-automotive .block-title { text-transform: uppercase; }
body.vertical-automotive .block-title::before {
	content: "";
	width: 8px; height: 22px;
	background: var(--accent);
	transform: skewX(-18deg);
}
/* Travel: small uppercase letter-spaced teal titles, short teal rule under the head. */
body.vertical-travel .block-title,
body.vertical-travel .panel__title {
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--title-ink);
}
body.vertical-travel .block-title a:hover { color: var(--link-hover); }

.section-tag {
	display: inline-block;
	font-size: .75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--label-ink);
	background: var(--label-bg);
	text-decoration: none;
	padding: 2px 8px;
	border-radius: var(--radius);
	margin-bottom: 8px;
}
.section-tag:hover { color: var(--accent-ink); background: var(--accent); }
body.vertical-automotive .section-tag { font-family: var(--font-display); font-size: .8125rem; font-weight: 700; }
body.vertical-travel .section-tag { padding: 0; letter-spacing: .1em; }
body.vertical-travel .section-tag:hover { background: none; color: var(--link-hover); text-decoration: underline; }

/* ---------- Cards ---------- */
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card__media { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); aspect-ratio: 16 / 9; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__placeholder { display: block; width: 100%; height: 100%; background: var(--surface); }
.card__title { font-size: 1.3rem; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--link-hover); text-decoration: underline; }
.card__excerpt { margin: 6px 0 0; color: var(--muted); }
.card__meta { margin: 6px 0 0; color: var(--muted); font-size: .8125rem; }

.card--lead .card__title { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
.card--lead .card__excerpt { font-size: 1.0625rem; }
body.vertical-automotive .card--lead .card__title { font-size: clamp(2rem, 4vw, 3rem); }

.card--compact {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
}
.card--compact .card__title { font-size: 1.05rem; line-height: 1.2; }
body.vertical-travel .card--compact .card__title { font-size: 1rem; letter-spacing: -.005em; }
body.vertical-automotive .card__title a:hover { color: var(--ink); text-decoration-color: var(--accent); text-decoration-thickness: 3px; }
.card--compact .card__media { aspect-ratio: 3 / 2; }

/* ---------- Video marker ---------- */
.card__media { position: relative; }
.video-icon { display: block; flex: none; }
.video-icon__disc { fill: var(--accent); }
.video-icon__play { fill: var(--accent-ink); }
.card__badge {
	position: absolute;
	left: 10px;
	bottom: 10px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px 3px 3px;
	border-radius: 999px;
	background: rgba(10, 14, 18, .78);
	color: #fff;
	font-size: .8125rem;
	font-weight: 600;
	line-height: 1;
}
.card--compact .card__badge { left: 6px; bottom: 6px; padding: 2px; }
.card--compact .card__badge-text { display: none; }
.inline-video { display: inline-block; vertical-align: -2px; margin-left: 4px; }
.byline-video { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }

/* ---------- Home ---------- */
.front-top {
	display: grid;
	grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
	gap: 28px;
	padding-bottom: 36px;
	margin-bottom: 36px;
	border-bottom: 1px solid var(--line);
}
.front-top__latest { display: flex; flex-direction: column; gap: 18px; }
.front-top__latest .block-title { font-size: 1.2rem; }

.block { margin-bottom: 40px; }
.block__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 10px;
	margin-bottom: 18px;
	border-bottom: 2px solid var(--ink);
}
.block__more { font-size: .875rem; font-weight: 600; white-space: nowrap; }
.block__grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; }
.block__stack { display: flex; flex-direction: column; gap: 18px; }

.block__head { position: relative; }
body.vertical-travel .block__head { border-bottom: 1px solid var(--line); }
body.vertical-travel .block__head::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 56px;
	height: 3px;
	background: var(--accent);
}

.block--video { background: var(--feature-bg); color: var(--feature-ink); padding: 20px; border-radius: var(--radius); }
.block--video .block__head { border-bottom-color: rgba(255, 255, 255, .25); }
body .block--video .block-title,
body .block--video .block-title a { color: var(--feature-ink); }
body.vertical-automotive .block--video { border-top: 5px solid var(--accent); }

/* ---------- Archive ---------- */
.page-head { padding-bottom: 18px; margin-bottom: 28px; border-bottom: 2px solid var(--ink); }
body.vertical-automotive .page-head__title { text-transform: uppercase; }
body.vertical-automotive .page-head { border-bottom: 3px solid var(--ink); box-shadow: 0 3px 0 var(--accent); }
body.vertical-travel .page-head { border-bottom: 1px solid var(--line); }
body.vertical-travel .page-head__title { color: var(--title-ink); }
.page-head__title { font-size: clamp(2rem, 4vw, 3rem); }
.page-head__desc { color: var(--muted); max-width: 62ch; margin-top: 8px; }
.page-head__desc p { margin: 0; }

.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 28px; }
.archive-grid .card--lead { grid-column: 1 / -1; }

.pager { display: flex; justify-content: space-between; margin-top: 36px; font-weight: 600; }
.empty { color: var(--muted); }

/* ---------- Article ---------- */
.article { min-width: 0; }
.crumbs { font-size: .875rem; color: var(--muted); display: flex; gap: 8px; margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.article__title { font-size: clamp(2rem, 4.2vw, 3.1rem); max-width: 22ch; }
body.vertical-automotive .article__title { font-size: clamp(2.2rem, 4.8vw, 3.5rem); }
.article__standfirst { font-size: 1.25rem; line-height: 1.45; color: var(--muted); margin: 16px 0 0; max-width: 60ch; }
.article__byline {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	font-size: .875rem;
	color: var(--muted);
	margin: 18px 0 0;
	padding: 12px 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}
.article__byline span:first-child { color: var(--ink); font-weight: 600; }
.article__figure { margin: 24px 0 28px; }
.article__figure img { width: 100%; border-radius: var(--radius); }
.article__figure figcaption { font-size: .8125rem; color: var(--muted); margin-top: 8px; }
.article__figure figcaption a { color: inherit; }

.prose { max-width: 68ch; font-size: 1.125rem; line-height: 1.68; }
.prose p { margin: 0 0 1.15em; }
.prose h2 { font-size: 1.65rem; margin: 1.6em 0 .55em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--link-hover); }
.prose .kasis-ad-wrap { margin: 2em 0; }

.article__tags ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.article__tags a {
	display: inline-block;
	font-size: .875rem;
	text-decoration: none;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid var(--line);
	padding: 4px 10px;
	border-radius: 999px;
}
.article__tags a:hover { border-color: var(--ink); }

.related { margin-top: 48px; padding-top: 18px; border-top: 2px solid var(--ink); }
body.vertical-travel .related { border-top: 1px solid var(--line); }
.related .block-title { margin-bottom: 18px; }
.related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.related .card__title { font-size: 1.1rem; }
.related .card__excerpt { display: none; }

/* ---------- Sidebar panel ---------- */
.panel { background: var(--surface); padding: 16px 18px 6px; border-radius: var(--radius); }
.panel__title { font-size: 1.25rem; padding-bottom: 8px; border-bottom: 2px solid var(--ink); margin-bottom: 8px; }
body.vertical-automotive .panel__title { text-transform: uppercase; border-bottom-color: var(--accent); border-bottom-width: 4px; }
body.vertical-travel .panel__title { border-bottom: 1px solid var(--line); }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranked li {
	counter-increment: rank;
	display: grid;
	grid-template-columns: 34px 1fr;
	gap: 8px;
	padding: 12px 0;
	border-bottom: 1px solid var(--line);
	line-height: 1.3;
}
.ranked li::before {
	content: counter(rank);
	font-family: var(--font-display);
	font-weight: var(--display-weight);
	font-size: 1.75rem;
	line-height: 1;
	color: var(--link-hover);
}
body.vertical-automotive .ranked li::before { color: var(--ink); text-shadow: 2px 2px 0 var(--accent); }
body.vertical-travel .ranked li::before { color: var(--accent); font-weight: 300; font-size: 2rem; }
.ranked li:last-child { border-bottom: 0; }
.ranked a { color: var(--ink); text-decoration: none; font-weight: 500; }
.ranked a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--foot-bg); color: var(--foot-ink); padding: 40px 0 20px; font-size: .9375rem; }
.site-footer a, .site-footer .linklike { color: var(--foot-ink); }
.site-footer a:hover { color: var(--accent); }
body.vertical-automotive .site-footer { border-top: 5px solid var(--accent); }
body.vertical-automotive .site-footer__title { text-transform: uppercase; }
body.vertical-travel .site-footer__title { font-family: var(--font-body); font-size: .875rem; text-transform: uppercase; letter-spacing: .1em; }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer__title { font-size: 1.1rem; margin-bottom: 10px; }
.site-footer__note { opacity: .75; max-width: 46ch; }
.brand--footer .brand__name { font-size: 1.75rem; }
.site-footer__base {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 32px;
	padding-top: 16px;
	border-top: 1px solid rgba(255, 255, 255, .15);
	opacity: .85;
}
.linklike { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; }

.button {
	display: inline-block;
	background: var(--ink);
	color: var(--paper);
	text-decoration: none;
	padding: 10px 16px;
	border-radius: var(--radius);
	font-weight: 600;
}
.button:hover { color: var(--paper); background: var(--link-hover); }
body.vertical-automotive .button { background: var(--accent); color: var(--accent-ink); text-transform: uppercase; font-family: var(--font-display); }
body.vertical-automotive .button:hover { background: var(--ink); color: var(--paper); }
body.vertical-travel .button { background: var(--accent-strong); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.sidebar { align-items: center; }
	.sidebar .panel { width: 100%; }
	.sidebar__sticky { position: static; }
	.masthead__inner { grid-template-columns: auto 1fr; }
	.masthead__tagline { display: none; }
	.search { justify-self: end; }
}

@media (max-width: 767px) {
	:root { --gap: 28px; }
	.masthead__inner { grid-template-columns: 1fr; gap: 12px; padding-top: 16px; padding-bottom: 12px; }
	.search { justify-self: stretch; }
	.search input { width: 100%; }
	.brand__name { font-size: 1.85rem; }
	.front-top, .block__grid { grid-template-columns: minmax(0, 1fr); }
	.archive-grid, .related__grid { grid-template-columns: minmax(0, 1fr); }
	.site-footer__grid { grid-template-columns: 1fr; }
	.prose { font-size: 1.0625rem; }
	.block--video { padding: 14px; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-radius: 0; }
}

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