/*
Theme Name: FredyFredo
Theme URI: https://fredyfredo.ch
Author: FredyFredo & Antigravity
Description: Thème sur-mesure ultra-léger et optimisé pour le blog culinaire FredyFredo.
Version: 1.0.0
Text Domain: fredyfredo
*/

/* 
 * ----------------------------------------
 * VARIABLES GLOBALES (DESIGN SYSTEM)
 * ----------------------------------------
 */
:root {
	/* Backgrounds & Borders */
	--color-bg-cream: #fbf9f2;
	--color-bg-chip: #eaf4e1;
	--color-border: #e4dece;

	/* Typography Colors */
	--color-text-dark: #5f594a;
	--color-title-olive: #2f3b20;

	/* Accent Colors */
	--color-accent-green: #5ca144;
	--color-accent-dark-green: #3f752d;
	--color-accent-orange: #e67e22;
	--color-checked-gray: #a0a099;

	/* Layout */
	--max-width-article: 840px;
}

/* 
 * ----------------------------------------
 * RESET & STYLES GLOBAUX
 * ----------------------------------------
 */
body {
	background-color: var(--color-bg-cream);
	color: var(--color-text-dark);
	font-family: 'Lato', sans-serif;
	font-size: 16px;
	line-height: 1.65;
	margin: 0;
	padding: 0;
}

h1, h2, h3, h4, h5, h6 {
	color: var(--color-title-olive);
	font-family: 'Playfair Display', serif;
	line-height: 1.2;
	margin-top: 2rem;
	margin-bottom: 1rem;
}

a {
	color: var(--color-accent-green);
	text-decoration: none;
	transition: color 0.3s ease;
}

a:hover, a:focus {
	color: var(--color-accent-orange);
}

img {
	max-width: 100%;
	height: auto;
}

/* 
 * ----------------------------------------
 * SINGLE ARTICLE (single.php)
 * ----------------------------------------
 */
.site-main--single {
	max-width: var(--max-width-article);
	margin: 0 auto;
	padding: 40px 20px;
}

.entry-header {
	text-align: center;
	margin-bottom: 3rem;
}

.entry-title {
	font-size: 2.5rem;
	margin-top: 0.5rem;
	margin-bottom: 0.5rem;
}

.entry-meta--category a {
	color: var(--color-accent-orange);
	text-transform: uppercase;
	font-weight: bold;
	font-size: 0.85rem;
	letter-spacing: 1px;
}

.entry-meta--date {
	font-family: 'Lato', sans-serif;
	font-size: 0.9rem;
	opacity: 0.8;
	margin-bottom: 2rem;
}

.entry-thumbnail img {
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(95, 89, 74, 0.1);
}

/* 
 * ----------------------------------------
 * MODULE : .ff-recipe-box (Fiche Recette)
 * ----------------------------------------
 */
.ff-recipe-box,
.ff-recipe-box * {
	box-sizing: border-box;
}

.ff-recipe-box {
	/* Map local variables to global design system */
	--bg-main: var(--color-bg-cream);     
	--bg-chip: var(--color-bg-chip);     
	--border: var(--color-border);      
	--text: var(--color-text-dark);
	--title: var(--color-title-olive);       
	--accent: var(--color-accent-green);      
	--accent-dark: var(--color-accent-dark-green);
	--checked: var(--color-checked-gray);

	background: var(--bg-main);
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 22px 22px 26px;
	max-width: 840px;
	margin: 0 auto 40px;
	color: var(--text);
	
	/* L'héritage utilise maintenant 'Lato' défini sur le body */
	font-family: inherit; 
	font-size: 16px;
	line-height: inherit;
	box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
	position: relative;
	display: flow-root;
}

.ff-recipe-box .ff-title {
	font-family: 'Playfair Display', serif; 
	color: var(--title);
	font-size: clamp(26px, 3vw, 38px); 
	font-weight: 800; 
	line-height: 1.15; 
	margin: 0 0 8px;
}

