/* ═══════════════════════════════════════════
   LAYOUTS DE PAGES — PILOTABLE.FR
   Mobile-first, compose les composants
   ═══════════════════════════════════════════ */

/* ───────────────────────────────────────────
   GLOBAL / TYPOGRAPHIE
   ─────────────────────────────────────────── */

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

html {
	scroll-behavior: smooth;
}

body {
	background-color: var(--sw-bg);
	color: var(--sw-text);
	font-family: var(--sw-font-body);
}

h1, h2, h3, h4 {
	font-family: var(--sw-font-display);
	color: var(--sw-text);
	line-height: 1.25;
}

.sw-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ───────────────────────────────────────────
   HERO SECTION
   ─────────────────────────────────────────── */

.sw-hero {
	background: var(--sw-navy);
	color: #fff;
	padding: 32px 20px;
	text-align: center;
}

.sw-hero__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.sw-hero__title {
	font-family: var(--sw-font-display);
	font-size: 1.6rem;
	font-weight: 800;
	margin: 0 0 8px;
	color: #fff;
}

.sw-hero__subtitle {
	font-family: var(--sw-font-body);
	font-size: 0.95rem;
	color: rgba(255, 255, 255, 0.6);
	margin: 0 0 20px;
	letter-spacing: 0.03em;
}

.sw-hero__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.sw-hero__filter {
	display: inline-block;
	padding: 6px 16px;
	border-radius: 20px;
	font-family: var(--sw-font-body);
	font-size: 0.8rem;
	font-weight: 600;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.7);
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	transition: all 0.2s;
}

.sw-hero__filter:hover {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

.sw-hero__filter--active {
	background: var(--sw-teal);
	border-color: var(--sw-teal);
	color: #fff;
}

/* Couleurs actives par pilier */
.sw-hero__filter--nucleaire.sw-hero__filter--active   { background: var(--sw-blue); border-color: var(--sw-blue); }
.sw-hero__filter--hydrogene.sw-hero__filter--active    { background: var(--sw-teal); border-color: var(--sw-teal); }
.sw-hero__filter--stockage.sw-hero__filter--active     { background: var(--sw-orange); border-color: var(--sw-orange); }
.sw-hero__filter--flexibilite.sw-hero__filter--active  { background: var(--sw-violet); border-color: var(--sw-violet); }
.sw-hero__filter--strategie.sw-hero__filter--active    { background: var(--sw-red); border-color: var(--sw-red); }

@media (min-width: 768px) {
	.sw-hero {
		padding: 40px 40px;
	}

	.sw-hero__title {
		font-size: 2rem;
	}
}

@media (min-width: 1400px) {
	.sw-hero {
		max-width: 1320px;
		margin: 0 auto;
	}
}

/* ───────────────────────────────────────────
   ARTICLE A LA UNE
   ─────────────────────────────────────────── */

.sw-featured {
	display: flex;
	flex-direction: column;
	background: var(--sw-card);
	border: 1px solid var(--sw-border);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 32px;
	transition: box-shadow 0.2s;
}

.sw-featured:hover {
	box-shadow: 0 6px 20px rgba(11, 29, 51, 0.08);
}

.sw-featured__image-link {
	display: block;
}

.sw-featured__image {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.sw-featured__body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sw-featured__title {
	font-family: var(--sw-font-display);
	font-size: 1.4rem;
	font-weight: 800;
	line-height: 1.25;
	margin: 0;
}

.sw-featured__title a {
	color: var(--sw-text);
	text-decoration: none;
}

.sw-featured__title a:hover {
	color: var(--sw-teal);
}

.sw-featured__excerpt {
	font-family: var(--sw-font-body);
	font-size: 0.95rem;
	color: var(--sw-muted);
	line-height: 1.6;
	margin: 0;
}

@media (min-width: 768px) {
	.sw-featured {
		flex-direction: row;
	}

	.sw-featured__image-link {
		flex: 0 0 55%;
	}

	.sw-featured__image {
		height: 100%;
		aspect-ratio: auto;
		min-height: 300px;
	}

	.sw-featured__body {
		padding: 28px;
		justify-content: center;
	}

	.sw-featured__title {
		font-size: 1.7rem;
	}
}

/* Titre de section */
.sw-homepage__section-title {
	font-family: var(--sw-font-display);
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--sw-text);
	margin: 0 0 20px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--sw-border);
}

