/*
Theme Name: Lacustre
Theme URI: https://example.ch/lacustre
Author: Lacustre
Description: Thème blocs pour un guide et magazine de la pêche à la truite dans les lacs suisses. Fiches lacs avec données et taxonomies (canton, espèce), compositions éditoriales, polices embarquées (Instrument Serif et Instrument Sans) et illustrations originales. Direction « Alpin éditorial ».
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lacustre
Tags: blog, news, full-site-editing, block-patterns, block-styles, custom-colors, custom-logo, editor-style, featured-images, wide-blocks, translation-ready
*/

/* ---------- Base ---------- */

html {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

:where(h1, h2, h3, .wp-block-post-title) {
	text-wrap: balance;
}

:where(p) {
	text-wrap: pretty;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--lac);
	outline-offset: 2px;
}

/* ---------- Marque (titre du site + logo) ---------- */

.lacustre-marque {
	gap: 12px;
}

.lacustre-marque::before {
	content: "";
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	background: url("assets/images/logo-lacustre.svg") center / contain no-repeat;
}

.lacustre-marque.is-clair::before {
	background-image: url("assets/images/logo-lacustre-clair.svg");
}

.lacustre-marque .wp-block-site-tagline {
	margin-top: 5px;
}

/* ---------- En-tête ---------- */

.lacustre-barre a {
	text-decoration: none;
}

.lacustre-barre a:hover {
	text-decoration: underline;
}

.lacustre-entete .wp-block-navigation .current-menu-item > a,
.lacustre-entete .wp-block-navigation a[aria-current="page"] {
	box-shadow: inset 0 -2px 0 currentColor;
	color: var(--wp--preset--color--lac-profond);
	font-weight: 600;
}

.lacustre-entete .wp-block-navigation-item__content {
	padding: 10px 12px;
}

.lacustre-entete .wp-block-search__button {
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--givre);
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--nuit);
	display: grid;
	place-items: center;
}

.lacustre-entete .wp-block-search__button svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.lacustre-entete .wp-block-search__input {
	border-radius: 999px;
	border-color: var(--wp--preset--color--givre);
	padding: 10px 16px;
}

@media (max-width: 781px) {
	.lacustre-barre .lacustre-barre-annonce {
		font-size: 12px;
	}
	.lacustre-entete .lacustre-cta {
		display: none;
	}
	.lacustre-marque::before {
		flex-basis: 34px;
		width: 34px;
		height: 34px;
	}
	.lacustre-marque .wp-block-site-tagline {
		display: none;
	}
}

/* ---------- Surtitres, étiquettes, puces ---------- */

.is-style-surtitre {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--mousse);
}

.has-abysse-background-color .is-style-surtitre,
.has-nuit-background-color .is-style-surtitre {
	color: var(--wp--preset--color--givre);
}

.wp-block-post-terms.is-style-especes {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	letter-spacing: 0;
	text-transform: none;
	font-weight: 500;
	font-size: 13px;
}

.wp-block-post-terms.is-style-especes a {
	display: inline-block;
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--wp--preset--color--mousse-pale);
	color: var(--wp--preset--color--mousse-sombre);
}

.wp-block-post-terms.is-style-especes .wp-block-post-terms__separator {
	display: none;
}

.lacustre-puces {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.lacustre-puces a,
.wp-block-tag-cloud a {
	display: inline-block;
	padding: 9px 14px;
	border-radius: 999px;
	background: var(--wp--preset--color--brume);
	color: var(--wp--preset--color--nuit);
	font-size: 14px !important;
	text-decoration: none;
	line-height: 1.3;
}

.wp-block-post-terms.lacustre-puces {
	letter-spacing: 0;
	text-transform: none;
	font-weight: 400;
}

.wp-block-post-terms.lacustre-puces .wp-block-post-terms__separator {
	display: none;
}

.lacustre-puces a:hover,
.wp-block-tag-cloud a:hover {
	background: var(--wp--preset--color--givre);
}

.lacustre-cantons {
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--ardoise);
}

.lacustre-cantons a {
	color: inherit !important;
}

/* ---------- Cartes ---------- */

.wp-block-group.is-style-carte {
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: 14px;
	overflow: hidden;
}

