/*
THEME NAME: Barbara Soia
THEME URI: https://www.barbarasoia.com/
DESCRIPTION: un theme pour le site de Barbara Soïa.
AUTHOR: Sariha Chabert
AUTHOR URI: https://www.sariha.com/
VERSION: 2.0
*/

/* ------------------------------------------------------------------
   couleurs : neutre, titre bleu outremer, accents orange foncé
   ------------------------------------------------------------------ */
:root {
	--fond: #f3f2ef;
	--texte: #2a2a2a;
	--discret: #6e6c68;
	--filet: #d8d5cf;
	--outremer: #1f2f9c;
	--orange: #b4470f;
	--marge: clamp(16px, 4vw, 48px);
	--lecture: 40rem;
}

/* reset léger */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

html {
	-webkit-text-size-adjust: 100%;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--fond);
	color: var(--texte);
	font: 300 16px/1.65 "Inter", system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

a {
	color: inherit;
	text-decoration-color: var(--filet);
	text-underline-offset: 3px;
	transition: color .2s, text-decoration-color .2s;
}
a:hover,
a:focus-visible {
	color: var(--orange);
	text-decoration-color: currentColor;
}
:focus-visible {
	outline: 1px solid var(--orange);
	outline-offset: 3px;
}

strong, b { font-weight: 500; }
em, i { font-style: italic; }

/* ------------------------------------------------------------------
   en-tête : titre en haut à gauche, menu à droite
   ------------------------------------------------------------------ */
#site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	padding: 28px var(--marge) 22px;
	background: var(--fond);
}

#site-title {
	font-weight: 100;
	font-size: clamp(30px, 3.4vw, 44px);
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--outremer);
	text-decoration: none;
	white-space: nowrap;
}
#site-title:hover {
	color: var(--outremer);
	opacity: .8;
}

#site-nav .menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px 28px;
}

#site-nav a {
	position: relative;
	display: inline-block;
	padding: 4px 0;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: .08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--texte);
}

/* petit trait orange sous l'entrée active / survolée */
#site-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: var(--orange);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s;
}
#site-nav a:hover::after,
#site-nav .current-menu-item > a::after,
#site-nav .current-menu-ancestor > a::after {
	transform: scaleX(1);
}
#site-nav .current-menu-item > a {
	color: var(--orange);
}

#site-nav .sub-menu {
	display: none;
}

/* burger : seulement sur mobile */
#menu-toggle {
	display: none;
}

/* ------------------------------------------------------------------
   contenu
   ------------------------------------------------------------------ */
#main {
	flex: 1;
	width: 100%;
	padding: 24px var(--marge) 64px;
}

#post-title {
	max-width: var(--lecture);
	margin: 16px auto 40px;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-weight: 400;
	font-size: clamp(30px, 4vw, 42px);
	line-height: 1.15;
}

/* l'accueil est la galerie : pas de titre visible */
.home #post-title {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

#post-content {
	max-width: var(--lecture);
	margin: 0 auto;
}

#post-content > * + * {
	margin-top: 1em;
}

#post-content h2 {
	margin-top: 3.2rem;
	margin-bottom: 1.2rem;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--discret);
}
#post-content h2:first-child {
	margin-top: 0;
}
#post-content h3 {
	margin-top: 2rem;
	font-size: 15px;
	font-weight: 500;
}

/* citation d'ouverture et textes critiques */
#post-content .chapeau {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: clamp(21px, 2.2vw, 25px);
	line-height: 1.45;
	font-style: italic;
}

#post-content blockquote {
	padding-left: 20px;
	border-left: 1px solid var(--orange);
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 20px;
	line-height: 1.5;
}
#post-content blockquote p + p {
	margin-top: .6em;
}
#post-content blockquote cite,
#post-content .signature {
	display: block;
	margin-top: 1em;
	font-family: "Inter", sans-serif;
	font-size: 13px;
	font-style: normal;
	letter-spacing: .04em;
	color: var(--discret);
}