.ff-recipe-box .ff-kicker { 
	margin: 0 0 18px; 
	font-size: 1.02rem; 
	font-style: italic; 
	color: #666; 
}

.ff-recipe-box .ff-chips { 
	display: flex; 
	flex-wrap: wrap; 
	gap: 8px; 
	margin: 0 0 20px; 
}

.ff-recipe-box .ff-chip {
	display: inline-flex; 
	align-items: center; 
	padding: 6px 12px; 
	border-radius: 999px;
	background: var(--bg-chip); 
	border: 1px solid var(--border);
	font-size: .85rem; 
	font-weight: 700; 
	color: var(--title);
}

.ff-recipe-box .ff-meta-grid {
	display: grid; 
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); 
	gap: 12px; 
	margin-bottom: 20px;
}

.ff-recipe-box .ff-meta-card {
	background: #fff; 
	border-radius: 14px; 
	border: 1px solid var(--border);
	padding: 10px 8px; 
	text-align: center; 
	box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.ff-recipe-box .ff-meta-label { 
	font-size: .75rem; 
	font-weight: 600; 
	color: #888; 
	text-transform: uppercase; 
	letter-spacing: 0.05em; 
	margin-bottom: 2px; 
}

.ff-recipe-box .ff-meta-value { 
	font-weight: 800; 
	font-size: 1.05rem; 
	color: var(--title); 
}

.ff-recipe-box .ff-toolbar { 
	display: flex; 
	flex-wrap: wrap; 
	gap: 10px; 
	margin: 4px 0 20px; 
}

.ff-recipe-box .ff-btn {
	display: inline-flex; 
	align-items: center; 
	gap: 8px; 
	padding: 10px 18px;
	border-radius: 999px; 
	border: 2px solid var(--accent); 
	background: var(--accent);
	color: #fff; 
	text-transform: uppercase; 
	font-size: .85rem; 
	font-weight: 800;
	cursor: pointer; 
	box-shadow: 0 3px 6px rgba(0,0,0,.08); 
	transition: all 0.2s ease; 
	text-decoration: none;
}

.ff-recipe-box .ff-btn:hover {
	background: var(--accent-dark); 
	border-color: var(--accent-dark); 
	transform: translateY(-1px); 
	color: #fff;
}

.ff-recipe-box .ff-btn-wa { 
	background: #25D366; 
	border-color: #25D366; 
}

.ff-recipe-box .ff-btn-wa:hover { 
	background: #1da851; 
	border-color: #1da851; 
}

.ff-recipe-box .ff-panel {
	background: #fff; 
	border-radius: 16px; 
	border: 1px solid var(--border);
	padding: 25px; 
	margin-bottom: 20px;
}

.ff-recipe-box h2.ff-sect-title {
	/* Déjà défini dans le bloc h2 global, mais on le sécurise ici au cas où */
	font-family: 'Playfair Display', serif; 
	margin: 0 0 18px; 
	font-size: 1.35rem; 
	color: var(--title);
	border-bottom: 2px solid var(--bg-chip); 
	display: inline-block; 
	padding-bottom: 4px;
}

.ff-recipe-box .ff-servings strong { 
	color: var(--title); 
}

.ff-recipe-box .ff-servingsInput {
	width: 60px; 
	padding: 6px; 
	margin-left: 6px; 
	text-align: center;
	border-radius: 8px; 
	border: 1px solid var(--border); 
	font-weight: 700; 
	color: var(--accent-dark); 
	font-size: 1.1rem;
}

.ff-recipe-box ul, .ff-recipe-box ol { 
	margin: 0; 
	padding-left: 0; 
	list-style: none; 
}

.ff-recipe-box .ff-ingredient-item {
	display: flex; 
	align-items: flex-start; 
	gap: 12px; 
	padding: 10px 0;
	border-bottom: 1px dashed var(--border); 
	cursor: pointer; 
	transition: all 0.2s;
}

.ff-recipe-box .ff-ingredient-item:last-child { 
	border-bottom: none; 
}

.ff-recipe-box .ff-ingredient-item:hover { 
	background-color: #fafafa; 
}

.ff-recipe-box .ff-check-box {
	min-width: 22px; 
	height: 22px; 
	border: 2px solid #ccc; 
	border-radius: 4px;
	margin-top: 2px; 
	display: flex; 
	align-items: center; 
	justify-content: center; 
	transition: all 0.2s;
}

.ff-recipe-box .ff-ingredient-item.checked { 
	color: var(--checked); 
	text-decoration: line-through; 
}

.ff-recipe-box .ff-ingredient-item.checked .ff-check-box { 
	background: var(--accent); 
	border-color: var(--accent); 
	color: #fff; 
}

.ff-recipe-box .ff-ingredient-item.checked .ff-check-box::after { 
	content: "✓"; 
	font-size: 14px; 
	font-weight: bold; 
}

.ff-recipe-box .ff-qty { 
	font-weight: 800; 
	color: var(--title); 
}

.ff-recipe-box .ff-instruction-item {
	position: relative; 
	padding: 0 0 25px 25px; 
	margin-left: 10px;
	border-left: 2px solid var(--border); 
	cursor: pointer; 
	transition: opacity 0.3s;
}

.ff-recipe-box .ff-instruction-item:last-child { 
	border-left: 2px solid transparent; 
}

.ff-recipe-box .ff-instruction-item::before {
	content: counter(inst, decimal); 
	counter-increment: inst; 
	position: absolute; 
	left: -15px; 
	top: 0;
	width: 28px; 
	height: 28px; 
	background: var(--bg-chip); 
	border: 2px solid #fff; 
	border-radius: 50%;
	text-align: center; 
	line-height: 24px; 
	font-weight: 800; 
	font-size: 0.9rem; 
	color: var(--accent-dark);
}

.ff-recipe-box ol { 
	counter-reset: inst; 
}

.ff-recipe-box .ff-instruction-item.step-done { 
	opacity: 0.4; 
}

.ff-recipe-box .ff-instruction-item.step-done::before { 
	background: var(--accent); 
	color: #fff; 
	content: "✓"; 
}

.ff-recipe-box .ff-timer-link {
	display: inline-block; 
	background-color: var(--bg-chip); 
	border: 1px solid var(--border);
	border-radius: 4px; 
	padding: 0 6px; 
	font-weight: 700; 
	color: var(--accent-dark);
	cursor: pointer; 
	transition: all 0.2s;
}

.ff-recipe-box .ff-timer-link:hover { 
	background: var(--accent); 
	color: #fff; 
	border-color: var(--accent); 
}

.ff-recipe-box .ff-timer-link::before { 
	content: "⏱ "; 
	font-size: 0.9em; 
}

/* 
 * ----------------------------------------
 * FLOATING TIMER
 * ----------------------------------------
 */
#ff-floating-timer {
	position: fixed; 
	bottom: 20px; 
	right: 20px; 
	background: var(--color-title-olive); 
	color: #fff;
	padding: 12px 20px; 
	border-radius: 50px; 
	box-shadow: 0 5px 20px rgba(0,0,0,0.3);
	display: flex; 
	align-items: center; 
	gap: 15px; 
	z-index: 9999;
	font-family: monospace; 
	font-size: 1.2rem; 
	font-weight: bold;
	opacity: 0; 
	pointer-events: none; 
	transform: translateY(20px); 
	transition: all 0.3s;
}