.lacustre-carte-lien {
	position: relative;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.lacustre-carte-lien:hover {
	box-shadow: 0 18px 40px rgba(11, 31, 42, 0.1);
	transform: translateY(-2px);
}

.lacustre-carte-lien .wp-block-post-title a::after,
.lacustre-carte-lien .lacustre-lien-etendu a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.lacustre-carte-lien .wp-block-post-terms a,
.lacustre-carte-lien .wp-block-button a {
	position: relative;
	z-index: 2;
}

.lacustre-illu-lac {
	margin: 0;
	background: var(--wp--preset--color--brume);
}

.lacustre-illu-lac img {
	display: block;
	width: 100%;
	height: 200px;
	object-fit: cover;
}

.lacustre-donnees p {
	margin: 0;
}

/* ---------- Numéros, icônes, illustrations ---------- */

.is-style-chiffre {
	font-style: italic;
	color: var(--wp--preset--color--lac);
	line-height: 0.8 !important;
}

.has-abysse-background-color .is-style-chiffre {
	color: #8fb3c2;
}

[class*="lacustre-icone-"]::before {
	content: "";
	display: block;
	width: 32px;
	height: 32px;
	margin-bottom: 14px;
	background: center / contain no-repeat;
}

.lacustre-icone-lieu::before { background-image: url("assets/icons/lieu.svg"); }
.lacustre-icone-permis::before { background-image: url("assets/icons/permis.svg"); }
.lacustre-icone-hamecon::before { background-image: url("assets/icons/hamecon.svg"); }
.lacustre-icone-regle::before { background-image: url("assets/icons/regle.svg"); }
.lacustre-icone-bateau::before { background-image: url("assets/icons/bateau.svg"); }
.lacustre-icone-profondeur::before { background-image: url("assets/icons/profondeur.svg"); }
.lacustre-icone-vent::before { background-image: url("assets/icons/vent.svg"); }
.lacustre-icone-calendrier::before { background-image: url("assets/icons/calendrier.svg"); }
.lacustre-icone-taille::before { background-image: url("assets/icons/taille-clair.svg"); }
.lacustre-icone-quota::before { background-image: url("assets/icons/quota-clair.svg"); }
.lacustre-icone-protection::before { background-image: url("assets/icons/calendrier-clair.svg"); }
.lacustre-icone-interdit::before { background-image: url("assets/icons/interdit-clair.svg"); }
.lacustre-icone-respect::before { background-image: url("assets/icons/respect-clair.svg"); }
.lacustre-icone-carnet::before { background-image: url("assets/icons/carnet-clair.svg"); }
.lacustre-icone-info::before { background-image: url("assets/icons/info.svg"); }

.lacustre-illu-espece {
	min-height: 180px;
	background: var(--wp--preset--color--mousse-pale) center / 300px auto no-repeat;
}

.lacustre-illu-espece.is-truite-lacustre { background-image: url("assets/images/truite-lacustre.svg"); }
.lacustre-illu-espece.is-omble-chevalier { background-image: url("assets/images/omble-chevalier.svg"); background-color: var(--wp--preset--color--brume); }

/* ---------- Listes ---------- */

.wp-block-list.is-style-coches {
	list-style: none;
	padding-left: 0;
}

.wp-block-list.is-style-coches li {
	position: relative;
	padding-left: 34px;
	margin-bottom: 12px;
}

.wp-block-list.is-style-coches li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.25em;
	width: 22px;
	height: 22px;
	background: url("assets/icons/coche-mousse.svg") center / contain no-repeat;
}

/* ---------- Tableaux ---------- */

.wp-block-table.is-style-lacustre {
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: 14px;
	overflow-x: auto;
}

.wp-block-table.is-style-lacustre table {
	border-collapse: collapse;
	min-width: 640px;
	width: 100%;
}

.wp-block-table.is-style-lacustre :where(th, td) {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--brume);
	padding: 16px 20px;
	text-align: left;
	vertical-align: top;
}

.wp-block-table.is-style-lacustre thead {
	border: 0;
}

.wp-block-table.is-style-lacustre thead th {
	background: #e9eff0;
	border-top: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #33464f;
}

.wp-block-table.is-style-lacustre tbody td:first-child {
	font-weight: 600;
}

.wp-block-table.is-style-lacustre figcaption {
	margin: 0;
	padding: 14px 20px;
	border-top: 1px solid var(--wp--preset--color--brume);
	text-align: left;
}

/* ---------- Questions fréquentes ---------- */

.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--givre);
	padding: 0;
}

.wp-block-details summary {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	align-items: center;
	padding: 24px 0;
	font-size: 20px;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "";
	flex: 0 0 22px;
	height: 22px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B1F2A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform 0.2s ease;
}

.wp-block-details[open] summary::after {
	transform: rotate(180deg);
}

.wp-block-details > :not(summary) {
	margin-top: 0;
	margin-bottom: 24px;
	max-width: 680px;
	color: #33464f;
}

/* ---------- Formulaires ---------- */

.lacustre-filtres {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
	gap: 16px;
	align-items: end;
	margin: 0;
}

.lacustre-filtres label {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ardoise);
}

.lacustre-filtres select,
.lacustre-filtres input[type="search"],
.wp-block-search__input,
.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-post-comments-form textarea {
	width: 100%;
	min-height: 52px;
	border: 1px solid var(--wp--preset--color--givre);
	border-radius: 10px;
	padding: 0 14px;
	background: var(--wp--preset--color--glacier);
	color: var(--wp--preset--color--nuit);
	font: inherit;
	font-size: 16px;
}

.wp-block-post-comments-form textarea {
	padding: 12px 14px;
}

