/*
Theme Name:  Bravada – Sonia Lawniczak
Template:    bravada
Description: Thème enfant de Bravada pour le site de Sonia Lawniczak, peintre. Les mises à jour du thème Bravada restent possibles.
Version:     1.0.0
Text Domain: bravada-sonia
*/

/* ---------- Mise en page : place aux tableaux ---------- */
.one-column #main { max-width: 1400px; margin: 0 auto; }
.one-column #main .entry-content { max-width: none; }

/* Pas de méta (auteur / date) ni commentaires sur les pages d'œuvres */
.page .entry-meta, .page #comments { display: none; }

/* ---------- Galeries de tableaux ---------- */
.entry-content .wp-block-gallery.has-nested-images {
	--wp--style--unstable-gallery-gap: 2em; /* écart utilisé par WordPress pour calculer la largeur des colonnes */
	gap: 2em;
	justify-content: center;
}
/* Les tableaux de la dernière rangée (ou un tableau seul) gardent la même taille que les autres */
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { flex-grow: 0; }
/* Tableau en « Pleine largeur » (style choisi dans l'éditeur) : toute la largeur de la galerie */
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-pleine-largeur:not(#individual-image) { width: 100% !important; }
.entry-content .wp-block-image.is-style-pleine-largeur img { width: 100%; height: auto; }
/* Tableau « Centrée » (style choisi dans l'éditeur) : seul sur sa ligne, centré, sur la moitié de la largeur */
@media (min-width: 601px) {
	.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-centree:not(#individual-image) {
		width: 50% !important;
		margin-left: 25% !important;  /* les marges occupent le reste de la ligne : le tableau y est seul */
		margin-right: 25% !important;
	}
}
.entry-content .wp-block-image.is-style-centree img { width: 100%; height: auto; }
/* 2 colonnes : les tableaux d'une même rangée sont alignés par le bas (les légendes restent sur une même ligne) */
@media (min-width: 601px) {
	.entry-content .wp-block-gallery.has-nested-images { align-items: flex-end; }
	.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		align-self: flex-end;
		justify-content: flex-end;
		margin-top: auto !important;
		margin-bottom: 0 !important; /* WordPress met « margin-bottom: auto » aux galeries non recadrées, ce qui aligne en haut */
	}
	/* Hauteur de légende réservée sur 2 lignes, pour qu'une légende plus longue ne décale pas son tableau */
	.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { min-height: 3.6em; box-sizing: content-box; }
	/* Tableau sans légende : même espace réservé sous l'image */
	.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(:has(figcaption)) { padding-bottom: 3.78em; }
}
@media (max-width: 600px) {
	/* Sur téléphone : un tableau par ligne, sur toute la largeur */
	.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: 100% !important; }
}
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image img {
	transition: transform .4s ease, box-shadow .4s ease;
}
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
	transform: scale(1.02);
	box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
/* Légendes (titre, technique, dimensions) sous l'image plutôt que par-dessus */
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static;
	background: none;
	color: inherit;
	text-shadow: none;
	padding: .6em 0 0;
	font-size: .9em;
	text-align: center;
	max-height: none;
	overflow: visible;
}
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption::before { display: none; }
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image {
	flex-direction: column;
}

/* ---------- Accueil : biographie ---------- */
.sonia-bio {
	max-width: 760px;
	margin: 0 auto 4em;
	font-size: 1.15em;
	line-height: 1.8;
	text-align: center;
}
.sonia-bio h2 { margin-bottom: .8em; }

