/*
Theme Name: Margoes Around
Theme URI: https://margoes-around.fr
Author: Margoes Around
Description: Thème du blog Margoes Around — bonnes adresses et actu de Troyes. Façade à pans de bois, prune, lilas et ocre.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.4.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: margoes
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; }
:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--ocre);
	outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}
img { height: auto; }
.wp-site-blocks > footer, .wp-site-blocks > main { margin-block-start: 0; }

/* ---------- Façade à pans de bois ---------- */
.margoes-facade {
	border-radius: 28px 28px 8px 8px;
	align-items: stretch !important;
}
.margoes-facade > * {
	border-radius: 4px;
	margin: 0 !important;
}
.margoes-facade > .wp-block-group,
.margoes-facade > .wp-block-image,
.margoes-facade > .wp-block-cover {
	flex: 1 1 200px;
	min-width: 0;
}
.margoes-facade > .margoes-panneau-large { flex: 3 1 520px; }
.margoes-facade > .margoes-panneau-moyen { flex: 2 1 320px; }
.margoes-facade > .margoes-panneau-petit { flex: 1 1 160px; min-height: 150px; }
.margoes-facade .wp-block-image { align-self: stretch; min-height: 420px; position: relative; overflow: hidden; }
.margoes-facade .wp-block-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

/* Croix de Saint-André (style de bloc « Pan de bois ») */
.is-style-pan-de-bois-croix {
	background-image:
		linear-gradient(to top right, transparent calc(50% - 6px), var(--wp--preset--color--prune) calc(50% - 6px), var(--wp--preset--color--prune) calc(50% + 6px), transparent calc(50% + 6px)),
		linear-gradient(to bottom right, transparent calc(50% - 6px), var(--wp--preset--color--prune) calc(50% - 6px), var(--wp--preset--color--prune) calc(50% + 6px), transparent calc(50% + 6px));
}
.is-style-pan-de-bois-diagonale {
	background-image:
		linear-gradient(to top right, transparent calc(50% - 6px), var(--wp--preset--color--prune) calc(50% - 6px), var(--wp--preset--color--prune) calc(50% + 6px), transparent calc(50% + 6px));
}

/* ---------- Rubriques en enseignes ---------- */
.margoes-enseigne {
	border-bottom: 2px solid var(--wp--preset--color--lilas);
}
.margoes-enseigne:last-child { border-bottom: 6px solid var(--wp--preset--color--prune); }
.margoes-enseigne a { text-decoration: none; color: inherit; }
.margoes-enseigne a:hover { color: var(--wp--preset--color--prune); }

/* ---------- Bulles Potins ---------- */
.margoes-bulles .wp-block-post-template { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.margoes-bulles .wp-block-post {
	width: min(400px, 88%);
	box-sizing: border-box;
	align-self: flex-start;
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--encre);
	padding: 18px 22px;
	border-radius: 24px 24px 24px 6px;
}
.margoes-bulles .wp-block-post:nth-child(even) {
	align-self: flex-end;
	background: var(--wp--preset--color--prune);
	color: var(--wp--preset--color--blanc);
	border-radius: 24px 24px 6px 24px;
}
.margoes-bulles .wp-block-post:nth-child(even) a,
.margoes-bulles .wp-block-post:nth-child(even) .wp-block-post-date,
.margoes-bulles .wp-block-post:nth-child(even) .wp-block-post-excerpt { color: var(--wp--preset--color--lilas-texte); }
.margoes-bulles .wp-block-post:nth-child(even) .wp-block-post-title a { color: var(--wp--preset--color--blanc); }
.margoes-bulles .margoes-bulle-photo { margin: 0 0 12px; }
.margoes-bulles .margoes-bulle-photo, .margoes-bulles .margoes-bulle-photo img { border-radius: 16px; width: 100%; max-width: none; }
/* Photo d'un potin (page seule) : format portrait 4:5, comme les photos prises au téléphone */
.margoes-potin-photo { max-width: 560px; margin-left: auto !important; margin-right: auto !important; }
.margoes-potin-photo img { border-radius: 22px; }
.margoes-bulles .wp-block-post-title { font-family: var(--wp--preset--font-family--figtree); font-size: 1.0625rem; font-weight: 600; line-height: 1.45; margin: 0; letter-spacing: 0; }
.margoes-bulles .wp-block-post-title a { text-decoration: none; }
.margoes-bulles .wp-block-post-excerpt, .margoes-bulles .wp-block-post-excerpt__excerpt { margin: 6px 0 0; }
.margoes-bulles .wp-block-post-date { font-size: 0.875rem; margin-top: 4px; }

