/*
Theme Name: Eleonore Bridge
Theme URI: https://www.leblogdelamechante.fr/
Description: Thème FSE du blog Eleonore Bridge (Le blog de la méchante), reprise du design historique sur des outils actuels.
Author: L'Atelier Conception Web
Version: 1.2.2
Requires at least: 6.9
Requires PHP: 8.1
License: GNU General Public License v2 or later
Text Domain: eleonore-bridge
*/

/* ---------- Bandeau de titre (articles et pages) ---------- */
.eb-title-band {
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* ---------- Cartes blanches ---------- */
.eb-card {
	background: var(--wp--preset--color--surface);
}

.eb-card .wp-block-post-featured-image {
	margin: 0;
}

.eb-card .wp-block-post-featured-image img {
	width: 100%;
	height: auto;
}

.wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
}

.wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent-dark);
}

/* ---------- Extrait + « Lire la suite » pleine largeur ---------- */
.wp-block-post-excerpt__excerpt {
	margin-bottom: 0;
}

.wp-block-post-excerpt__more-text {
	margin-top: 26px;
}

.wp-block-post-excerpt__more-link {
	display: block;
	padding: 4px 10px;
	background: var(--wp--preset--color--button-soft);
	color: #fff !important;
	font-size: 15px;
	text-align: center;
	text-decoration: none;
}

.wp-block-post-excerpt__more-link:hover {
	background: var(--wp--preset--color--accent);
}

/* ---------- Encart « 15 commentaires » ---------- */
.eb-comment-count {
	display: inline-block;
	width: 140px;
	padding: 10px;
	border: 1px solid #ccc;
	background: #fff;
	color: #ccc;
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
}

.eb-comment-count a {
	color: #ccc;
	text-decoration: none;
}

.eb-comment-count a:hover {
	color: var(--wp--preset--color--accent-dark);
}

/* ---------- Pagination « Voir plus d'articles » ---------- */
.eb-pagination a {
	padding: 10px 22px;
	font-size: 19px;
	text-transform: uppercase;
	border: 1px solid var(--wp--preset--color--accent-border);
	background: var(--wp--preset--color--accent);
	color: #fff;
	text-decoration: none;
}

.eb-pagination a:hover {
	background: var(--wp--preset--color--accent-dark);
	color: #fff;
}

/* ---------- Contenu ---------- */
.wp-block-post-content img {
	max-width: 100%;
	height: auto;
}

.wp-block-post-content h3 {
	margin-bottom: 1.1em;
	font-size: 1.2em;
	text-transform: uppercase;
	text-align: center;
}

.wp-block-post-content h3 a,
.wp-block-post-content h4 a {
	color: var(--wp--preset--color--accent-alt);
}

.wp-block-post-content h3 a:hover,
.wp-block-post-content h4 a:hover {
	color: var(--wp--preset--color--accent-dark);
}

.wp-block-post-content h5 {
	float: right;
	width: 48%;
	margin: 0 0 3% 4%;
	font-size: 15px;
	line-height: 1.65em;
	text-align: justify;
}

.wp-block-post-content .alignleft {
	float: left;
	margin: 0.4em 1.5em 1em 0;
}

.wp-block-post-content .alignright {
	float: right;
	margin: 0.4em 0 1em 1.5em;
}

.wp-block-post-content .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-block-post-content .clear {
	clear: both;
}

.wp-block-post-content .wp-caption {
	max-width: 100%;
}

.wp-block-post-content address {
	margin-bottom: 22px;
	text-align: center;
}

figcaption,
.wp-caption-text,
.wp-element-caption {
	padding: 8px;
	background-color: var(--wp--preset--color--caption);
	color: #000;
	font-size: 0.9em;
	font-weight: bold;
	text-align: center;
}

blockquote p {
	color: #000;
}

/* Anciennes colonnes de l'éditeur classique (shortcodes du thème Loma). */
.wp-block-post-content .df_row-fluid::after {
	content: "";
	display: table;
	clear: both;
}

.wp-block-post-content [class*="df_span-"] {
	box-sizing: border-box;
	float: left;
	padding: 0 1%;
}

