/*
Theme Name: Corinne Clarysse
Description: Thème sur mesure, sobre et sans dépendance, pour l'atelier de reliure de Corinne Clarysse.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: corinne
*/

/* Roboto, la police d'origine du site, hébergée localement. */
@font-face { font-family: Roboto; src: url("assets/fonts/roboto-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: Roboto; src: url("assets/fonts/roboto-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: Roboto; src: url("assets/fonts/roboto-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
	--ink: #222;
	--text: #555;
	--brand: #24499a;
	--brand-dark: #1a3571;
	--line: #e6e6e1;
	--band: #eaeaea;
	--page: #fff;
	--gutter: clamp(16px, 4vw, 48px);
	--font: Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
	margin: 0;
	background: var(--page);
	color: var(--text);
	font: 300 1.0625rem/1.65 var(--font);
	-webkit-font-smoothing: antialiased;
	/* Le pied de page reste en bas de la fenêtre, même sur les pages courtes. */
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100svh;
}
body.admin-bar { min-height: calc(100svh - 32px); }
.site-main { flex: 1 0 auto; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: .18em; overflow-wrap: anywhere; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, h4, h5, h6 { color: var(--ink); line-height: 1.25; font-weight: 500; }
strong, b { font-weight: 500; }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 2; background: var(--page); padding: 8px 12px; }

.wrap { max-width: 1320px; margin-inline: auto; padding-inline: var(--gutter); }

/* En-tête */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 40px; padding-block: 24px; }
.site-logo { color: var(--ink); font-size: 1.35rem; font-weight: 500; text-decoration: none; }
.custom-logo { max-height: 64px; width: auto; }
.menu-toggle { display: none; padding: 8px 0; border: 0; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; padding: 0; list-style: none; }
.site-nav a { color: var(--ink); text-decoration: none; display: inline-block; padding-block: 6px; }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--brand); box-shadow: inset 0 -1px var(--brand); }

/* Contenu */
.site-main { padding-block: clamp(32px, 5vw, 64px); overflow-x: clip; }
.page-title { margin: 0 0 32px; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.prose { max-width: 46rem; }
.prose h4 { font-size: 1.4rem; }
.prose h5 { margin: 40px 0 8px; font-size: 1.1rem; }
.prose h5 strong { font-weight: 600; }
.intro { max-width: 54rem; margin-bottom: 32px; }
/* Le H1 et le texte se lisent comme un seul paragraphe. */
.intro-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px clamp(32px, 5vw, 64px); margin-bottom: clamp(40px, 5vw, 64px); }
.home .site-main { padding-top: clamp(8px, 1.5vw, 16px); }
.intro-row .intro { flex: 1 1 28rem; margin-bottom: 0; }
.intro-photo { flex: none; width: 220px; }
@media (max-width: 781px) {
	.intro-photo { width: 160px; }
}
.intro { color: var(--ink); font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.45; }
.intro h1, .intro p { display: inline; margin: 0; color: inherit; font: inherit; }

.prose h2 { margin: 32px 0 4px; font-size: 1.05rem; }
.prose h2 + p { margin-top: 0; }
.prose h2 a { color: inherit; }

/* Page avec photo : le texte à gauche, la photo entière à droite */
.page-photo { width: 240px; margin: 0 0 24px; }
.page-photo img { width: 100%; }
.page-photo figcaption { margin-top: 6px; font-size: .8rem; }
.page-photo figcaption a { color: inherit; }
@media (min-width: 900px) {
	.has-photo { display: grid; grid-template-columns: minmax(0, 46rem) 320px; column-gap: clamp(40px, 6vw, 96px); align-items: start; justify-content: space-between; }
	.has-photo .page-title { grid-column: 1; }
	.has-photo .prose { grid-column: 1; }
	.has-photo .page-photo { grid-column: 2; grid-row: 1 / span 2; width: 100%; margin: 0; position: sticky; top: 24px; }
}

