/*
Theme Name: Atelier Moreau
Author: M. Moreau
Description: Thème sur mesure pour l'Atelier Moreau : colonne vidéo verticale, collections d'illustrations et prints en édition limitée.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: atelier-moreau
*/

/* ---------- Polices (hébergées dans le thème) ---------- */
@font-face {
	font-family: "AM Playfair";
	src: url("assets/fonts/playfair-display-900.woff2") format("woff2");
	font-weight: 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "AM Playfair";
	src: url("assets/fonts/playfair-display-900-ext.woff2") format("woff2");
	font-weight: 900;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "AM Kaushan";
	src: url("assets/fonts/kaushan-script-400.woff2") format("woff2");
	font-display: swap;
}
@font-face {
	font-family: "AM Garamond";
	src: url("assets/fonts/eb-garamond-400.woff2") format("woff2");
	font-display: swap;
}
@font-face {
	font-family: "AM Garamond";
	src: url("assets/fonts/eb-garamond-400-ext.woff2") format("woff2");
	font-display: swap;
	unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "AM Chewy";
	src: url("assets/fonts/chewy-400.woff2") format("woff2");
	font-display: swap;
}
@font-face {
	font-family: "AM Mono";
	src: url("assets/fonts/dejavu-sans-mono.woff2") format("woff2");
	font-display: swap;
}

/* ---------- Variables ---------- */
:root {
	--am-rose: #faa8be;
	--am-rouge: #c55748;
	--am-sombre: #484848;
	--am-blanc: #ffffff;
	--am-noir: #111111;
	--am-titre: "AM Playfair", "Playfair Display", Georgia, serif;
	--am-mono: Menlo, "AM Mono", "DejaVu Sans Mono", monospace;
	--am-colonne: min(56.25vh, 38vw); /* 9:16 sur toute la hauteur */
	--am-marge: clamp(16px, 2.2vw, 30px);
}

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

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

body {
	margin: 0;
	background: var(--am-blanc);
	color: var(--am-noir);
	font-family: var(--am-mono);
	font-size: 13px;
	line-height: 1.5;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--am-rouge); }
:focus-visible { outline: 2px solid var(--am-rouge); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ---------- Mise en page : colonne vidéo + contenu ---------- */
.am-site {
	display: grid;
	grid-template-columns: var(--am-colonne) minmax(0, 1fr);
	min-height: 100vh;
}

.am-videos {
	position: sticky;
	top: 0;
	height: 100vh;
	background: var(--am-rose);
	overflow: hidden;
}
.admin-bar .am-videos { top: 32px; height: calc(100vh - 32px); }

.am-videos video {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

.am-contenu { min-width: 0; display: flex; flex-direction: column; }
.am-main { flex: 1; }

/* ---------- En-tête ---------- */
.am-entete {
	display: flex;
	align-items: flex-end;
	gap: 26px;
	padding: 30px var(--am-marge) 14px;
}

.am-logo img,
.am-logo .custom-logo {
	width: 90px;
	height: auto;
}

.am-titre-site {
	margin: 0 0 6px;
	font-family: var(--am-titre);
	font-weight: 900;
	font-size: clamp(30px, 4vw, 50px);
	line-height: 1;
	letter-spacing: -0.01em;
}

.am-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
}
.am-menu a { font-size: 13px; }
/* Le mot devient rouge dès le clic, puis reste rouge sur la page ouverte. */
.am-menu a:active,
.am-menu .current-menu-item > a,
.am-menu .current_page_item > a,
.am-menu .current-menu-ancestor > a,
.am-menu .current_page_parent > a { color: var(--am-rouge); }

/* ---------- Accueil ---------- */
.am-accueil {
	padding: 0 64px 24px var(--am-marge);
}
.am-accueil img {
	width: 100%;
	max-height: calc(100vh - 175px);
	object-fit: cover;
}

/* ---------- Collections (page Illustrations) ---------- */
.am-collection {
	padding: 30px var(--am-marge) 34px;
}
.am-collection--rose {
	background: #fbd5de; /* rose doux, distinct de la colonne vidéo */
	color: var(--am-noir);
}
.am-collection--sombre {
	background: var(--am-sombre);
	color: var(--am-blanc);
}

.am-collection__titre {
	margin: 0 0 36px;
	font-family: var(--am-titre);
	font-weight: 900;
	font-size: 20px;
	line-height: 1.2;
}
.am-collection__nom { font-size: 1.15em; }
.am-police-kaushan .am-collection__nom {
	font-family: "AM Kaushan", "Kaushan Script", cursive;
	font-weight: 400;
	font-size: 1.3em;
}
.am-police-garamond .am-collection__nom {
	font-family: "AM Garamond", "EB Garamond", Garamond, serif;
	font-weight: 400;
	font-size: 1.4em;
	letter-spacing: 0.01em;
}
.am-police-chewy .am-collection__nom {
	font-family: "AM Chewy", "Chewy", cursive;
	font-weight: 400;
	font-size: 1.3em;
}

.am-grille {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 176px));
	gap: 28px;
}

