/**
 * Impact Theme – Style pixel-perfect d'après maquette
 */

/* -----------------------------------------------------------------------
   Variables
   ----------------------------------------------------------------------- */
:root {
	--blue:        #2563eb;
	--blue-dark:   #1d4ed8;
	--blue-light:  #dbeafe;
	--text:        #0f172a;
	--text-muted:  #64748b;
	--border:      #e2e8f0;
	--bg-sidebar:  #ffffff;
	--bg-main:     #ffffff;
	--radius-sm:   8px;
	--radius-md:   12px;
	--radius-pill: 50px;
	--shadow-card: 0 2px 8px rgba(15,23,42,.08);
	--sidebar-w:   200px;
}

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

html, body { margin: 0; padding: 0; }

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--text);
	background: var(--bg-main);
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; }

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px,1px,1px,1px);
	width: 1px; height: 1px;
	overflow: hidden;
}

/* -----------------------------------------------------------------------
   Layout global : sidebar + main
   ----------------------------------------------------------------------- */
.site-layout {
	display: flex;
	min-height: 100vh;
	width: 100%;
}

/* -----------------------------------------------------------------------
   Sidebar
   ----------------------------------------------------------------------- */
.site-sidebar {
	width: var(--sidebar-w);
	min-width: var(--sidebar-w);
	display: flex;
	flex-direction: column;
	background: var(--bg-sidebar);
	border-right: 1px solid var(--border);
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
	padding: 28px 20px 24px;
}

.sidebar-top {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.sidebar-bottom {
	margin-top: auto;
	padding-top: 16px;
}

/* Logo ----------------------------------------------------------------- */
.site-branding {
	margin-bottom: 20px;
}

.site-branding .site-logo img {
	max-height: 52px;
	width: auto;
}

/* Logo texte "impact .info" quand pas d'image */
.impact-logo-link {
	display: inline-block;
	text-decoration: none;
	line-height: 1;
}

.impact-logo-main {
	display: block;
	font-size: 26px;
	font-weight: 800;
	color: var(--text);
	letter-spacing: -0.03em;
	text-transform: lowercase;
}

.impact-logo-sub {
	display: block;
	font-size: 17px;
	font-weight: 700;
	color: var(--blue);
	letter-spacing: -0.01em;
	text-transform: lowercase;
	margin-top: -2px;
}

/* ─── Sélecteur de langue ────────────────────────────────────────────── */
.lang-switcher {
	position: relative;
	margin-bottom: 20px;
}

/* Bouton principal – langue courante */
.lang-btn-current {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	background: var(--blue);
	color: #fff;
	border: none;
	border-radius: var(--radius-pill);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: background .15s;
}
.lang-btn-current:hover { background: var(--blue-dark); }

.lang-mic-icon {
	width: 14px;
	height: 14px;
	fill: currentColor;
	flex-shrink: 0;
}

/* Dropdown */
.lang-dropdown {
	list-style: none;
	margin: 6px 0 0;
	padding: 6px 0;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	box-shadow: 0 4px 16px rgba(15,23,42,.12);
	min-width: 140px;
	position: absolute;
	left: 0;
	top: 100%;
	z-index: 200;
}
.lang-dropdown[hidden] { display: none; }

.lang-option {
	display: block;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	color: var(--text);
	text-decoration: none;
	transition: background .1s;
}
.lang-option:hover { background: var(--blue-light); color: var(--blue); text-decoration: none; }
.lang-option--active { color: var(--blue); font-weight: 700; }

/* Menu principal (vertical) ------------------------------------------- */
.site-navigation--vertical {
	flex: 1;
}

.menu.menu--vertical,
.menu.menu--vertical-bottom {
	list-style: none;
	margin: 0;
	padding: 0;
}

.menu.menu--vertical .menu-item a,
.menu.menu--vertical-bottom .menu-item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--text);
	text-decoration: none;
	transition: color .15s;
}

.menu.menu--vertical .menu-item a:hover,
.menu.menu--vertical .menu-item.current-menu-item a,
.menu.menu--vertical-bottom .menu-item a:hover,
.menu.menu--vertical-bottom .menu-item.current-menu-item a {
	color: var(--blue);
}

/* Chevron pour sous-menus */
.menu.menu--vertical .menu-item-has-children > a::after,
.menu.menu--vertical-bottom .menu-item-has-children > a::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-3px);
	transition: transform .2s;
	margin-left: 6px;
	flex-shrink: 0;
}

.menu.menu--vertical .menu-item-has-children.is-open > a::after {
	transform: rotate(-135deg) translateY(3px);
}

/* Sous-menus cachés par défaut */
.menu.menu--vertical .sub-menu,
.menu.menu--vertical-bottom .sub-menu {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0 0 4px 12px;
}

.menu.menu--vertical .menu-item-has-children.is-open > .sub-menu,
.menu.menu--vertical-bottom .menu-item-has-children.is-open > .sub-menu {
	display: block;
}