/* ───────────────────────────────────────────
   HOMEPAGE
   ─────────────────────────────────────────── */

.sw-homepage {
	padding: 32px 0 48px;
}

.sw-homepage__inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
}

.sw-homepage__content {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.sw-homepage__main {
	flex: 1;
	min-width: 0;
}

.sw-homepage__sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Grille d'articles */
.sw-article-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

@media (min-width: 768px) {
	.sw-article-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.sw-homepage__content {
		flex-direction: row;
	}

	.sw-homepage__main {
		flex: 1;
		min-width: 0;
	}

	.sw-homepage__sidebar {
		flex: 0 0 300px;
	}

	.sw-article-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1280px) {
	.sw-article-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ───────────────────────────────────────────
   ARTICLE SINGLE LAYOUT (article + sidebar)
   ─────────────────────────────────────────── */

.sw-single-layout {
	padding: 24px 20px 48px;
}

.sw-single-layout__inner {
	max-width: 1200px;
	margin: 0 auto;
}

.sw-single-layout__content {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

@media (min-width: 1024px) {
	.sw-single-layout {
		padding: 32px 40px 64px;
	}

	.sw-single-layout__content {
		flex-direction: row;
		gap: 40px;
	}
}

/* Sidebar dans l article */
.sw-single-article__sidebar {
	width: 100%;
}

@media (min-width: 1024px) {
	.sw-single-article__sidebar {
		flex: 0 0 300px;
		position: sticky;
		top: 32px;
		align-self: flex-start;
	}
}

/* ───────────────────────────────────────────
   ARTICLE SINGLE
   ─────────────────────────────────────────── */

.sw-single-article {
	flex: 1;
	min-width: 0;
	padding: 0;
}

.sw-single-article__header {
	margin-bottom: 24px;
}

.sw-single-article__badges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.sw-single-article__title {
	font-family: var(--sw-font-display);
	font-size: 1.8rem;
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 12px;
}

.sw-single-article__meta {
	font-family: var(--sw-font-body);
	font-size: 0.85rem;
	color: var(--sw-muted);
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.sw-single-article__content {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sw-single-article__body {
	font-family: var(--sw-font-article);
	font-size: 1.05rem;
	line-height: 1.8;
	color: var(--sw-text);
	max-width: 740px;
}

.sw-single-article__body h2 {
	font-size: 1.4rem;
	margin: 32px 0 12px;
}

.sw-single-article__body h3 {
	font-size: 1.15rem;
	margin: 24px 0 8px;
}

.sw-single-article__body p {
	margin: 0 0 16px;
}

.sw-single-article__body ul,
.sw-single-article__body ol {
	margin: 0 0 16px;
	padding-left: 24px;
}

.sw-single-article__body img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 16px 0;
}

.sw-single-article__body a {
	color: var(--sw-teal);
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (min-width: 768px) {
	.sw-single-article__title {
		font-size: 2.2rem;
	}
}

@media (min-width: 1024px) {
	.sw-single-article__content {
		flex-direction: row;
		gap: 40px;
	}

	.sw-single-article__toc {
		flex: 0 0 220px;
		order: -1;
	}

	.sw-single-article__title {
		font-size: 2.5rem;
	}
}

/* ───────────────────────────────────────────
   GUIDE EVERGREEN
   ─────────────────────────────────────────── */

.sw-single-guide {
	max-width: 1280px;
	margin: 0 auto;
	padding: 24px 20px 48px;
}

.sw-single-guide__header {
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 2px solid var(--sw-border);
}

.sw-single-guide__title {
	font-family: var(--sw-font-display);
	font-size: 1.8rem;
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 12px;
}

.sw-single-guide__meta {
	font-family: var(--sw-font-body);
	font-size: 0.85rem;
	color: var(--sw-muted);
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.sw-single-guide__content {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.sw-single-guide__body {
	font-family: var(--sw-font-article);
	font-size: 1.05rem;
	line-height: 1.8;
	color: var(--sw-text);
	max-width: 740px;
	counter-reset: sw-section;
}

/* Numérotation visuelle des sections H2 */
.sw-single-guide__body h2 {
	counter-increment: sw-section;
	font-size: 1.4rem;
	margin: 40px 0 12px;
	padding-left: 40px;
	position: relative;
}

.sw-single-guide__body h2::before {
	content: counter(sw-section);
	position: absolute;
	left: 0;
	top: 0;
	width: 28px;
	height: 28px;
	background: var(--sw-teal);
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--sw-font-body);
	font-size: 0.8rem;
	font-weight: 700;
}

.sw-single-guide__body h3 {
	font-size: 1.15rem;
	margin: 24px 0 8px;
}

.sw-single-guide__body p {
	margin: 0 0 16px;
}

.sw-single-guide__body a {
	color: var(--sw-teal);
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (min-width: 768px) {
	.sw-single-guide__title {
		font-size: 2.2rem;
	}
}

@media (min-width: 1024px) {
	.sw-single-guide {
		padding: 32px 40px 64px;
	}

	.sw-single-guide__content {
		flex-direction: row;
		gap: 40px;
	}

	.sw-single-guide__toc {
		flex: 0 0 240px;
		order: -1;
	}

	.sw-single-guide__title {
		font-size: 2.5rem;
	}
}

/* ───────────────────────────────────────────
   PAGE ÉVÉNEMENT
   ─────────────────────────────────────────── */

.sw-page-event__content {
	max-width: 1280px;
	margin: 0 auto;
	padding: 32px 20px 48px;
}

.sw-page-event__body {
	font-family: var(--sw-font-article);
	font-size: 1.05rem;
	line-height: 1.8;
	max-width: 740px;
	margin-bottom: 48px;
}

.sw-page-event__body h2 {
	font-size: 1.4rem;
	margin: 32px 0 12px;
}

.sw-page-event__body p {
	margin: 0 0 16px;
}

.sw-page-event__section-title {
	font-family: var(--sw-font-display);
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--sw-border);
}

.sw-page-event__sponsors {
	margin-top: 48px;
}

@media (min-width: 1024px) {
	.sw-page-event__content {
		padding: 48px 40px 64px;
	}
}

/* ───────────────────────────────────────────
   SIDEBAR LAYOUT GLOBAL
   ─────────────────────────────────────────── */

.sw-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Liste simple dans un widget sidebar */
.sw-sidebar-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sw-sidebar-list__item {
	padding: 8px 0;
	border-bottom: 1px solid var(--sw-border);
}

.sw-sidebar-list__item:last-child {
	border-bottom: none;
}

.sw-sidebar-list__link {
	font-family: var(--sw-font-body);
	font-size: 0.9rem;
	color: var(--sw-text);
	text-decoration: none;
	line-height: 1.4;
}

.sw-sidebar-list__link:hover,
.sw-sidebar-list__link:focus-visible {
	color: var(--sw-teal);
	outline: none;
}

.sw-sidebar-list__date {
	display: block;
	font-family: var(--sw-font-body);
	font-size: 0.75rem;
	color: var(--sw-muted);
	margin-top: 2px;
}

/* ───────────────────────────────────────────
   ARCHIVE HEADER (categories, tags)
   ─────────────────────────────────────────── */

.sw-archive-header {
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 2px solid var(--sw-border);
}

.sw-archive-header__title {
	font-family: var(--sw-font-display);
	font-size: 1.6rem;
	font-weight: 800;
	color: var(--sw-text);
	margin: 0 0 8px;
}

.sw-archive-header__title .sw-badge {
	font-size: 0.9rem;
	padding: 6px 16px;
	vertical-align: middle;
}

.sw-archive-header__desc {
	font-family: var(--sw-font-body);
	font-size: 0.95rem;
	color: var(--sw-muted);
	margin: 0;
	line-height: 1.6;
}

/* ───────────────────────────────────────────
   PAGINATION
   ─────────────────────────────────────────── */

.sw-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 32px;
	font-family: var(--sw-font-body);
}

.sw-pagination a,
.sw-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 6px;
	font-size: 0.9rem;
	text-decoration: none;
	border: 1px solid var(--sw-border);
	color: var(--sw-text);
	transition: background-color 0.2s, color 0.2s;
}

.sw-pagination a:hover,
.sw-pagination a:focus-visible {
	background-color: var(--sw-teal);
	border-color: var(--sw-teal);
	color: #fff;
	outline: none;
}

.sw-pagination .current {
	background-color: var(--sw-teal);
	border-color: var(--sw-teal);
	color: #fff;
	font-weight: 600;
}