#post-content hr,
#post-content .wp-block-separator {
	width: 48px;
	margin: 3.5rem auto;
	border: 0;
	border-top: 1px solid var(--orange);
}

/* listes chronologiques (parcours, expositions) */
#post-content .chapeau + * {
	margin-top: 1.6em;
}

/* citation de l'artiste en ouverture de la page Textes */
#post-content blockquote.chapeau-citation {
	margin-bottom: 2.5rem;
	padding-left: 0;
	border: 0;
	font-size: clamp(22px, 2.4vw, 27px);
	line-height: 1.45;
	font-style: italic;
}

/* portrait en tête du parcours */
#post-content .portrait {
	float: right;
	width: 220px;
	margin: 6px 0 24px 36px;
}
#post-content .portrait + * {
	margin-top: 0;
}
#post-content h2 {
	clear: both;
}
#post-content .portrait img {
	filter: grayscale(.15);
}

#post-content .chrono {
	display: grid;
	grid-template-columns: 6rem 1fr;
	gap: 6px 20px;
	font-size: 15px;
}
#post-content .chrono dt {
	font-weight: 500;
	color: var(--orange);
	font-variant-numeric: tabular-nums;
}
#post-content .chrono dd {
	margin: 0;
}
#post-content .chrono dd + dd {
	grid-column: 2;
}

#post-content ul.liens li {
	padding: 14px 0;
	border-bottom: 1px solid var(--filet);
}
#post-content ul.liens li:first-child {
	border-top: 1px solid var(--filet);
}
#post-content ul.liens span {
	display: block;
	font-size: 14px;
	color: var(--discret);
}

#post-content .wp-block-embed iframe,
#post-content iframe {
	max-width: 100%;
}
#post-content .wp-block-embed__wrapper {
	position: relative;
	aspect-ratio: 16 / 9;
}
#post-content .wp-block-embed__wrapper iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* formulaire de contact (Contact Form 7) */
#post-content input:not([type=submit]):not([type=checkbox]),
#post-content textarea {
	width: 100%;
	margin-top: 4px;
	padding: 10px 12px;
	border: 1px solid var(--filet);
	border-radius: 0;
	background: #fff;
	font: inherit;
	color: inherit;
}
#post-content input:focus,
#post-content textarea:focus {
	outline: none;
	border-color: var(--orange);
}
#post-content input[type=submit] {
	padding: 10px 28px;
	border: 1px solid var(--orange);
	border-radius: 0;
	background: none;
	font: 400 13px "Inter", sans-serif;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--orange);
	cursor: pointer;
	transition: background .2s, color .2s;
}
#post-content input[type=submit]:hover {
	background: var(--orange);
	color: #fff;
}

/* ------------------------------------------------------------------
   galerie : mosaïque sur toute la largeur, sans recadrage
   ------------------------------------------------------------------ */
#post-content:has(.wp-block-gallery),
.home #post-content {
	max-width: 1600px;
}

#post-content .wp-block-gallery.has-nested-images {
	display: block;
	columns: 3 280px;
	column-gap: 28px;
}

#post-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
	display: block;
	width: 100% !important;
	margin: 0 0 32px;
	break-inside: avoid;
}

/* pas de recadrage : sinon le zoom reprend les proportions de la vignette
   et affiche certaines images coupées ou toutes petites */
#post-content .wp-block-gallery.has-nested-images figure.wp-block-image img {
	width: 100%;
	height: auto;
	object-fit: contain;
	transition: opacity .3s;
}
#post-content .wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
	opacity: .88;
}

/* légende sous l'image, et non posée dessus */
#post-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) figcaption {
	position: static;
	max-height: none;
	margin: 10px 0 0;
	padding: 0;
	background: none;
	font-size: 13px;
	line-height: 1.4;
	text-align: left;
	color: var(--discret);
	text-shadow: none;
	transition: color .2s;
}
#post-content .wp-block-gallery.has-nested-images figure.wp-block-image:hover figcaption {
	color: var(--orange);
}
#post-content .wp-block-gallery.has-nested-images figure.wp-block-image::before {
	content: none;
}