.lacustre-filtres button,
.wp-block-search__button,
.wp-block-post-comments-form .wp-block-button__link,
.wp-block-post-comments-form input[type="submit"] {
	min-height: 52px;
	border: 0;
	border-radius: 10px;
	padding: 0 24px;
	background: var(--wp--preset--color--lac-profond);
	color: var(--wp--preset--color--blanc);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.lacustre-filtres button:hover,
.wp-block-search__button:hover {
	background: var(--wp--preset--color--nuit);
}

.lacustre-recherche {
	position: relative;
	z-index: 2;
}

/* ---------- Héros et emplacements photo ---------- */

.lacustre-heros .wp-block-cover__image-background {
	object-position: center bottom;
}

.lacustre-heros {
	padding-bottom: 168px !important;
}

.lacustre-recherche-carte {
	margin-top: -104px !important;
	box-shadow: var(--wp--custom--ombre);
}

.lacustre-image-defaut {
	position: relative;
	margin: 0;
	overflow: hidden;
}

.lacustre-image-defaut img {
	display: block;
}

.lacustre-badge-photo {
	position: absolute;
	left: 16px;
	bottom: 16px;
	padding: 8px 12px;
	border: 1px dashed rgba(230, 239, 241, 0.7);
	border-radius: 8px;
	background: rgba(11, 31, 42, 0.5);
	color: #e6eff1;
	font-size: 13px;
	font-weight: 600;
}

.is-style-a-completer {
	display: inline-block;
	border: 1px dashed #8fa3ab;
	border-radius: 4px;
	padding: 1px 6px;
}

/* ---------- Article ---------- */

.lacustre-article-contenu {
	font-size: var(--wp--preset--font-size--article);
	line-height: 1.72;
	color: #1d3240;
}

.lacustre-article-contenu > h2 {
	margin-top: 1.6em;
	font-size: clamp(32px, 3.4vw, 40px);
	line-height: 1.1;
}

.lacustre-article-contenu .has-drop-cap:not(:focus)::first-letter {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 5.2em;
	line-height: 0.8;
	margin: 0.08em 0.12em 0 0;
	color: var(--wp--preset--color--lac-profond);
	font-weight: 400;
}

.lacustre-article-contenu figure.wp-block-image img {
	border-radius: 14px;
	border: 1px solid var(--wp--preset--color--ligne);
	background: var(--wp--preset--color--blanc);
}

.wp-block-post-author {
	align-items: flex-start;
	padding: 28px;
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--ligne);
	border-radius: 14px;
}

.wp-block-post-author__avatar img {
	border-radius: 999px;
}

.wp-block-post-author__name {
	font-weight: 600;
	font-size: 18px;
}

.wp-block-post-author__bio {
	color: var(--wp--preset--color--ardoise);
	font-size: 16px;
}

/* ---------- Calendrier ---------- */

.lacustre-calendrier {
	overflow-x: auto;
}

.lacustre-calendrier .lacustre-mois {
	display: grid;
	grid-template-columns: repeat(12, minmax(44px, 1fr));
	gap: 6px;
	min-width: 600px;
}

.lacustre-mois p {
	margin: 0;
	padding-top: 64px;
	border-radius: 8px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	position: relative;
}

.lacustre-mois p::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 56px;
	border-radius: 8px;
	background: var(--wp--preset--color--brume);
}

.lacustre-mois p.is-fort::before {
	background: var(--wp--preset--color--lac-profond);
}

.lacustre-mois p.is-moyen::before {
	background: var(--wp--preset--color--lac-clair);
}

.lacustre-legende p {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	margin: 0;
}

.lacustre-legende p::before {
	content: "";
	width: 18px;
	height: 12px;
	border-radius: 3px;
	background: var(--wp--preset--color--brume);
	border: 1px solid var(--wp--preset--color--givre);
}

.lacustre-legende p.is-fort::before {
	background: var(--wp--preset--color--lac-profond);
	border-color: transparent;
}

.lacustre-legende p.is-moyen::before {
	background: var(--wp--preset--color--lac-clair);
	border-color: transparent;
}

.lacustre-accroche:empty {
	display: none;
}

/* ---------- Pied de page ---------- */

.lacustre-pied a {
	text-decoration: none;
}

.lacustre-pied a:hover {
	text-decoration: underline;
}

.lacustre-pied .wp-block-list {
	list-style: none;
	padding-left: 0;
}

.lacustre-pied .wp-block-list li {
	margin-bottom: 10px;
}

/* Bouton lié à un lien vide : masqué */
.wp-block-button:has(> .wp-block-button__link:not([href])) {
	display: none;
}

/* ---------- Pagination ---------- */

.wp-block-query-pagination {
	gap: 8px;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--givre);
	text-decoration: none;
	color: var(--wp--preset--color--nuit);
}

.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--nuit);
	border-color: var(--wp--preset--color--nuit);
	color: var(--wp--preset--color--blanc);
}