.wp-block-post-content .df_span-sm-6 { width: 50%; }
.wp-block-post-content .df_span-sm-4 { width: 33.333%; }
.wp-block-post-content .df_span-sm-3 { width: 25%; }
.wp-block-post-content .df_span-sm-8 { width: 66.666%; }
.wp-block-post-content .df_span-sm-12 { width: 100%; }

/* Encart « Ma boutique de déco » en tête d'article. */
.eb-shop .wp-block-image {
	margin-bottom: 0;
}

.eb-shop .wp-block-image img {
	aspect-ratio: 1;
	object-fit: cover;
}

.eb-shop figcaption {
	margin: 14px 0 0;
	background: #fff;
	color: #000;
	font-size: 15px;
}

.eb-shop p a {
	color: #fff !important;
	text-decoration: none;
}

.eb-shop p a:hover {
	text-decoration: underline;
}

/* ---------- Barre latérale : un encadré blanc par widget ---------- */
.eb-sidebar > .wp-block-group {
	padding: 22px;
	background: var(--wp--preset--color--surface);
}

.eb-sidebar img {
	width: 100%;
	height: auto;
}

.eb-sidebar .eb-widget-title {
	margin-bottom: 18px;
	font-size: 15px;
	letter-spacing: 2px;
	text-align: center;
	text-transform: uppercase;
}

.eb-sidebar select {
	width: 100%;
	padding: 6px;
	border: 1px solid var(--wp--preset--color--border);
	background: #fff;
	color: var(--wp--preset--color--text);
	font-family: inherit;
	font-size: 15px;
}

.eb-sidebar .wp-block-social-links {
	justify-content: space-between;
	padding: 0 6px;
}

.eb-sidebar .eb-links a {
	color: #000;
}

/* Carrousel « Jolis livres » : défilement natif, sans JavaScript. */
.eb-carousel {
	display: flex;
	gap: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.eb-carousel > * {
	flex: 0 0 100%;
	margin: 0 !important;
	scroll-snap-align: center;
}

/* ---------- Commentaires ---------- */
.wp-block-comments .comment-respond {
	margin-bottom: 3em;
}

.wp-block-comment-template li {
	margin-bottom: 1.5em;
}

/* Réponses d'Eleonore mises en avant, comme sur l'ancien thème. */
.wp-block-comment-template .bypostauthor > .wp-block-group {
	padding: 10px 30px 10px 20px !important;
	background-color: var(--wp--preset--color--author);
}

.wp-block-comment-author-name {
	font-family: var(--wp--preset--font-family--old-standard);
	font-weight: 700;
	letter-spacing: 1px;
}

.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--wp--preset--color--border);
	font-family: inherit;
	font-size: 16px;
}

/* ---------- Partage (Scriptless Social Sharing) ---------- */
.scriptlesssocialsharing {
	margin: 30px 0 10px;
}

.scriptlesssocialsharing__heading {
	font-family: var(--wp--preset--font-family--old-standard);
	font-size: 15px;
	letter-spacing: 2px;
	text-align: center;
	text-transform: uppercase;
}

/* ---------- Articles similaires ---------- */
.eb-related {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid var(--wp--preset--color--border);
}

.eb-related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.eb-related-grid img {
	width: 100%;
	height: 160px;
	object-fit: cover;
}

.eb-related-grid h3 {
	margin: 8px 0 0;
	font-size: 17px;
	text-align: center;
}

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.eb-card-inner {
		padding-left: 22px !important;
		padding-right: 22px !important;
	}

	.wp-block-post-content [class*="df_span-"] {
		float: none;
		width: 100% !important;
	}

	.eb-related-grid {
		grid-template-columns: 1fr;
	}

	.eb-shop {
		display: none;
	}
}

/* ---------- Tailles de titres de l'ancien thème ---------- */
.eb-card .wp-block-post-title {
	font-size: 38px;
}

.eb-title-band .wp-block-post-title {
	font-size: clamp(30px, 3.4vw, 46px);
}

