/*
Theme Name: Rose Hippocampe
Theme URI: https://rosehippocampe.fr
Author: Rose Hippocampe
Description: Thème en blocs de Rose Hippocampe, marque-pages et bijoux de liseuse faits main. Couleurs, typographies et motifs issus de la charte graphique (rayures, polaroïds, papier déchiré, bandeau pinceau, chaîne dorée).
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Version: 1.1.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rose-hippocampe-blocs
*/

/* Motifs de la charte, exposés comme styles de blocs (functions.php). */

:root {
	--rh-ombre: var(--wp--preset--shadow--polaroid);
	--rh-dechire: polygon(0 3%, 6% 0, 13% 2.5%, 21% .5%, 30% 3%, 38% 1%, 47% 2.5%, 55% 0, 64% 2%, 72% .5%, 81% 3%, 89% 1%, 96% 2.5%, 100% .5%, 99% 50%, 100% 98%, 93% 100%, 85% 97.5%, 77% 99.5%, 68% 97%, 59% 99.5%, 50% 97.5%, 41% 100%, 33% 97.5%, 24% 99.5%, 16% 97%, 8% 99.5%, 0 97.5%, 1% 50%);
}

body { -webkit-font-smoothing: antialiased; }

:where(h1, h2, h3, h4) { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- Rayures (groupe) ---------- */

.is-style-rayures {
	background-color: var(--wp--preset--color--creme);
	background-image: repeating-linear-gradient(90deg, var(--wp--preset--color--rayure) 0 80px, var(--wp--preset--color--creme) 80px 160px);
}

/* ---------- Papier déchiré (groupe) ---------- */

.is-style-papier {
	position: relative;
	isolation: isolate;
	background: none !important;
}
.is-style-papier::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--blanc);
	clip-path: var(--rh-dechire);
	filter: drop-shadow(0 6px 10px rgba(74, 35, 64, .1));
}
.is-style-papier.has-lavande-background-color::before { background: var(--wp--preset--color--lavande); }
.is-style-papier.has-rose-background-color::before { background: var(--wp--preset--color--rose); }

/* ---------- Polaroïd (image) ---------- */

.wp-block-image.is-style-polaroid,
.wp-block-image.is-style-polaroid-penche,
.is-style-photo-a-venir {
	position: relative;
	padding: 14px 14px 0;
	background: var(--wp--preset--color--blanc);
	box-shadow: var(--rh-ombre);
}
.wp-block-image.is-style-polaroid img,
.wp-block-image.is-style-polaroid-penche img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}
.wp-block-image.is-style-polaroid figcaption,
.wp-block-image.is-style-polaroid-penche figcaption {
	margin: 0;
	min-height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--dancing);
	font-style: normal;
	font-size: 22px;
	color: var(--wp--preset--color--prune);
}
.wp-block-image.is-style-polaroid-penche { transform: rotate(-2.5deg); }
.wp-block-image.is-style-polaroid-penche:nth-of-type(even) { transform: rotate(2.5deg); }

/* Ruban adhésif doré au-dessus des polaroïds */
.wp-block-image.is-style-polaroid::before,
.wp-block-image.is-style-polaroid-penche::before,
.is-style-photo-a-venir::before {
	content: "";
	position: absolute;
	top: -14px;
	left: 50%;
	z-index: 2;
	width: 120px;
	height: 30px;
	background: rgba(201, 161, 74, .55);
	transform: translateX(-50%) rotate(-3deg);
}

/* Emplacement photo provisoire, à remplacer par un bloc Image style Polaroïd */
.is-style-photo-a-venir { margin: 0; }
.is-style-photo-a-venir > p:first-child {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 5;
	margin: 0;
	padding: 24px;
	text-align: center;
	font-style: italic;
	background-color: var(--wp--preset--color--rose);
	background-image: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55), transparent 60%);
}
.is-style-photo-a-venir.has-lavande-background-color { background: var(--wp--preset--color--blanc) !important; }
.is-style-photo-a-venir.has-lavande-background-color > p:first-child { background-color: var(--wp--preset--color--lavande); }
.is-style-photo-a-venir > p:last-child {
	margin: 0;
	min-height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--dancing);
	font-size: 22px;
}

/* ---------- Chaîne dorée (séparateur) ---------- */

