/*
Theme Name:   Noly Compta (Astra enfant)
Theme URI:    https://noly-compta.fr/
Description:  Thème enfant d’Astra pour Noly Compta : menus, sommaire, partage et tableaux des articles, textes du blog repris de l’ancien thème.
Author:       Noly Compta
Template:     astra
Version:      1.3.2
Text Domain:  noly-astra
*/

/* ---------- Sommaire des articles (« Dans cet article ») ---------- */
.noly-sommaire {
	margin: 24px 0 32px;
	border: 1px solid #D9D9D9;
	border-radius: 12px;
	background: #FFFFFF;
	max-width: 640px;
}
.noly-sommaire summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	font-family: "League Spartan", sans-serif;
	font-size: 19px;
	font-weight: 600;
	color: #161922;
}
.noly-sommaire summary::-webkit-details-marker { display: none; }
.noly-sommaire summary::after {
	content: "+";
	font-size: 22px;
	line-height: 1;
	color: #45CAAD;
}
.noly-sommaire details[open] summary::after { content: "−"; }
.noly-sommaire nav { padding: 0 18px 16px; }
.noly-sommaire ol {
	margin: 0;
	padding-left: 0;
	list-style: none;
	counter-reset: noly-sommaire;
}
.noly-sommaire ol ol { padding-left: 22px; margin-top: 6px; }
.noly-sommaire li {
	counter-increment: noly-sommaire;
	margin: 6px 0;
	font-size: 16px;
	line-height: 1.4;
}
.noly-sommaire li::before {
	content: counters(noly-sommaire, ".") ". ";
	color: #8A8A8A;
}
.single .noly-sommaire nav a { color: #1D1D1F; text-decoration: none; }
.single .noly-sommaire nav a:hover { color: #2E9E86; text-decoration: underline; }

/* Ancres du sommaire : ne passent pas sous l'en-tête */
.noly-ancre { display: block; height: 0; scroll-margin-top: 110px; }

/* ---------- Boutons de partage ---------- */
.noly-partage {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-top: 20px;
	border-top: 1px solid #E5E5E5;
	font-family: "League Spartan", sans-serif;
	color: #5F5F5F;
}
.noly-partage-liens { display: flex; gap: 10px; }
.noly-partage a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #F6F0F9;
	color: #161922;
	transition: background .2s, color .2s;
}
.noly-partage a:hover { background: #58C9B9; color: #000000; }
.noly-partage svg { width: 18px; height: 18px; fill: currentColor; }

/* =====================================================================
   Menus (shortcode [noly_menu]) — remplace l'extension de menu
   ===================================================================== */
.noly-nav { position: static; font-family: "League Spartan", sans-serif; }
.noly-nav ul { list-style: none; margin: 0; padding: 0; }
.noly-nav a { text-decoration: none; }

/* --- Ordinateur --- */
@media (min-width: 1025px) {
	.noly-nav-bouton, .noly-nav-fleche { display: none; }
	.noly-nav-liste { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
	.noly-nav-liste > li { position: relative; }
	.noly-nav-liste > li > a {
		display: flex; align-items: center; gap: 8px;
		padding: 10px 13px; color: #FFFFFF; font-size: 16px; font-weight: 500;
	}
	.noly-nav-liste > li.menu-item-has-children > a::after {
		content: ""; width: 6px; height: 6px; margin-top: -4px;
		border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
	}
	.noly-nav-liste > li > a:hover,
	.noly-nav-liste > li:focus-within > a,
	.noly-nav-liste > li.current-menu-item > a,
	.noly-nav-liste > li.current-menu-ancestor > a { color: #58C9B9; }

	/* sous-menus */
	.noly-nav .sub-menu {
		position: absolute; top: 100%; left: 0; z-index: 100; min-width: 250px;
		padding: 8px; margin-top: 10px; background: #FFFFFF; border-radius: 12px;
		box-shadow: 0 14px 40px rgba(0, 0, 0, .18);
		opacity: 0; visibility: hidden; transform: translateY(6px);
		transition: opacity .18s, transform .18s, visibility .18s;
	}
	.noly-nav .sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* pont pour la souris */
	.noly-nav li:hover > .sub-menu,
	.noly-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
	.noly-nav .sub-menu li { position: relative; }
	.noly-nav .sub-menu a {
		display: flex; justify-content: space-between; align-items: center; gap: 12px;
		padding: 11px 14px; border-radius: 8px; color: #161922; font-size: 15px; font-weight: 500;
	}
	.noly-nav .sub-menu a:hover,
	.noly-nav .sub-menu li:focus-within > a,
	.noly-nav .sub-menu .current-menu-item > a { background: #DEF4F1; color: #000000; }
	.noly-nav .sub-menu .menu-item-has-children > a::after { content: "›"; font-size: 18px; line-height: 1; color: #45CAAD; }
	/* 3e niveau : à droite */
	.noly-nav .sub-menu .sub-menu { top: -8px; left: 100%; margin: 0 0 0 8px; }
	.noly-nav .sub-menu .sub-menu::before { top: 0; bottom: 0; left: -10px; right: auto; width: 10px; height: auto; }
}

/* --- Tablette et téléphone --- */
@media (max-width: 1024px) {
	.noly-nav-bouton {
		display: flex; flex-direction: column; justify-content: center; gap: 5px;
		width: 44px; height: 44px; padding: 10px; margin-left: auto;
		background: transparent; border: 0; cursor: pointer;
	}
	.noly-nav-bouton span { display: block; height: 3px; border-radius: 2px; background: #FFFFFF; transition: transform .2s, opacity .2s; }
	.noly-nav.est-ouvert .noly-nav-bouton span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
	.noly-nav.est-ouvert .noly-nav-bouton span:nth-child(2) { opacity: 0; }
	.noly-nav.est-ouvert .noly-nav-bouton span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

	.noly-nav-panneau {
		display: none; position: absolute; left: -16px; right: -16px; top: calc(100% + 12px); z-index: 100;
		max-height: calc(100vh - 120px); overflow-y: auto;
		padding: 10px 16px 18px; background: #FFFFFF; box-shadow: 0 18px 40px rgba(0, 0, 0, .2);
	}
	.noly-nav.est-ouvert .noly-nav-panneau { display: block; }
	.noly-nav-liste li { position: relative; border-bottom: 1px solid #F0F0F0; }
	.noly-nav-liste li:last-child { border-bottom: 0; }
	.noly-nav-liste a { display: block; padding: 13px 48px 13px 4px; color: #161922; font-size: 17px; font-weight: 500; }
	.noly-nav-liste .current-menu-item > a { color: #2E9E86; }
	.noly-nav-fleche {
		position: absolute; top: 4px; right: 0; width: 44px; height: 44px;
		background: transparent; border: 0; cursor: pointer;
	}
	.noly-nav-fleche::before {
		content: ""; display: block; width: 9px; height: 9px; margin: 0 auto;
		border-right: 2px solid #161922; border-bottom: 2px solid #161922;
		transform: rotate(45deg); transition: transform .2s;
	}
	.sous-ouvert > .noly-nav-fleche::before { transform: rotate(-135deg); }
	.noly-nav .sub-menu { display: none; padding-left: 14px; border-left: 2px solid #DEF4F1; margin-bottom: 8px; }
	.noly-nav .sous-ouvert > .sub-menu { display: block; }
	.noly-nav .sub-menu a { font-size: 16px; padding-top: 10px; padding-bottom: 10px; }
}

/* --- Priorité sur les réglages globaux (liens d'Elementor, boutons d'Astra) --- */
body .noly-nav a,
body .noly-nav a:hover,
body .noly-liste a,
body .noly-liste a:hover,
body .noly-filtres a,
body .noly-filtres a:hover { text-decoration: none; }
body .noly-nav .noly-nav-liste .sub-menu { background-color: #FFFFFF; }
body .noly-nav button.noly-nav-bouton,
body .noly-nav button.noly-nav-fleche,
body .noly-nav button.noly-nav-bouton:hover,
body .noly-nav button.noly-nav-fleche:hover,
body .noly-nav button.noly-nav-bouton:focus,
body .noly-nav button.noly-nav-fleche:focus {
	background: transparent; border: 0; box-shadow: none; color: inherit; border-radius: 6px;
}
body .noly-nav button:focus-visible { outline: 2px solid #58C9B9; outline-offset: 2px; }
@media (max-width: 1024px) {
	body .noly-nav .noly-nav-panneau { left: auto; right: -16px; width: 100vw; padding: 8px 24px 20px; box-sizing: border-box; }
	body .noly-nav .noly-nav-liste a { color: #161922; }
	body .noly-nav .noly-nav-liste .current-menu-item > a,
	body .noly-nav .noly-nav-liste .current-menu-ancestor > a { color: #2E9E86; }
}
/* bouton « haut de page » d'Astra aux couleurs du site */
#ast-scroll-top { background-color: #58C9B9; color: #000000; border-radius: 50%; }

/* --- Listes du pied de page --- */
.noly-liste-ul { list-style: none; margin: 0; padding: 0; font-family: "League Spartan", sans-serif; }
.noly-liste-ul li { margin: 0 0 12px; }
body .noly-liste a { color: #000000; font-size: 16px; text-decoration: none; }
body .noly-liste a:hover, body .noly-liste .current-menu-item > a { color: #2E9E86; }

/* --- Filtres du blog (boutons arrondis) --- */
.noly-filtres-ul {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
	list-style: none; margin: 0; padding: 0; font-family: "League Spartan", sans-serif;
}
body .noly-filtres a {
	display: block; min-width: 150px; padding: 11px 26px; text-align: center;
	border: 1px solid #E3E3E3; border-radius: 120px; background: #FFFFFF;
	color: #555555; font-size: 17px; text-decoration: none; transition: background .2s, color .2s, border-color .2s;
}
body .noly-filtres a:hover { border-color: #58C9B9; color: #000000; }
body .noly-filtres .current-menu-item > a { background: #58C9B9; border-color: #58C9B9; color: #000000; font-weight: 600; }
@media (max-width: 767px) { .noly-filtres a { min-width: 0; padding: 9px 18px; font-size: 15px; } }

/* =====================================================================
   Tableaux des articles
   ===================================================================== */
.single .emcp-dyn-post-content figure.wp-block-table {
	margin: 28px 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
	border: 1px solid #E3E3E3; border-radius: 16px; box-shadow: 0 6px 24px rgba(22, 25, 34, .06);
}
.single .emcp-dyn-post-content table {
	width: 100%; margin: 0; border: 0; border-collapse: collapse;
	font-size: 15.5px; line-height: 1.5; color: #333333; background: #FFFFFF;
}
/* tableau sans en-têtes sur petit écran : il défile dans son cadre */
.single .emcp-dyn-post-content figure.wp-block-table table:not(.noly-cartes) { min-width: 560px; }
.single .emcp-dyn-post-content table th,
.single .emcp-dyn-post-content table thead td {
	padding: 15px 18px; border: 0; text-align: left; vertical-align: bottom;
	background: #161922; color: #FFFFFF;
	font-family: "League Spartan", sans-serif; font-size: 15.5px; font-weight: 600;
}
.single .emcp-dyn-post-content table td {
	padding: 13px 18px; border: 0; border-top: 1px solid #ECECEC; text-align: left; vertical-align: top;
}
.single .emcp-dyn-post-content table tbody tr:nth-child(even) td { background: #F7FBFA; }
.single .emcp-dyn-post-content table tbody tr:hover td { background: #DEF4F1; }
.single .emcp-dyn-post-content table td:first-child { font-weight: 600; color: #161922; }
.single .emcp-dyn-post-content figure.wp-block-table figcaption {
	padding: 10px 18px; margin: 0; font-size: 14px; color: #6B6B6B; background: #FAFAFA; border-top: 1px solid #ECECEC;
}

/* Téléphone : chaque ligne devient une carte (tableaux avec en-têtes, voir inc/tableaux.php) */
@media (max-width: 767px) {
	.single .emcp-dyn-post-content figure.wp-block-table:has(table.noly-cartes) {
		overflow: visible; border: 0; border-radius: 0; box-shadow: none;
	}
	.single .emcp-dyn-post-content table.noly-cartes,
	.single .emcp-dyn-post-content table.noly-cartes tbody,
	.single .emcp-dyn-post-content table.noly-cartes tr,
	.single .emcp-dyn-post-content table.noly-cartes td { display: block; width: 100%; min-width: 0; }
	.single .emcp-dyn-post-content table.noly-cartes { background: transparent; }
	.single .emcp-dyn-post-content table.noly-cartes thead,
	.single .emcp-dyn-post-content table.noly-cartes tr.noly-entete { display: none; }
	.single .emcp-dyn-post-content table.noly-cartes tr {
		margin: 0 0 14px; overflow: hidden; background: #FFFFFF;
		border: 1px solid #E3E3E3; border-radius: 14px; box-shadow: 0 4px 16px rgba(22, 25, 34, .06);
	}
	.single .emcp-dyn-post-content table.noly-cartes td {
		display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
		padding: 11px 14px; border-top: 1px solid #F0F0F0; text-align: right; background: #FFFFFF;
		font-weight: 400; color: #333333;
	}
	.single .emcp-dyn-post-content table.noly-cartes tbody tr:nth-child(even) td,
	.single .emcp-dyn-post-content table.noly-cartes tbody tr:hover td { background: #FFFFFF; }
	.single .emcp-dyn-post-content table.noly-cartes td::before {
		content: attr(data-label); flex: 0 0 45%; text-align: left;
		font-family: "League Spartan", sans-serif; font-weight: 600; color: #161922;
	}
	/* 1re cellule = titre de la carte */
	.single .emcp-dyn-post-content table.noly-cartes tbody tr:nth-child(n) td:first-child {
		display: block; border-top: 0; text-align: left; background: #DEF4F1;
		font-family: "League Spartan", sans-serif; font-size: 17px; font-weight: 700; color: #161922;
	}
	.single .emcp-dyn-post-content table.noly-cartes td:first-child::before {
		display: block; margin-bottom: 2px; font-size: 13px; font-weight: 500; color: #2E9E86;
	}
	.single .emcp-dyn-post-content table.noly-cartes td:not([data-label])::before { content: none; }
}

/* ---------- Formulaires Contact Form 7 (repris du vrai site) ---------- */
/* Contact (6) et services (6453) : colonne centrée de 580 px */
.wpcf7[id^="wpcf7-f6-"], .wpcf7[id^="wpcf7-f6453-"] { max-width: 580px; margin-left: auto; margin-right: auto; }
.wpcf7[id^="wpcf7-f6-"] form p, .wpcf7[id^="wpcf7-f6453-"] form p { margin: 0 0 15px; }
.wpcf7[id^="wpcf7-f6-"] label, .wpcf7[id^="wpcf7-f6453-"] label {
	display: block; margin: 0 0 5px; font-family: "League Spartan", sans-serif;
	font-size: 18px; font-weight: 400; line-height: 32px; color: #000;
}
.wpcf7[id^="wpcf7-f6-"] .wpcf7-form-control:not(.wpcf7-submit),
.wpcf7[id^="wpcf7-f6453-"] .wpcf7-form-control:not(.wpcf7-submit) {
	width: 100%; height: 48px; padding: 10px; font-size: 14px; color: #000; background: #fff;
	border: 1px solid #B3AEAE; border-radius: 10px; box-shadow: none;
}
.wpcf7[id^="wpcf7-f6-"] .wpcf7-form-control:not(.wpcf7-submit):focus,
.wpcf7[id^="wpcf7-f6453-"] .wpcf7-form-control:not(.wpcf7-submit):focus { border-color: #519D9E; outline: 0; }
.wpcf7[id^="wpcf7-f6-"] textarea.wpcf7-form-control:not(.wpcf7-submit) { height: 200px; }
.wpcf7[id^="wpcf7-f6-"] form p:has(.wpcf7-submit), .wpcf7[id^="wpcf7-f6453-"] form p:has(.wpcf7-submit) { text-align: center; }
.wpcf7 .wpcf7-quiz-label { color: #000; }

/* Partenariat Shine (2753) : icône ronde dans chaque champ */
.wpcf7[id^="wpcf7-f2753-"] .form-group { margin-bottom: 20px; }
.wpcf7[id^="wpcf7-f2753-"] label {
	position: relative; display: block; margin: 0 0 5px; font-size: 18px; font-weight: 700; line-height: 25px; color: #626262;
}
.wpcf7[id^="wpcf7-f2753-"] .wpcf7-form-control-wrap { display: block; margin-top: 8px; }
.wpcf7[id^="wpcf7-f2753-"] .wpcf7-form-control:not(.wpcf7-submit) {
	width: 100%; height: 39px; padding: 10px 10px 10px 55px; font-size: 14px; color: #626262; background: #fff;
	border: 1px solid #EBEBEB; border-radius: 0; box-shadow: inset 0 0 2px 2px rgba(0, 0, 0, .02);
}
.wpcf7[id^="wpcf7-f2753-"] textarea.wpcf7-form-control:not(.wpcf7-submit) { height: 200px; padding-left: 10px; }
.wpcf7[id^="wpcf7-f2753-"] .form-icon {
	position: absolute; left: 0; bottom: -6px; z-index: 9; display: flex; align-items: center; justify-content: center;
	width: 50px; height: 50px; background: #fff; border-radius: 50%; box-shadow: inset 0 4px 6px 0 #BAE0F1;
}
.wpcf7[id^="wpcf7-f2753-"] .form-icon img { max-width: 28px; }

/* Bouton Envoyer (tous les formulaires) */
body .wpcf7 .wpcf7-submit {
	min-width: 225px; padding: 16px 32px; font-family: "League Spartan", sans-serif; font-size: 21px; font-weight: 600;
	line-height: 25px; text-align: center; color: #000; background: #58C9B9; border: 1px solid #B3AEAE;
	border-radius: 120px; transition: all .3s; cursor: pointer;
}
body .wpcf7 .wpcf7-submit:hover, body .wpcf7 .wpcf7-submit:focus { color: #000; background: #D1B6E1; border-color: #B3AEAE; }
body .wpcf7[id^="wpcf7-f2753-"] .wpcf7-submit { color: #fff; border: 0; }
body .wpcf7[id^="wpcf7-f2753-"] .wpcf7-submit:hover { color: #4FB2D9; background: #fff; }

/* ---------- Outils (convertisseur HT/TTC, calculateur TVA) ---------- */
/* La grille Bootstrap (row / col-md-* / col-lg-*) venait de l'ancien thème : reprise ici, limitée aux outils. */
.calculator-wrapper { max-width: 980px; margin-left: auto; margin-right: auto; }
.calculator-wrapper .row { display: flex; flex-wrap: wrap; margin: 20px 0; }
.calculator-wrapper .row > [class*="col-"] { flex: 0 0 auto; width: 100%; max-width: 100%; padding: 0 12px; box-sizing: border-box; }
.calculator-wrapper .row > .calculator-action-btn-wrapper { padding: 0; }
@media (min-width: 768px) {
	.calculator-wrapper .row > .col-md-2 { width: 16.6667%; }
	.calculator-wrapper .row > .col-md-4 { width: 33.3333%; }
	.calculator-wrapper .row > .col-md-5 { width: 41.6667%; }
}
@media (min-width: 992px) {
	.calculator-wrapper .row > .col-lg-2 { width: 16.6667%; }
	.calculator-wrapper .row > .col-lg-5 { width: 41.6667%; }
}
.calculator-wrapper .calculator-input label { display: block; margin: 0 0 5px; }
.calculator-wrapper .with-icon input { display: block; max-width: 100%; }
.calculator-wrapper .calculator-action-btn { width: 100%; margin: 0 7px 15px 0; }
@media (max-width: 767px) {
	.calculator-wrapper .calculator-action-btn-wrapper { text-align: center; }
	.calculator-wrapper .calculator-action-btn { width: 200px !important; max-width: 100%; }  /* une règle de l'outil le met à 100 % */
}

/* Titres numérotés des pages métiers : <h3><span>1</span>Titre</h3> comme sur le vrai site */
.noly-num {
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
	width: 30px; height: 30px; margin-right: 12px; border-radius: 50%;
	background: #58C9B9; color: #000; font-size: 16px; font-weight: 700; line-height: 1; vertical-align: middle;
}

/* Pages « Pour qui » : tuiles d icônes sans soulignement (comme le vrai site) */
.noly-tuile a, .noly-tuile a:hover, .noly-tuile a:focus { text-decoration: none !important; }

/* Questions-réponses (FAQ, accueil, pages métiers) : pastille « + » dans un carré clair, liste centrée, comme le vrai site */
.e-con:has(> .elementor-widget-toggle) { max-width: 837px; width: 100%; margin-left: auto; margin-right: auto; }
.elementor-toggle .elementor-tab-title { display: flex; align-items: center; gap: 18px; padding: 14px !important; }
.elementor-toggle .elementor-toggle-icon { flex: 0 0 70px; width: 70px; height: 70px; margin: 0 !important; float: none !important;
	display: block; border-radius: 12px; background: #F6F0F9 url("../../uploads/2024/02/Group-55250.png") center no-repeat; }
.elementor-toggle .elementor-toggle-icon i, .elementor-toggle .elementor-toggle-icon svg { display: none !important; }
.elementor-toggle .elementor-tab-title.elementor-active .elementor-toggle-icon { background-image: url("../../uploads/2024/03/Group-552501.png"); }
.elementor-toggle .elementor-toggle-title { font-size: 21px; font-weight: 400; line-height: 1.3; }
.elementor-toggle .elementor-tab-content { padding: 0 14px 18px 102px; }
@media (max-width: 767px) {
	.elementor-toggle .elementor-toggle-icon { flex-basis: 48px; width: 48px; height: 48px; background-size: 12px auto; }
	.elementor-toggle .elementor-toggle-title { font-size: 17px; }
	.elementor-toggle .elementor-tab-content { padding: 0 14px 16px 14px; }
}

/* Pages juridiques : tableaux comme le vrai site (bordure grise, lignes paires bleu très clair, texte centré) */
.elementor-widget-text-editor table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.elementor-widget-text-editor table th, .elementor-widget-text-editor table td { border: 1px solid #626262; padding: 9px; text-align: center; vertical-align: middle; }
.elementor-widget-text-editor table tbody tr:nth-child(even) td { background: #E9F5F7; }
@media (max-width: 767px) { .elementor-widget-text-editor table { display: block; overflow-x: auto; } }

/* Espacement des paragraphes : 15 px comme le vrai site (Astra met 1,6 em) */
.elementor-widget-text-editor p { margin-bottom: 15px; }
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* Section « 3 étapes » (Tarifs comptabilité) : 882 px au plus, centrée, comme le vrai site */
.noly-etapes { max-width: 882px; margin-left: auto; margin-right: auto; }