.am-oeuvre { margin: 0; }
.am-oeuvre img {
	width: 100%;
	aspect-ratio: 176 / 250;
	object-fit: cover;
	background: rgba(0, 0, 0, 0.06);
}
.am-oeuvre figcaption {
	margin-top: 20px;
	text-align: center;
	font-size: 12px;
	line-height: 1.3;
}

/* ---------- Limité print ---------- */
.am-prints { padding: 30px 54px 60px var(--am-marge); }

.am-prints__titre {
	margin: 0 0 26px;
	font-family: var(--am-titre);
	font-weight: 900;
	font-size: 20px;
}

.am-prints__grille {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr)); /* deux prints de même taille */
	gap: 0 40px;
	align-items: start;
}

/* Le dessin s'affiche en entier, dans sa forme d'origine, sans dépasser l'écran en hauteur. */
.am-print img {
	width: 100%;
	height: auto;
	max-height: 80vh;
	object-fit: contain;
	object-position: left top;
}
.am-print figcaption { margin-top: 8px; font-size: 12px; }
.am-print .price { margin-left: 8px; color: var(--am-rouge); }

.am-prints__texte { max-width: 485px; margin: 0 0 34px; }
.am-prints__texte h2,
.am-prints__texte h3 {
	margin: 0 0 18px;
	font-family: var(--am-titre);
	font-weight: 900;
	font-size: 15px;
}
.am-prints__texte p { margin: 0 0 1em; font-size: 12px; line-height: 1.25; }

.am-vide {
	padding: 24px;
	border: 1px dashed currentColor;
	font-size: 12px;
}

/* ---------- L'artiste ---------- */
.am-artiste { padding: 30px 64px 40px calc(var(--am-marge) + 14px); max-width: 780px; }

.am-artiste__nom {
	margin: 0 0 22px;
	font-family: var(--am-titre);
	font-weight: 900;
	font-size: 20px;
}

.am-artiste__texte p {
	margin: 0 0 1.2em;
	font-size: 12px;
	line-height: 1.2;
}

/* Images : en galerie, en colonnes ou à la suite, elles se placent côte à côte. */
.am-artiste__texte .wp-block-gallery,
.am-artiste__texte .wp-block-columns,
.am-artiste__images {
	display: flex;
	flex-wrap: nowrap;
	gap: 32px;
	max-width: 640px;
	margin: 34px 0 0;
	padding: 0;
	list-style: none;
}
.am-artiste__texte .wp-block-gallery > figure,
.am-artiste__texte .wp-block-columns > .wp-block-column {
	flex: 0 1 auto;
	margin: 0;
	width: auto !important;
}
.am-artiste__texte figure { margin: 0; }
/* Photo entière, jamais recadrée : même hauteur, largeur selon la photo. */
.am-artiste__texte .wp-block-gallery img,
.am-artiste__texte img {
	width: auto !important;
	max-width: 100%;
	height: 300px !important;
	object-fit: contain !important;
}
.am-artiste__texte figcaption { font-size: 11px; margin-top: 6px; }

@media (max-width: 760px) {
	.am-artiste { padding-right: var(--am-marge); padding-left: var(--am-marge); }
	.am-artiste__texte .wp-block-gallery,
	.am-artiste__texte .wp-block-columns { flex-direction: column; gap: 20px; }
	.am-artiste__texte .wp-block-gallery,
	.am-artiste__texte .wp-block-columns { max-width: 100%; }
	.am-artiste__texte .wp-block-gallery img,
	.am-artiste__texte img { height: auto !important; max-height: none; }
}

/* ---------- Prix sous les illustrations en vente ---------- */
.am-oeuvre__prix { display: block; margin-top: 4px; color: var(--am-rouge); }
.am-collection--sombre .am-oeuvre__prix { color: var(--am-rose); }
.am-oeuvre__prix del { opacity: 0.6; margin-right: 4px; }
.am-oeuvre__prix ins { text-decoration: none; }

/* ---------- Boutique WooCommerce (fiche produit, panier…) ---------- */
.am-boutique { padding: 30px 54px 60px var(--am-marge); font-size: 13px; }