.wp-block-separator.is-style-chaine {
	width: 100%;
	max-width: none;
	height: 14px;
	border: 0 !important;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='14'%3E%3Cellipse cx='10' cy='7' rx='9' ry='5' fill='none' stroke='%23C9A14A' stroke-width='2'/%3E%3C/svg%3E") repeat-x center / 20px 14px !important;
	opacity: 1;
}

/* ---------- Phrase manuscrite et bandeau pinceau (paragraphe) ---------- */

.is-style-script {
	font-family: var(--wp--preset--font-family--dancing) !important;
	font-weight: 600;
	font-size: clamp(24px, 2.6vw, 32px);
	line-height: 1.25;
	color: var(--wp--preset--color--framboise);
}

.is-style-bandeau {
	display: inline-block;
	width: fit-content;
	padding: 10px 34px 12px;
	font-family: var(--wp--preset--font-family--dancing) !important;
	font-weight: 600;
	font-size: clamp(22px, 2.4vw, 28px);
	line-height: 1.2;
	color: var(--wp--preset--color--creme);
	background: var(--wp--preset--color--framboise);
	clip-path: polygon(1% 8%, 12% 2%, 30% 6%, 52% 0, 74% 5%, 96% 1%, 100% 40%, 98% 92%, 80% 98%, 58% 93%, 36% 100%, 14% 95%, 0 100%, 2% 55%);
	transform: rotate(-1.5deg);
}
.is-style-bandeau a { color: inherit; }

/* ---------- Titre surligné rose (titre) ---------- */

.is-style-surligne mark,
.is-style-surligne em {
	font-style: inherit;
	color: inherit;
	padding-inline: .12em;
	background: linear-gradient(transparent 58%, var(--wp--preset--color--rose) 58%, var(--wp--preset--color--rose) 92%, transparent 92%);
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

/* ---------- Étiquette (paragraphe) ---------- */

.is-style-etiquette {
	display: inline-block;
	width: fit-content;
	padding: 6px 20px;
	font-family: var(--wp--preset--font-family--playfair);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--creme);
	background: var(--wp--preset--color--framboise);
	clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
}

/* ---------- En-tête ---------- */

.rh-annonce p { margin: 0; }
.rh-annonce a { color: inherit; text-decoration: none; }
.rh-entete .wp-block-navigation a { text-decoration: none; }
.rh-entete .wp-block-navigation a:hover { color: var(--wp--preset--color--framboise); }
.rh-logo img { display: block; width: clamp(140px, 16vw, 190px); height: auto; }

/* ---------- Boutique ---------- */

.wc-block-product .wc-block-components-product-image,
.wp-block-woocommerce-product-image-gallery .woocommerce-product-gallery__wrapper,
.wc-block-components-product-image {
	background: var(--wp--preset--color--blanc);
	padding: 10px 10px 10px;
	box-shadow: var(--rh-ombre);
}
.wc-block-product .wc-block-components-product-image img { aspect-ratio: 4 / 5; object-fit: cover; }
.wc-block-product .wp-block-post-title { font-size: 21px !important; line-height: 1.2; }
.wc-block-product .wp-block-post-title a { color: var(--wp--preset--color--prune); text-decoration: none; }
.wc-block-components-product-sale-badge,
.wc-block-components-product-badge {
	font-family: var(--wp--preset--font-family--dancing);
	background: var(--wp--preset--color--framboise) !important;
	color: var(--wp--preset--color--creme) !important;
	border: 0 !important;
}
.wc-block-components-button:not(.is-link),
.wp-element-button { transition: background-color .2s ease, transform .1s ease; }
.wp-element-button:active { transform: translateY(1px); }
.wc-block-components-product-rating__stars,
.star-rating { color: var(--wp--preset--color--framboise); }

/* ---------- Bingo lecture ---------- */

