/*
Theme Name: BTsun
Theme URI: https://btsun.ch
Author: BTsun SA
Description: Thème enfant de Twenty Twenty-Four pour BTsun SA : couleurs RAL 5022 et jaune soleil, polices Barlow, constellations et sections prêtes à l'emploi. Modifiable sans code dans l'éditeur de blocs.
Template: twentytwentyfour
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: btsun
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
:where(section[id], .wp-block-group[id]) { scroll-margin-top: 110px; }
body { -webkit-font-smoothing: antialiased; }

/* Les sections pleine largeur se touchent, sans espace blanc entre elles */
.wp-block-post-content > .alignfull { margin-block-start: 0 !important; margin-block-end: 0 !important; }
main.bt-main { margin-block-start: 0 !important; }
.wp-site-blocks > footer { margin-block-start: 0 !important; }

/* ---------- Sections ---------- */
.bt-section { padding-top: clamp(56px, 7vw, 84px) !important; padding-bottom: clamp(56px, 7vw, 84px) !important; }
.bt-section--tight { padding-top: 22px !important; padding-bottom: 22px !important; }

.bt-on-dark, .bt-on-dark p { color: #ddd6ce; }
.bt-on-dark :where(h1, h2, h3, h4) { color: #ffffff; }
.bt-on-dark .bt-eyebrow { color: #c9bfb4; }
.bt-on-dark a:not(.wp-block-button__link) { color: #ffffff; }

.bt-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8rem !important;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #6b645d;
	margin-bottom: 0 !important;
}
.bt-lead { max-width: 720px; color: #4a4642; }
.bt-on-dark .bt-lead { color: #ddd6ce; }
.bt-link-more a, a.bt-link-more { font-weight: 600; text-decoration: none; }
.bt-link-more a:hover { text-decoration: underline; }

/* ---------- En-tête fixe ---------- */
.wp-site-blocks > header,
header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.admin-bar .wp-site-blocks > header,
.admin-bar header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) { .admin-bar .wp-site-blocks > header, .admin-bar header.wp-block-template-part { top: 0; } }
.bt-header { background: #ffffff; border-bottom: 1px solid #e3ded8; padding-top: 10px; padding-bottom: 10px; }
.bt-header .bt-logo a { line-height: 0; display: block; }
.bt-header .bt-logo { flex: 0 0 auto; margin: 0 !important; }
.bt-header .bt-logo img { height: 56px; width: auto; max-width: none; display: block; }
.bt-header .wp-block-navigation { font-size: 0.95rem; gap: 1.1rem; }
.bt-header .wp-block-navigation__container { column-gap: 1.1rem; }
.bt-header .bt-header-cta .wp-block-button__link { font-size: 1rem; padding: 0.6rem 1.1rem; }
.bt-header .bt-phone { margin: 0 !important; }
.bt-header .bt-phone a {
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
}
.bt-header .wp-block-navigation a { color: #2b2b29; text-decoration: none; }
.bt-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent); }
@media (max-width: 600px) {
	.bt-header .bt-logo img { height: 44px; }
	.bt-header .bt-phone, .bt-header .bt-header-cta { display: none; }
}

/* ---------- Rythme vertical dans les sections ---------- */
.bt-inner.is-layout-flow > * + * { margin-block-start: clamp(28px, 3vw, 40px); }
.bt-head.is-layout-flow > * + * { margin-block-start: 12px; }
.bt-section.bt-follow { padding-top: 24px !important; }
.bt-head { flex: 1 1 520px; min-width: 0; }

/* ---------- Hero ---------- */
.bt-hero-constellation { margin: 0 auto !important; text-align: center; }
.bt-hero-constellation img { width: 100%; max-width: 300px; height: auto; }
.bt-hero h1 { color: #ffffff; }
.bt-hero .bt-sky img { width: 100%; height: auto; max-width: 620px; margin: 0 auto; display: block; }
.bt-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.bt-chips a {
	display: inline-flex; align-items: center; gap: 10px;
	border: 1px solid #6b645d; border-radius: 999px;
	padding: 9px 18px; color: #f1ede8 !important; text-decoration: none; font-size: 1rem;
}
.bt-chips a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f6a81a; flex: 0 0 8px; }
.bt-chips a:hover { border-color: #f6a81a; }
.bt-chips-wrap { border-top: 1px solid #5c5752; padding-top: 22px; }

/* ---------- Bande des labels ---------- */
.bt-labels p {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600; font-size: 1.05rem; letter-spacing: 0.1em; text-transform: uppercase;
	color: #ddd6ce; margin: 0;
}

/* ---------- Cartes (entièrement cliquables) ---------- */
.bt-card {
	position: relative;
	background: #ffffff;
	border: 1px solid #ddd7d0;
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.bt-card:hover { border-color: #2f2a5a; box-shadow: 0 6px 22px rgba(47, 42, 90, .10); transform: translateY(-2px); }
.bt-card .bt-more a { font-weight: 600; text-decoration: none; }
.bt-card .bt-more a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.bt-card .bt-more { margin-top: auto !important; padding-top: 8px; }
.bt-card h3, .bt-card h4 { margin: 0; }
.bt-card .is-layout-flow > * + *, .bt-card.is-layout-flow > * + * { margin-block-start: 10px; }
.bt-card--solution > .bt-card__body { margin-block-start: 0 !important; }
.bt-card--plain-hover:hover { transform: none; box-shadow: none; border-color: #ddd7d0; }
/* Cartes blanches posées sur une section sombre */
.bt-on-dark .bt-card, .bt-on-dark .bt-card p { color: #4a4642; }
.bt-on-dark .bt-card :where(h1, h2, h3, h4) { color: #2f2a5a; }
.bt-on-dark .bt-card a:not(.wp-block-button__link) { color: #2f2a5a; }
.bt-on-dark .bt-card .bt-num { color: #6b645d; }
.bt-btn-light .wp-block-button__link { color: #f1ede8 !important; border-color: #a59890 !important; }
.bt-btn-light .wp-block-button__link:hover { border-color: #f6a81a !important; background: transparent !important; }
.bt-card > .wp-block-group:last-child { flex: 1 1 auto; }

.bt-card--solution { display: flex; flex-direction: column; }
.bt-card--solution .bt-card__media {
	height: 150px; margin: 0 !important; border-bottom: 1px solid #ebe6e0;
	display: flex; align-items: center; justify-content: center;
}
.bt-card--solution .bt-card__media img { width: 104px; height: 104px; }
.bt-card--solution h3 { font-size: 2rem; line-height: 1; }
.bt-card__body { padding: 24px 26px 28px !important; display: flex; flex-direction: column; gap: 10px; }

.bt-card--compact { padding: 20px 22px !important; }
.bt-card--compact .bt-glyph { margin: 0 !important; flex: 0 0 48px; }
.bt-card--compact .bt-glyph img { width: 48px; height: 48px; }
.bt-card--compact h3 { font-size: 1.4rem; line-height: 1.05; }
.bt-card--compact p { font-size: 0.95rem; color: #4a4642; }

.bt-num {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8rem !important; color: #6b645d; margin: 0 !important;
}
.bt-card--solution .bt-num { position: absolute; top: 18px; left: 22px; }

.bt-card--plain { padding: 26px 24px !important; }
.bt-card--plain:hover { transform: none; box-shadow: none; border-color: #ddd7d0; }

/* Cartes réalisations avec photo */
.bt-card--photo .bt-photo { margin: 0 !important; }
.bt-card--photo .bt-photo img { width: 100%; height: 220px; object-fit: cover; display: block; }
.bt-card--photo .bt-card__body { gap: 8px; }
.bt-card--photo h3 { font-size: 1.6rem; color: #2b2b29; }
.bt-photo img { background: #e9e5e0; }

/* ---------- Écosystème : étapes ---------- */
.bt-step { border-top: 1px solid #a59890; padding-right: 24px; position: relative; padding-top: 18px; }
.bt-step::before {
	content: ""; position: absolute; top: -7px; left: 0;
	width: 13px; height: 13px; border-radius: 50%; background: #f6a81a;
}
.bt-step h3 { font-size: 1.6rem; font-weight: 600; letter-spacing: 0.04em; margin: 0; }
.bt-step p { font-size: 1rem; margin: 0; }
.bt-on-dark .bt-num { color: #c9bfb4; }

/* ---------- Méthode ---------- */
.bt-engagement {
	border-left: 4px solid #f6a81a;
	background: #ffffff;
	padding: 22px 26px !important;
}
.bt-engagement p { margin: 0; }
.bt-compass img { width: 120px; height: 120px; }

/* ---------- Avis ---------- */
.bt-avis .wp-block-quote {
	border-radius: 0 !important; font-family: var(--wp--preset--font-family--body) !important;
	background: #ffffff; border: 1px solid #ddd7d0 !important; border-left: 4px solid #2f2a5a !important;
	padding: 24px 26px; margin: 0; height: 100%; box-sizing: border-box;
}
.bt-avis .wp-block-quote p { font-size: 1.1rem; font-family: var(--wp--preset--font-family--body); font-weight: 400; line-height: 1.5; }
.bt-avis .wp-block-quote cite {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.8rem; font-style: normal; letter-spacing: 0.08em; color: #6b645d; text-transform: uppercase;
}

/* ---------- Nouveautés ---------- */
.bt-news { border-top: 3px solid #2f2a5a; padding-top: 16px; }
.bt-news h3 { font-size: 1.4rem; color: #2b2b29; line-height: 1.15; }

/* ---------- FAQ ---------- */
.bt-faq .wp-block-details summary {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600; font-size: 1.3rem; letter-spacing: 0.03em; text-transform: uppercase;
	color: #2f2a5a; cursor: pointer;
}
.bt-faq .wp-block-details p { margin-top: 10px; color: #4a4642; }

/* ---------- Règle graduée (style carte du ciel) ---------- */
hr.bt-regle, .wp-block-separator.bt-regle {
	border: 0 !important; height: 26px !important; width: 100% !important; max-width: none !important;
	background: url("assets/images/regle.svg") no-repeat center / 100% 26px;
	opacity: 1;
}

/* ---------- Pied de page ---------- */
.bt-footer, .bt-footer p { color: #ddd6ce; }
.bt-footer h2 { color: #ffffff; }
.bt-footer .bt-footer-title { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.06em; text-transform: uppercase; color: #ffffff; }
.bt-footer .bt-eyebrow { color: #c9bfb4; }
.bt-footer p { margin: 0; }
.bt-footer a { color: #ffffff; }
.bt-footer .bt-phone-big a { font-family: var(--wp--preset--font-family--mono); font-size: 1.15rem; text-decoration: none; }
.bt-footer .bt-labels-line { font-size: 0.9rem; color: #c9bfb4; border-top: 1px solid #5c5752; padding-top: 18px; }

/* ---------- Contenu à compléter (bien visible dans l'éditeur) ---------- */
.bt-a-completer, mark.bt-a-completer {
	background: #fff3c4 !important; color: #5a4300 !important;
	outline: 1px dashed #f6a81a; padding: 2px 6px;
	font-family: var(--wp--preset--font-family--mono); font-size: 0.85rem;
}

/* ---------- Formulaire (Contact Form 7) ---------- */
.bt-form .wpcf7 label { display: block; font-weight: 600; margin-bottom: 4px; }
.bt-form .wpcf7 input:not([type=checkbox]):not([type=radio]):not([type=submit]),
.bt-form .wpcf7 select,
.bt-form .wpcf7 textarea {
	width: 100%; box-sizing: border-box; padding: 11px 12px; font: inherit;
	border: 1px solid #c9c2ba; border-radius: 2px; background: #ffffff;
}
.bt-form .wpcf7 input:focus, .bt-form .wpcf7 select:focus, .bt-form .wpcf7 textarea:focus { outline: 2px solid #2f2a5a; outline-offset: 1px; }
.bt-form .wpcf7-checkbox, .bt-form .wpcf7-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.bt-form .wpcf7-list-item { margin: 0; }
.bt-form .wpcf7-list-item label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #ddd7d0; padding: 8px 14px; font-weight: 400; cursor: pointer; background: #ffffff; }
.bt-form .wpcf7-submit {
	background: #2f2a5a; color: #ffffff; border: 0; border-radius: 2px; cursor: pointer;
	font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.15rem;
	letter-spacing: 0.08em; text-transform: uppercase; padding: 14px 28px;
}
.bt-form .wpcf7-submit:hover { background: #201c42; }
.bt-form fieldset { border: 0; border-top: 1px solid #ddd7d0; padding: 20px 0 0; margin: 0 0 24px; }
.bt-form legend { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; color: #2f2a5a; padding: 0 8px 0 0; }

/* ---------- Accessibilité ---------- */
a:focus-visible, .wp-block-button__link:focus-visible { outline: 3px solid #f6a81a; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.bt-card { transition: none; }
	.bt-card:hover { transform: none; }
}
