/**
 * Parti socialiste de Sion — styles front (couleurs PS explicites)
 */

:root {
	--ps-red: #E4002B;
	--ps-slope: clamp(1.25rem, 3.5vw, 3rem);
	/* Typo — alignée sur theme.json (Manrope + presets) */
	--ps-font-body: var(--wp--preset--font-family--manrope, Manrope, sans-serif);
	--ps-text-body: var(--wp--preset--font-size--medium, 1rem);
	--ps-text-small: var(--wp--preset--font-size--small, 0.875rem);
	--ps-text-large: var(--wp--preset--font-size--large, 1.125rem);
	--ps-text-x-large: var(--wp--preset--font-size--x-large, 1.5rem);
}

body {
	font-family: var(--ps-font-body);
	font-size: var(--ps-text-body);
	line-height: 1.55;
}

/* —— En-tête type PS Lausanne (rouge + biais) —— */
.ps-header-shell {
	color: #fff;
	background: transparent;
	padding: 1.25rem max(1.25rem, env(safe-area-inset-right)) calc(1.5rem + var(--ps-slope))
		max(1.25rem, env(safe-area-inset-left));
	position: relative;
	z-index: 20;
}

/* Biais sur un calque dédié (évite de couper le menu avec clip-path) */
.ps-header-shell::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--ps-red);
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--ps-slope)), 0 100%);
	z-index: 0;
	pointer-events: none;
}

.ps-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

.ps-header-row {
	gap: 1.5rem;
	width: 100%;
}

.ps-header-brand {
	gap: 1rem;
	flex: 1 1 auto;
	min-width: 0;
}

.ps-header-brand .wp-block-site-logo img {
	filter: brightness(0) invert(1);
	height: auto;
	max-height: 4rem;
	width: auto;
}

.ps-footer-logo img {
	filter: brightness(0) invert(1);
	height: auto;
	max-height: 7rem;
	width: auto;
	min-width: 5.5rem;
}

.ps-header-shell .ps-header-site-name,
.ps-header-shell .ps-header-site-name a,
.ps-header-shell .ps-header-site-name a:visited,
.ps-header-shell .ps-header-site-name a:hover {
	color: #fff !important;
	text-decoration: none;
}

.ps-header-shell .ps-header-site-name {
	font-family: var(--ps-font-body);
	font-weight: 700;
	font-size: clamp(var(--ps-text-large), 2.2vw, var(--ps-text-x-large));
	line-height: 1.2;
	margin: 0;
}

.ps-header-shell .ps-header-site-name a:hover {
	opacity: 0.92;
}

.ps-header-tagline {
	color: rgba(255, 255, 255, 0.9);
	margin: 0.15rem 0 0;
	font-size: var(--ps-text-small);
	font-weight: 500;
}

/* Navigation (blanc, majuscules) */
.ps-main-nav {
	flex: 1 1 auto;
	justify-content: flex-end;
	min-width: 0;
}

.ps-main-nav .wp-block-navigation__responsive-container-open,
.ps-main-nav .wp-block-navigation__responsive-container-close {
	color: #fff;
}

@media (min-width: 782px) {
	.ps-main-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: block !important;
		position: relative;
		width: auto;
		height: auto;
	}

	.ps-main-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-container-close {
		display: none;
	}

	.ps-main-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__responsive-container-open {
		display: none;
	}

	.ps-main-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container {
		display: flex !important;
	}
}

.ps-main-nav .wp-block-navigation-item__content {
	color: #fff !important;
	text-decoration: none;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: clamp(0.75rem, 1.4vw, var(--ps-text-small));
	padding: 0.35rem 0.5rem;
}

.ps-main-nav .wp-block-navigation-item__content:hover,
.ps-main-nav .current-menu-item .wp-block-navigation-item__content {
	opacity: 0.85;
}

