/*
Theme Name: Pétanque Club
Theme URI: https://example.com/
Author: Votre club
Description: Thème sportif et moderne pour club de pétanque : calendrier des concours (doublette, triplette, tête-à-tête…), inscriptions, actualités et animations légères (boules qui roulent, compteurs, apparitions au défilement). Couleurs et polices modifiables dans Apparence → Éditeur → Styles.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: petanque-club
Tags: block-theme, full-site-editing, sports, events, custom-colors
*/

:root {
	--pc-marine: var(--wp--preset--color--marine, #0B1F3A);
	--pc-marine-clair: var(--wp--preset--color--marine-clair, #16345C);
	--pc-orange: var(--wp--preset--color--orange, #FF6B1A);
	--pc-jaune: var(--wp--preset--color--jaune, #FFC93C);
	--pc-acier: var(--wp--preset--color--acier, #C9D1DC);
	--pc-sable: var(--wp--preset--color--sable, #E9DFC9);
	--pc-clair: var(--wp--preset--color--clair, #F4F6F9);
	--pc-titres: var(--wp--preset--font-family--titres, "Arial Narrow", sans-serif);
	--pc-ombre: 0 10px 30px -12px rgba(11, 31, 58, .35);
	--pc-rayon: 16px;
	--pc-ease: cubic-bezier(.22, .9, .3, 1);
}

/* ---------- En-tête ---------- */
.pc-header {
	position: sticky;
	top: 0;
	z-index: 50;
	transition: box-shadow .3s ease, padding .3s ease;
}
.admin-bar .pc-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .pc-header { top: 46px; } }
.pc-header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.pc-header::after { /* liseré orange → jaune */
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--pc-orange), var(--pc-jaune));
}
.pc-nav a { position: relative; text-decoration: none; }
.pc-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0; bottom: -4px;
	width: 100%; height: 2px;
	background: var(--pc-orange);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s var(--pc-ease);
}
.pc-nav .wp-block-navigation-item__content:hover::after,
.pc-nav .current-menu-item > .wp-block-navigation-item__content::after { transform: scaleX(1); }

/* ---------- Typo utilitaire ---------- */
.pc-surtitre {
	font-family: var(--pc-titres);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .14em;
	font-size: .9rem;
	margin-bottom: .25rem;
}
.pc-surtitre a { color: inherit; text-decoration: none; }
.pc-titre-section { position: relative; padding-bottom: .6rem; margin-top: 0; }
.pc-titre-section::after {
	content: "";
	display: block;
	width: 64px; height: 5px;
	margin-top: .6rem;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--pc-orange), var(--pc-jaune));
}
.pc-surligne {
	background: linear-gradient(90deg, var(--pc-orange), var(--pc-jaune));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* ---------- Boutons ---------- */
.wp-element-button, .pc-btn {
	position: relative;
	overflow: hidden;
	transition: transform .2s var(--pc-ease), box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.wp-element-button:hover, .pc-btn:hover { transform: translateY(-2px); box-shadow: var(--pc-ombre); }
.wp-element-button::before, .pc-btn::before { /* reflet qui balaie le bouton */
	content: "";
	position: absolute;
	top: 0; left: -60%;
	width: 40%; height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
	transform: skewX(-20deg);
	transition: left .55s ease;
	pointer-events: none;
}
.wp-element-button:hover::before, .pc-btn:hover::before { left: 120%; }
.pc-btn-clair .wp-element-button { color: #fff; border: 2px solid rgba(255, 255, 255, .7); background: transparent; }
.pc-btn-clair .wp-element-button:hover { background: #fff; color: var(--pc-marine); }

.pc-btn {
	display: inline-block;
	padding: .6rem 1.3rem;
	border-radius: 999px;
	background: var(--pc-orange);
	color: #fff;
	font-family: var(--pc-titres);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	text-decoration: none;
	white-space: nowrap;
}
.pc-btn:hover { background: var(--pc-jaune); color: var(--pc-marine); }

/* ---------- Bandeau d'accueil + animation des boules ---------- */
.pc-hero { position: relative; overflow: hidden; }
.pc-hero::before { /* lignes de terrain discrètes */
	content: "";
	position: absolute;
	inset: 0;
	background:
		repeating-linear-gradient(90deg, transparent 0 119px, rgba(255, 255, 255, .04) 119px 120px),
		radial-gradient(circle at 85% 30%, rgba(255, 107, 26, .25), transparent 45%);
	pointer-events: none;
}
.pc-hero > * { position: relative; }
.pc-hero__titre { margin-top: .2rem; }

.pc-terrain {
	position: relative;
	height: 260px;
	border-radius: 24px;
	background:
		radial-gradient(circle at 20% 30%, rgba(0, 0, 0, .06) 0 2px, transparent 3px) 0 0 / 22px 22px,
		radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .25) 0 1.5px, transparent 2.5px) 0 0 / 17px 17px,
		linear-gradient(160deg, #EFE5CF, var(--pc-sable) 55%, #D8C9A8);
	box-shadow: inset 0 -12px 30px rgba(0, 0, 0, .12), var(--pc-ombre);
	overflow: hidden;
}
.pc-terrain__trace { /* sillon laissé par la boule */
	position: absolute;
	left: 6%; top: 61%;
	width: 0; height: 3px;
	border-radius: 2px;
	background: rgba(120, 95, 60, .25);
	animation: pc-trace 1.6s var(--pc-ease) .3s forwards;
}
.pc-but { /* le cochonnet */
	position: absolute;
	left: 72%; top: 52%;
	width: 18px; height: 18px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #FFB37A, var(--pc-orange) 55%, #B8430A);
	box-shadow: 0 4px 6px rgba(0, 0, 0, .3);
	animation: pc-but-pulse 2.4s ease-in-out 2.2s infinite;
}
.pc-boule {
	position: absolute;
	top: 47%;
	left: 0;
	width: 64px; height: 64px;
	margin-top: -32px;
	border-radius: 50%;
	background: radial-gradient(circle at 32% 28%, #FFFFFF 0 6%, #DDE3EA 18%, #9AA6B4 55%, #4B5663 100%);
	box-shadow: 0 12px 14px -6px rgba(0, 0, 0, .45);
	transform: translateX(-120px);
	animation: pc-roule-1 1.9s var(--pc-ease) .3s forwards;
}
.pc-boule > span { /* stries, pour voir la boule tourner */
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background:
		linear-gradient(transparent 46%, rgba(40, 50, 62, .35) 46% 50%, transparent 50%),
		linear-gradient(90deg, transparent 30%, rgba(40, 50, 62, .25) 30% 33%, transparent 33% 67%, rgba(40, 50, 62, .25) 67% 70%, transparent 70%);
	animation: pc-tourne-1 1.9s var(--pc-ease) .3s forwards;
}
.pc-boule--2 { top: 72%; width: 58px; height: 58px; margin-top: -29px; animation-name: pc-roule-2; animation-delay: 1s; animation-duration: 2s; }
.pc-boule--2 > span { animation-name: pc-tourne-2; animation-delay: 1s; animation-duration: 2s; }
.pc-boule--3 { top: 30%; width: 60px; height: 60px; margin-top: -30px; animation-name: pc-roule-3; animation-delay: 1.7s; animation-duration: 1.8s; filter: saturate(.3) brightness(.85); }
.pc-boule--3 > span { animation-name: pc-tourne-3; animation-delay: 1.7s; animation-duration: 1.8s; }

@keyframes pc-roule-1 { 0% { transform: translateX(-120px); } 85% { transform: translateX(calc(var(--pc-w, 330px) * .72 - 64px)); } 100% { transform: translateX(calc(var(--pc-w, 330px) * .72 - 70px)); } }
@keyframes pc-roule-2 { 0% { transform: translateX(-120px); } 88% { transform: translateX(calc(var(--pc-w, 330px) * .72 - 22px)); } 100% { transform: translateX(calc(var(--pc-w, 330px) * .72 - 26px)); } }
@keyframes pc-roule-3 { 0% { transform: translateX(-120px); } 90% { transform: translateX(calc(var(--pc-w, 330px) * .72 - 14px)); } 100% { transform: translateX(calc(var(--pc-w, 330px) * .72 - 19px)); } }
@keyframes pc-tourne-1 { to { transform: rotate(560deg); } }
@keyframes pc-tourne-2 { to { transform: rotate(620deg); } }
@keyframes pc-tourne-3 { to { transform: rotate(500deg); } }
@keyframes pc-trace { to { width: 52%; } }
@keyframes pc-but-pulse { 0%, 100% { box-shadow: 0 4px 6px rgba(0, 0, 0, .3), 0 0 0 0 rgba(255, 201, 60, .7); } 50% { box-shadow: 0 4px 6px rgba(0, 0, 0, .3), 0 0 0 10px rgba(255, 201, 60, 0); } }

/* ---------- Chiffres clés ---------- */
.pc-stat { text-align: center; }
.pc-compteur { margin: 0; font-variant-numeric: tabular-nums; }
.pc-stat__libelle {
	margin-top: .2rem;
	font-family: var(--pc-titres);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--pc-marine);
}

/* ---------- Bandeau de page ---------- */
.pc-bandeau { position: relative; overflow: hidden; }
.pc-bandeau::after {
	content: "";
	position: absolute;
	right: -60px; top: -60px;
	width: 260px; height: 260px;
	border-radius: 50%;
	border: 34px solid rgba(255, 255, 255, .05);
	pointer-events: none;
}
.pc-bandeau h1 { margin-top: .2rem; }

/* ---------- Calendrier des concours ---------- */
.pc-calendrier { display: grid; gap: 2rem; }
.pc-mois-titre {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 0 0 1rem;
	font-size: 1.15rem;
	color: var(--pc-marine-clair);
	letter-spacing: .1em;
}
.pc-mois-titre::after { content: ""; flex: 1; height: 2px; background: var(--pc-acier); }
.pc-liste { display: grid; gap: 1rem; }

.pc-concours {
	display: grid;
	grid-template-columns: 88px 1fr auto;
	align-items: center;
	gap: 1.25rem;
	padding: 1rem 1.25rem 1rem 1rem;
	background: #fff;
	border-radius: var(--pc-rayon);
	box-shadow: 0 2px 6px rgba(11, 31, 58, .06);
	border-left: 5px solid var(--pc-orange);
	transition: transform .25s var(--pc-ease), box-shadow .25s ease;
}
.pc-concours:hover { transform: translateY(-3px); box-shadow: var(--pc-ombre); }
.pc-concours.is-complet { border-left-color: var(--pc-acier); }
.pc-concours.is-passe { border-left-color: var(--pc-acier); opacity: .8; }
.pc-concours[hidden] { display: none; }

.pc-concours__date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border-radius: 14px;
	background: var(--pc-marine);
	color: #fff;
	font-family: var(--pc-titres);
	text-transform: uppercase;
	line-height: 1;
}
.pc-wd { font-size: .75rem; letter-spacing: .1em; color: var(--pc-acier); }
.pc-jour { font-size: 2.3rem; font-weight: 800; margin: .1rem 0; }
.pc-mois { font-size: .85rem; font-weight: 700; color: var(--pc-jaune); letter-spacing: .08em; }
.is-passe .pc-concours__date { background: var(--pc-marine-clair); }

.pc-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .35rem; }
.pc-chip {
	display: inline-block;
	padding: .15rem .6rem;
	border-radius: 999px;
	background: var(--pc-clair);
	color: var(--pc-marine);
	font-size: .78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
}
.pc-chip--format { background: var(--pc-marine); color: #fff; }
.pc-chip--public { background: #DDF5E3; color: #146C2E; }
.pc-chip--bientot { background: var(--pc-jaune); color: var(--pc-marine); animation: pc-clignote 2.2s ease-in-out infinite; }
@keyframes pc-clignote { 50% { box-shadow: 0 0 0 5px rgba(255, 201, 60, .25); } }

.pc-concours__titre { margin: 0 0 .35rem; font-size: 1.35rem; }
.pc-concours__titre a { color: var(--pc-marine); text-decoration: none; }
.pc-concours__titre a:hover { color: var(--pc-orange); }
.pc-concours__resume { margin: 0 0 .45rem; font-size: .95rem; color: #2B3646; }
.pc-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; margin: 0; padding: 0; list-style: none; font-size: .92rem; color: #4A5668; }
.pc-meta li { display: inline-flex; align-items: center; gap: .35rem; }
.pc-ico { flex: none; color: var(--pc-orange); }

.pc-etat {
	display: inline-block;
	padding: .5rem 1rem;
	border-radius: 999px;
	background: var(--pc-clair);
	color: #4A5668;
	font-family: var(--pc-titres);
	font-weight: 700;
	text-transform: uppercase;
	font-size: .9rem;
	white-space: nowrap;
}
.pc-etat--complet { background: #FDE8E8; color: #B42318; }

.pc-filtres { display: flex; flex-wrap: wrap; gap: .5rem; }
.pc-filtre {
	padding: .45rem 1rem;
	border: 2px solid var(--pc-marine);
	border-radius: 999px;
	background: transparent;
	color: var(--pc-marine);
	font-family: var(--pc-titres);
	font-weight: 700;
	font-size: .95rem;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, transform .2s var(--pc-ease);
}
.pc-filtre:hover { transform: translateY(-1px); }
.pc-filtre.is-actif { background: var(--pc-marine); color: #fff; }
.pc-titre-passes { margin-top: var(--wp--preset--spacing--60, 4rem); color: var(--pc-marine-clair); }
.pc-vide { padding: 1.5rem; border-radius: var(--pc-rayon); background: #fff; text-align: center; }

@media (max-width: 640px) {
	.pc-concours { grid-template-columns: 70px 1fr; padding: .9rem; gap: .9rem; }
	.pc-concours__cta { grid-column: 1 / -1; }
	.pc-concours__cta .pc-btn, .pc-concours__cta .pc-etat { display: block; text-align: center; }
	.pc-jour { font-size: 1.9rem; }
	.pc-terrain { height: 200px; }
}

/* ---------- Fiche d'un concours ---------- */
.pc-fiche {
	display: grid;
	gap: 1.25rem;
	padding: 1.5rem;
	margin-bottom: 2rem;
	border-radius: var(--pc-rayon);
	background: #fff;
	box-shadow: var(--pc-ombre);
	border-top: 5px solid var(--pc-orange);
}
.pc-fiche__resume { margin: 0; font-size: 1.1rem; color: #2B3646; }
.pc-fiche__grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 0; }
.pc-fiche dt { font-family: var(--pc-titres); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--pc-orange); }
.pc-fiche dd { margin: .15rem 0 0; font-size: 1.1rem; font-weight: 600; color: var(--pc-marine); }
.pc-fiche__cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

/* ---------- Cartes d'actualités ---------- */
.pc-carte {
	height: 100%;
	overflow: hidden;
	border-radius: var(--pc-rayon);
	background: #fff;
	box-shadow: 0 2px 6px rgba(11, 31, 58, .06);
	transition: transform .25s var(--pc-ease), box-shadow .25s ease;
}
.pc-carte:hover { transform: translateY(-4px); box-shadow: var(--pc-ombre); }
.pc-carte .wp-block-post-featured-image { margin: 0; overflow: hidden; }
.pc-carte .wp-block-post-featured-image img { transition: transform .5s var(--pc-ease); }
.pc-carte:hover .wp-block-post-featured-image img { transform: scale(1.05); }
.pc-carte__corps { padding: 1rem 1.25rem 1.25rem; }
.pc-carte__corps .wp-block-post-title { margin: .2rem 0 .5rem; }
.pc-carte__corps .wp-block-post-title a { color: var(--pc-marine); }
.pc-carte__corps .pc-surtitre { color: var(--pc-orange); }

/* ---------- Pied de page ---------- */
.pc-footer a { color: #fff; }
.pc-footer a:hover { color: var(--pc-jaune); }
.pc-sep { opacity: .5; }

/* ---------- Apparition au défilement (seulement si JS actif) ---------- */
.pc-js .pc-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity .6s ease, transform .6s var(--pc-ease);
}
.pc-js .pc-reveal.is-visible { opacity: 1; transform: none; }
.pc-js .pc-concours.pc-reveal.is-visible:hover { transform: translateY(-3px); }
.pc-js .pc-carte.pc-reveal.is-visible:hover { transform: translateY(-4px); }

/* ---------- Respect du réglage « réduire les animations » ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	.pc-js .pc-reveal { opacity: 1; transform: none; }
}
