/*
Theme Name: Chailluz
Theme URI: https://ferme-equestre-besancon.com/
Description: Thème sur mesure de la Ferme équestre de la forêt de Chailluz (Besançon) : ambiance « forêt et or », pensé d'abord pour le mobile, léger et accessible.
Version: 1.0.31
Requires at least: 6.6
Requires PHP: 7.4
Author: Ferme équestre de la forêt de Chailluz
Text Domain: chailluz
License: GPL-2.0-or-later
*/

/* ---------- Base ---------- */

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	text-rendering: optimizeLegibility;
}

img {
	height: auto;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--or);
	outline-offset: 3px;
	border-radius: 4px;
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--or);
	color: var(--wp--preset--color--foret-nuit);
}

/* ---------- En-tête ---------- */

.fc-header {
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 1px 0 rgba(201, 162, 75, 0.35);
}

body.admin-bar .fc-header {
	top: var(--wp-admin--admin-bar--height, 0px);
}

@media (max-width: 600px) {
	body.admin-bar .fc-header {
		top: 0;
	}
}

.fc-brand {
	text-decoration: none;
	color: inherit;
}

.fc-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	min-width: 0;
}

.fc-brand img {
	display: block;
	flex: none;
	width: auto;
	height: 42px;
}

.fc-brand-text {
	font-family: var(--wp--preset--font-family--fraunces);
	font-weight: 600;
	font-size: 1.05rem;
	line-height: 1.1;
	color: var(--wp--preset--color--creme);
}

.fc-brand-text em {
	font-weight: 400;
	font-size: 0.9em;
	color: var(--wp--preset--color--or-clair);
}

@media (max-width: 380px) {
	.fc-brand-text {
		font-size: 0.95rem;
	}
}

.fc-header .wp-block-site-title a,
.fc-brand-title a {
	text-decoration: none;
}

.fc-header .wp-block-navigation a {
	text-decoration: none;
}

.fc-header .wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--or);
}

.fc-header .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--foret-nuit) !important;
	border: 1px solid rgba(201, 162, 75, 0.35) !important;
	border-radius: 12px;
	padding: 0.5rem 0;
	min-width: 16rem !important;
}

.fc-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--foret-nuit) !important;
	color: var(--wp--preset--color--creme) !important;
	padding: 1.5rem;
}

.fc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	gap: 1.1rem;
	font-size: 1.25rem;
	font-family: var(--wp--preset--font-family--fraunces);
}

.fc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	border: 0 !important;
	padding: 0.5rem 0 0 1rem;
	font-size: 1.05rem;
	font-family: var(--wp--preset--font-family--systeme);
}

.fc-header-phone {
	white-space: nowrap;
}

.fc-brand-text {
	white-space: nowrap;
}

/* Menu ☰ jusqu'à 1080 px : sur tablette, le menu horizontal ne tient pas sur une ligne. */
@media (max-width: 1079px) {
	.fc-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex !important;
	}

	.fc-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none !important;
	}

	.fc-header .fc-hide-mobile {
		display: none !important;
	}
}

@media (max-width: 781px) {
	.fc-hide-mobile {
		display: none !important;
	}
}

@media (min-width: 782px) {
	.fc-hide-desktop {
		display: none !important;
	}
}

/* ---------- Héros ---------- */

.fc-hero h1 {
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
	text-wrap: balance;
}

.fc-hero .fc-kicker {
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.fc-hero .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--creme);
	border-color: var(--wp--preset--color--creme);
	background: transparent;
}

.fc-hero .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(248, 244, 234, 0.12);
}

.fc-scroll-hint {
	opacity: 0.85;
}

/* ---------- Bandeau de titre des pages ---------- */

.fc-page-hero .wp-block-post-title {
	text-wrap: balance;
}

/* Fil d'Ariane (Yoast) */
.fc-ariane {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--or-clair);
}

.fc-ariane a {
	color: var(--wp--preset--color--creme);
	text-decoration: underline;
	text-decoration-color: rgba(248, 244, 234, 0.4);
	text-underline-offset: 3px;
}

.fc-ariane a:hover {
	color: var(--wp--preset--color--or-clair);
}

/* ---------- Événement à venir (accueil) ---------- */

.fc-event {
	background: var(--wp--preset--color--foret-nuit);
	color: var(--wp--preset--color--creme);
	border-bottom: 3px solid var(--wp--preset--color--or);
	padding: var(--wp--preset--spacing--50) 1rem;
	margin-top: 0 !important;
}

.fc-event__inner {
	display: grid;
	gap: 1.5rem;
	max-width: 1200px;
	margin-inline: auto;
	align-items: center;
}

@media (min-width: 782px) {
	.fc-event__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: var(--wp--preset--spacing--60);
	}
}

.fc-event__image img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 16px;
}

