/**
 * Template « lafonciere » – La Foncière Verte (Joomla 6)
 *
 * Reprend le design du site d'origine (thème Refraction, déclinaison claire « style2 ») avec un code
 * actuel : HTML5 sémantique, mise en page en flexbox, cadres dessinés en CSS, aucune dépendance
 * (ni Bootstrap, ni JavaScript). Largeur fixe de 979 px, comme le site d'origine.
 *
 * Sommaire
 *   1. Variables
 *   2. Base et typographie
 *   3. Utilitaires (accessibilité, classes utilisées par Joomla)
 *   4. Structure de page
 *   5. En-tête et menu principal
 *   6. Contenu principal
 *   7. Colonne de droite
 *   8. Pied de page
 *   9. Contenus éditoriaux (classes proposées dans l'éditeur)
 *  10. Formulaires et boutons
 *  11. Page d'erreur et page hors ligne
 *  12. Impression
 */

/* 1. Variables
   ========================================================================== */

:root {
	--lf-font: Geneva, Tahoma, "Nimbus Sans L", sans-serif;
	--lf-font-size: 12px;
	--lf-width: 979px;
	--lf-sidebar-width: 280px;

	--lf-text: #4d4d4d;
	--lf-title: #7e8407;
	--lf-link: #7e8407;
	--lf-link-hover: #000;
	--lf-page-bg: #ddd;

	/* Cadres translucides posés sur le fond « planète » */
	--lf-frame: rgba(204, 204, 204, .2);
	--lf-frame-top: rgba(255, 255, 255, .45);
	--lf-frame-bottom: rgba(204, 204, 204, .22);
	--lf-line-light: #fff;
	--lf-line-dark: #d0d0d0;
	--lf-panel: rgba(242, 242, 242, .6);
	--lf-panel-light: rgba(249, 249, 249, .5);
	--lf-overlay: rgba(255, 255, 255, .4);
	--lf-dropdown: rgba(255, 255, 255, .9);

	/* Encart de mise en avant (bouton « Offre Publique de Retrait » de l'accueil) */
	--lf-accent: #d19e8d;
	--lf-accent-border: #93cc4a;
}

/* 2. Base et typographie
   ========================================================================== */

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

html {
	scrollbar-gutter: stable;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	min-width: var(--lf-width);
	margin: 0;
	background: var(--lf-page-bg);
	color: #000;
	font: var(--lf-font-size)/1.55 var(--lf-font);
}

img {
	max-width: 100%;
	height: auto;
	border: 0;
}

a {
	color: var(--lf-link);
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--lf-link-hover);
	text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 25px 0 10px;
	padding-bottom: 5px;
	font-weight: normal;
	line-height: 1.2;
}

h1 {
	font-size: 2.5em;
	line-height: 1;
}

h2 {
	font-size: 1.75em;
	line-height: 1;
}

h3 {
	font-size: 1.4em;
}

h4,
h5,
h6 {
	font-size: 1.2em;
	line-height: 1.3;
}

h5 {
	text-transform: uppercase;
}

p {
	margin: 10px 0 15px;
	line-height: 20px;
	text-align: justify;
}

table {
	border-collapse: collapse;
}

td p {
	margin: 0;
	line-height: 1.3em;
}

blockquote {
	margin: 15px 0;
	padding: 10px 20px;
	border: 1px solid var(--lf-page-bg);
	background: var(--lf-overlay);
	font-size: 1.2em;
	font-style: italic;
	line-height: 1.5;
}

hr {
	height: 17px;
	border: 0;
	background: url("../images/menu-highlight.png") 50% 0 no-repeat;
}

/* 3. Utilitaires
   ========================================================================== */

