/* ============================================
   RUBRIQUE - Articles en Cartes 4 Colonnes
   ============================================ */

.rubrique-header {
	position: relative;
	background-image: linear-gradient(rgba(44, 62, 80, 0.45), rgba(44, 62, 80, 0.45)), url('../IMG/banniere.jpg');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: white;
	min-height: 225px;
	padding: 40px 20px;
	text-align: center;
	display: flex;
	align-items: center;
}

.rubrique-header-content {
	max-width: 1000px;
	margin: 0 auto;
}

.rubrique-header-logo {
	position: absolute;
	top: 20px;
	left: 24px;
	z-index: 5;
	width: min(22vw, 120px);
	max-width: 120px;
	min-width: 70px;
	pointer-events: none;
}

.rubrique-header-logo img {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

@media (max-width: 768px) {
	.rubrique-header-logo {
		width: min(20vw, 46px);
		min-width: 30px;
		top: auto;
		bottom: 12px;
		left: 50%;
		transform: translateX(-50%);
	}
}

.rubrique-header h1 {
	font-size: 2.5em;
	margin-bottom: 20px;
	font-weight: 700;
}

/* ============================================
   RUBRIQUE HERO
   Variante utilisee sur les rubriques 38 et 103 (rubriques du
   menu) : banniere haute avec les cartes des sous-rubriques
   incrustees en bas, comme sur la page d'accueil.
   ============================================ */

.rubrique-header-hero {
	min-height: 450px;
	flex: 1;
	align-items: flex-end;
	padding: 0;
}

.rubrique-header-hero::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(8, 20, 33, 0.05) 0%, rgba(8, 20, 33, 0.2) 45%, rgba(8, 20, 33, 0.6) 100%);
	pointer-events: none;
	z-index: 1;
}

.rubrique-header-hero .rubrique-header-content {
	position: absolute;
	top: 38%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: calc(100% - 40px);
	z-index: 2;
}

.rubrique-header-cards {
	position: relative;
	width: 100%;
	z-index: 3;
	padding: 0 24px 44px;
}

@media (min-width: 769px) {
	body.page-hero {
		position: relative;
		height: 100vh;
		overflow: hidden;
		background-color: #0f2338;
	}

	body.page-hero .rubrique-header-hero {
		min-height: 0;
	}

	body.page-hero .menu-principal {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		z-index: 100;
	}

	body.page-hero .rubrique-header-hero .rubrique-header-logo {
		top: 78px;
	}
}

@media (max-width: 768px) {
	.rubrique-header-hero {
		min-height: 100svh;
	}

	.rubrique-header-hero .rubrique-header-content {
		top: 34%;
	}

	.rubrique-header-hero .rubrique-header-logo {
		top: 16px;
		bottom: auto;
		left: 16px;
		transform: none;
	}

	.rubrique-header-cards {
		padding: 0 14px 22px;
	}
}

/* ============================================
   FIL D'ARIANE
   Absent sur les rubriques de premier niveau (Accueil suffit, deja
   accessible en permanence via le menu). Visible des qu'on est dans
   une sous-rubrique, et toujours visible sur un article (qui n'indique
   sa rubrique nulle part ailleurs).
   ============================================ */

.fil-ariane {
	max-width: 1000px;
	margin: 16px auto 0;
	padding: 0 20px;
	font-size: 0.9em;
	color: #666;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px;
}

.fil-ariane a {
	color: #3498db;
	text-decoration: none;
}

.fil-ariane a:hover {
	text-decoration: underline;
}

.fil-ariane-sep {
	color: #bbb;
}

.fil-ariane-current {
	color: #666;
}

/* Mobile : on ne garde que le dernier maillon (rubrique/page parente
   immediate) + la page actuelle, pour rester compact et lisible. */
@media (max-width: 700px) {
	.fil-ariane > * {
		display: none;
	}

	.fil-ariane > *:nth-last-child(-n+4) {
		display: inline;
	}
}

.rubrique-description {
	font-size: 1.1em;
	line-height: 1.6;
	opacity: 0.95;
	text-align: justify;
}

.rubrique-texte {
	font-size: 1.1em;
	line-height: 1.6;
	opacity: 0.95;
	text-align: justify;
}

.rubrique-intro {
	margin-top: 1em;
}

