/*
Theme Name: Access Drones Modern
Theme URI: https://access-drones.fr/
Author: Access Drones
Description: Refonte responsive et mobile-first d'Access Drones. Conserve le contenu WordPress existant et modernise uniquement la présentation.
Version: 1.3.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: access-drones-modern
*/

:root{
  --ad-navy:#073a60;
  --ad-blue:#0d5794;
  --ad-cyan:#50b9dd;
  --ad-sky:#eaf6fb;
  --ad-ink:#13283a;
  --ad-text:#455867;
  --ad-line:#dbe5eb;
  --ad-bg:#f5f8fb;
  --ad-white:#fff;
  --ad-radius:18px;
  --ad-shadow:0 10px 28px rgba(7,58,96,.10);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{margin:0;background:var(--ad-bg);color:var(--ad-text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;font-size:17px;line-height:1.65;overflow-x:hidden}
img,svg,video,iframe{max-width:100%;height:auto}
a{color:var(--ad-blue);text-underline-offset:3px}
a:hover{color:var(--ad-navy)}
button,input,select,textarea{font:inherit}

.ad-shell{width:min(1180px,calc(100% - 40px));margin-inline:auto}

/* Header */
.ad-header{position:sticky;top:0;z-index:1000;background:rgba(255,255,255,.97);border-bottom:1px solid var(--ad-line);backdrop-filter:saturate(160%) blur(10px)}
.admin-bar .ad-header{top:32px}
.ad-header-inner{min-height:86px;display:flex;align-items:center;gap:24px}
.ad-brand{display:flex;align-items:center;gap:13px;min-width:0;text-decoration:none;color:var(--ad-navy);flex:0 1 auto}
.ad-brand img,.ad-brand .custom-logo{display:block;max-height:58px;width:auto;max-width:250px;object-fit:contain}
.ad-brand-text{display:flex;flex-direction:column;min-width:0}
.ad-brand-name{font-weight:800;font-size:1.15rem;line-height:1.1;color:var(--ad-navy)}
.ad-brand-tagline{margin-top:4px;font-size:.78rem;line-height:1.2;color:#667985;white-space:nowrap}
.ad-nav{margin-left:auto}
.ad-nav ul{list-style:none;margin:0;padding:0;display:flex;align-items:center;gap:4px}
.ad-nav li{position:relative}
.ad-nav a{display:block;padding:12px 11px;border-radius:10px;color:var(--ad-ink);font-weight:650;text-decoration:none;font-size:.94rem}
.ad-nav a:hover,.ad-nav .current-menu-item>a,.ad-nav .current-menu-ancestor>a{background:var(--ad-sky);color:var(--ad-navy)}
.ad-nav .sub-menu{position:absolute;top:100%;left:0;display:none;min-width:280px;padding:8px;background:white;border:1px solid var(--ad-line);border-radius:14px;box-shadow:var(--ad-shadow)}
.ad-nav li:hover>.sub-menu{display:block}
.ad-nav .sub-menu a{padding:10px 12px;font-weight:600}
.ad-menu-toggle{display:none;margin-left:auto;width:46px;height:46px;border:0;border-radius:14px;background:var(--ad-navy);color:#fff;align-items:center;justify-content:center;cursor:pointer}
.ad-menu-toggle span,.ad-menu-toggle::before,.ad-menu-toggle::after{content:"";display:block;width:22px;height:2px;background:currentColor;border-radius:99px;transition:.2s}
.ad-menu-toggle span{margin:5px 0}
.ad-menu-toggle[aria-expanded="true"] span{opacity:0}
.ad-menu-toggle[aria-expanded="true"]::before{transform:translateY(7px) rotate(45deg)}
.ad-menu-toggle[aria-expanded="true"]::after{transform:translateY(-7px) rotate(-45deg)}

/* Main */
.ad-main{min-height:55vh}
.ad-content-wrap{width:min(1120px,calc(100% - 40px));margin:34px auto 60px}
.ad-article{background:#fff;border:1px solid var(--ad-line);border-radius:24px;box-shadow:0 8px 24px rgba(7,58,96,.06);padding:clamp(26px,5vw,64px)}
.home .ad-article{padding-top:34px}
.entry-title{margin:0 0 28px;color:var(--ad-navy);font-size:clamp(2rem,4vw,3.6rem);line-height:1.03;letter-spacing:-.035em;overflow-wrap:anywhere}
.entry-content{min-width:0}
.entry-content>*:first-child{margin-top:0}
.entry-content>*:last-child{margin-bottom:0}
.entry-content p,.entry-content li{font-size:clamp(1rem,1.3vw,1.12rem);line-height:1.72}
.entry-content p{margin:0 0 1.15em}
.entry-content ul,.entry-content ol{padding-left:1.4em}
.entry-content h1,.entry-content h2,.entry-content h3,.entry-content h4{color:var(--ad-navy);font-weight:800;line-height:1.12;letter-spacing:-.025em;overflow-wrap:anywhere;text-wrap:balance}
.entry-content h1{font-size:clamp(2rem,4.5vw,3.25rem);margin:1.2em 0 .5em}
.entry-content h2{font-size:clamp(1.65rem,3vw,2.35rem);margin:1.35em 0 .55em}
.entry-content h3{font-size:clamp(1.35rem,2.2vw,1.75rem);margin:1.25em 0 .5em}
.entry-content h4{font-size:clamp(1.15rem,1.8vw,1.4rem)}
.entry-content hr{border:0;border-top:1px solid var(--ad-line);margin:32px 0}
.entry-content figure{max-width:100%;margin:24px auto}
.entry-content img{border-radius:16px}
.entry-content .wp-block-image img{display:block}
.entry-content blockquote{border-left:4px solid var(--ad-cyan);margin:26px 0;padding:14px 20px;background:var(--ad-sky);border-radius:0 14px 14px 0}

/* Neutralise les styles hérités excessifs des anciens builders, sans masquer de contenu */
.entry-content [style*="font-size"]{max-width:100%}
.entry-content h1[style],.entry-content h2[style],.entry-content h3[style],.entry-content h4[style]{font-size:revert-layer!important}
.entry-content table{font-size:1rem}
.entry-content .elementor-widget-heading .elementor-heading-title,
.entry-content .wpb_wrapper h1,
.entry-content .wpb_wrapper h2,
.entry-content .wpb_wrapper h3,
.entry-content .et_pb_text h1,
.entry-content .et_pb_text h2,
.entry-content .et_pb_text h3{line-height:1.12!important;overflow-wrap:anywhere!important}

/* Boutons */
.entry-content .wp-element-button,.entry-content .wp-block-button__link,.entry-content a.button,.entry-content button,.entry-content input[type="submit"]{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:12px 22px;border:0;border-radius:12px;background:var(--ad-blue);color:#fff!important;font-weight:750;text-decoration:none;line-height:1.2;box-shadow:none;transition:.18s}
.entry-content .wp-element-button:hover,.entry-content .wp-block-button__link:hover,.entry-content a.button:hover,.entry-content button:hover,.entry-content input[type="submit"]:hover{background:var(--ad-navy);transform:translateY(-1px)}

/* Formulaires */
.entry-content input[type="text"],.entry-content input[type="email"],.entry-content input[type="tel"],.entry-content input[type="number"],.entry-content input[type="date"],.entry-content select,.entry-content textarea{max-width:100%;min-height:48px;border:1px solid #cbd8e0;border-radius:12px;background:#fff;padding:10px 13px;color:var(--ad-ink)}

/* Tableaux & calendrier */
.entry-content table{width:100%;border-collapse:collapse;background:#fff}
.entry-content th,.entry-content td{border:1px solid #d8e0e6;padding:10px;text-align:left;vertical-align:top}
.entry-content th{background:#f2f7fa;color:var(--ad-navy);font-weight:800}
body.page-template-default .entry-content table,
body[class*="calendrier"] .entry-content table,
body.page-id-0 .entry-content table{max-width:100%}
.ad-table-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:14px}
.ad-table-scroll table{min-width:680px;margin:0}

/* Formation / cartes anciennes */
.entry-content .wp-block-group,.entry-content .wp-block-columns{max-width:100%}
.entry-content .wp-block-columns{gap:24px}
.entry-content .wp-block-column{min-width:0}
.entry-content [class*="card"],.entry-content [class*="box"]{max-width:100%}

/* Footer */
.ad-footer{background:linear-gradient(145deg,var(--ad-navy),#0a4a78);color:#e8f2f8;margin-top:60px}
.ad-footer a{color:#fff}
.ad-footer-main{display:grid;grid-template-columns:1.25fr 1fr 1fr;gap:28px;padding:52px 0 36px}
.ad-footer h2,.ad-footer h3{margin:0 0 12px;color:#fff;line-height:1.2}
.ad-footer h2{font-size:1.35rem}.ad-footer h3{font-size:1.05rem}
.ad-footer p{margin:0 0 9px}
.ad-footer-card{padding:22px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.06);border-radius:18px}
.ad-footer-bottom{border-top:1px solid rgba(255,255,255,.15);padding:18px 0 26px;font-size:.88rem;color:#c9dbe6}
.ad-footer-links{grid-column:1/-1;padding-top:4px}
.ad-footer-links h3{font-size:1.05rem;margin:0 0 14px}
.ad-footer-links ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 22px}
.ad-footer-links li{margin:0;padding:0}
.ad-footer-links a{display:inline-block;text-decoration:none;border-bottom:1px solid rgba(255,255,255,.34);line-height:1.35;padding:3px 0}
.ad-footer-links a:hover,.ad-footer-links a:focus-visible{border-bottom-color:#fff}


@media (max-width: 900px){
  .admin-bar .ad-header{top:46px}
  .ad-header-inner{min-height:72px;gap:12px}
  .ad-brand img,.ad-brand .custom-logo{max-height:46px;max-width:190px}
  .ad-brand-tagline{display:none}
  .ad-menu-toggle{display:flex;flex-direction:column;flex:0 0 auto}
  .ad-nav{position:fixed;left:0;right:0;top:72px;margin:0;background:white;border-bottom:1px solid var(--ad-line);box-shadow:0 14px 30px rgba(7,58,96,.12);max-height:calc(100dvh - 72px);overflow:auto;transform:translateY(-130%);opacity:0;visibility:hidden;transition:.22s ease}
  .admin-bar .ad-nav{top:118px;max-height:calc(100dvh - 118px)}
  .ad-nav.is-open{transform:translateY(0);opacity:1;visibility:visible}
  .ad-nav ul{display:block;padding:10px 20px 20px}
  .ad-nav li{border-bottom:1px solid #edf1f4}
  .ad-nav a{padding:14px 10px;font-size:1rem;border-radius:8px}
  .ad-nav .sub-menu{position:static;display:block;box-shadow:none;border:0;border-radius:0;padding:0 0 6px 16px;min-width:0}
  .ad-nav .sub-menu li{border:0}
  .ad-nav .sub-menu a{font-size:.95rem;padding:10px}
  .ad-footer-main{grid-template-columns:1fr 1fr}
}

@media (max-width: 600px){
  body{font-size:16px;line-height:1.58;background:#f6f8fa}
  .ad-shell,.ad-content-wrap{width:calc(100% - 28px)}
  .ad-header-inner{min-height:68px}
  .ad-brand img,.ad-brand .custom-logo{max-width:165px;max-height:43px}
  .ad-brand-name{font-size:1rem}
  .ad-menu-toggle{width:43px;height:43px;border-radius:12px}
  .ad-nav{top:68px;max-height:calc(100dvh - 68px)}
  .admin-bar .ad-nav{top:114px;max-height:calc(100dvh - 114px)}
  .ad-content-wrap{margin:18px auto 38px}
  .ad-article{border-radius:18px;padding:24px 18px;box-shadow:0 5px 18px rgba(7,58,96,.06)}
  .home .ad-article{padding-top:20px}
  .entry-title{font-size:clamp(1.8rem,10vw,2.5rem);margin-bottom:20px}
  .entry-content p,.entry-content li{font-size:1rem;line-height:1.62}
  .entry-content p{text-align:left!important;letter-spacing:normal!important;word-spacing:normal!important}
  .entry-content h1{font-size:clamp(1.75rem,9vw,2.35rem)!important}
  .entry-content h2{font-size:clamp(1.45rem,7.8vw,2rem)!important}
  .entry-content h3{font-size:clamp(1.22rem,6vw,1.55rem)!important}
  .entry-content h4{font-size:1.15rem!important}

  /* Corrige les grands bandeaux/titres visibles sur les captures */
  .entry-content h1,.entry-content h2,.entry-content h3,
  .entry-content .elementor-heading-title,
  .entry-content [class*="heading"]{max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important}
  .entry-content .elementor-widget-heading .elementor-heading-title{font-size:clamp(1.45rem,7vw,2.05rem)!important;line-height:1.12!important;padding:0!important}

  /* Images : pas de débordement, ratio naturel */
  .entry-content img{max-width:100%!important;width:auto;height:auto!important;object-fit:contain;border-radius:14px}
  .entry-content figure,.entry-content .wp-caption{width:100%!important;max-width:100%!important}

  /* Espaces hérités démesurés */
  .entry-content .wp-block-spacer{height:32px!important}
  .entry-content [style*="padding-top: 100"],.entry-content [style*="padding-top:100"],
  .entry-content [style*="padding-bottom: 100"],.entry-content [style*="padding-bottom:100"]{padding-top:28px!important;padding-bottom:28px!important}
  .entry-content [style*="margin-top: 100"],.entry-content [style*="margin-top:100"],
  .entry-content [style*="margin-bottom: 100"],.entry-content [style*="margin-bottom:100"]{margin-top:28px!important;margin-bottom:28px!important}

  /* Calendrier : défilement horizontal contenu, pas page entière */
  .entry-content .ad-table-scroll{margin-inline:0}
  .entry-content table{font-size:.92rem}
  .entry-content th,.entry-content td{padding:8px}

  /* Sélecteurs calendrier / filtres */
  .entry-content form{max-width:100%}
  .entry-content form select{min-width:0;width:auto;max-width:100%}
  .entry-content form button,.entry-content form input[type="submit"]{min-height:46px;padding:10px 16px}

  .ad-footer{margin-top:38px}
  .ad-footer-main{grid-template-columns:1fr;gap:16px;padding:34px 0 24px}
  .ad-footer-card{padding:18px;border-radius:16px}
}

/* === v1.2 — harmonisation mobile de la page d'accueil === */
@media (max-width:600px){
  /* Une seule grille visuelle pour tous les blocs historiques de l'accueil. */
  .home .ad-content-wrap{width:calc(100% - 24px);margin:12px auto 28px}
  .home .ad-article{padding:18px 14px}
  .home .entry-content{font-size:16px;line-height:1.45}

  /* Neutralise les tailles de texte injectées en ligne par l'ancien contenu. */
  .home .entry-content [style*="font-size"]{font-size:16px!important;line-height:1.35!important}
  .home .entry-content h1[style],
  .home .entry-content h2[style],
  .home .entry-content h3[style],
  .home .entry-content h4[style]{font-size:inherit!important}

  /* Tous les anciens bandeaux/menu de formations ont la même largeur,
     la même hauteur minimale, le même rythme et une typo cohérente. */
  .home .entry-content [style*="background"],
  .home .entry-content [bgcolor]{max-width:100%!important}
  .home .entry-content p[style*="background"],
  .home .entry-content div[style*="background"],
  .home .entry-content td[style*="background"],
  .home .entry-content th[style*="background"]{
    width:100%!important;
    min-height:76px!important;
    height:auto!important;
    margin:0 0 14px!important;
    padding:16px 14px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    text-align:center!important;
    font-size:16px!important;
    line-height:1.25!important;
    letter-spacing:0!important;
    word-spacing:normal!important;
    overflow-wrap:anywhere!important;
  }
  .home .entry-content [style*="background"] a{
    font-size:inherit!important;
    line-height:inherit!important;
    text-align:center!important;
  }

  /* Les tableaux utilisés historiquement comme grilles de menus deviennent
     des piles régulières sur smartphone, sans changer leur contenu. */
  .home .entry-content table:not(.ad-keep-table),
  .home .entry-content table:not(.ad-keep-table) tbody,
  .home .entry-content table:not(.ad-keep-table) tr{
    display:block!important;
    width:100%!important;
    height:auto!important;
  }
  .home .entry-content table:not(.ad-keep-table){margin:0 0 20px!important;border:0!important;background:transparent!important}
  .home .entry-content table:not(.ad-keep-table) tr{margin:0!important}
  .home .entry-content table:not(.ad-keep-table) td,
  .home .entry-content table:not(.ad-keep-table) th{
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:76px!important;
    margin:0 0 14px!important;
    padding:16px 14px!important;
    border:0!important;
    vertical-align:middle!important;
    font-size:16px!important;
    line-height:1.25!important;
    text-align:center!important;
  }
  .home .entry-content table:not(.ad-keep-table) td *,
  .home .entry-content table:not(.ad-keep-table) th *{
    margin-top:0!important;
    margin-bottom:0!important;
    font-size:inherit!important;
    line-height:inherit!important;
    text-align:inherit!important;
  }

  /* Titres de section : compacts et constants. */
  .home .entry-content h1,
  .home .entry-content h2,
  .home .entry-content h3{
    margin:26px 0 16px!important;
    padding:0!important;
    line-height:1.12!important;
  }
  .home .entry-content h1{font-size:30px!important}
  .home .entry-content h2{font-size:26px!important}
  .home .entry-content h3{font-size:22px!important}

  /* Réduit les vides créés par les anciens blocs, cellules et retours. */
  .home .entry-content .wp-block-spacer{height:18px!important}
  .home .entry-content br+br{display:none}
  .home .entry-content p:empty{display:none!important}
  .home .entry-content [style*="height: 100"],
  .home .entry-content [style*="height:100"],
  .home .entry-content [style*="height: 200"],
  .home .entry-content [style*="height:200"],
  .home .entry-content [style*="height: 300"],
  .home .entry-content [style*="height:300"]{height:auto!important;min-height:0!important}
}

@media (max-width:760px){
  .ad-footer-links{padding-top:8px}
  .ad-footer-links h3{margin-bottom:10px}
  .ad-footer-links ul{grid-template-columns:1fr;gap:0}
  .ad-footer-links li{border-top:1px solid rgba(255,255,255,.13)}
  .ad-footer-links li:last-child{border-bottom:1px solid rgba(255,255,255,.13)}
  .ad-footer-links a{display:block;padding:12px 0;border-bottom:0;font-size:.96rem}
  .ad-footer-bottom{padding-top:18px}
}