.rh-bingo { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rh-bingo > .wp-block-group {
	position: relative;
	min-height: 150px;
	margin: 0 !important;
	padding: 18px 14px 44px;
	text-align: center;
	background: var(--wp--preset--color--blanc);
	cursor: pointer;
	user-select: none;
	transition: background-color .2s ease, color .2s ease;
}
.rh-bingo > .wp-block-group p { margin: 0; line-height: 1.25; }
.rh-bingo > .wp-block-group::after {
	content: "";
	position: absolute;
	bottom: 14px;
	left: 50%;
	width: 22px;
	height: 20px;
	transform: translateX(-50%);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 20.5 3.5 12A5.3 5.3 0 0 1 11 4.5l1 1 1-1a5.3 5.3 0 0 1 7.5 7.5Z' fill='none' stroke='%23A8345A' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat center / contain;
}
.rh-bingo > .wp-block-group.est-cochee,
.rh-bingo > .wp-block-group.rh-bingo__libre {
	background: var(--wp--preset--color--framboise);
	color: var(--wp--preset--color--creme);
}
.rh-bingo > .wp-block-group.est-cochee::after,
.rh-bingo > .wp-block-group.rh-bingo__libre::after {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 20.5 3.5 12A5.3 5.3 0 0 1 11 4.5l1 1 1-1a5.3 5.3 0 0 1 7.5 7.5Z' fill='%23FBF4EE'/%3E%3C/svg%3E");
}
.rh-bingo > .wp-block-group:focus-visible { outline: 2px solid var(--wp--preset--color--dore); outline-offset: 3px; }

/* ---------- Chronique : tropes ---------- */

.rh-tropes ul { list-style: none; padding: 0; margin: 0; }
.rh-tropes li { padding: 8px 0 8px 28px; border-bottom: 1px solid rgba(74, 35, 64, .15); position: relative; }
.rh-tropes li::before { content: "\2665"; position: absolute; left: 4px; color: var(--wp--preset--color--framboise); }

.rh-note { font-family: var(--wp--preset--font-family--playfair); font-weight: 700; }

/* ---------- Mobile ---------- */

@media (max-width: 781px) {
	.is-style-rayures { background-image: repeating-linear-gradient(90deg, var(--wp--preset--color--rayure) 0 40px, var(--wp--preset--color--creme) 40px 80px); }
	.wp-block-image.is-style-polaroid,
	.wp-block-image.is-style-polaroid-penche,
	.is-style-photo-a-venir { padding: 8px 8px 0; }
	.rh-bingo { gap: 8px; }
	.rh-bingo > .wp-block-group { min-height: 120px; padding: 12px 8px 40px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}

/* ---------- Pied de page ---------- */

.rh-pied ul { list-style: none; }
.rh-pied li { margin-bottom: 6px; }
.rh-pied a { text-decoration: none; }
.rh-pied a:hover { text-decoration: underline; }

/* ---------- Accueil ---------- */

.rh-duo { position: relative; }
.rh-duo > .rh-penche-g { max-width: 300px; transform: rotate(-3deg); }
.rh-duo > .rh-penche-d { max-width: 240px; margin: -90px 0 0 auto !important; transform: rotate(4deg); position: relative; z-index: 1; }

.rh-familles > .wp-block-column:nth-child(odd) > .is-style-photo-a-venir { transform: rotate(-2deg); }
.rh-familles > .wp-block-column:nth-child(even) > .is-style-photo-a-venir { transform: rotate(2deg); margin-top: 28px; }
.rh-familles h3 a { color: var(--wp--preset--color--prune); text-decoration: none; }
.rh-familles h3 a:hover { color: var(--wp--preset--color--framboise); }

.rh-raisons h3 { margin-bottom: 4px; padding-left: 30px; position: relative; }
.rh-raisons h3::before { content: "\2665"; position: absolute; left: 0; color: var(--wp--preset--color--dore); }
.rh-raisons p { margin-top: 0; padding-left: 30px; }

.rh-image-polaroid { background: var(--wp--preset--color--blanc); padding: 10px; box-shadow: var(--rh-ombre); }

.wp-block-button.is-style-outline > .wp-block-button__link { border: 2px solid currentColor; color: var(--wp--preset--color--prune); background: transparent; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { color: var(--wp--preset--color--creme); background: var(--wp--preset--color--prune); border-color: var(--wp--preset--color--prune); }

@media (max-width: 781px) {
	.rh-duo { padding-top: 24px; }
	.rh-duo > .rh-penche-g { max-width: 70%; }
	.rh-duo > .rh-penche-d { max-width: 58%; margin-top: -70px !important; }
	.rh-familles > .wp-block-column:nth-child(even) > .is-style-photo-a-venir { margin-top: 0; }
}
.rh-duo-livre .is-style-photo-a-venir { max-width: 340px; margin-inline: auto; }
.rh-penche-g { transform: rotate(-3deg); }
.rh-penche-d { transform: rotate(3deg); }

@media print {
	header, footer, .rh-imprimer, .wp-block-woocommerce-mini-cart { display: none !important; }
	.is-style-rayures { background: none !important; }
	.rh-bingo > .wp-block-group { border: 1px solid #A8345A; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 1180px) and (min-width: 600px) {
	.rh-entete .wp-block-navigation { font-size: 14px; letter-spacing: .03em; gap: 18px !important; }
	.rh-entete .wp-block-navigation__container { gap: 18px !important; flex-wrap: nowrap; }
	.rh-logo img { width: 140px !important; }
}

/* Ajustements après relecture à l'écran */
.rh-duo > .rh-penche-d { margin-top: -40px !important; }
.is-style-photo-a-venir > p:last-child { text-align: center; font-size: 20px; line-height: 1.2; padding: 8px 6px; }
.rh-avis:not(:has(.wc-block-review-list-item__item)) { display: none; }
.rh-bingo__libre .is-style-script { color: var(--wp--preset--color--creme); }

@media (max-width: 781px) {
	.rh-duo > .rh-penche-d { margin-top: 12px !important; }
	.rh-logo img { width: 120px !important; }
}

/* ---------- Zone de personnalisation (fiche produit) ---------- */

.rh-perso { margin: 0 0 20px; }
.rh-perso label { display: block; margin-bottom: 6px; font-family: var(--wp--preset--font-family--playfair); font-weight: 700; }
.rh-perso abbr { color: var(--wp--preset--color--framboise); text-decoration: none; }
.rh-perso textarea {
	width: 100%;
	padding: 12px 14px;
	font: inherit;
	color: var(--wp--preset--color--prune);
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--prune-douce);
	border-radius: 2px;
}
.rh-perso textarea:focus { outline: 2px solid var(--wp--preset--color--dore); outline-offset: 2px; }
.rh-perso textarea::placeholder { color: var(--wp--preset--color--prune-douce); }

/* ---------- Bandeau d'annonce défilant ---------- */

.rh-annonce:not(:has(.rh-defile)) { display: none; }
.rh-defile { overflow: hidden; white-space: nowrap; font-size: 17px; line-height: 1.4; }
.rh-defile__piste { display: inline-flex; width: max-content; animation: rh-defile var(--rh-defile-duree, 40s) linear infinite; }
.rh-defile:hover .rh-defile__piste { animation-play-state: paused; }
.rh-defile__groupe { display: inline-flex; }
.rh-defile__item { display: inline-flex; align-items: center; }
.rh-defile__item::after { content: "\2665"; margin: 0 28px; font-size: 13px; color: var(--wp--preset--color--rose); }
@keyframes rh-defile { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
	.rh-defile__piste { animation: none; width: 100%; justify-content: center; }
	.rh-defile__groupe + .rh-defile__groupe,
	.rh-defile__item ~ .rh-defile__item { display: none; }
	.rh-defile__item::after { content: none; }
}
.rh-annonce > * { margin-block: 0 !important; }

/* ---------- Sous-menu Boutique ---------- */

.rh-entete .wp-block-navigation .wp-block-navigation__submenu-container {
	min-width: 230px;
	padding: 10px 0;
	background: var(--wp--preset--color--creme) !important;
	border: 1px solid var(--wp--preset--color--rose) !important;
	box-shadow: var(--rh-ombre);
	text-transform: none;
	letter-spacing: 0;
}
.rh-entete .wp-block-navigation .wp-block-navigation__submenu-container a {
	padding: 8px 20px;
	font-family: var(--wp--preset--font-family--cormorant);
	font-size: 19px;
	font-weight: 600;
}
.rh-entete .wp-block-navigation .wp-block-navigation__submenu-container a:hover { background: var(--wp--preset--color--rayure); }
.rh-entete .wp-block-navigation__submenu-icon { color: var(--wp--preset--color--framboise); }
.rh-entete .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content { white-space: nowrap; }
@media (max-width: 599px) {
	.rh-entete .wp-block-navigation .wp-block-navigation__submenu-container { border: 0 !important; box-shadow: none; padding: 0 0 0 12px; }
}

/* ---------- Formulaire de contact ---------- */

.rh-contact { max-width: none; }
.rh-contact *, .rh-contact *::before { box-sizing: border-box; }
.rh-contact p { margin: 0 0 18px; }
.rh-contact label { display: block; font-family: var(--wp--preset--font-family--playfair); font-weight: 700; font-size: 17px; }
.rh-contact label span { color: var(--wp--preset--color--framboise); }
.rh-contact input[type=text],
.rh-contact input[type=email],
.rh-contact textarea {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 12px 14px;
	font: 500 19px/1.4 var(--wp--preset--font-family--cormorant);
	color: var(--wp--preset--color--prune);
	background: var(--wp--preset--color--blanc);
	border: 1px solid var(--wp--preset--color--prune-douce);
	border-radius: 2px;
}
.rh-contact input:focus,
.rh-contact textarea:focus { outline: 2px solid var(--wp--preset--color--dore); outline-offset: 2px; }
.rh-contact__duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rh-contact__piege { position: absolute !important; left: -9999px; }
.rh-contact__rgpd { font-size: 16px; font-style: italic; color: var(--wp--preset--color--prune-douce); }
.rh-contact__retour { padding: 14px 18px; border-left: 3px solid; background: var(--wp--preset--color--blanc); }
.rh-contact__retour--ok { border-color: var(--wp--preset--color--dore); }
.rh-contact__retour--erreur { border-color: var(--wp--preset--color--framboise); color: var(--wp--preset--color--framboise); }
@media (max-width: 600px) { .rh-contact__duo { grid-template-columns: 1fr; } }

/* ---------- Choix des breloques (fiche produit) ---------- */

.rh-breloques { margin: 8px 0 24px; padding: 20px; background: var(--wp--preset--color--blanc); box-shadow: var(--rh-ombre); }
.rh-breloques.est-incomplet { outline: 2px solid var(--wp--preset--color--framboise); outline-offset: 2px; }
.rh-breloques__titre { margin: 0 0 10px; font-family: var(--wp--preset--font-family--playfair); font-weight: 700; }
.rh-breloques__titre span { font-family: var(--wp--preset--font-family--cormorant); font-weight: 600; color: var(--wp--preset--color--prune-douce); }
.rh-breloques__titre span.est-complet { color: var(--wp--preset--color--framboise); }
.rh-breloques__aide { margin: -6px 0 10px; font-size: 17px; font-style: italic; }
.rh-breloques__image { display: block; margin-bottom: 14px; text-decoration: none; }
.rh-breloques__image img { display: block; width: 100%; height: auto; }
.rh-breloques__image span { display: block; margin-top: 4px; font-size: 16px; text-align: right; }
.rh-breloques__grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; }
.rh-breloques__grille--ap { margin-bottom: 4px; }
.rh-breloques__grille label { position: relative; cursor: pointer; }
.rh-breloques__grille input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.rh-breloques__grille span {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	font-family: var(--wp--preset--font-family--playfair);
	font-weight: 700;
	font-size: 16px;
	color: var(--wp--preset--color--prune);
	background: var(--wp--preset--color--creme);
	border: 1px solid var(--wp--preset--color--rose);
	border-radius: 50%;
	aspect-ratio: 1;
	width: 44px;
	margin: 0 auto;
	transition: background-color .15s ease, color .15s ease;
}
.rh-breloques__grille input:checked + span { color: var(--wp--preset--color--creme); background: var(--wp--preset--color--framboise); border-color: var(--wp--preset--color--framboise); }
.rh-breloques__grille input:focus-visible + span { outline: 2px solid var(--wp--preset--color--dore); outline-offset: 2px; }
.rh-breloques__grille input:disabled + span { opacity: .35; cursor: not-allowed; }
.rh-breloques-ref { margin: 0; background: var(--wp--preset--color--blanc); padding: 12px; box-shadow: var(--rh-ombre); }
.rh-breloques-ref img { display: block; width: 100%; height: auto; }

/* ---------- Bannière Personnalisation (accueil) ---------- */

.rh-perso-banniere .is-style-photo-a-venir,
.rh-perso-banniere .wp-block-image { max-width: 340px; margin-inline: auto; }