.menu.menu--vertical .sub-menu .menu-item a,
.menu.menu--vertical-bottom .sub-menu .menu-item a {
	font-size: 14px;
	font-weight: 600;
	padding: 6px 0;
}

/* Menu bas sidebar ---------------------------------------------------- */
.sidebar-bottom .menu.menu--vertical-bottom .menu-item a {
	font-size: 15px;
}

/* -----------------------------------------------------------------------
   Zone principale (main)
   ----------------------------------------------------------------------- */
.site-main {
	flex: 1;
	min-width: 0;
	background: var(--bg-main);
	padding: 28px 36px 48px;
	display: flex;
	flex-direction: column;
}

/* -----------------------------------------------------------------------
   Barre de recherche
   ----------------------------------------------------------------------- */
.site-main-header {
	margin-bottom: 32px;
}

.search-form-impact {
	position: relative;
	max-width: 540px;
	margin: 0 auto;
}

.search-form-impact .search-field {
	width: 100%;
	padding: 13px 56px 13px 22px;
	border: 1px solid var(--border);
	border-radius: var(--radius-pill);
	background: #f8fafc;
	font-size: 14px;
	color: var(--text);
	outline: none;
	transition: border-color .2s, box-shadow .2s;
}

.search-form-impact .search-field::placeholder {
	color: #94a3b8;
}

.search-form-impact .search-field:focus {
	border-color: var(--blue);
	background: #fff;
	box-shadow: 0 0 0 3px var(--blue-light);
}

.search-form-impact .search-submit {
	position: absolute;
	right: 7px;
	top: 50%;
	transform: translateY(-50%);
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color .2s, background .2s;
}

.search-form-impact .search-submit:hover {
	border-color: var(--blue);
	background: var(--blue-light);
}

.search-form-impact .search-submit svg {
	width: 17px;
	height: 17px;
	fill: #94a3b8;
}

.search-form-impact .search-submit:hover svg {
	fill: var(--blue);
}

/* -----------------------------------------------------------------------
   Section homepage (Récents, Playlists)
   ----------------------------------------------------------------------- */
.hp-section {
	margin-bottom: 40px;
}

.section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.section-title {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	color: var(--text);
	letter-spacing: -0.02em;
}

.btn-voir-plus {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	background: var(--blue);
	color: #fff !important;
	border-radius: var(--radius-pill);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s;
	white-space: nowrap;
}

.btn-voir-plus:hover {
	background: var(--blue-dark);
	text-decoration: none;
}

/* -----------------------------------------------------------------------
   Filtres Playlists
   ----------------------------------------------------------------------- */
.filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.filter-pill {
	display: inline-block;
	padding: 7px 16px;
	border-radius: var(--radius-pill);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s, border-color .15s, color .15s;
	cursor: pointer;
}

.filter-pill--active,
.filter-pill.active {
	background: var(--blue);
	color: #fff;
	border: 1px solid var(--blue);
}

.filter-pill:not(.filter-pill--active):not(.active) {
	background: #fff;
	color: var(--text);
	border: 1px solid var(--border);
}

.filter-pill:not(.filter-pill--active):not(.active):hover {
	border-color: var(--blue);
	color: var(--blue);
}

/* -----------------------------------------------------------------------
   Carrousel horizontal (partagé Récents + Playlists)
   ----------------------------------------------------------------------- */
.cards-scroll-wrapper {
	position: relative;
}

.cards-row {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-behavior: smooth;
	padding-bottom: 8px;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.cards-row::-webkit-scrollbar { display: none; }

/* Bouton de navigation → */
.scroll-btn {
	position: absolute;
	right: -16px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--border);
	background: #fff;
	box-shadow: var(--shadow-card);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	color: var(--blue);
	transition: background .15s, border-color .15s;
}

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

/* -----------------------------------------------------------------------
   Carte Récents (image ronde + texte)
   ----------------------------------------------------------------------- */
.card-recent {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	min-width: 300px;
	max-width: 340px;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-card);
	scroll-snap-align: start;
	flex-shrink: 0;
	transition: box-shadow .2s;
}

.card-recent:hover {
	box-shadow: 0 4px 16px rgba(15,23,42,.12);
}

.card-recent__img {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: #e2e8f0;
}

.card-recent__img--placeholder {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: #e2e8f0;
	flex-shrink: 0;
}

.card-recent__body { flex: 1; min-width: 0; }

.card-recent__title {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--text);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-recent__title a {
	color: inherit;
	text-decoration: none;
}

.card-recent__title a:hover { color: var(--blue); }

.card-recent__name {
	margin: 0 0 2px;
	font-size: 13px;
	color: var(--text-muted);
	font-weight: 500;
}

.card-recent__role {
	margin: 0;
	font-size: 12px;
	color: var(--text-muted);
	font-style: italic;
}