#ff-floating-timer.is-visible { 
	opacity: 1; 
	pointer-events: auto; 
	transform: translateY(0); 
}

@keyframes flashTimer { 
	0% { background: red; } 
	50% { background: var(--color-title-olive); } 
	100% { background: red; } 
}

#ff-floating-timer.is-ringing { 
	animation: flashTimer 1s infinite; 
}

#ff-timer-close { 
	background: rgba(255,255,255,0.2); 
	border: none; 
	color: #fff; 
	width: 24px; 
	height: 24px; 
	border-radius: 50%; 
	cursor: pointer; 
}

/* 
 * ----------------------------------------
 * MEDIA QUERIES & IMPRESSION
 * ----------------------------------------
 */
@media (max-width: 640px) {
	.ff-recipe-box { 
		padding: 15px; 
		border-radius: 12px; 
	}
	.ff-recipe-box .ff-meta-grid { 
		grid-template-columns: repeat(2, minmax(0, 1fr)); 
		gap: 6px; 
	}
}

@media print {
	/* Masquer les éléments inutiles pour l'impression finale Haut de gamme */
	.site-header, 
	.site-footer, 
	.ff-share-section, 
	.ff-breadcrumbs, 
	.post-navigation, 
	#comments, 
	.ff-print-btn, 
	.entry-meta--category,
	.ff-toolbar, 
	#ff-floating-timer, 
	.ff-seo-intro { 
		display: none !important; 
	}

	/* Réinitialiser les couleurs de fond et les bordures pour économiser l'encre */
	body, 
	.site-main--single article, 
	.ff-recipe-box,
	.site-main {
		background: transparent !important;
		background-color: transparent !important;
		box-shadow: none !important;
		border: none !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* S'assurer que le contenu principal prend toute la largeur de la feuille A4 */
	.site-main__container, .site-main--single {
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}
	
	/* Ne pas imprimer les liens avec des soulignements ou des couleurs */
	a {
		text-decoration: none !important;
		color: #000 !important;
	}
}

/* 
 * ----------------------------------------
 * HEADER & NAVIGATION
 * ----------------------------------------
 */
.site-header {
	background-color: var(--color-bg-cream); /* Cohérence avec le design ! */
	border-bottom: 1px solid var(--color-border);
	padding: 25px 20px;
	position: sticky;
	top: 0;
	z-index: 1000;
	box-shadow: 0 4px 15px rgba(0,0,0,0.03); /* Ombre douce pour le sticky */
}

/* Limiter la taille du logo officiel */
.site-logo img {
	max-height: 90px;
	width: auto;
}

.site-header__container {
	max-width: var(--max-width-article);
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 20px;
}

.site-branding .site-title {
	margin: 0;
	font-size: 2rem;
	font-weight: 900;
	letter-spacing: -0.5px;
	font-family: 'Playfair Display', serif;
}

.site-title a {
	color: var(--color-title-olive);
}

.site-title a:hover {
	color: var(--color-accent-green);
}

.site-description {
	margin: 0;
	font-size: 0.95rem;
	color: var(--color-text-dark);
	opacity: 0.8;
	font-style: italic;
}

/* Menu principal */
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 30px;
	align-items: center;
}