/* ---------- En-tête et en-tête flottant ---------- */
.eb-header .wp-block-navigation-item__content {
	white-space: nowrap;
}

.eb-search-toggle {
	display: none;
	padding: 4px;
	border: 0;
	background: none;
	color: #000;
	cursor: pointer;
}

.eb-search-toggle:hover {
	color: #42476b;
}

.eb-header--floating {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 9990;
	border-bottom: 1px solid #ddd;
	transform: translateY(-110%);
	transition: transform 0.35s ease;
}

.eb-header--floating.is-visible {
	transform: none;
}

.eb-header--floating .wp-block-site-logo img {
	width: 240px !important;
}

.eb-header--floating .eb-search-toggle {
	display: block;
}

body.admin-bar .eb-header--floating {
	top: 32px;
}

@media (max-width: 959px) {
	.eb-header--floating {
		display: none;
	}

	.eb-header .eb-search-toggle {
		display: block;
	}
}

/* ---------- Recherche plein écran ---------- */
.eb-search-open {
	overflow: hidden;
}

.eb-search {
	position: fixed;
	inset: 0;
	z-index: 100000;
	overflow-y: auto;
	padding: 90px 20px 40px;
	background: rgba(255, 255, 255, 0.96);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.eb-search.is-open {
	opacity: 1;
}

.eb-search__close {
	position: absolute;
	top: 40px;
	right: 40px;
	border: 0;
	background: none;
	color: #555;
	cursor: pointer;
}

.eb-search__inner {
	max-width: 1100px;
	margin: 0 auto;
}

.eb-search__input {
	width: 100%;
	padding: 0 0 12px;
	border: 0;
	border-bottom: 1px solid #ddd;
	background: transparent;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--old-standard);
	font-size: clamp(30px, 4vw, 46px);
	font-weight: 700;
	letter-spacing: 1.5px;
	text-align: center;
	outline: none;
}

.eb-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.eb-search__input::placeholder {
	color: #777;
}

.eb-search__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	margin-top: 44px;
}

.eb-search__viewing {
	margin: 0;
	color: #999;
}

.eb-search__summary {
	color: #777;
	font-weight: 700;
}

.eb-search__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.eb-search__filter {
	min-width: 154px;
	max-width: 260px;
	padding: 9px 6px;
	border: 1px solid #ccc;
	background: #fff;
	color: #333;
	font-family: inherit;
	font-size: 18px;
}

.eb-search__results {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 18px 28px;
	margin-top: 40px;
}

.eb-search__results.is-loading {
	opacity: 0.4;
}

.eb-search__item {
	display: flex;
	gap: 16px;
	align-items: center;
	color: var(--wp--preset--color--contrast);
}

.eb-search__item img,
.eb-search__noimg {
	flex: 0 0 80px;
	width: 80px;
	height: 80px;
	object-fit: cover;
	background: var(--wp--preset--color--caption);
}

.eb-search__item strong {
	display: block;
	font-family: var(--wp--preset--font-family--old-standard);
	letter-spacing: 1px;
}

.eb-search__item small {
	color: #999;
}

.eb-search__all {
	grid-column: 1 / -1;
	justify-self: center;
	padding: 10px 22px;
	background: var(--wp--preset--color--accent);
	color: #fff !important;
}

/* ---------- Barre latérale : le dernier encadré suit le défilement ---------- */
.wp-block-column:has(> .eb-sidebar),
.wp-block-column:has(> .wp-block-template-part > .eb-sidebar) {
	align-self: stretch;
}

.wp-block-column > .wp-block-template-part:has(> .eb-sidebar),
.eb-sidebar {
	height: 100%;
}

.eb-sidebar > .wp-block-group:last-child {
	position: sticky;
	top: 110px;
}

/* ---------- Pied de page ---------- */
.eb-footer .eb-box {
	padding: 22px;
	background: var(--wp--preset--color--surface);
	align-self: flex-start;
}