.fc-event__kicker {
	margin: 0 0 0.5rem;
	color: var(--wp--preset--color--or-clair);
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.fc-event__titre {
	margin: 0;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(1.75rem, 5vw, 2.5rem);
	line-height: 1.15;
	text-wrap: balance;
}

.fc-event__titre a {
	color: var(--wp--preset--color--creme);
	text-decoration: none;
}

.fc-event__titre a:hover {
	color: var(--wp--preset--color--or-clair);
}

.fc-event__resume {
	margin: 0.9rem 0 1.25rem;
	font-size: 1.125rem;
}

.fc-event .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.fc-event .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--creme);
	border: 2px solid var(--wp--preset--color--creme);
	background: transparent;
}

.fc-event .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: rgba(248, 244, 234, 0.12);
}

/* ---------- Chiffres clés ---------- */

.fc-facts .fc-fact {
	margin: 0;
	padding-left: 1rem;
	border-left: 3px solid var(--wp--preset--color--or);
	color: var(--wp--preset--color--bois);
}

.fc-facts .fc-fact strong {
	display: block;
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(1.5rem, 4vw, 2rem);
	color: var(--wp--preset--color--foret);
	line-height: 1.1;
}

/* ---------- Cartes d'activités ---------- */

.fc-card {
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	background: var(--wp--preset--color--blanc);
	box-shadow: 0 1px 2px rgba(18, 37, 27, 0.06), 0 10px 30px -12px rgba(18, 37, 27, 0.25);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	height: 100%;
}

.fc-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 1px 2px rgba(18, 37, 27, 0.06), 0 18px 40px -14px rgba(18, 37, 27, 0.35);
}

.fc-card .wp-block-image {
	margin: 0;
}

.fc-card .wp-block-image img,
.fc-card .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
	border-radius: 0;
}

.fc-card h3 a {
	text-decoration: none;
	color: inherit;
}

/* Toute la carte est cliquable via le lien du titre. */
.fc-card h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.fc-price {
	display: inline-block;
	background: var(--wp--preset--color--sable);
	color: var(--wp--preset--color--bois);
	border-radius: 999px;
	padding: 0.2rem 0.75rem;
	font-weight: 700;
	font-size: 0.9375rem;
}

/* ---------- Tuiles de prix ---------- */

.fc-tile {
	border-radius: 18px;
	border: 1px solid rgba(201, 162, 75, 0.45);
	height: 100%;
}

.fc-tile .fc-tile-price {
	font-family: var(--wp--preset--font-family--fraunces);
	font-size: clamp(2rem, 6vw, 2.75rem);
	line-height: 1;
	color: #8a6a1f; /* or foncé : contraste 5:1 sur fond blanc */
}

/* ---------- Étapes ---------- */

.fc-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background: var(--wp--preset--color--or);
	color: var(--wp--preset--color--foret-nuit);
	font-family: var(--wp--preset--font-family--fraunces);
	font-weight: 700;
	font-size: 1.25rem;
}

/* ---------- Tableaux ---------- */

.wp-block-table {
	overflow-x: auto;
}

.wp-block-table table {
	font-size: 1rem;
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	background: var(--wp--preset--color--blanc);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 0 0 1px rgba(31, 58, 44, 0.12);
}

.wp-block-table thead {
	border: 0;
}

.wp-block-table th {
	background: var(--wp--preset--color--foret);
	color: var(--wp--preset--color--creme);
	font-weight: 700;
	text-align: left;
}

.wp-block-table th,
.wp-block-table td {
	border: 0;
	padding: 0.8rem 1rem;
	vertical-align: top;
}

.wp-block-table tbody tr + tr td {
	border-top: 1px solid rgba(31, 58, 44, 0.1);
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background: rgba(238, 229, 210, 0.45);
}

.wp-block-table td:last-child {
	font-weight: 600;
}

/* ---------- Contenu des pages ---------- */

.entry-content > h2 {
	margin-top: var(--wp--preset--spacing--50);
}

.entry-content > h2::after {
	content: "";
	display: block;
	width: 3rem;
	height: 3px;
	margin-top: 0.6rem;
	background: var(--wp--preset--color--or);
	border-radius: 3px;
}

/* Règle unique pour toutes les photos de contenu : format 3:2, recadrage centré. */
.page .entry-content .wp-block-image img,
.fc-card .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 16px;
}

/* Les affiches des articles restent entières (texte lisible), centrées et de largeur limitée. */
.single .entry-content .wp-block-image img,
.single .entry-content p img {
	display: block;
	margin-inline: auto;
	max-width: min(100%, 560px);
	height: auto;
	border-radius: 12px;
}

.entry-content :is(h2, h3) a {
	text-decoration: none;
}

.entry-content ul li::marker {
	color: var(--wp--preset--color--or);
}

/* Formulaire de contact */
.wpcf7 label {
	display: block;
	font-weight: 600;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin-top: 0.35rem;
	padding: 0.8rem 0.9rem;
	font-size: 1rem;
	border: 1.5px solid rgba(31, 58, 44, 0.3);
	border-radius: 12px;
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--encre);
}

.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--or);
	color: var(--wp--preset--color--foret-nuit);
	border: 0;
	border-radius: 999px;
	padding: 0.9rem 1.75rem;
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
}