.main-navigation li {
	position: relative;
}

.main-navigation a {
	display: block;
	color: var(--color-text-dark);
	font-weight: 700;
	font-size: 1.05rem;
	padding: 5px 0;
	transition: color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
	color: var(--color-accent-green);
}

/* Effet Hover (Soulignement animé) */
.main-navigation a::after {
	content: '';
	position: absolute;
	width: 100%;
	transform: scaleX(0);
	height: 3px;
	bottom: -4px;
	left: 0;
	background-color: var(--color-accent-green);
	transform-origin: bottom right;
	transition: transform 0.3s cubic-bezier(0.86, 0, 0.07, 1);
	border-radius: 2px;
}

.main-navigation a:hover::after {
	transform: scaleX(1);
	transform-origin: bottom left;
}

/* Accessibilité: Cacher le texte aux yeux (utile pour les liens skip-to-content) */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* 
 * ----------------------------------------
 * FOOTER
 * ----------------------------------------
 */
.site-footer {
	background-color: var(--color-bg-cream);
	border-top: 1px solid var(--color-border);
	padding: 50px 20px;
	text-align: center;
	margin-top: 60px;
}

.site-footer__container {
	max-width: var(--max-width-article);
	margin: 0 auto;
}

.site-info p {
	margin: 0;
	color: var(--color-text-dark);
	font-size: 1rem;
}