/* ---------- Grille des séries (shortcode [sonia_series]) ---------- */
.sonia-series {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 2em;
	margin: 2em 0 4em;
}
.sonia-serie {
	display: block;
	text-decoration: none !important;
	color: inherit;
}
.sonia-serie-img {
	display: block;
	aspect-ratio: 4 / 3;
	background: #e9e6e1 center / cover no-repeat;
	overflow: hidden;
	transition: box-shadow .4s ease;
}
.sonia-serie-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; display: block; }
.sonia-serie:hover .sonia-serie-img img { transform: scale(1.04); }
.sonia-serie:hover .sonia-serie-img { box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.sonia-serie-title {
	display: block;
	margin-top: .8em;
	font-size: 1.1em;
	letter-spacing: .03em;
}
.sonia-serie-dates { display: block; opacity: .65; font-size: .9em; }

/* ---------- Pied de page épuré ---------- */
#footer-bottom { display: none; }
#footer #site-copyright { text-align: center; width: 100%; }

/* Pas de navigation « article précédent / suivant » (inutile pour l'article Expositions) */
.single #nav-below { display: none; }

/* ---------- Diaporama de l'accueil (fondu enchaîné) ---------- */
.sonia-slide {
	position: absolute;
	top: 0; left: 0; right: 0; bottom: 0;
	background: center / cover no-repeat;
	opacity: 0;
	transition: opacity 2.5s ease-in-out;
}
.sonia-slide.is-active { opacity: 1; }

/* ---------- Autres pages : image d'en-tête réduite à un bandeau ---------- */
body:not(.home) #header-image-main,
body:not(.home) #masthead #header-image-main-inside,
body:not(.home) #header-image-main div.header-image,
body:not(.home) #header-image-main img.header-image {
	height: 35vh !important;
	min-height: 260px;
	max-height: 380px;
}
body:not(.home) #header-image-main img.header-image { object-fit: cover; width: 100%; }
body:not(.home) #header-image-main .meta-arrow { display: none; }
body:not(.home) #header-image-main-inside { overflow: hidden; }
body:not(.home) #header-page-title { height: 100%; }

/* ---------- Liste des expositions (toute liste d'un article de la catégorie Expositions) ----------
   Chaque ligne : la date en gras au début, puis le texte. La date se place dans la colonne de gauche. */
.category-expositions .entry-content ul { list-style: none; margin: 0 auto; padding: 0; max-width: 900px; }
.category-expositions .entry-content ul li {
	position: relative;
	padding: 1em 0 1em 12em;
	border-bottom: 1px solid #eee;
	line-height: 1.6;
}
.category-expositions .entry-content ul li::before { display: none; }
.category-expositions .entry-content ul li > strong:first-child {
	position: absolute;
	left: 0;
	top: 1em;
	width: 11em;
	font-weight: 400;
	opacity: .7;
}
@media (max-width: 640px) {
	.category-expositions .entry-content ul li { padding-left: 0; }
	.category-expositions .entry-content ul li > strong:first-child { position: static; display: block; width: auto; }
}

/* ---------- Menu : le bouton « 3 barres » ne sert que sur mobile (le menu principal y est masqué) ---------- */
@media (min-width: 641px) {
	body:not(.mobile-ios) .menu-burger { display: none; }
}

/* Galeries : tableaux jamais recadrés, même si l'option « Recadrer les images » est cochée */
.entry-content .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
	object-fit: contain;
	height: auto;
}

/* ---------- Légende dans la vue agrandie ---------- */
.wp-lightbox-overlay .sonia-lightbox-caption {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2000003; /* au-dessus du fond et de l'image de la visionneuse */
	padding: .8em 1em 1em;
	text-align: center;
	font-size: .95em;
	color: #333;
	background: rgba(255,255,255,.85);
	pointer-events: none;
}
.wp-lightbox-overlay:not(.active) .sonia-lightbox-caption { opacity: 0; }

/* ---------- Pied de page : lien « Mentions légales » discret ---------- */
#site-copyright { font-size: .85em; opacity: .75; }
#site-copyright .sonia-sep { margin: 0 .4em; }
#site-copyright a.sonia-legal { color: inherit; text-decoration: none; }
#site-copyright a.sonia-legal:hover { text-decoration: underline; }