/* Ressources */
.resources h2 { margin: 56px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 1.35rem; scroll-margin-top: 16px; }
.resources h3 { margin: 24px 0 4px; font-size: 1rem; scroll-margin-top: 16px; }
.resources h2 + h3 { margin-top: 12px; }
.resources ul { margin: 0; padding-left: 1.1em; }
.resources li { margin-bottom: 3px; }
.resources .lexique { margin: 24px 0; padding: 14px 18px; background: #f3f3ef; font-size: .95rem; }
.resources .toc { margin: 24px 0 0; font-size: .95rem; }
.resources .toc ul { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0; list-style: none; }
.resources .toc li { margin: 0; }

/* Filtres par type de reliure */
.filters-toggle { display: none; }
.filters-bar { position: relative; margin-bottom: 24px; padding-block: 8px; background: var(--page); }
/* Filet sur toute la largeur de la fenêtre, coupé aux bords par .site-main. */
.filters-bar::after { content: ""; position: absolute; inset: auto -100vmax 0; border-bottom: 1px solid var(--line); }
@media (min-width: 782px) {
	.filters-bar { position: sticky; top: 0; z-index: 1; }
}
.filters { display: flex; flex-wrap: wrap; gap: 2px 20px; margin: 0; padding: 0; list-style: none; font-size: .95rem; }
.filters a { display: inline-block; padding-block: 6px; color: var(--text); text-decoration: none; }
.filters a:hover, .filters a[aria-current] { color: var(--brand); box-shadow: inset 0 -1px var(--brand); }

/* Grille des projets */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: clamp(16px, 2.5vw, 32px); margin: 0; padding: 0; list-style: none; }
.project a { display: block; color: var(--ink); text-decoration: none; }
.project-media { aspect-ratio: 4 / 3; overflow: hidden; background: #f3f3ef; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.project a:hover img { transform: scale(1.03); }
.project-title { margin: 10px 0 0; font-size: 1rem; font-weight: 500; }
.project a:hover .project-title { color: var(--brand); }
.project-cats { margin: 0; font-size: .875rem; color: var(--text); }

/* Page projet */
.project-page .wp-block-columns { gap: clamp(24px, 4vw, 56px); align-items: flex-start; }
@media (min-width: 782px) {
	.project-page .wp-block-column:first-child { position: sticky; top: 24px; align-self: flex-start; }
}
.project-page .wp-block-column .page-title { margin: 0 0 16px; font-size: clamp(1.4rem, 2.2vw, 1.75rem); }
.project-page .wp-block-image { margin: 0 0 16px; }
.project-page .wp-block-image img { width: 100%; }
.project-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px 24px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.project-nav a { color: var(--ink); text-decoration: none; }
.project-nav a:hover { color: var(--brand); }
.project-nav small { display: block; color: var(--text); font-size: .85rem; }
.project-nav .prev { grid-column: 1; }
.project-nav .all { grid-column: 2; font-size: .95rem; }
.project-nav .all a { color: var(--brand); }
.project-nav .next { grid-column: 3; text-align: right; }
@media (max-width: 781px) {
	.project-nav { grid-template-columns: 1fr 1fr; align-items: start; }
	.project-nav .all { grid-column: 1 / -1; grid-row: 1; text-align: center; }
	.project-nav .prev { grid-column: 1; grid-row: 2; }
	.project-nav .next { grid-column: 2; grid-row: 2; }
}

/* Pied de page */
.site-footer { padding-block: 0 32px; font-size: .875rem; }
.site-footer p { margin-block: 0; }
.site-footer a { color: inherit; }

/* Mobile */
@media (max-width: 781px) {
	/* En-tête et menu */
	.site-header .wrap { padding-block: 14px; }
	.custom-logo { max-height: 48px; }
	.js .menu-toggle { display: block; min-height: 44px; padding: 8px 0 8px 16px; font-size: 1.0625rem; }
	.js .site-nav { display: none; flex-basis: 100%; }
	.js .site-nav.is-open { display: block; }
	.site-header .wrap { row-gap: 8px; }
	.site-nav ul { flex-direction: column; gap: 0; }
	.site-nav li { border-top: 1px solid var(--line); }
	.site-nav a { display: block; padding-block: 13px; font-size: 1.25rem; }
	.site-nav a:hover, .site-nav .current-menu-item > a { box-shadow: none; }

	/* Accueil */
	.home .site-main { padding-top: 16px; }
	.intro { font-size: 1.1rem; line-height: 1.5; }
	.intro-row { margin-bottom: 24px; }

	/* Filtres : un bouton qui déplie la liste complète, sans JavaScript la liste reste visible */
	.filters-bar { position: sticky; top: 0; z-index: 1; padding-block: 0; }
	.js .filters-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 1rem; cursor: pointer; }
	.filters-toggle strong { color: var(--brand); font-weight: 400; }
	.filters-chevron { width: 8px; height: 8px; margin: -4px 4px 0; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: rotate(45deg); transition: transform .15s ease; }
	.filters-toggle[aria-expanded="true"] .filters-chevron { margin-top: 4px; transform: rotate(-135deg); }
	.js .filters { display: none; }
	.js .filters.is-open { display: flex; padding-bottom: 12px; }
	.filters { gap: 2px 18px; }
	.filters a { padding-block: 8px; font-size: 1rem; }
}

/* Deux colonnes de projets sur téléphone */
@media (max-width: 560px) {
	.projects { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
	.project-title { margin-top: 8px; font-size: .95rem; line-height: 1.3; }
	.project-cats { font-size: .8rem; line-height: 1.35; }
}

@media (prefers-reduced-motion: reduce) {
	.project-media img { transition: none; }
}
