/* ART CONSTRUCTION - onglet « Outils » du menu du site et son mega menu colore.
   6 piliers a gauche (une couleur chacun), les outils du pilier survole a droite, recherche instantanee en haut.
   Charge apres art-menu-haut.css. Gabarit : partials/art-mega-outils.blade.php ; interactions : outils-mega.js. */

/* pastille « 78 » sur l'onglet */
.amh-pastille { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: linear-gradient(135deg, #2563EB, #7C3AED); color: #fff; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.amh-outils > .amh-lien { font-weight: 600; }

/* panneau (le mode « mega » du menu le place sous la barre, sur toute la largeur du cadre) */
.amh-outils > .amh-panneau.mo { padding: 0; overflow: hidden; border-top: 0; border-radius: 0 0 18px 18px; box-shadow: 0 28px 50px -14px rgba(15,23,42,.30); }
.amh-outils.amh-ouvert > .amh-panneau.mo { display: block; }
.mo::before { content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, #2563EB 0 16.66%, #059669 0 33.33%, #7C3AED 0 50%, #D97706 0 66.66%, #0891B2 0 83.33%, #E11D48 0); }
.mo, .mo *, .mo *::before, .mo *::after { box-sizing: border-box; }
.mo a { text-decoration: none; }
.mo-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mo [hidden] { display: none !important; }

/* haut : recherche + lien « tous les outils » */
.mo-haut { display: flex; align-items: center; gap: 16px; padding: 14px 22px; border-bottom: 1px solid #E2E8F0; background: linear-gradient(180deg, #F8FAFC, #fff); }
.mo-recherche { position: relative; flex: 1 1 auto; max-width: 540px; }
.mo-recherche svg { position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; fill: none; stroke: #64748B; stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.mo-q { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid #CBD5E1; border-radius: 12px; background: #fff; color: #1E293B; font: 400 15px/1.2 inherit; font-family: inherit; -webkit-appearance: none; appearance: none; }
.mo-q::placeholder { color: #7B8798; }
.mo-q:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.mo-q::-webkit-search-cancel-button { cursor: pointer; }
.mo-tous { flex: none; margin-left: auto; color: #1D4ED8; font-size: 14px; font-weight: 600; white-space: nowrap; }
.mo-tous:hover { text-decoration: underline; }

/* corps : colonne des piliers (a gauche) + volet des outils (a droite) ; chaque pilier est un bloc, mis a plat dans la grille */
.mo-corps { display: grid; grid-template-columns: 290px minmax(0, 1fr); grid-template-rows: repeat(6, min-content) 1fr; min-height: 430px;
  background-image: linear-gradient(to right, #F8FAFC 290px, #E2E8F0 290px 291px, #fff 291px); }
.mo-bloc { display: contents; }
.mo-onglet { grid-column: 1; display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 12px 16px; border: 0; border-left: 4px solid transparent;
  background: none; color: #1E293B; font: inherit; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.mo-bloc:not(.mo-actif) .mo-onglet:hover { background: #EEF2F7; }
.mo-bloc.mo-actif .mo-onglet { border-left-color: var(--c); background: var(--cs); }
.mo-onglet:focus-visible { outline: 3px solid var(--c); outline-offset: -3px; }
.mo-pic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--cs); font-size: 20px; line-height: 1; transition: transform .2s, box-shadow .2s, background .2s; }
.mo-bloc.mo-actif .mo-pic { background: #fff; box-shadow: 0 6px 12px -6px var(--c); transform: scale(1.07); }
.mo-txt { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.mo-txt strong { font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.mo-txt small { color: #64748B; font-size: 12px; }
.mo-fl { flex: none; width: 8px; height: 8px; border-top: 2px solid var(--c); border-right: 2px solid var(--c); transform: rotate(45deg); opacity: 0; transition: opacity .15s, transform .15s; }
.mo-bloc.mo-actif .mo-fl { opacity: 1; }

/* volet d'un pilier */
.mo-pane { display: none; grid-column: 2; grid-row: 1 / -1; min-width: 0; max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); overflow-y: auto; padding-bottom: 20px; overscroll-behavior: contain; }
.mo-bloc.mo-actif .mo-pane { display: block; animation: mo-entree .22s ease-out; }
@keyframes mo-entree { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.mo-pane-tete { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px;
  background: linear-gradient(120deg, var(--cs), #fff 88%); border-bottom: 1px solid var(--cm); }
.mo-pilier { margin: 0; color: var(--cd); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mo-titre { margin: 2px 0 0; color: #1E293B; font-size: 17px; font-weight: 700; line-height: 1.3; }
.mo-voir { flex: none; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--cd); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; transition: transform .15s, box-shadow .15s; }
.mo-voir:hover { color: #fff; transform: translateX(2px); box-shadow: 0 8px 16px -8px var(--c); }
.mo-voir:focus-visible, .mo-outil:focus-visible, .mo-tous:focus-visible { outline: 3px solid var(--c, #2563EB); outline-offset: 2px; }

.mo-outils { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 18px 24px 0; list-style: none; }
.mo-bloc[data-p="ingenierie-physique-urbanisme"] .mo-outils { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mo-outil { display: flex; align-items: center; gap: 11px; height: 100%; padding: 10px 12px; border: 1px solid #E2E8F0; border-radius: 12px; background: #fff; color: #1E293B;
  transition: transform .15s, border-color .15s, background .15s, box-shadow .15s; }
.mo-outil:hover { transform: translateY(-2px); border-color: var(--c); background: var(--cs); color: #1E293B; box-shadow: 0 12px 22px -14px var(--c); }
.mo-outil[aria-current="page"] { border-color: var(--c); background: var(--cs); box-shadow: inset 3px 0 0 var(--c); }
.mo-oic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--cs); font-size: 17px; line-height: 1; }
.mo-outil:hover .mo-oic, .mo-outil[aria-current="page"] .mo-oic { background: #fff; }
.mo-otxt { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.mo-otxt strong { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.mo-otxt small { color: var(--cd); font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.mo-puce { flex: none; padding: 2px 7px; border-radius: 999px; background: #FEF3C7; color: #92400E; font-size: 10.5px; font-weight: 600; }

/* pilier 6 : les 5 groupes A a E, en liste compacte sur 3 colonnes */
.mo-groupe { display: flex; align-items: center; gap: 10px; margin: 18px 24px 0; color: var(--cd); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mo-groupe::after { content: ""; flex: 1; height: 1px; background: var(--cm); }
.mo-groupe + .mo-outils { padding-top: 10px; }
.mo-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mo-compact .mo-outil { padding: 6px 10px; border-radius: 10px; }
.mo-compact .mo-oic { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
.mo-compact .mo-otxt small, .mo-compact .mo-puce { display: none; }

/* resultats de la recherche (remplacent le corps) */
.mo-res { max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); min-height: 200px; overflow-y: auto; padding: 4px 0 22px; overscroll-behavior: contain; }
.mo-res-etat { margin: 14px 24px 0; color: #475569; font-size: 14px; }
.mo-res-bloc { margin-top: 4px; }
.mo-res .mo-outils { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mo-res-vide { margin: 14px 24px 0; padding: 18px; border: 1px dashed #CBD5E1; border-radius: 12px; color: #475569; font-size: 14px; }
.mo-pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; padding: 10px 22px; border-top: 1px solid #E2E8F0; background: #F8FAFC; color: #64748B; font-size: 12.5px; }

/* 1024 a 1180 px : on resserre */
@media (min-width: 1024px) and (max-width: 1180px) {
  .mo-corps { grid-template-columns: 260px minmax(0, 1fr); background-image: linear-gradient(to right, #F8FAFC 260px, #E2E8F0 260px 261px, #fff 261px); }
  .mo-outils, .mo-bloc[data-p="ingenierie-physique-urbanisme"] .mo-outils, .mo-res .mo-outils { padding-left: 18px; padding-right: 18px; }
  .mo-bloc[data-p="ingenierie-physique-urbanisme"] .mo-outils, .mo-res .mo-outils { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mo-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* telephone et tablette : un accordeon colore (un pilier = une carte qui se deplie) */
@media (max-width: 1023px) {
  .amh-outils > .amh-panneau.mo { padding: 0 0 8px; overflow: visible; border-radius: 0; box-shadow: none; background: none; }
  .mo::before { height: 4px; margin: 2px 0 12px; border-radius: 4px; }
  .mo-haut { flex-wrap: wrap; gap: 8px; padding: 0 0 12px; border: 0; background: none; }
  .mo-recherche { flex-basis: 100%; max-width: none; }
  .mo-tous { margin: 0; }
  .mo-corps { display: block; min-height: 0; background: none; }
  .mo-bloc { display: block; margin: 0 0 8px; border: 1px solid var(--cm); border-radius: 14px; background: #fff; overflow: hidden; }
  .mo-onglet { padding: 10px 12px; border-left-color: var(--c); }
  .mo-bloc.mo-actif .mo-onglet { background: var(--cs); }
  .mo-fl { opacity: 1; transform: rotate(135deg); }
  .mo-bloc.mo-actif .mo-fl { transform: rotate(-45deg); }
  .mo-pane { max-height: none; overflow: visible; padding-bottom: 12px; }
  .mo-pane-tete { position: static; padding: 8px 12px 0; background: none; border: 0; }
  .mo-pane-tete { display: block; }
  .mo-pane-tete > div { display: none; }
  .mo-voir { display: flex; width: 100%; justify-content: center; }
  .mo-outils, .mo-bloc .mo-outils, .mo-bloc[data-p] .mo-outils, .mo-compact, .mo-res .mo-outils { grid-template-columns: minmax(0, 1fr); padding: 10px 10px 0; gap: 8px; }
  .mo-groupe { margin: 14px 12px 0; }
  .mo-compact .mo-oic { width: 34px; height: 34px; }
  .mo-res { max-height: none; }
  .mo-res-etat, .mo-res-vide { margin-left: 0; margin-right: 0; }
  .mo-pied { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mo *, .mo-bloc.mo-actif .mo-pane { transition: none !important; animation: none !important; }
}