.site-info a {
	color: var(--color-title-olive);
	font-weight: 900;
}

.site-info a:hover {
	color: var(--color-accent-green);
	text-decoration: underline;
}

/* Responsive basique pour forcer l'empilement sur petits écrans */
@media (max-width: 640px) {
	.site-header__container {
		flex-direction: column;
		text-align: center;
	}
	.main-navigation ul {
		flex-wrap: wrap;
		justify-content: center;
		gap: 15px;
	}
}

/* 
 * ----------------------------------------
 * FORMULAIRES (Contact, Commentaires)
 * ----------------------------------------
 */
form {
	max-width: 100%;
}

form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="url"],
form textarea {
	width: 100%;
	padding: 12px 15px;
	margin-bottom: 20px;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	background-color: #fff;
	color: var(--color-text-dark);
	font-family: inherit;
	font-size: 1rem;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	box-sizing: border-box;
}

form input:focus,
form textarea:focus {
	outline: none;
	border-color: var(--color-accent-green);
	box-shadow: 0 0 0 3px rgba(92, 161, 68, 0.15);
}

form textarea {
	min-height: 150px;
	resize: vertical;
}

form label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: var(--color-title-olive);
	font-size: 0.95rem;
}

form input[type="submit"],
form button[type="submit"],
.wp-block-button__link {
	background-color: var(--color-accent-green);
	color: #fff;
	border: none;
	border-radius: 50px;
	padding: 12px 30px;
	font-size: 1.05rem;
	font-weight: bold;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.2s ease;
	font-family: inherit;
	text-decoration: none;
	display: inline-block;
}

form input[type="submit"]:hover,
form button[type="submit"]:hover,
.wp-block-button__link:hover {
	background-color: var(--color-accent-dark-green);
	transform: translateY(-2px);
	color: #fff;
}

/* 
 * ----------------------------------------
 * PEPS VISUEL & FINITIONS UTILE
 * ----------------------------------------
 */
/* Fond doux derrière le contenu de l'article pour le détacher du body */
.site-main--single article {
	background-color: #f4f1ea;
	padding: 40px;
	border-radius: 20px;
}

@media (max-width: 640px) {
	.site-main--single article {
		padding: 20px;
		border-radius: 12px;
	}
}

/* Animation Battement de Cœur discret */
@keyframes ffHeartbeat {
	0% { transform: scale(1); }
	14% { transform: scale(1.04); }
	28% { transform: scale(1); }
	42% { transform: scale(1.04); }
	70% { transform: scale(1); }
}

/* Effet Glow (lueur) sur le bouton Surprends-moi et boutons majeurs */
.ff-btn-surprise {
	transition: all 0.3s ease;
	animation: ffHeartbeat 3s infinite;
}

.ff-featured-btn {
	transition: all 0.3s ease;
}

.ff-btn-surprise:hover,
.ff-featured-btn:hover {
	box-shadow: 0 0 25px rgba(109, 161, 63, 0.6);
	transform: translateY(-3px);
	animation-play-state: paused;
}

/* 
 * ----------------------------------------
 * SOCIAL & PARTAGE 
 * ----------------------------------------
 */
.ff-social-icon {
	color: var(--color-title-olive);
	font-weight: 900;
	font-size: 0.95rem;
	padding: 8px 15px;
	border-radius: 8px;
	background: var(--color-bg-chip);
	transition: all 0.3s ease;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 5px;
}

.ff-social-icon:hover {
	background: var(--color-accent-green);
	color: #fff;
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 4px 10px rgba(92, 161, 68, 0.2);
}

.ff-share-btn.ff-share-whatsapp {
	display: inline-block;
	background-color: #25D366;
	color: #fff;
	padding: 14px 28px;
	border-radius: 50px;
	font-weight: 900;
	font-size: 1.1rem;
	text-decoration: none;
	box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
	transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.ff-share-btn.ff-share-whatsapp:hover {
	background-color: #1da851;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
	color: #fff;
}