.am-boutique .woocommerce-breadcrumb { font-size: 11px; margin-bottom: 24px; }

.am-boutique h1,
.am-boutique h2,
.am-boutique .product_title {
	font-family: var(--am-titre);
	font-weight: 900;
}
.am-boutique .product_title { font-size: 26px; line-height: 1.15; margin: 0 0 12px; }

.woocommerce .am-boutique div.product p.price,
.woocommerce .am-boutique div.product span.price,
.am-boutique .price { color: var(--am-rouge); font-size: 16px; }

/* Photos à gauche, infos d'achat à droite. */
.woocommerce .am-boutique div.product div.images { width: 54%; margin-bottom: 30px; }
.woocommerce .am-boutique div.product div.summary { width: 40%; }
.woocommerce .am-boutique div.product div.images .flex-control-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}
.woocommerce .am-boutique div.product div.images .flex-control-thumbs li {
	width: 72px;
	float: none;
}
.woocommerce .am-boutique div.product div.images .flex-control-thumbs img {
	aspect-ratio: 1;
	object-fit: cover;
	opacity: 0.55;
}
.woocommerce .am-boutique div.product div.images .flex-control-thumbs img.flex-active,
.woocommerce .am-boutique div.product div.images .flex-control-thumbs img:hover { opacity: 1; }

/* Boutons dans les couleurs du site. */
.woocommerce .am-boutique a.button,
.woocommerce .am-boutique button.button,
.woocommerce .am-boutique input.button,
.woocommerce .am-boutique .button.alt,
.woocommerce .am-boutique button.single_add_to_cart_button {
	background: var(--am-rouge);
	color: var(--am-blanc);
	border-radius: 0;
	font-family: var(--am-mono);
	font-weight: 400;
	padding: 12px 22px;
}
.woocommerce .am-boutique a.button:hover,
.woocommerce .am-boutique button.button:hover,
.woocommerce .am-boutique .button.alt:hover {
	background: var(--am-noir);
	color: var(--am-blanc);
}

.woocommerce .am-boutique div.product .woocommerce-tabs ul.tabs li { border-radius: 0; }
.woocommerce .am-boutique div.product .woocommerce-tabs ul.tabs li a { font-weight: 400; }
.am-boutique .related.products > h2,
.am-boutique .upsells > h2 { font-size: 20px; }

@media (max-width: 760px) {
	.am-boutique { padding-right: var(--am-marge); }
	.woocommerce .am-boutique div.product div.images,
	.woocommerce .am-boutique div.product div.summary { width: 100%; float: none; }
}

/* ---------- Pages simples ---------- */
.am-page { padding: 30px 64px 60px var(--am-marge); max-width: 900px; }
.am-page h1, .am-page h2 {
	font-family: var(--am-titre);
	font-weight: 900;
}
.am-page h1 { font-size: 26px; margin-top: 0; }

/* ---------- Pied de page ---------- */
.am-pied {
	background: var(--am-sombre);
	color: var(--am-blanc);
	min-height: 360px;
	padding: 48px var(--am-marge);
	font-size: 12px;
}

