/* The theme adds an empty footer after the custom Sauv’Garde footer. */
body:has(.sgf-footer) footer.wp-block-template-part:empty{display:none!important;margin:0!important;padding:0!important}
html:has(.sgf-footer),body:has(.sgf-footer){overscroll-behavior-y:none}
body:has(.sgf-footer){overflow-x:clip}
body:has(.sgf-footer) .wp-site-blocks{padding-bottom:0!important}
.jetpack-likes-widget-wrapper,.sharedaddy .sd-like,.wp-block-jetpack-like,
.wp-block-jetpack-likes,.comments-area,.wp-block-comments,.wp-block-post-comments-form{display:none!important}

/* Finitions Sauv’Garde : alignements, lecture et petits écrans. */
.sgh-training-track { grid-template-rows:auto auto 1fr auto auto; align-items:stretch; }
.sgh-training-track .sgh-training-card { display:grid; grid-row:span 5; grid-template-rows:subgrid; row-gap:0; }
.sgh-training-card .sgh-specific-text { margin:14px 0 24px!important; }
.sgh-training-card .sgh-training-details { margin:0 0 26px!important; }
.sgh-training-card .sgh-text-link { margin:0!important; align-self:end; }
.sgh-why .sgh-why-intro { width:100%; max-width:1120px!important; margin-left:0!important; margin-right:0!important; text-wrap:pretty; }
.sgh-cta .sgh-cta-grid { grid-template-columns:minmax(0,1fr)!important; gap:24px!important; margin:0!important; }
.sgh-cta-grid>.wp-block-column { margin:0!important; }
.sgh-cta { padding:38px 42px!important; }
.sgh-cta .sgh-cta-title { font-size:clamp(26px,2.3vw,32px)!important; line-height:1.25; }
.sgh-cta .sgh-cta-text { max-width:1000px; font-size:16px; }
.sgh-cta .wp-block-buttons { justify-content:flex-start!important; }
.sgh-cta .wp-block-button__link { font-size:15px; padding:14px 24px; }
@media(max-width:700px) {
 .sgh-cta { padding:28px 24px!important; }
 .sgh-cta .sgh-cta-title { font-size:26px!important; }
 .sgh-training-card .sgh-specific-title { overflow-wrap:normal; word-break:normal; hyphens:auto; }
 .sgh-training-card .sgh-training-details { font-size:14px; }
 .sgh-why-intro { text-wrap:wrap; }
}
@media(prefers-reduced-motion:reduce) {
 .sgh-section *, .sgh-header * { transition:none!important; scroll-behavior:auto!important; }
}
/* Le pied de page termine réellement le contenu, y compris les modèles de page. */
html:has(.sgf-footer),body:has(.sgf-footer) { overscroll-behavior-y:none; }
body:has(.sgf-footer) { overflow-x:clip; }
body:has(.sgf-footer) .wp-site-blocks,
body:has(.sgf-footer) .wp-block-post-content:has(.sgf-footer),
body:has(.sgf-footer) main:has(.sgf-footer) { padding-bottom:0!important; margin-bottom:0!important; }
body:has(.sgf-footer) footer.wp-block-template-part:empty { display:none!important; }
.sgf-footer { margin-bottom:0!important; }
.sgf-footer .sgf-inner { padding-bottom:max(22px,env(safe-area-inset-bottom))!important; }
/* Cohérence des blocs de contact de fin de page. */
body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help){box-sizing:border-box;padding:32px 36px!important;border-radius:20px!important;text-align:left!important}
body :is(.sgp-help){display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:20px!important}
body :is(.sgh-cta-grid,.sg-cta-columns){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:22px!important;margin:0!important}
body :is(.sgh-cta-grid,.sg-cta-columns)>.wp-block-column{margin:0!important;min-width:0}
body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help) h2{font-size:clamp(24px,2.2vw,30px)!important;line-height:1.25!important;letter-spacing:-.5px!important;margin:0 0 12px!important}
body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help) p{font-size:16px!important;line-height:1.65!important;max-width:1000px}
body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help) :is(.wp-block-buttons,.sgc-actions,.sge-contact-links){justify-content:flex-start!important;align-items:flex-start!important;margin-top:22px!important}
body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help) :is(.wp-block-button,.sgc-button,.sgp-button,.sge-contact-button){width:auto!important;max-width:100%}
body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help) :is(.wp-block-button__link,.sgc-button,.sgp-button,.sge-contact-button a){font-size:15px!important;line-height:1.4!important;padding:14px 22px!important;white-space:normal!important;min-height:48px;max-width:100%}
body :is(.sgc-contact-panel,.sgr-form) textarea{resize:none!important;overflow:auto}
/* Footer commun : le contenu se termine au pied de page. */
body:has(.sgf-footer) .wp-block-post-content:has(>.sgf-footer){margin-bottom:0!important;padding-bottom:0!important}
body .sgf-footer{width:100%!important;max-width:none!important;margin:0!important;background:#edf3f9!important;color:#273445;border-top:1px solid #e1e7ee}
body .sgf-inner{max-width:1440px!important;margin:auto!important;padding:40px 32px max(22px,env(safe-area-inset-bottom))!important;box-sizing:border-box}
body .sgf-main{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,2fr) minmax(0,1fr)!important;gap:28px!important;align-items:start!important;text-align:center}
body .sgf-main>*{min-width:0;margin:0!important}
body .sgf-detail{overflow-wrap:anywhere;font-size:15px!important;line-height:1.65}
body .sgf-tagline{font-size:15px!important;line-height:1.65}
body .sgf-legal{display:flex!important;flex-wrap:wrap!important;justify-content:center!important;gap:12px 24px!important;margin-top:28px!important}
body .sgf-legal-item{font-size:14px!important;line-height:1.6}
body .sgf-copyright{font-size:12px!important;margin:24px 0 0!important;text-align:center!important}
/* Tablettes : colonnes souples sans texte comprimé. */
@media(max-width:1000px){
 body .sg-course :is(.sgc-grid,.sgc-two){grid-template-columns:minmax(0,1fr)!important;gap:32px!important}
 body :is(.sg-hero-columns,.sg-program-columns,.sg-practice-columns){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:30px!important}
 body :is(.sg-hero-columns,.sg-program-columns,.sg-practice-columns)>.wp-block-column{margin:0!important;min-width:0}
 body .sgf-main{grid-template-columns:minmax(0,1fr) minmax(0,1.5fr) minmax(0,1.2fr)!important;gap:20px!important}
}
@media(max-width:700px){
 body:has(.sgh-header) .wp-site-blocks{padding-top:0!important}
 body:has(.sgh-header) main:has(.sgh-header){margin-top:0!important}
 body :is(.sgh-header,.sgf-footer,.sg-section,.sgl-hero,.sgl-section,.sge-hero,.sge-section,.sgc-page).alignfull{margin-left:0!important;margin-right:0!important;width:100%!important;max-width:100%!important}
 body :is(.sg-inner,.sgl-inner,.sge-inner,.sgc-inner,.sgc-wrap){padding-left:20px!important;padding-right:20px!important;min-width:0;box-sizing:border-box}
 body :is(.sg-hero-title,.sg-course h1,.sgl-hero h1,.sge-hero h1,.sgc-page h1){font-size:clamp(29px,7.8vw,36px)!important;line-height:1.18!important;letter-spacing:-.8px!important;overflow-wrap:break-word}
 body :is(.sg-section-title,.sg-course h2,.sgl-section h2,.sge-section h2){font-size:clamp(25px,6.6vw,30px)!important;line-height:1.25!important}
 body :is(.sg-objectives-grid,.sg-details-grid,.sg-method-grid,.sgc-practical,.sge-grid,.sgl-grid){display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:20px!important}
 body :is(.sg-info-grid,.sgc-facts){grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body :is(.sg-padding,.sgc-section,.sgl-section,.sge-section){padding-top:40px!important;padding-bottom:40px!important}
 body :is(.sg-card,.sg-detail-card,.sg-method-card,.sgc-card,.sgc-method,.sge-card){padding:24px!important;min-width:0;box-sizing:border-box}
 body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help){padding:26px 22px!important;border-radius:16px!important}
 body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help) h2{font-size:25px!important}
 body :is(.sgh-cta,.sg-cta,.sgc-cta,.sgl-contact,.sge-contact,.sg-planning-cta,.sgp-help) .wp-block-button__link{width:auto!important}
 body :is(.sgc-actions,.sgl-actions,.sge-jumps){gap:12px!important}
 body .sgc-contact-panel{padding:24px 18px!important;border-radius:18px!important}
 body :is(.sgc-contact-panel,.sgr-form) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){font-size:16px!important;max-width:100%;box-sizing:border-box}
 body .sg-devis-grid{grid-template-columns:minmax(0,1fr)!important}
 body .sg-devis-grid>:is(.sg-half,.sg-third,.sg-postal,.sg-city,.sg-country){grid-column:1/-1!important}
 body .sgf-main{grid-template-columns:minmax(0,1fr)!important;gap:26px!important}
 body .sgf-brand{grid-row:1!important}body .sgf-contact{grid-row:2!important}body .sgf-networks{grid-row:3!important}
 body .sgf-inner{padding:32px 20px max(22px,env(safe-area-inset-bottom))!important}
 body .sgf-legal{flex-direction:column!important;align-items:center!important;gap:8px!important}
 body .sgf-legal a{display:inline-block;padding:5px 0}
 body .sgf-social .wp-social-link a{padding:10px!important}
 body :is(.sg-cgv-article,.sg-mentions-article,.sg-privacy-article){padding:24px 20px!important;overflow-wrap:anywhere}
}
@media(max-width:360px){body :is(.sg-info-grid,.sgc-facts){grid-template-columns:minmax(0,1fr)!important}}
/* Pleine largeur mobile : retirer le cadre du modèle, pas les marges de lecture. */
@media(max-width:900px){
 body:has(.sgh-header) .wp-block-post-content:has(.sgh-header){padding:0!important;margin:0!important;width:100%!important;max-width:none!important;box-sizing:border-box}
 body:has(.sgh-header) .wp-block-post-content:has(.sgh-header)>:is(.sgh-header,.sgf-footer,.alignfull,.sg-course){margin-left:0!important;margin-right:0!important;width:100%!important;max-width:none!important}
}
/* Le calendrier reste visible sur téléphone, au-dessus du détail des sessions. */
@media(max-width:800px){
 body .sgcal-grid{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr));width:100%;border-radius:12px;margin-bottom:24px}
 body .sgcal-weekday{font-size:11px;padding:9px 2px}
 body .sgcal-day{min-height:66px;padding:5px 2px}
 body .sgcal-day>span{display:block;font-size:12px;padding-left:2px}
 body .sgcal-day a{display:flex;align-items:center;justify-content:center;min-height:32px;padding:4px 1px;margin-top:5px;font-size:10px;line-height:1.25;text-align:center;border-radius:4px;overflow-wrap:anywhere}
 body .sgcal-month{gap:10px}
 body .sgcal-month h2{font-size:23px}
 body .sgcal-month>a{flex:0 0 42px;width:42px;height:44px}
 body .sgcal-card{scroll-margin-top:110px}
}

/* Message fields stay inside the form, without a drag handle on either axis. */
html body :is(.sgc-contact-panel,.sgr-form) textarea { resize:none!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;overflow:auto!important; }
.sgl-image>a {display:block;height:100%;}
/* One total and one payment method in the detailed confirmation table. */
.sg-confirmation-page .woocommerce-order-overview__total,.sg-confirmation-page .woocommerce-order-overview__payment-method {display:none!important;}
.sg-confirmation-page .woocommerce-order-overview {display:flex!important;flex-wrap:wrap;gap:16px;padding:0!important;margin:0 0 28px!important;}
.sg-confirmation-page .woocommerce-order-overview li {border:0!important;padding:0!important;margin:0!important;}
.sg-confirmation-page .woocommerce-order-details {margin-top:24px;}
.sg-confirmation-page table.shop_table thead {background:#EDF3F9;color:#0A2A57;}
.sg-confirmation-page table.shop_table tfoot th,.sg-confirmation-page table.shop_table tfoot td {background:#F7F9FC;}
.sg-confirmation-page .woocommerce-customer-details address {border:1px solid #D8E3F0!important;border-radius:12px!important;padding:20px!important;line-height:1.8;}