.eb-widget-title {
	margin: 0 0 20px;
	font-size: 19px !important;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.eb-footer a {
	color: #000;
}

.eb-footer a:hover {
	color: var(--wp--preset--color--accent-dark);
}

.eb-footer .wp-block-latest-comments {
	margin: 0;
	padding: 0;
}

.eb-footer .wp-block-latest-comments__comment {
	min-height: 60px;
	margin: 0 0 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.eb-footer .wp-block-latest-comments .avatar {
	width: 60px;
	height: 60px;
	border-radius: 10px;
}

.eb-footer .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta {
	margin-left: 100px;
}

.eb-footer .wp-block-latest-comments__comment-author {
	color: #555 !important;
	font-style: italic;
}

.eb-plain-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.eb-plain-list li + li {
	margin-top: 14px;
}

.eb-last-post {
	margin: 0;
	padding: 0 0 16px;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.eb-last-post .wp-block-latest-posts__post-title {
	font-family: var(--wp--preset--font-family--old-standard);
	font-weight: 700;
	letter-spacing: 1.5px;
}

.eb-instagram #sb_instagram {
	padding-bottom: 0 !important;
}

.eb-footer-nav .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--old-standard);
	font-size: 19px;
	font-weight: 700;
	letter-spacing: 1px;
}

.eb-copyright {
	margin: 0;
	color: #888;
}

/* ---------- Retour en haut ---------- */
.eb-scroll-top {
	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border: 1px solid var(--wp--preset--color--border);
	background: #fff;
	color: #555;
}

.eb-scroll-top:hover {
	color: var(--wp--preset--color--accent-dark);
}

/* ---------- Contenu en blocs ---------- */
.wp-block-post-content h2.is-style-section {
	margin-bottom: 1.1em;
	font-size: 1.2em;
	text-align: center;
	text-transform: uppercase;
}

.wp-block-post-content h2.is-style-section a {
	color: var(--wp--preset--color--accent-alt);
}

.wp-block-post-content .wp-block-image img {
	height: auto;
}

.wp-block-post-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	background: var(--wp--preset--color--caption);
}

/* FAQ : questions dépliables */
.eb-faq {
	border-top: 1px solid var(--wp--preset--color--border);
}

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

.eb-faq summary {
	position: relative;
	padding-right: 36px;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--old-standard);
	font-weight: 700;
	letter-spacing: 1px;
	list-style: none;
	cursor: pointer;
}

.eb-faq summary::-webkit-details-marker {
	display: none;
}

.eb-faq summary::after {
	content: "+";
	position: absolute;
	top: -2px;
	right: 6px;
	color: var(--wp--preset--color--accent);
	font-size: 26px;
	line-height: 1;
}

.eb-faq details[open] summary::after {
	content: "−";
}

.eb-faq details > :not(summary) {
	margin-top: 12px;
}

/* Grilles d'articles (anciennes pages de rubrique) */
.eb-post-grid.is-grid {
	gap: 28px;
	padding: 0;
}

.eb-post-grid li {
	margin: 0 !important;
	background: var(--wp--preset--color--base);
}

.eb-post-grid .wp-block-latest-posts__featured-image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
}

.eb-post-grid .wp-block-latest-posts__post-title {
	display: block;
	padding: 12px 14px 16px;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--old-standard);
	font-weight: 700;
	letter-spacing: 1px;
	text-align: center;
}

ul.wp-block-latest-posts.eb-post-grid.is-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

ul.wp-block-latest-posts.eb-post-grid.is-grid > li {
	width: auto;
	margin: 0;
}

@media (max-width: 781px) {
	ul.wp-block-latest-posts.eb-post-grid.is-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 781px) {
	.eb-footer-nav .wp-block-navigation-item__content {
		font-size: 16px;
	}

	.eb-colophon {
		padding-bottom: 90px !important;
	}

	.eb-copyright {
		text-align: center;
	}

	.eb-scroll-top {
		right: 14px;
		bottom: 14px;
		width: 44px;
		height: 44px;
	}
}

/* Le bloc Navigation du colophon doit occuper toute la largeur, sinon il se réduit et ses liens débordent. */
.eb-colophon .eb-footer-nav,
.eb-colophon .eb-footer-nav .wp-block-navigation__container {
	width: 100%;
}