.wpcf7 .wpcf7-list-item {
	margin: 0;
}

/* ---------- Pied de page ---------- */

.fc-footer a {
	color: var(--wp--preset--color--creme);
}

.fc-footer a:hover {
	color: var(--wp--preset--color--or);
}

.fc-footer h2 {
	color: var(--wp--preset--color--or);
}

/* ---------- Barre d'actions mobile ---------- */

.fc-actionbar {
	display: none;
}

@media (max-width: 781px) {
	.fc-actionbar {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		position: fixed;
		left: 0.75rem;
		right: 0.75rem;
		bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
		z-index: 60;
		background: var(--wp--preset--color--foret-nuit);
		border: 1px solid rgba(201, 162, 75, 0.5);
		border-radius: 18px;
		box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.45);
		overflow: hidden;
	}

	.fc-actionbar a {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 0.2rem;
		padding: 0.6rem 0.25rem 0.55rem;
		min-height: 3.5rem;
		color: var(--wp--preset--color--creme);
		text-decoration: none;
		font-size: 0.8125rem;
		font-weight: 600;
	}

	.fc-actionbar a:first-child {
		background: var(--wp--preset--color--or);
		color: var(--wp--preset--color--foret-nuit);
	}

	.fc-actionbar svg {
		width: 22px;
		height: 22px;
	}

	body {
		padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
	}
}

/* ---------- Mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.fc-card,
	.fc-card:hover {
		transition: none;
		transform: none;
	}
}

/* ---------- Grilles régulières (3 colonnes) ---------- */

@media (min-width: 600px) {
	.fc-grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (min-width: 960px) {
	.fc-grid-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	}
}
/* Galeries des articles : photos 3:2 en grille régulière. */
.single .entry-content .wp-block-gallery .wp-block-image img {
	max-width: 100%;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	margin: 0;
	border-radius: 12px;
}

.single .entry-content > .wp-block-image img {
	max-width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* ---------- Visionneuse photo ---------- */

.fc-lb-declencheur {
	cursor: zoom-in;
	transition: filter 0.2s ease;
}

.fc-lb-declencheur:hover {
	filter: brightness(1.06);
}

.fc-lb-declencheur:focus-visible {
	outline: 3px solid #C9A24B;
	outline-offset: 3px;
}

html.fc-lb-ouverte,
html.fc-lb-ouverte body {
	overflow: hidden;
}

.fc-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	background: rgba(13, 26, 19, 0.97);
	color: #F8F4EA;
	opacity: 0;
	transition: opacity 0.25s ease;
	touch-action: pan-y;
	overscroll-behavior: contain;
}

.fc-lb[hidden] {
	display: none;
}

.fc-lb.is-ouverte {
	opacity: 1;
}

.fc-lb__haut {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.5rem;
}

.fc-lb__compteur {
	margin: 0;
	font-size: 0.95rem;
	letter-spacing: 0.08em;
	color: #C9A24B;
	font-variant-numeric: tabular-nums;
}

.fc-lb__scene {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 0 1rem;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.85rem;
}

.fc-lb__photo {
	display: block;
	max-width: 100%;
	max-height: calc(100dvh - 11rem);
	width: auto;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
	transition: opacity 0.2s ease;
	user-select: none;
	-webkit-user-drag: none;
}

.fc-lb.is-chargement .fc-lb__photo {
	opacity: 0.35;
}

.fc-lb__legende {
	max-width: 60ch;
	margin: 0;
	text-align: center;
	font-size: 0.95rem;
	line-height: 1.45;
	color: rgba(248, 244, 234, 0.88);
}

.fc-lb__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(201, 162, 75, 0.55);
	border-radius: 50%;
	background: rgba(31, 58, 44, 0.85);
	color: #F8F4EA;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.fc-lb__btn:hover {
	background: #C9A24B;
	color: #12251B;
}

.fc-lb__btn:focus-visible {
	outline: 3px solid #C9A24B;
	outline-offset: 3px;
}

.fc-lb__btn[hidden] {
	display: none;
}

/* Mobile : flèches en bas, à portée de pouce. */
.fc-lb__nav {
	position: absolute;
	bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.fc-lb__prec {
	left: calc(50% - 64px);
}

.fc-lb__suiv {
	right: calc(50% - 64px);
}

.fc-lb__suiv svg {
	transform: rotate(180deg);
}

.fc-lb__scene {
	padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

/* Ordinateur : flèches de part et d'autre de la photo. */
@media (min-width: 900px) {
	.fc-lb__nav {
		top: 50%;
		bottom: auto;
		width: 56px;
		height: 56px;
		transform: translateY(-50%);
	}

	.fc-lb__prec {
		left: 1.5rem;
	}

	.fc-lb__suiv {
		right: 1.5rem;
	}

	.fc-lb__scene {
		padding: 0 6rem 2rem;
	}

	.fc-lb__photo {
		max-height: calc(100dvh - 9rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fc-lb,
	.fc-lb__photo {
		transition: none;
	}
}