/* ---------- Fiches adresses (article Sélection) ---------- */
.margoes-photo-fiche { max-width: 480px; }

/* ---------- Pastilles articles ---------- */
.margoes-pastille img { border-radius: 999px; aspect-ratio: 1; object-fit: cover; }

/* ---------- Bandeau façade du pied de page ---------- */
.margoes-bandeau { display: flex; gap: 8px; padding: 8px; background: var(--wp--preset--color--prune); }
.margoes-bandeau span { height: 26px; border-radius: 3px; }

/* ---------- Formulaire Potin (extension Potins Troyes) ---------- */
.potin-form { display: flex; flex-direction: column; gap: 18px; max-width: 100% !important; margin-left: 0 !important; }
.potin-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.potin-form .potin-aide { font-weight: 400; font-size: 0.9375rem; color: var(--wp--preset--color--encre-douce); }
.potin-form input[type="text"],
.potin-form input[type="email"],
.potin-form input[type="url"],
.potin-form select,
.potin-form textarea {
	font: inherit;
	font-weight: 400;
	color: var(--wp--preset--color--encre);
	background: var(--wp--preset--color--blanc);
	border: 2px solid var(--wp--preset--color--encre);
	border-radius: 18px;
	padding: 14px 18px;
	min-height: 52px;
	box-sizing: border-box;
	width: 100%;
}
.potin-form textarea { min-height: 160px; resize: vertical; }
.potin-form input[type="file"] { font: inherit; font-weight: 400; padding: 12px 0; }
.potin-form input[type="file"]::file-selector-button { font: inherit; font-weight: 700; color: var(--wp--preset--color--blanc); background: var(--wp--preset--color--prune); border: 0; border-radius: 999px; padding: 10px 18px; margin-right: 12px; cursor: pointer; }
.potin-form .potin-ligne { display: flex; flex-wrap: wrap; gap: 18px; }
.potin-form .potin-ligne > label { flex: 1 1 240px; }
.potin-form .potin-consentement { flex-direction: row; align-items: flex-start; gap: 12px; font-weight: 400; }
.potin-form .potin-consentement input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; }
.potin-form button {
	align-self: flex-start;
	font: inherit;
	font-weight: 700;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--blanc);
	background: var(--wp--preset--color--prune);
	border: 0;
	border-radius: 999px;
	padding: 17px 28px;
	cursor: pointer;
}
.potin-form button:hover { background: var(--wp--preset--color--encre); }
.potin-message { padding: 18px 22px; border-radius: 18px; font-weight: 600; max-width: 680px; }
.potin-message--ok { background: var(--wp--preset--color--lilas); color: var(--wp--preset--color--encre); }
.potin-message--erreur { background: #FBE3D9; color: #7A2414; }
.potin-piege { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Chiffres clés ---------- */
.margoes-chiffres__grille { margin: 0 !important; gap: 0 !important; }
.margoes-chiffre { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .25rem clamp(.75rem, 2vw, 1.5rem); }
.margoes-chiffre + .margoes-chiffre { border-left: 3px solid var(--wp--preset--color--prune); }
.margoes-chiffres .margoes-chiffre__valeur {
	margin: 0;
	font-size: clamp(2.25rem, 4.2vw, 3.25rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.04em;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	display: inline-block;
}
.margoes-chiffres .margoes-chiffre__legende {
	margin: 0;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.3;
	color: var(--wp--preset--color--encre-douce);
}
.margoes-chiffre__legende sup { font-size: .7em; line-height: 0; }
.margoes-chiffres .margoes-chiffres__accroche {
	margin-top: clamp(1.5rem, 3vw, 2.25rem);
	margin-bottom: 0;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}
@media (max-width: 781px) {
	.margoes-chiffre { padding: 1.1rem 0; }
	.margoes-chiffre:first-child { padding-top: 0; }
	.margoes-chiffre + .margoes-chiffre { border-left: 0; border-top: 3px solid var(--wp--preset--color--prune); }
	.margoes-chiffres .margoes-chiffres__accroche { margin-top: 1rem; }
}

/* Façade : pseudo Instagram, coupé proprement si la case est étroite */
.margoes-pseudo { overflow-wrap: anywhere; }