.rubrique-intro-content {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Déroulant description */
.rubrique-intro-text {
	overflow: hidden;
	transition: max-height 0.4s ease;
}

.rubrique-intro-text.collapsed {
	max-height: calc(1.6em * 5);
	-webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
	mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.rubrique-intro-text.expanded {
	max-height: 9999px;
	-webkit-mask-image: none;
	mask-image: none;
}

.rubrique-lire-plus {
	display: inline-block;
	margin-top: 8px;
	color: #3498db;
	cursor: pointer;
	font-size: 0.95em;
	font-weight: 600;
	background: none;
	border: none;
	padding: 0;
	text-decoration: underline;
}

/* Logo rubrique dans les cartes de sous-rubriques */
.rubrique-card-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ============================================
   STYLE CARTE OVERLAY (titre sur l'image)
   ============================================ */

.article-card-overlay {
	min-height: 200px;
	border-radius: 8px;
	overflow: hidden;
	background: linear-gradient(135deg, #d9e8f5 0%, #a9c9e0 100%);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
}

.article-card-overlay.has-logo::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.72);
	transition: background 0.3s ease;
}

.article-card-overlay.has-logo:hover::before {
	background: rgba(255, 255, 255, 0.55);
}

.article-card-overlay:hover {
	box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
	transform: translateY(-3px);
}

.article-card-overlay:not(.has-logo):hover {
	background: linear-gradient(135deg, #c2dcf0 0%, #7fabd0 100%);
}

.article-card-overlay-content {
	position: relative;
	z-index: 1;
	text-align: center;
	padding: 15px 20px;
}

.article-card-overlay-content h3 {
	margin: 0;
	font-size: 1.1em;
	font-weight: 600;
	color: #2c3e50;
}

/* ============================================
   SOUS-RUBRIQUES
   ============================================ */

.sous-rubriques-section {
	background-color: #f5f5f5;
	padding: 40px 20px;
}

.sous-rubriques-section h2 {
	text-align: center;
	color: #2c3e50;
	font-size: 2em;
	margin-bottom: 40px;
}

.sous-rubriques-grid {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 25px;
}

.sous-rubrique-card {
	background: white;
	padding: 25px;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	transition: all 0.3s ease;
}

.sous-rubrique-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.sous-rubrique-card h3 {
	margin: 0 0 15px 0;
	font-size: 1.2em;
	color: #2c3e50;
}

.sous-rubrique-card h3 a {
	color: #2c3e50;
	text-decoration: none;
}

.sous-rubrique-card h3 a:hover {
	color: #3498db;
}

.sous-rubrique-card p {
	margin: 0 0 15px 0;
	color: #666;
	line-height: 1.5;
}

.btn-voir {
	display: inline-block;
	color: #3498db;
	text-decoration: none;
	font-weight: 600;
	transition: color 0.3s ease;
}

.btn-voir:hover {
	color: #2980b9;
	text-decoration: underline;
}

/* ============================================
   ARTICLES LISTÉS (par rubrique)
   ============================================ */

.articles-section {
	background-color: #fff;
	padding: 40px 20px;
}

.articles-section h2 {
	text-align: center;
	color: #2c3e50;
	font-size: 2em;
	margin-bottom: 40px;
}

.articles-list {
	max-width: 1000px;
	margin: 0 auto;
}

.article-item {
	background: #f9f9f9;
	padding: 25px;
	border-left: 4px solid #3498db;
	margin-bottom: 20px;
	border-radius: 4px;
	transition: all 0.3s ease;
}

.article-item:hover {
	background: white;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-item h3 {
	margin: 0 0 10px 0;
	font-size: 1.1em;
}

.article-item h3 a {
	color: #2c3e50;
	text-decoration: none;
}

.article-item h3 a:hover {
	color: #3498db;
}

.article-date {
	color: #999;
	font-size: 0.85em;
	margin: 0 0 10px 0;
}

.article-chapo {
	color: #666;
	line-height: 1.5;
	margin: 0 0 12px 0;
	font-size: 0.95em;
}

/* Agenda insere sous les sous-rubriques (rubrique 3) */
.rubrique-agenda-zone .section-actualites {
	background-color: transparent;
}

.article-item a {
	color: #3498db;
	text-decoration: none;
	font-weight: 600;
	transition: color 0.3s ease;
}

.article-item a:hover {
	color: #2980b9;
	text-decoration: underline;
}

/* ============================================
   GRILLE D'ARTICLES - 4 COLONNES
   ============================================ */

.articles-grid-section {
	background-color: #f5f5f5;
	padding: 40px 20px;
	margin: 20px 0;
}

.articles-grid-section h2 {
	text-align: center;
	color: #2c3e50;
	font-size: 2em;
	margin-bottom: 40px;
}

.articles-grid {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 25px;
}

.article-grid-card {
	background: white;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.article-grid-card:hover {
	transform: translateY(-8px);
	box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card-image {
	width: 100%;
	height: 200px;
	background: linear-gradient(135deg, #ecf0f1 0%, #d5dbdb 100%);
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.card-no-image {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #ecf0f1 0%, #d5dbdb 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 2.5em;
}

.card-content {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.card-content h3 {
	margin: 0 0 10px 0;
	font-size: 1.1em;
	font-weight: 600;
	line-height: 1.4;
}

.card-content h3 a {
	color: #2c3e50;
	text-decoration: none;
	transition: color 0.3s ease;
}

.card-content h3 a:hover {
	color: #3498db;
}

.card-date {
	margin: 0 0 10px 0;
	color: #999;
	font-size: 0.85em;
	font-weight: 500;
}

.card-chapo {
	margin: 0 0 15px 0;
	color: #666;
	font-size: 0.9em;
	line-height: 1.5;
	flex-grow: 1;
}

.card-link {
	display: inline-block;
	color: #3498db;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9em;
	margin-top: auto;
	transition: color 0.3s ease;
}

.card-link:hover {
	color: #2980b9;
	text-decoration: underline;
}

.articles-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: #999;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
	.sous-rubriques-grid {
		grid-template-columns: 1fr;
	}
	
	.rubrique-header h1 {
		font-size: 1.8em;
	}
	
	.articles-grid-section h2,
	.articles-section h2,
	.sous-rubriques-section h2 {
		font-size: 1.5em;
	}
}