/* image isolée en tête de la galerie */
.home #post-content > .wp-block-image {
	display: block;
	max-width: 100%;
	margin: 0 auto 32px;
}
.home #post-content > .wp-block-image img {
	width: auto !important;
	height: auto !important;
	max-height: 75vh;
	margin: 0 auto;
}

/* images insérées dans le texte (anciennes pages) */
#post-content .wp-caption {
	max-width: 100%;
}
img.alignright { float: right; margin: 0 0 16px 24px; }
img.alignleft { float: left; margin: 0 24px 16px 0; }

/* ------------------------------------------------------------------
   zoom (lightbox native de WordPress)
   ------------------------------------------------------------------ */
.wp-lightbox-overlay .scrim {
	background-color: var(--fond) !important;
}

/* texte alt sous l'image agrandie (ajouté par lightbox.js) */
.wp-lightbox-overlay .lightbox-legende {
	position: absolute;
	top: calc(50% + var(--wp--lightbox-container-height) / 2 + 12px);
	left: 16px;
	right: 16px;
	z-index: 2000002;
	margin: 0;
	text-align: center;
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 19px;
	font-style: italic;
	line-height: 1.4;
	color: var(--texte);
	visibility: hidden;
}
.wp-lightbox-overlay.active .lightbox-legende {
	visibility: visible;
	animation: lightbox-legende 0.3s 0.3s both;
}
@keyframes lightbox-legende {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ------------------------------------------------------------------
   pied de page
   ------------------------------------------------------------------ */
#site-footer {
	padding: 24px var(--marge) 32px;
	font-size: 12px;
	letter-spacing: .04em;
	color: var(--discret);
}

/* ------------------------------------------------------------------
   mobile : titre + burger, le menu se déplie dessous
   ------------------------------------------------------------------ */
@media (max-width: 800px) {
	#site-header {
		flex-wrap: wrap;
		align-items: center;
		padding-top: 20px;
		padding-bottom: 16px;
	}

	/* burger léger en haut à droite, trois traits fins qui deviennent une croix */
	#menu-toggle {
		display: block;
		position: relative;
		width: 44px;
		height: 44px;
		margin-right: -10px;
		padding: 0;
		border: 0;
		background: none;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	#menu-toggle span,
	#menu-toggle span::before,
	#menu-toggle span::after {
		position: absolute;
		left: 11px;
		width: 22px;
		height: 1px;
		background: var(--texte);
		transition: transform 0.2s, background-color 0.2s;
	}
	#menu-toggle span {
		top: 22px;
	}
	#menu-toggle span::before,
	#menu-toggle span::after {
		content: "";
		left: 0;
	}
	#menu-toggle span::before { transform: translateY(-7px); }
	#menu-toggle span::after { transform: translateY(7px); }

	#site-header.ouvert #menu-toggle span { background-color: transparent; }
	#site-header.ouvert #menu-toggle span::before { transform: rotate(45deg); }
	#site-header.ouvert #menu-toggle span::after { transform: rotate(-45deg); }

	#site-nav {
		display: none;
		flex-basis: 100%;
	}
	#site-header.ouvert #site-nav {
		display: block;
	}

	#site-nav .menu {
		flex-direction: column;
		gap: 0;
		padding: 12px 0 8px;
	}
	#site-nav a {
		padding: 10px 0;
		font-size: 14px;
	}
	#site-nav a::after {
		bottom: 6px;
	}

	#post-title {
		margin-top: 8px;
		margin-bottom: 28px;
	}

	#post-content .wp-block-gallery.has-nested-images {
		columns: 2 140px;
		column-gap: 16px;
	}
	#post-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
		margin-bottom: 20px;
	}
	#post-content .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) figcaption {
		font-size: 12px;
	}

	#post-content .chrono {
		grid-template-columns: 4.6rem 1fr;
		gap: 4px 14px;
	}

	#post-content .portrait {
		float: none;
		width: 180px;
		margin: 0 0 24px;
	}

	img.alignright,
	img.alignleft {
		float: none;
		margin: 0 0 16px;
	}
}