/* -----------------------------------------------------------------------
   Carte Playlist (image carrée + infos)
   ----------------------------------------------------------------------- */
.card-playlist {
	min-width: 175px;
	max-width: 175px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--radius-md);
	overflow: hidden;
	scroll-snap-align: start;
	flex-shrink: 0;
	box-shadow: var(--shadow-card);
	transition: box-shadow .2s;
}

.card-playlist:hover { box-shadow: 0 4px 16px rgba(15,23,42,.12); }

.card-playlist__img-wrap {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: #e2e8f0;
}

.card-playlist__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.card-playlist__img-wrap--placeholder {
	aspect-ratio: 1;
	background: linear-gradient(135deg, #cbd5e1, #94a3b8);
}

/* Bouton play au survol */
.card-playlist__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(37,99,235,.18);
	opacity: 0;
	transition: opacity .2s;
}

.card-playlist:hover .card-playlist__play { opacity: 1; }

.card-playlist__play-icon {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--blue);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(37,99,235,.4);
}

.card-playlist__play-icon svg {
	width: 22px;
	height: 22px;
	fill: #fff;
	margin-left: 3px;
}

.card-playlist__body { padding: 12px 12px 14px; }

.card-playlist__title {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--text);
}

.card-playlist__title a {
	color: inherit;
	text-decoration: none;
}

.card-playlist__title a:hover { color: var(--blue); }

.card-playlist__desc {
	margin: 0 0 4px;
	font-size: 12px;
	color: var(--text-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-playlist__count {
	margin: 0;
	font-size: 11px;
	color: var(--text-muted);
}

/* -----------------------------------------------------------------------
   Pages / articles (hors homepage)
   ----------------------------------------------------------------------- */
.page-header { margin-bottom: 24px; }

.entry-title {
	margin: 0 0 8px;
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--text);
}

.page-content, .entry-content { max-width: 760px; }

.entry-content > * + * { margin-top: 1em; }

.archive-content .post,
.search-content .post {
	margin-bottom: 28px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--border);
}

.archive-content .post:last-child,
.search-content .post:last-child { border-bottom: none; }

.entry-summary { color: var(--text-muted); margin-top: 6px; }

.pagination {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--border);
}

/* -----------------------------------------------------------------------
   Page Playlist (tag.php)
   ----------------------------------------------------------------------- */
.playlist-page {
	padding: 0;
}

/* En-tête avec image de couverture */
.playlist-header {
	position: relative;
	margin-bottom: 32px;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: var(--text);
	min-height: 180px;
	display: flex;
	align-items: flex-end;
}

.playlist-header__cover {
	position: absolute;
	inset: 0;
}

.playlist-header__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.playlist-header__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.15) 60%, transparent 100%);
}

.playlist-header__info {
	position: relative;
	z-index: 1;
	padding: 28px 28px 24px;
	color: #fff;
}

.playlist-header__eyebrow {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	opacity: .8;
	margin: 0 0 6px;
}

.playlist-header__title {
	font-size: 28px;
	font-weight: 800;
	margin: 0 0 6px;
	line-height: 1.15;
}

.playlist-header__desc {
	font-size: 14px;
	opacity: .85;
	margin: 0 0 8px;
}

.playlist-header__count {
	font-size: 13px;
	font-weight: 600;
	opacity: .7;
	margin: 0;
}

/* Episodes — utilise le rendu du plugin ccap */
.playlist-episodes {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* Réinitialisation CCAP dans le contexte playlist */
.playlist-episodes .ccap-audio-shortcode {
	margin: 0;
	padding: 0;
}

/* -----------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------- */
.site-footer {
	padding: 14px 36px;
	background: #f8fafc;
	border-top: 1px solid var(--border);
	font-size: 13px;
	color: var(--text-muted);
}

.site-navigation--footer .menu {
	list-style: none; margin: 0; padding: 0;
	display: flex; flex-wrap: wrap; gap: 0 20px;
}

.site-navigation--footer .menu-item a {
	color: var(--text-muted);
	font-size: 13px;
}

.site-navigation--footer .menu-item a:hover { color: var(--blue); }

/* -----------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------- */
@media (max-width: 860px) {
	.site-layout { flex-direction: column; }

	.site-sidebar {
		width: 100%;
		min-width: unset;
		height: auto;
		max-height: none;
		position: relative;
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		gap: 12px;
		padding: 14px 16px;
		border-right: none;
		border-bottom: 1px solid var(--border);
	}

	.sidebar-top { flex: 1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
	.sidebar-bottom { margin-top: 0; padding-top: 0; }

	.site-branding { margin-bottom: 0; }
	.language-switcher { margin-bottom: 0; }
	.site-navigation--vertical { flex: none; }

	.site-main { padding: 20px 16px 36px; }

	.search-form-impact { max-width: none; }
}