.ps-main-nav .wp-block-navigation-item.ps-nav-external .wp-block-navigation-item__content::after {
	content: " ↗";
	font-size: 0.75em;
	opacity: 0.9;
}

.ps-main-nav .wp-block-navigation__submenu-container {
	background-color: var(--ps-red) !important;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.ps-main-nav .wp-block-navigation__responsive-container-open svg {
	fill: #fff;
}

.ps-main-nav .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--ps-red) !important;
	padding: 1.5rem;
}

.ps-main-nav .wp-block-navigation__responsive-container-close svg,
.ps-main-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: #fff !important;
	fill: #fff;
}

@media (max-width: 781px) {
	.ps-header-row {
		flex-direction: column;
		align-items: stretch;
	}

	.ps-main-nav {
		width: 100%;
	}

	.ps-main-nav .wp-block-navigation__container {
		justify-content: flex-start;
		flex-wrap: wrap;
		gap: 0.25rem 0.75rem;
	}
}

/* Boutons */
.wp-block-button__link {
	background-color: var(--ps-red) !important;
	color: #fff !important;
	font-weight: 600;
	border-radius: 4px;
}

.wp-block-button__link:hover {
	background-color: var(--ps-red) !important;
	color: #fff !important;
	opacity: 0.9;
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background-color: transparent !important;
	color: var(--ps-red) !important;
	border: 2px solid var(--ps-red) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--ps-red) !important;
	color: #fff !important;
}

.ps-download-buttons {
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
}

/* Article d’intervention communale */
.ps-intervention-meta {
	color: #555;
	align-items: baseline;
	gap: 0.25rem 0.5rem;
}

.ps-intervention-meta .wp-block-post-terms a {
	text-decoration: none;
	font-weight: 600;
	color: var(--ps-red);
}

.ps-intervention-meta .wp-block-post-terms a:hover {
	text-decoration: underline;
}

.ps-plenum-prefix {
	font-weight: 600;
	color: #1a1a1a;
}

.ps-plenum-date {
	font-weight: 500;
}

/* Blocs lutte / programme */
.ps-lutte {
	border-left: 4px solid var(--ps-red);
	padding-left: 1.25rem;
	margin-block: 2rem;
}

.ps-lutte:target {
	scroll-margin-top: 7rem;
}

.ps-lutte .wp-block-heading {
	margin-bottom: 0.5rem;
	color: #1a1a1a;
}

/* Lien étendu sur carte cliquable */
.ps-pillar-stretch-link {
	position: absolute;
	inset: 0;
	z-index: 2;
	border-radius: 6px;
	text-decoration: none;
}

.ps-pillar-stretch-link:focus-visible {
	outline: 2px solid var(--ps-red);
	outline-offset: 2px;
}

/* Héro accueil : diaporama + programme unifié (raccord biais = en-tête) */
.ps-hero-mega {
	--ps-hero-duration: 25s;
	position: relative;
	z-index: 1;
	min-height: clamp(36rem, 92vh, 52rem);
	display: flex;
	align-items: stretch;
	overflow: hidden;
	background-color: #1a1a1a;
	/* Remonte sous le biais rouge de l’en-tête */
	margin-top: calc(-1 * var(--ps-slope));
	padding-top: var(--ps-slope);
	clip-path: polygon(0 var(--ps-slope), 100% 0, 100% 100%, 0 100%);
}

.ps-hero-mega__slides {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.ps-hero-mega__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	animation: ps-hero-mega-fade var(--ps-hero-duration) infinite;
}

@keyframes ps-hero-mega-fade {
	0%,
	16% {
		opacity: 1;
	}
	20%,
	100% {
		opacity: 0;
	}
}

.ps-hero-mega__slide-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	filter: brightness(0.8);
}

.ps-hero-mega__scrim {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0.1) 0%,
		rgba(0, 0, 0, 0.35) 55%,
		rgba(0, 0, 0, 0.55) 100%
	);
	pointer-events: none;
}