/* Texte réservé aux lecteurs d'écran (classe utilisée par les layouts de Joomla) */
.visually-hidden,
.visually-hidden-focusable:not(:focus, :focus-within) {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.skip-link {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1000;
	padding: 8px 12px;
	background: #fff;
	color: #000;
	font-weight: bold;
	transform: translateY(-100%);
}

.skip-link:focus {
	transform: none;
}

/* Images alignées (images d'introduction / complètes de Joomla) */
.float-start {
	float: left;
	margin: 0 15px 10px 0;
}

.float-end {
	float: right;
	margin: 0 0 10px 15px;
}

/* 4. Structure de page
   ========================================================================== */

.container {
	position: relative;
	width: var(--lf-width);
	margin: 0 auto;
}

/* Fond « planète » fixe derrière l'en-tête et le contenu (pas derrière le pied de page) */
.site-page {
	background: url("../images/background.jpg") 50% 0 no-repeat fixed;
}

.site-body {
	padding: 16px 0 12px;
	color: var(--lf-text);
	background:
		linear-gradient(var(--lf-overlay), var(--lf-overlay)) 0 1px / 100% 100% no-repeat,
		url("../images/body-divider.png") 50% 0 no-repeat;
}

.site-columns {
	display: flex;
	align-items: flex-start;
}

.site-main {
	flex: 1 1 auto;
	min-width: 0;
}

.site-sidebar {
	flex: 0 0 var(--lf-sidebar-width);
}

/* 5. En-tête et menu principal
   ========================================================================== */

.site-header {
	height: 138px;
	background: url("../images/header-overlay.png") 0 100% repeat-x;
}

.site-header .container {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	height: 100%;
}

.site-brand {
	margin-top: 15px;
}

.site-brand img {
	display: block;
}

.site-nav {
	margin-top: 20px;
	padding-left: 10px;
	background: url("../images/menu-highlight.png") 50% 0 no-repeat;
}

.site-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav .mod-menu {
	display: flex;
}

.site-nav .mod-menu > li {
	position: relative;
	display: flex;
	background: url("../images/menu-divider.png") 100% 15px no-repeat;
}

.site-nav .mod-menu > li > a {
	padding: 0 15px 12px;
	font-size: 14px;
	line-height: 65px;
	white-space: nowrap;
}

.site-nav .mod-menu > li:hover > a,
.site-nav .mod-menu > li.active > a,
.site-nav .mod-menu > li > a:focus {
	color: var(--lf-link-hover);
	text-decoration: none;
}

/* Sous-menu déroulant : au survol, au clavier (focus) ou via le bouton du module (aria-hidden="false") */
.site-nav .mod-menu__sub {
	position: absolute;
	top: 100%;
	left: -4px;
	z-index: 100;
	width: 260px;
	padding: 0 10px 15px;
	background: var(--lf-dropdown);
	box-shadow: 1px 2px 4px rgba(0, 0, 0, .15);
}

.site-nav .mod-menu > li:hover > .mod-menu__sub,
.site-nav .mod-menu > li:focus-within > .mod-menu__sub {
	display: block;
}

.site-nav .mod-menu__sub li {
	width: 173px;
	background: url("../images/separator.png") 50% 100% repeat-x;
}

.site-nav .mod-menu__sub a {
	display: block;
	padding: 3px 0 3px 10px;
	line-height: 24px;
}

.site-nav .mod-menu__sub a:hover,
.site-nav .mod-menu__sub a:focus {
	color: var(--lf-link-hover);
	text-decoration: none;
}

/* Bouton d'ouverture du sous-menu ajouté par Joomla : invisible à la souris, visible au clavier */
.site-nav .mod-menu__toggle-sub {
	position: absolute;
	right: 0;
	bottom: 8px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.site-nav .mod-menu__toggle-sub:focus-visible {
	width: auto;
	height: auto;
	padding: 0 4px;
	overflow: visible;
	clip-path: none;
	outline: 1px dotted currentColor;
}

.site-nav .mod-menu__toggle-sub:focus-visible::after {
	content: "\25BE";
}

/* 6. Contenu principal
   ========================================================================== */

/* Cadre translucide : bord de 10 px, double filet en creux, fond légèrement éclairci en haut */
.site-main {
	display: flow-root;
	padding: 10px 17px 17px;
	border: 10px solid var(--lf-frame);
	background-color: var(--lf-panel);
	background-image:
		linear-gradient(var(--lf-line-light), var(--lf-line-light)),
		linear-gradient(rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 240px);
	background-repeat: no-repeat;
	background-size: 100% 1px, 100% 240px;
	background-position: 0 1px, 0 0;
	background-origin: border-box, padding-box;
	background-clip: border-box, padding-box;
	box-shadow:
		inset 1px 1px var(--lf-line-light),
		inset -1px -1px var(--lf-line-dark),
		inset 2px 2px var(--lf-line-dark),
		inset -2px -2px var(--lf-line-light);
}

/* Titre de la page (article) et titres des articles de l'accueil */
.page-header h1,
.item-title {
	margin: 25px 0 10px;
	padding-bottom: 5px;
	color: var(--lf-title);
	font-size: 1.75em;
	line-height: 1;
}

/* 7. Colonne de droite
   ========================================================================== */

.site-sidebar .moduletable {
	margin-bottom: 20px;
	padding: 10px;
	border: 10px solid transparent;
	background-image:
		linear-gradient(var(--lf-line-light), var(--lf-line-light)),
		linear-gradient(var(--lf-panel-light), var(--lf-panel-light)),
		linear-gradient(var(--lf-frame-top) 40px, var(--lf-frame-bottom) 200px);
	background-repeat: no-repeat;
	background-size: 100% 1px, auto, auto;
	background-position: 0 1px, 0 0, 0 0;
	background-origin: border-box, padding-box, border-box;
	background-clip: border-box, padding-box, border-box;
}

.site-sidebar .moduletable > h3 {
	margin: 0;
	padding: 0 10px;
	color: #000;
	font-size: 1.2em;
	line-height: 28px;
}

.site-sidebar .mod-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-sidebar .mod-menu li {
	background: url("../images/separator.png") 0 100% no-repeat;
}

.site-sidebar .mod-menu a {
	position: relative;
	display: block;
	padding: 8px 10px 8px 20px;
	font-size: 1.2em;
	line-height: 18.6px;
}

.site-sidebar .mod-menu a::before {
	content: "\00BB";
	position: absolute;
	left: 5px;
	color: var(--lf-text);
}

.site-sidebar .mod-menu a:hover,
.site-sidebar .mod-menu a:focus {
	color: var(--lf-link-hover);
	text-decoration: none;
}

.site-sidebar .mod-menu a:hover::before {
	color: var(--lf-link-hover);
}

.site-sidebar .mod-menu .current > a {
	font-weight: bold;
}

/* 8. Pied de page
   ========================================================================== */

.site-footer {
	color: var(--lf-text);
}

.site-footer .container {
	padding: 15px 0;
}

.back-to-top {
	position: absolute;
	top: 13px;
	right: 15px;
	width: 90px;
	color: var(--lf-text);
	font-weight: bold;
	line-height: 22px;
	text-align: center;
}

.back-to-top:hover,
.back-to-top:focus {
	color: #222;
	text-decoration: none;
}

/* 9. Contenus éditoriaux
   Classes proposées dans l'éditeur (voir editor.css) pour mettre en forme les articles sans style en ligne.
   ========================================================================== */

/* Paragraphe d'accroche en tête d'article */
.chapeau {
	margin: 25px 0 15px;
	font-size: 1.75em;
	line-height: 1.3;
	text-align: left;
}

/* Bloc centré (intertitres, images) */
.centre {
	text-align: center;
}

/* Liste dont les éléments sont espacés d'une ligne */
.liste-espacee > li + li {
	margin-top: 1.55em;
}

/* Liste de documents (une ligne par document, sans puce) */
.liste-documents {
	padding: 0;
	list-style: none;
}

.liste-documents > li {
	margin: 10px 0 15px;
	line-height: 20px;
}

/* Encart de mise en avant centré (lien vers l'Offre Publique de Retrait sur l'accueil) */
.cta {
	width: fit-content;
	margin: 15px auto 35px;
	padding: 15px;
	border: 3px solid var(--lf-accent-border);
	background: var(--lf-accent);
	font-size: 14pt;
	text-align: center;
}

.cta a {
	color: #fff;
}

/* Intertitre de liste (années des communiqués, de la documentation…) */
.intertitre {
	margin: 10px 0 15px;
	padding: 0;
	font-size: 1em;
	font-weight: bold;
	line-height: 20px;
	text-decoration: underline;
}

/* Tableau de données (récapitulatif du patrimoine) */
.table-donnees {
	width: 100%;
	border: 2px solid var(--lf-title);
}

.table-donnees th,
.table-donnees td {
	padding: 4px 6px;
	border: 1px solid var(--lf-text);
	vertical-align: middle;
}

.table-donnees th {
	font-weight: normal;
	text-align: center;
}

.table-donnees th small {
	display: block;
}

.table-donnees .nombre {
	text-align: center;
	white-space: nowrap;
}

/* Graphique SVG généré depuis un champ personnalisé (layout de champ « camembert ») */
svg.graphique {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 15px 0;
}

.graphique-etiquettes polyline {
	fill: none;
	stroke: #999;
}

.graphique-etiquettes text {
	fill: #444;
	font: 11px Verdana, Geneva, Tahoma, sans-serif;
}

/* 10. Formulaires et boutons
   ========================================================================== */

button,
input,
select,
textarea {
	font: inherit;
}

.btn {
	display: inline-block;
	padding: 5px 14px;
	border: 1px solid var(--lf-line-dark);
	background: rgba(255, 255, 255, .7);
	color: var(--lf-link);
	font-weight: bold;
	line-height: 18px;
	cursor: pointer;
}

.btn:hover,
.btn:focus {
	border-color: var(--lf-link);
	color: var(--lf-link-hover);
	text-decoration: none;
}

/* Formulaires RSForm (mise en page « Responsive » de RSForm, sans framework).
   Reprend l'aspect du formulaire de contact du site d'origine. */
.site-main .formResponsive {
	--lf-form-accent: #1e87f0;
	--lf-form-border: #e5e5e5;
	--lf-form-error: #f0506e;
}

.site-main .formResponsive .formRow {
	display: flex;
	gap: 40px;
}

.site-main .formResponsive .formRow::before,
.site-main .formResponsive .formRow::after {
	content: none;
}

.site-main .formResponsive .formRow [class*="formSpan"] {
	flex: 1 1 0;
	width: auto;
	min-height: 0;
	margin: 0;
}

.site-main .formResponsive .rsform-block {
	margin-bottom: 20px;
}

.site-main .formResponsive .formControlLabel {
	display: block;
	margin: 0 0 5px;
	color: #333;
	font-size: 14px;
}

.site-main .formResponsive .formControls label {
	margin: 0 5px 0 0;
	color: #333;
}

.site-main .formResponsive input[type="text"],
.site-main .formResponsive input[type="email"],
.site-main .formResponsive input[type="tel"],
.site-main .formResponsive input[type="number"],
.site-main .formResponsive input[type="url"],
.site-main .formResponsive textarea,
.site-main .formResponsive select {
	box-sizing: border-box;
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--lf-form-border);
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	color: #666;
	font-size: 12px;
	line-height: 18px;
}

.site-main .formResponsive textarea {
	height: auto;
	padding: 6px 10px;
}

.site-main .formResponsive input:focus,
.site-main .formResponsive textarea:focus,
.site-main .formResponsive select:focus {
	border-color: var(--lf-form-accent);
	outline: 0;
	box-shadow: none;
}

.site-main .formResponsive .rsform-error input,
.site-main .formResponsive .rsform-error textarea {
	border-color: var(--lf-form-error);
}

.site-main .formResponsive input[type="radio"],
.site-main .formResponsive input[type="checkbox"] {
	appearance: none;
	width: 16px;
	height: 16px;
	margin: -4px 4px 0 0;
	padding: 0;
	border: 1px solid #ccc;
	background: transparent;
	vertical-align: middle;
}

.site-main .formResponsive input[type="radio"] {
	border-radius: 50%;
}

.site-main .formResponsive input[type="radio"]:checked,
.site-main .formResponsive input[type="checkbox"]:checked {
	border-color: transparent;
	background: var(--lf-form-accent) radial-gradient(#fff 0 2px, transparent 3px);
}

.site-main .formResponsive button[type="submit"],
.site-main .formResponsive input[type="submit"] {
	margin: 0;
	padding: 0 30px;
	border: 1px solid transparent;
	border-radius: 0;
	background: var(--lf-form-accent);
	box-shadow: none;
	color: #fff;
	font-size: 14px;
	line-height: 38px;
	text-shadow: none;
	text-transform: uppercase;
	cursor: pointer;
}

.site-main .formResponsive button[type="submit"]:hover,
.site-main .formResponsive button[type="submit"]:focus {
	background: #0f7ae5;
}

/* 11. Page d'erreur et page hors ligne
   ========================================================================== */

.error-message {
	font-size: 1.2em;
}

.error-actions {
	margin-top: 25px;
}

.error-debug {
	margin-top: 25px;
	padding: 10px;
	overflow: auto;
	border: 1px solid #ccc;
	font-size: 11px;
}

.offline-box {
	width: 480px;
	margin: 40px auto;
}

.offline-box img {
	display: block;
	margin: 0 auto 15px;
}

.login-form fieldset {
	margin: 20px 0 0;
	padding: 0;
	border: 0;
}

.login-form legend {
	margin-bottom: 5px;
	font-size: 1.2em;
}

.login-form label {
	display: block;
	margin: 10px 0 4px;
}

.login-form input {
	width: 100%;
	padding: 6px;
	border: 1px solid #ccc;
	background: #fff;
}

.login-form .btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	margin-top: 15px;
}

/* Icônes des boutons d'authentification ajoutés par Joomla (clé d'accès…) */
.login-form .btn svg,
.login-form .btn img {
	width: 16px;
	height: 16px;
}

/* 12. Impression
   ========================================================================== */

@media print {
	body {
		min-width: 0;
		background: none;
	}

	.site-page,
	.site-header,
	.site-body {
		height: auto;
		padding: 0;
		background: none;
	}

	.container {
		width: auto;
	}

	.site-nav,
	.site-sidebar,
	.site-footer,
	.skip-link {
		display: none;
	}

	.site-main {
		padding: 0;
		border: 0;
		background: none;
		box-shadow: none;
	}

	a {
		color: #000;
	}
}
