/*
Theme Name: Flyers & Events Theme
Theme URI: https://example.com
Author: Votre agence
Description: Thème compagnon du plugin Flyers, Events & Hub. Vitrine publique pour flyers, événements, annonces et albums photo. / Companion theme for the Flyers, Events & Hub plugin.
Version: 1.3.6
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: flyers-events-theme
Tags: community, events, flyers, custom-menu, translation-ready
*/

* { box-sizing: border-box; }

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #1f2933;
	background: #fafafa;
	margin: 0;
}

a { color: #1d4ed8; }
.screen-reader-text { position: absolute; left: -9999px; }

.site-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== BARRE DU HAUT (menu secondaire + langue) ===== */
.site-topbar { background: #111827; color: #d1d5db; font-size: 13px; }
.site-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 20px; flex-wrap: wrap; }
.topbar-nav { min-width: 0; }
.topbar-menu, .topbar-menu ul { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; list-style: none; margin: 0; padding: 0; }
.topbar-menu a { color: #d1d5db; text-decoration: none; font-size: 13px; }
.topbar-menu a:hover { color: #fff; }
.topbar-menu li { position: relative; }
.topbar-menu li.menu-item-has-children > ul { display: none; }

/* Sélecteur de langue : toujours en ligne, jamais seul sur sa propre ligne */
.lang-switch,
.lang-switch ul,
.lang-switch .polylang-lang-list,
.site-topbar-inner ul {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}
.lang-switch li { display: inline-flex; }

/* ===== EN-TÊTE ===== */
.site-header { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 30; }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 20px; }

.site-logo { display: flex; align-items: center; text-decoration: none; }
.site-logo img,
.footer-logo img {
	max-height: 50px;
	width: auto !important;
	height: auto !important;
	max-width: 220px;
	object-fit: contain;
}
.footer-logo img { max-height: 40px; margin-bottom: 10px; }
.site-title { font-size: 20px; font-weight: 800; text-decoration: none; color: #111; }

.header-actions { display: flex; gap: 10px; align-items: center; }
.header-actions-mobile { display: none; }

.btn { padding: 8px 16px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 14px; border: none; cursor: pointer; }
.btn-primary { background: #1d4ed8; color: #fff; }
.btn-outline { border: 1px solid #ddd; color: #333; background: #fff; }
.btn-donate { background: #dc2626; color: #fff; }
.site-topbar .lang-switch a { text-decoration: none; padding: 2px 6px; border-radius: 4px; color: #d1d5db; }
.site-topbar .lang-switch a.active { background: #1d4ed8; color: #fff; }

/* ===== MENU PRINCIPAL + SOUS-MENUS DÉROULANTS ===== */
.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav > .menu { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
.main-nav .menu li { position: relative; }
.main-nav .menu a { text-decoration: none; color: #333; font-weight: 500; display: block; padding: 10px 2px; }
.main-nav .menu a:hover { color: #1d4ed8; }

/* Sous-menus cachés par défaut, affichés uniquement au survol/focus du parent */
.main-nav .menu ul.sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.08);
	padding: 8px 0;
	margin: 0;
	list-style: none;
	z-index: 40;
}
.main-nav .menu li.menu-item-has-children > a::after { content: " \25BE"; font-size: 11px; }
.main-nav .menu li.menu-item-has-children:hover > ul.sub-menu,
.main-nav .menu li.menu-item-has-children:focus-within > ul.sub-menu {
	display: block;
}
.main-nav .menu ul.sub-menu li { width: 100%; }
.main-nav .menu ul.sub-menu a { padding: 8px 16px; white-space: nowrap; }
.main-nav .menu ul.sub-menu ul.sub-menu { top: 0; left: 100%; }

.menu-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 40px; background: transparent; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; }
.menu-toggle-bar { width: 20px; height: 2px; background: #333; margin: 0 auto; }

/* ===== HERO / DIAPORAMA ===== */
.hero { position: relative; overflow: hidden; padding: 90px 0; text-align: center; color: #fff; background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%); }
.hero.no-slides { color: #1f2933; background: linear-gradient(180deg, #eef2ff 0%, #fafafa 100%); }
.hero.no-slides .hero-content p { color: #555; }

.hero-slider { position: absolute; inset: 0; }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s ease-in-out; }
.hero-slide.is-active { opacity: 1; }
.hero-overlay { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.hero.no-slides .hero-overlay { display: none; }

.hero-content { position: relative; z-index: 2; max-width: 640px; margin: 0 auto; }
.hero-content h1 { font-size: 38px; margin-bottom: 14px; }
.hero-content p { margin: 0 auto 22px; opacity: 0.95; }

.hero-slider-dots { position: absolute; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 3; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: transparent; cursor: pointer; padding: 0; }
.hero-dot.is-active { background: #fff; }

.site-main { padding: 40px 0; }
.section-title { font-size: 22px; margin-bottom: 20px; }

/* ===== PIED DE PAGE ===== */
.site-footer { background: #111827; color: #d1d5db; padding: 48px 0 24px; margin-top: 60px; }
.site-footer a { color: #fff; }
.site-footer h4 { color: #fff; margin-top: 0; }
.footer-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-menu a { text-decoration: none; color: #d1d5db; }
.footer-menu a:hover { color: #fff; }
.footer-social { display: flex; gap: 12px; margin-top: 12px; }
.footer-social a { text-decoration: none; font-size: 13px; border: 1px solid #374151; padding: 4px 10px; border-radius: 4px; }
.footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid #1f2937; font-size: 13px; color: #9ca3af; }
.footer-bottom a { color: #d1d5db; text-decoration: underline; }

/* ===== CONTENU SIMPLE / PAGES ===== */
.single-content { max-width: 780px; margin: 0 auto; }
.single-content .feh-meta { color: #666; font-size: 14px; margin-bottom: 20px; }
.single-content img { max-width: 100%; border-radius: 10px; }

.feht-page-content { line-height: 1.7; }
.feht-page-content img { max-width: 100%; border-radius: 10px; }
.feht-testimonials blockquote { background: #f9fafb; border-left: 4px solid #1d4ed8; margin: 0 0 20px; padding: 16px 20px; border-radius: 0 8px 8px 0; font-style: italic; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
	.site-topbar { display: none; }
	.header-actions-desktop { display: none; }
	.menu-toggle { display: flex; }

	.main-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid #eee;
		flex-direction: column;
		align-items: stretch;
		display: none;
		padding: 12px 20px 20px;
		box-shadow: 0 12px 24px rgba(0,0,0,0.06);
	}
	.main-nav.is-open { display: flex; }
	.main-nav > .menu { flex-direction: column; gap: 4px; }
	.main-nav .menu ul.sub-menu { position: static; box-shadow: none; border: none; padding-left: 16px; display: none; }
	.main-nav .menu li.menu-item-has-children.is-open > ul.sub-menu { display: block; }
	.header-actions-mobile { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #eee; }
	.header-actions-mobile .btn { text-align: center; }
	.site-topbar-inner { justify-content: center; text-align: center; }
	.topbar-menu, .topbar-menu ul { justify-content: center; }
}


/* Correctifs d'affichage, largeur des pages et barre d'administration WordPress */
.site-container-wide { max-width: 1440px; }
.site-main .site-container-wide { width: 100%; }
.feht-page-article { width: 100%; max-width: none; }
.feht-page-header { margin-bottom: 24px; }
.feht-page-header h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.15; margin: 0; }
.feht-page-content { max-width: 100%; font-size: 17px; }
.feht-page-content > * { max-width: 100%; }
.feht-page-content .alignwide { max-width: min(100%, 1320px); margin-left: auto; margin-right: auto; }
.feht-page-content .alignfull { width: 100%; max-width: 100%; margin-left: 0; margin-right: 0; }
body.admin-bar .site-header { top: 32px; }
#wpadminbar { position: fixed !important; z-index: 1000000 !important; left: 0 !important; right: 0 !important; width: auto !important; }
#wpadminbar .ab-top-menu > li, #wpadminbar .ab-top-menu > li > .ab-item { max-width: none; }
.feht-services-dropdown { position: relative; display: inline-flex; }
.feht-services-toggle { white-space: nowrap; }
.feht-services-menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 230px; max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 14px 35px rgba(15,23,42,.16); padding: 8px; z-index: 1000; }
.feht-services-dropdown.is-open .feht-services-menu, .feht-services-dropdown:focus-within .feht-services-menu { display: block; }
.feht-services-menu a { display: block; padding: 10px 12px; border-radius: 6px; color: #1f2937; text-decoration: none; }
.feht-services-menu a:hover, .feht-services-menu a:focus { background: #eff6ff; color: #1d4ed8; }
.feht-page-visuals { margin: 10px 0 34px; }
.feht-page-visuals h2, .feht-partners h2 { font-size: clamp(22px, 3vw, 30px); margin: 0 0 18px; }
.feht-visual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feht-visual-card { margin: 0; background: #fff; border: 1px solid #e8edf4; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 22px rgba(15,23,42,.05); }
.feht-visual-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.feht-visual-card figcaption { padding: 13px 15px; font-weight: 700; color: #1f2937; }
.site-main-home { padding-top: 22px; }
.feht-home-section { padding: 30px 0 8px; }
.feht-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.feht-section-head h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); color: #111827; }
.feht-see-all { color: #1d4ed8; text-decoration: none; white-space: nowrap; font-weight: 700; }
.feht-home-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.feht-home-card { overflow: hidden; border: 1px solid #e6eaf0; background: #fff; border-radius: 14px; box-shadow: 0 6px 24px rgba(15,23,42,.045); transition: transform .2s ease, box-shadow .2s ease; min-width: 0; }
.feht-home-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(15,23,42,.09); }
.feht-home-card-image { display: block; background: #f3f6fb; aspect-ratio: 16 / 10; overflow: hidden; }
.feht-home-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feht-home-card-body { padding: 16px; }
.feht-home-card-body h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.feht-home-card-body h3 a { color: #111827; text-decoration: none; }
.feht-home-card-body p { margin: 0 0 14px; color: #64748b; font-size: 14px; line-height: 1.55; }
.feht-card-link { font-size: 14px; font-weight: 700; color: #1d4ed8; text-decoration: none; }
.feht-empty-state { border: 1px dashed #cbd5e1; background: #f8fafc; border-radius: 12px; padding: 24px; color: #64748b; text-align: center; }
.feht-partners { margin-top: 54px; padding: 38px 0; background: #f1f5f9; overflow: hidden; }
.feht-partner-track-wrap { overflow: hidden; width: 100%; }
.feht-partner-track { display: flex; align-items: center; gap: 46px; width: max-content; animation: feht-partners-scroll 32s linear infinite; }
.feht-partner-track:hover { animation-play-state: paused; }
.feht-partner-logo { flex: 0 0 170px; height: 90px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 20px; }
.feht-partner-logo img { display: block; max-width: 100%; max-height: 60px; width: auto; object-fit: contain; }
.feht-partners-hint { margin: 0; color: #64748b; }
@keyframes feht-partners-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 1100px) { .feht-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } #wpadminbar { overflow: visible !important; } .feht-visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .feht-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .site-container, .site-container-wide { padding-left: 16px; padding-right: 16px; } .feht-visual-grid, .feht-home-grid { grid-template-columns: 1fr; } .feht-section-head { align-items: flex-start; } .feht-home-section { padding-top: 22px; } }
@media (prefers-reduced-motion: reduce) { .feht-partner-track { animation: none; } .feht-home-card { transition: none; } }

/* WooCommerce : conserver une grille lisible sans rétrécir la boutique */
.feht-woocommerce-main .woocommerce { width: 100%; max-width: none; }
.feht-woocommerce-main .woocommerce ul.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin: 24px 0; }
.feht-woocommerce-main .woocommerce ul.products::before, .feht-woocommerce-main .woocommerce ul.products::after { display: none; }
.feht-woocommerce-main .woocommerce ul.products li.product { width: auto !important; float: none !important; margin: 0 !important; padding: 14px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; }
.feht-woocommerce-main .woocommerce ul.products li.product a img { border-radius: 8px; }
.feht-woocommerce-main .woocommerce ul.products li.product .button { background: #1d4ed8; color: #fff; border-radius: 6px; }
@media (max-width: 1000px) { .feht-woocommerce-main .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .feht-woocommerce-main .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 420px) { .feht-woocommerce-main .woocommerce ul.products { grid-template-columns: 1fr; } }


/* Pages vitrines : six sections éditables, image et texte en alternance */
.feht-page-sections { display: flex; flex-direction: column; gap: 30px; margin: 10px 0 38px; }
.feht-page-sections-heading { margin: 0 0 2px; font-size: clamp(24px, 3vw, 32px); }
.feht-story-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(22px, 4vw, 54px); padding: clamp(18px, 3vw, 32px); background: #fff; border: 1px solid #e5eaf1; border-radius: 18px; box-shadow: 0 8px 28px rgba(15, 23, 42, .045); }
.feht-story-row.feht-section-reverse .feht-story-image { order: 2; }
.feht-story-row.feht-section-reverse .feht-story-copy { order: 1; }
.feht-story-image { min-width: 0; overflow: hidden; border-radius: 12px; background: #f1f5f9; }
.feht-story-image img { display: block; width: 100%; aspect-ratio: 5 / 4; max-height: 440px; object-fit: cover; }
.feht-story-copy { min-width: 0; }
.feht-story-copy h3 { margin: 0 0 14px; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; color: #111827; }
.feht-story-text { color: #475569; font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
.feht-story-text p { margin: 0 0 12px; }
.feht-story-text p:last-child { margin-bottom: 0; }
.feht-page-sections .feht-story-row:has(.feht-story-copy h3) { min-height: 240px; }
@media (max-width: 700px) {
  .feht-page-sections { gap: 18px; }
  .feht-story-row { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 16px; }
  .feht-story-row.feht-section-reverse .feht-story-image, .feht-story-row.feht-section-reverse .feht-story-copy { order: initial; }
  .feht-story-image img { aspect-ratio: 16 / 10; max-height: none; }
  .feht-story-copy h3 { font-size: 23px; }
  .feht-story-text { font-size: 16px; }
}