.ps-hero-mega__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem) clamp(1.5rem, 4vw, 3rem);
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: clamp(1.25rem, 3vw, 2rem);
	box-sizing: border-box;
}

.ps-hero-mega__glass {
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(26, 26, 26, 0.72);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.ps-hero-mega__glass--programme {
	padding: clamp(1.25rem, 3vw, 1.75rem);
	background: rgba(255, 255, 255, 0.94);
	border-color: rgba(255, 255, 255, 0.65);
}

.ps-hero-mega__programme-heading {
	text-align: center;
	font-family: var(--ps-font-body);
	font-size: var(--ps-text-x-large);
	font-weight: 700;
	margin: 0 0 1.25rem;
	color: #1a1a1a;
}

.ps-hero-mega__pillars {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.85rem;
}

.ps-hero-mega__pillar {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 5.5rem;
	padding: 1rem 1rem 1rem 1.1rem;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-left: 4px solid var(--ps-red);
	background: rgba(255, 255, 255, 0.95);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ps-hero-mega__pillar:hover {
	box-shadow: 0 6px 18px rgba(228, 0, 43, 0.14);
	transform: translateY(-2px);
}

.ps-hero-mega__pillar:hover .ps-hero-mega__pillar-title {
	color: var(--ps-red);
}

.ps-hero-mega__pillar-title {
	margin: 0 0 0.35rem;
	font-size: var(--ps-text-body);
	font-weight: 700;
	line-height: 1.25;
	color: #1a1a1a;
	position: relative;
	z-index: 1;
	pointer-events: none;
}

.ps-hero-mega__pillar-text {
	margin: 0;
	font-size: var(--ps-text-small);
	line-height: 1.45;
	color: #4a4a4a;
	position: relative;
	z-index: 1;
	pointer-events: none;
}

.ps-hero-mega__cta {
	margin-top: 1.5rem;
	text-align: center;
}

.ps-hero-mega__cta .wp-block-button__link {
	display: inline-block;
	padding: 0.65rem 1.35rem;
}

@media (max-width: 900px) {
	.ps-hero-mega__pillars {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.ps-hero-mega {
		min-height: auto;
	}

	.ps-hero-mega__inner {
		padding-top: 1.25rem;
		padding-bottom: 1.5rem;
	}

	.ps-hero-mega__pillars {
		grid-template-columns: 1fr;
	}

	.ps-hero-mega__pillar {
		min-height: 4.75rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ps-hero-mega__slide {
		animation: none;
		opacity: 0;
	}

	.ps-hero-mega__slide:first-child {
		opacity: 1;
	}
}

/* Héro cover legacy */
.ps-hero .wp-block-cover__inner-container {
	max-width: 900px;
	margin: 0 auto;
}

/* Sections page programme */
.ps-page-programme .ps-programme-section {
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-left: 4px solid var(--ps-red);
	background: var(--wp--preset--color--surface, #f5f5f5);
	padding: 1.5rem 1.25rem 1.5rem 1.35rem;
	margin-block: 2rem;
	border-radius: 4px;
	box-sizing: border-box;
}

.ps-page-programme .ps-programme-section:target {
	scroll-margin-top: 7rem;
}

.ps-page-programme .ps-programme-section > .wp-block-heading {
	margin-top: 0;
	margin-bottom: 0.75rem;
	color: #1a1a1a;
}

.ps-page-programme .ps-programme-section .wp-block-list {
	margin-top: 0.35rem;
	margin-bottom: 1rem;
	padding-left: 1.25rem;
}

.ps-page-programme .ps-programme-section .wp-block-list li {
	margin-bottom: 0.35rem;
}

.ps-page-programme .ps-programme-section p strong {
	color: #1a1a1a;
}

/* Pas d’auteur sur les articles */
.wp-block-post-author,
.wp-block-post-author-name,
.wp-block-post-author-biography {
	display: none !important;
}

/* Portraits élu·e·s et comité — grille 3 colonnes, photos uniformes */
.ps-elus-grid.wp-block-columns {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem 1.25rem;
	margin-bottom: 2rem;
}

.ps-elus-grid > .wp-block-column {
	width: 100% !important;
	flex-basis: auto !important;
	margin: 0 !important;
}

.ps-elu-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ps-elu-card--linked {
	text-align: center;
}

.ps-elu-card-link {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.ps-elu-card-link:hover .wp-block-heading,
.ps-elu-card-link:focus-visible .wp-block-heading {
	color: var(--ps-red, #e22b28);
}

.ps-elu-card-link:focus-visible {
	outline: 2px solid var(--ps-red, #e22b28);
	outline-offset: 2px;
}

.ps-elu-photo,
.ps-elu-card .ps-elu-photo {
	display: block;
	margin: 0 0 0.75rem;
	aspect-ratio: 3 / 4;
	width: 100%;
	overflow: hidden;
	border-radius: 4px;
	background-color: var(--wp--preset--color--surface, #f5f5f5);
}

.ps-elu-photo--placeholder {
	min-height: 0;
}

.ps-elu-card .ps-elu-photo img,
.ps-elu-card .wp-block-image.ps-elu-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	border-radius: 0;
}

.ps-elu-card .wp-block-heading {
	margin-top: 0;
	margin-bottom: 0.35rem;
}

.ps-elu-role,
.ps-elu-commissions {
	font-size: var(--ps-text-small);
	line-height: 1.45;
}

.ps-elu-role {
	margin-top: 0;
	color: var(--wp--preset--color--muted, #4a4a4a);
}

.ps-elu-commissions {
	margin-top: 0.35rem;
	margin-bottom: 0;
	color: var(--wp--preset--color--muted, #4a4a4a);
}

@media (max-width: 781px) {
	.ps-elus-grid.wp-block-columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.ps-elus-grid.wp-block-columns {
		grid-template-columns: 1fr;
	}
}

/* Actualités — filtres et étiquettes */
.ps-actualites-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 1.25rem 0 1.75rem;
}

.ps-actualites-filter {
	appearance: none;
	border: 1px solid var(--wp--preset--color--surface, #e8e8e8);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	cursor: pointer;
	font-family: var(--ps-font-body);
	font-size: var(--ps-text-small);
	line-height: 1.3;
	padding: 0.4rem 0.85rem;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ps-actualites-filter:hover,
.ps-actualites-filter:focus-visible {
	border-color: var(--ps-red, #e22b28);
	color: var(--ps-red, #e22b28);
	outline: none;
}

.ps-actualites-filter.is-active {
	background-color: var(--ps-red, #e22b28);
	border-color: var(--ps-red, #e22b28);
	color: #fff;
}

.ps-actualites-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
}

.ps-actualites-tags a {
	display: inline-block;
	border: 1px solid var(--wp--preset--color--surface, #e8e8e8);
	border-radius: 999px;
	color: var(--wp--preset--color--muted, #4a4a4a);
	font-size: var(--ps-text-small);
	line-height: 1.3;
	padding: 0.2rem 0.65rem;
	text-decoration: none;
}

.ps-actualites-tags a:hover,
.ps-actualites-tags a:focus-visible {
	border-color: var(--ps-red, #e22b28);
	color: var(--ps-red, #e22b28);
}

.ps-actualites-card .wp-block-post-title {
	margin-top: 0;
}

.ps-actualites-empty {
	color: var(--wp--preset--color--muted, #4a4a4a);
	font-size: var(--ps-text-small);
	margin: 1rem 0 2rem;
	text-align: center;
}

/* CTA rouge — textes et liens en blanc (surcharge theme.json) */
.ps-cta-band {
	background-color: var(--ps-red) !important;
	color: #fff !important;
}

.ps-cta-band .wp-block-heading,
.ps-cta-band h3,
.ps-cta-band p {
	color: #fff !important;
}

.ps-cta-band a:not(.wp-block-button__link),
.ps-cta-band a:not(.wp-block-button__link):visited,
.ps-cta-band a:not(.wp-block-button__link):hover {
	color: #fff !important;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ps-cta-band .wp-block-button.is-style-outline .wp-block-button__link {
	color: #fff !important;
	border-color: #fff !important;
	background-color: transparent !important;
}

.ps-cta-band .wp-block-button.is-style-outline .wp-block-button__link:hover {
	color: var(--ps-red) !important;
	background-color: #fff !important;
}

/* —— Pied de page type PS Lausanne (rouge + biais parallèle) —— */
.ps-footer-shell {
	color: #fff;
	padding: calc(2.5rem + var(--ps-slope)) max(1.25rem, env(safe-area-inset-right)) 2rem
		max(1.25rem, env(safe-area-inset-left));
	margin-top: 3rem;
	position: relative;
	z-index: 10;
}

.ps-footer-shell::before {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--ps-red);
	clip-path: polygon(0 var(--ps-slope), 100% 0, 100% 100%, 0 100%);
	z-index: 0;
	pointer-events: none;
}

.ps-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

.ps-footer-columns {
	gap: 2rem !important;
	margin-bottom: 2rem;
}

.ps-footer-heading {
	color: #fff !important;
	font-size: 0.85rem !important;
	font-weight: 800 !important;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 1rem !important;
}

.ps-footer-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ps-footer-list li {
	margin-bottom: 0.5rem;
}

.ps-footer-shell a,
.ps-footer-shell a:visited,
.ps-footer-shell .ps-footer-contact a,
.ps-footer-shell .ps-footer-contact a:visited {
	color: #fff !important;
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 500;
}

.ps-footer-shell a:hover,
.ps-footer-shell .ps-footer-contact a:hover {
	color: #fff !important;
	text-decoration: underline;
	text-underline-offset: 3px;
	opacity: 0.9;
}

.ps-footer-social.wp-block-social-links {
	gap: 0.65rem;
	margin-bottom: 1.25rem;
}

.ps-footer-social .wp-block-social-link {
	background: #fff !important;
	border-radius: 4px;
}

.ps-footer-social .wp-block-social-link svg {
	fill: var(--ps-red) !important;
}

.ps-footer-contact {
	opacity: 0.95;
	line-height: 1.6;
}

.ps-footer-slogan-col {
	display: flex;
	align-items: center;
}

.ps-footer-slogan-row {
	gap: 1.25rem;
	width: 100%;
	justify-content: flex-end !important;
}

.ps-footer-slogan {
	color: #fff !important;
	font-size: clamp(0.75rem, 1.35vw, 0.95rem) !important;
	font-weight: 800 !important;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	line-height: 1.25 !important;
	text-align: right;
	margin: 0 !important;
}

.ps-footer-slogan-line {
	display: block;
	white-space: nowrap;
}

.ps-footer-legal {
	border-top: 1px solid rgba(255, 255, 255, 0.25);
	padding-top: 1.25rem;
	gap: 0.75rem;
	font-size: 0.8rem;
	opacity: 0.9;
}

.ps-footer-legal p {
	margin: 0;
}

@media (max-width: 781px) {
	.ps-footer-slogan-col {
		order: -1;
		margin-bottom: 1rem;
	}

	.ps-footer-slogan-row {
		justify-content: flex-start !important;
	}

	.ps-footer-slogan {
		text-align: left;
		font-size: 0.9rem !important;
	}

	.ps-footer-legal {
		flex-direction: column;
	}
}

/* Liens contenu */
main a:not(.wp-block-button__link) {
	color: var(--ps-red);
}

main a:not(.wp-block-button__link):hover {
	color: var(--ps-red);
	opacity: 0.85;
}