/* ---------- Tablettes ---------- */
@media (max-width: 1100px) {
	.am-grille { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
	.am-prints__grille { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Téléphones : la vidéo passe au-dessus ---------- */
@media (max-width: 760px) {
	.am-site { display: flex; flex-direction: column; }
	.am-contenu { display: contents; }
	.am-entete { order: 1; }
	.am-videos { order: 2; }
	.am-main { order: 3; }
	.am-pied { order: 4; }
	.am-videos,
	.admin-bar .am-videos {
		position: relative;
		top: 0;
		width: min(100%, 360px);
		height: auto;
		aspect-ratio: 9 / 16;
		margin: 0 auto 24px;
	}
	.am-entete { flex-wrap: wrap; gap: 14px; padding-top: 20px; }
	.am-logo img, .am-logo .custom-logo { width: 64px; }
	.am-accueil, .am-prints, .am-page { padding-right: var(--am-marge); }
	.am-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; }
}

/* Lien « Modifier » visible seulement par l'administratrice connectée. */
.am-modifier {
	display: block;
	margin-top: 6px;
	font-size: 10px;
	opacity: 0.6;
	text-decoration: underline;
}
.am-modifier:hover { opacity: 1; }

/* ---------- Contact ---------- */
.am-contact { padding: 30px 64px 60px calc(var(--am-marge) + 14px); max-width: 820px; }
.am-contact__titre { margin: 0 0 18px; font-family: var(--am-titre); font-weight: 900; font-size: 20px; }
.am-contact__intro p { font-size: 12px; line-height: 1.3; margin: 0 0 1em; }
.am-contact__question { margin: 28px 0 10px; font-size: 12px; }

.am-onglets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.am-onglet {
	font: inherit;
	font-size: 12px;
	padding: 10px 14px;
	background: var(--am-blanc);
	color: var(--am-noir);
	border: 1px solid var(--am-noir);
	cursor: pointer;
	text-align: left;
}
.am-onglet:hover { border-color: var(--am-rouge); color: var(--am-rouge); }
.am-onglet[aria-selected="true"] { background: var(--am-rouge); border-color: var(--am-rouge); color: var(--am-blanc); }

.am-form p { margin: 0 0 16px; }
.am-form__grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.am-form__large { grid-column: 1 / -1; }
.am-form label { display: block; margin-bottom: 5px; font-size: 12px; }
.am-form input[type="text"],
.am-form input[type="email"],
.am-form input[type="url"],
.am-form input[type="date"],
.am-form input[type="file"],
.am-form select,
.am-form textarea {
	width: 100%;
	font: inherit;
	font-size: 13px;
	padding: 9px 10px;
	border: 1px solid #b9b9b9;
	border-radius: 0;
	background: var(--am-blanc);
	color: var(--am-noir);
}
.am-form input[type="file"] { padding: 7px; }
.am-form textarea { resize: vertical; min-height: 130px; }
.am-form input:focus,
.am-form select:focus,
.am-form textarea:focus { border-color: var(--am-rouge); outline: 2px solid var(--am-rouge); outline-offset: 0; }

.am-form__accord { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.am-form__accord input { margin-top: 2px; accent-color: var(--am-rouge); }
.am-form__accord label { flex: 1; margin: 0; font-size: 11px; line-height: 1.4; }
.am-form__accord .am-form__erreur { flex-basis: 100%; }

.am-form__bouton {
	font: inherit;
	font-size: 13px;
	padding: 12px 24px;
	border: 0;
	background: var(--am-rouge);
	color: var(--am-blanc);
	cursor: pointer;
}
.am-form__bouton:hover { background: var(--am-noir); }

.am-form__erreur { display: block; margin-top: 5px; font-size: 11px; color: #b3261e; }
.am-form__piege { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.am-form__annonce { padding: 12px 14px; font-size: 12px; margin: 0 0 22px; }
.am-form__annonce--ok { background: #e7f3e7; color: #1e5b23; }
.am-form__annonce--erreur { background: #fbe9e7; color: #8c1d18; }

@media (max-width: 760px) {
	.am-contact { padding-left: var(--am-marge); padding-right: var(--am-marge); }
	.am-form__grille { grid-template-columns: 1fr; }
}

/* ---------- Pied de page ---------- */
.am-pied__texte { margin: 0 0 24px; font-size: 12px; }
.am-pied__liens ul { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.am-pied__liens a { font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.am-pied__liens a:hover { color: var(--am-rose); }
.am-pied__copyright { margin: 0; font-size: 11px; opacity: 0.7; }

/* Accueil : l'illustration mène au portfolio. */
.am-accueil__lien { display: block; }
.am-accueil__lien img { transition: opacity 0.2s ease; }
.am-accueil__lien:hover img,
.am-accueil__lien:focus-visible img { opacity: 0.92; }

/* Bouton « Explorer le bureau de l'artiste » au-dessus de l'illustration d'accueil. */
.am-accueil__appel { margin: 0 0 14px; }
.am-bouton {
	display: inline-block;
	padding: 0;
	background: none;
	color: var(--am-rouge);
	font-family: var(--am-mono);
	font-size: 13px;
	text-decoration: none;
}
.am-bouton:hover,
.am-bouton:focus-visible { color: var(--am-noir); text-decoration: underline; text-underline-offset: 3px; }

/* Icône panier en haut à droite, avec pastille du nombre d'articles. */
.am-entete { position: relative; }
.am-panier {
	position: absolute;
	top: 22px;
	right: var(--am-marge);
	display: inline-flex;
	color: var(--am-noir);
	padding: 6px;
}
.am-panier:hover,
.am-panier:focus-visible,
.am-panier.est-actif { color: var(--am-rouge); }
.am-panier__nombre {
	position: absolute;
	top: 0;
	right: -2px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--am-rouge);
	color: var(--am-blanc);
	font-size: 10px;
	line-height: 17px;
	text-align: center;
}