/* ---------- Formulaire de contact ---------- */
.sonia-contact { max-width: 720px; margin: 0 auto 3em; }
.sonia-contact form { margin: 0; }
.sonia-contact__ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5em; }
.sonia-contact__champ { margin: 0 0 1.4em; }
.sonia-contact__champ label {
	display: block;
	margin-bottom: .45em;
	font-size: .8em;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #555;
}
.sonia-contact__champ label span { color: #b0894a; }
.sonia-contact input[type="text"],
.sonia-contact input[type="email"],
.sonia-contact select,
.sonia-contact textarea {
	width: 100%;
	box-sizing: border-box;
	padding: .85em 1em;
	border: 1px solid #ddd;
	border-radius: 0;
	background: #fff;
	color: #222;
	font: inherit;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.sonia-contact textarea { resize: vertical; min-height: 10em; }
.sonia-contact input:focus,
.sonia-contact select:focus,
.sonia-contact textarea:focus { outline: none; border-color: #162521; box-shadow: 0 0 0 3px rgba(22,37,33,.08); background: #fff; color: #222; }
.sonia-contact [aria-invalid="true"] { border-color: #b3402e; }
.sonia-contact__accord { display: flex; gap: .8em; align-items: flex-start; font-size: .85em; line-height: 1.5; color: #666; margin: 0 0 1.8em; }
.sonia-contact__accord input { margin-top: .3em; flex: none; width: 1.1em; height: 1.1em; }
.sonia-contact__envoi { display: flex; align-items: center; gap: 1.5em; flex-wrap: wrap; margin: 0; }
.sonia-contact button[type="submit"] {
	padding: 1em 2.4em;
	border: 0;
	border-radius: 0;
	background: #162521;
	color: #fff;
	font-size: .85em;
	letter-spacing: .15em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .25s ease;
}
.sonia-contact button[type="submit"]:hover,
.sonia-contact button[type="submit"]:focus { background: #0F8B8D; }
.sonia-contact__requis { font-size: .8em; color: #999; }
.sonia-contact__erreurs { border-left: 3px solid #b3402e; background: #fbf1ef; padding: .8em 1.2em; margin-bottom: 2em; color: #7a2b1f; }
.sonia-contact__erreurs p { margin: .2em 0; }
.sonia-contact--merci { text-align: center; padding: 3em 1em; border: 1px solid #e6e6e6; background: #fff; }
.sonia-contact__titre { font-family: 'Playfair Display', serif; font-size: 1.6em; color: #162521; margin-bottom: .5em; }
.sonia-contact__retour { letter-spacing: .1em; text-transform: uppercase; font-size: .8em; }
.sonia-contact__piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 640px) {
	.sonia-contact__ligne { grid-template-columns: 1fr; }
}

/* ---------- Page introuvable : 404 PAINT IT BLACK ---------- */
@font-face {
	font-family: 'Anton';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(fonts/anton-latin.woff2) format('woff2');
}
.error404 #container .main,
.error404 #main { background: transparent !important; }
.sonia-404 {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4em;
	max-width: 1100px;
	margin: 5em auto; /* espace avec la bannière en haut et le pied de page en bas */
	padding: 4.5em 4em;
	background: #0b0b0b;
	color: #eee;
	box-shadow: 0 30px 70px rgba(0,0,0,.18);
}
.sonia-404__photo { flex: 0 1 440px; margin: 0; }
.sonia-404__photo img {
	display: block;
	width: 100%;
	height: auto;
	filter: grayscale(1) contrast(1.15);
	box-shadow: 0 25px 60px rgba(0,0,0,.6);
}
.sonia-404__photo figcaption { margin-top: .9em; font-size: .7em; letter-spacing: .04em; line-height: 1.5; color: #777; }
.sonia-404__photo figcaption a { color: inherit; text-decoration: underline; }
.sonia-404__texte { flex: 1 1 auto; }
.sonia-404__titre { margin: 0; font-family: 'Anton', Impact, 'Arial Narrow Bold', sans-serif; font-weight: 400; text-transform: uppercase; line-height: .9; }
.sonia-404__code {
	display: block;
	font-size: clamp(6rem, 16vw, 12rem);
	color: #fff;
	letter-spacing: .02em;
}
.sonia-404__slogan {
	display: inline-block;
	margin-top: .15em;
	padding: .12em .35em .08em;
	white-space: nowrap;
	font-size: clamp(2rem, 4.6vw, 3.8rem);
	letter-spacing: .04em;
	color: #0b0b0b;
	background: #d4241b;
	transform: rotate(-4deg);
	box-shadow: 6px 6px 0 #fff;
}
.sonia-404__info { margin: 2.2em 0 0; font-size: 1.05em; color: #aaa; }
.sonia-404__sonia {
	margin: 1.4em 0 0;
	padding-left: 1em;
	border-left: 3px solid #d4241b;
	font-family: 'Playfair Display', serif;
	font-style: italic;
	font-size: 1.2em;
	line-height: 1.45;
	color: #eee;
}
.sonia-404__sonia a { color: #fff; text-decoration: underline; text-decoration-color: #d4241b; text-underline-offset: .2em; }
.sonia-404__liens { display: flex; gap: 2.2em; margin-top: 1.4em; flex-wrap: wrap; }
.sonia-404__liens a {
	color: #fff;
	font-family: 'Anton', Impact, sans-serif;
	font-size: 1.15em;
	letter-spacing: .14em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 2px solid #d4241b;
	padding-bottom: .1em;
	transition: color .2s ease;
}
.sonia-404__liens a:hover, .sonia-404__liens a:focus { color: #d4241b; }
@media (max-width: 800px) {
	.sonia-404 { flex-direction: column; gap: 2.5em; margin: 2.5em 1em; padding: 2.5em 1.2em; text-align: center; }
	.sonia-404__sonia { border-left: 0; padding-left: 0; }
	.sonia-404__photo { flex-basis: auto; width: min(420px, 100%); }
	.sonia-404__liens { justify-content: center; }
}

/* ---------- Accueil : diaporama plus lumineux (voile sombre du thème très allégé) ---------- */
.home #header-overlay { opacity: .12 !important; }
/* L'image d'en-tête est toujours visible (le thème ne l'affiche qu'au premier défilement de la page) */
#masthead div.header-image { opacity: 1; }
.home #header-page-title .entry-title,
.home #header-page-title #site-description,
.home #header-page-title-inside { text-shadow: 0 2px 18px rgba(0,0,0,.55), 0 0 2px rgba(0,0,0,.35); }

/* ---------- Bouton « i » sur les tableaux (même style que le bouton « agrandir » de WordPress) ---------- */
.entry-content .wp-block-gallery figure.wp-block-image { position: relative; }
.entry-content .wp-block-image .sonia-info {
	position: absolute;
	top: 16px;
	left: 16px; /* le bouton « agrandir » est en haut à droite */
	z-index: 101;
	display: flex;
	flex-direction: row !important; /* les galeries WordPress mettent les liens en colonne */
	flex-grow: 0 !important;
	align-items: center;
	height: 20px;
	min-width: 20px;
	padding: 0 4px;
	box-sizing: border-box;
	border-radius: 4px;
	background-color: rgba(90, 90, 90, .25);
	-webkit-backdrop-filter: blur(16px) saturate(1.8);
	backdrop-filter: blur(16px) saturate(1.8);
	color: #fff;
	text-decoration: none !important;
	opacity: 0;
	transition: opacity .2s, background-color .2s;
}
.entry-content .wp-block-image .sonia-info svg { flex: none; display: block; }
/* Visible au survol du tableau, comme « agrandir » */
.entry-content .wp-block-image:hover .sonia-info,
.entry-content .wp-block-image .sonia-info:focus-visible { opacity: 1; }
/* Écrans tactiles (pas de survol) : toujours visible */
@media (hover: none) {
	.entry-content .wp-block-image .sonia-info { opacity: 1; }
}
/* Au survol du bouton : le libellé « Se renseigner » se déploie */
.entry-content .wp-block-image .sonia-info__texte {
	display: block;
	flex: none;
	height: 20px;
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: 11px;
	line-height: 20px;
	letter-spacing: .04em;
	color: #fff;
	transition: max-width .25s ease, margin .25s ease;
}
.entry-content .wp-block-image .sonia-info:hover,
.entry-content .wp-block-image .sonia-info:focus-visible { background-color: rgba(40, 40, 40, .55); }
.entry-content .wp-block-image .sonia-info:hover .sonia-info__texte,
.entry-content .wp-block-image .sonia-info:focus-visible .sonia-info__texte { max-width: 10em; margin: 0 2px 0 6px; }

/* Page Contact : rappel du tableau concerné */
.sonia-contact__oeuvre {
	display: flex;
	align-items: center;
	gap: 1.4em;
	margin: 0 0 2em;
	padding: 1em;
	border: 1px solid #e6e6e6;
	background: #fff;
}
.sonia-contact__oeuvre img { flex: none; width: 110px; height: 110px; object-fit: cover; }
.sonia-contact__oeuvre p { margin: 0; }
.sonia-contact__oeuvre-label { font-size: .75em; letter-spacing: .12em; text-transform: uppercase; color: #999; }
.sonia-contact__oeuvre-titre { margin: .3em 0 !important; font-family: 'Playfair Display', serif; font-size: 1.15em; color: #162521; }
.sonia-contact__oeuvre-serie { font-size: .85em; color: #777; }
