/* ==========================================================
   WeddingPart — Overrides légers pour le contenu des outils
   --------------------------------------------------------
   Chargé uniquement sur les pages avec le template
   `template-outils-globaux` (cf. inc/assets.php → règle tmpl-*).
   But : harmoniser visuellement les composants internes des
   plugins idd-* avec la palette du shell SaaS et de la home,
   SANS toucher au code des plugins.
   ========================================================== */

/* ----------------------------------------------------------
   1. Cadre tool : suppression du double-padding superflu
   ---------------------------------------------------------- */
.app-workspace__inner > * { max-width: 100%; }

/* Compatibilité avec anciens conteneurs idd-tools-* (au cas où
   un plugin référence encore ces wrappers) */
.app-workspace .idd-tools-workspace,
.app-workspace .idd-tools-workspace__inner {
    background: transparent;
    padding: 0;
    margin: 0;
    box-shadow: none;
    border: 0;
    max-width: 100%;
}

/* ----------------------------------------------------------
   2. Hero interne aux outils : on adoucit la taille pour ne pas
   redoubler avec le titre du header app. (s'applique aux
   patterns repérés sur budget / liste / prestataires / etc.)
   ---------------------------------------------------------- */
.idd-budget__header,
.idd-invites__header,
.idd-presta__header,
.idd-moodboard__header,
.idd-retro__header,
.idd-tdb__header,
.idd-menu__header,
.idd-lieu__header,
.idd-playlist__header,
.idd-pdt__header,
.idd-plani__header {
    margin: 4px 0 22px; /* TODO: tokenize — margin hero */
}

/* ----------------------------------------------------------
   3. Conteneur racine de chaque outil : largeur naturelle
   ---------------------------------------------------------- */
#idd-budget-mariage,
#idd-liste-invites,
#idd-prestataires,
#idd-moodboard,
#idd-retroplanning,
#idd-menu-traiteur,
#idd-lieu,
#idd-playlist,
#idd-plan-de-table,
#idd-plan-interactif,
#idd-tdb,
#idd-tableau-de-bord,
#idd-mon-abonnement {
    max-width: 100%;
    margin: 0;
    padding-top: 0;
}

/* ----------------------------------------------------------
   4. Boutons des outils : on garde le style natif des plugins
   mais on assure cohérence des rayons (full pill) et focus
   accessible. (Sélecteurs très spécifiques pour ne pas
   marcher sur les styles internes.)
   ---------------------------------------------------------- */
.app-workspace__inner button:focus-visible,
.app-workspace__inner [role="button"]:focus-visible,
.app-workspace__inner a:focus-visible {
    outline: 3px solid rgba(181,99,122,.32); /* TODO: tokenize — focus ring brand */
    outline-offset: 2px;
}

/* ----------------------------------------------------------
   5. Gate abonnement — encadrement plus doux dans le shell
   (cohérent avec le centre du workspace plutôt que collé)
   ---------------------------------------------------------- */
.app-workspace .idd-abo-gate {
    margin: clamp(20px, 5vw, 56px) auto !important;
}

/* ----------------------------------------------------------
   6. Modales et drawers internes des outils : on assure
   un z-index supérieur à la bottom-nav mobile pour qu'ils
   passent au-dessus.
   ---------------------------------------------------------- */
.idd-modal,
.idd-drawer,
[class*="__modal"],
[class*="__drawer"] {
    z-index: var(--z-modal) !important;
}

/* ----------------------------------------------------------
   7. Texte par défaut dans le workspace (héritage clean)
   ---------------------------------------------------------- */
.app-workspace__inner h1,
.app-workspace__inner h2,
.app-workspace__inner h3,
.app-workspace__inner h4 {
    font-family: var(--font-serif);
    color: var(--app-ink);
    letter-spacing: -.01em;
}
.app-workspace__inner h1 { font-size: clamp(1.85rem, 3.5vw, 2.5rem); } /* TODO: tokenize — clamp typo h1 */
.app-workspace__inner h2 { font-size: clamp(var(--text-2xl), 2.8vw, 1.95rem); } /* TODO: tokenize — clamp typo h2 */
.app-workspace__inner h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); } /* TODO: tokenize — clamp typo h3 */

/* ----------------------------------------------------------
   8. Liens du contenu : éviter qu'un override de plugin n'efface
   le style brand
   ---------------------------------------------------------- */
.app-workspace__inner p a {
    color: var(--app-brand);
}
.app-workspace__inner p a:hover {
    color: var(--app-brand-dark);
}

/* ----------------------------------------------------------
   9. Sur mobile, on s'assure que les outils complexes
   (plan-de-table, plan-interactif, moodboard) gardent
   un espace en bas pour la bottom-nav.
   ---------------------------------------------------------- */
@media (max-width: 1023px) {
    .app-workspace__inner [class*="canvas"],
    .app-workspace__inner [class*="board"],
    .app-workspace__inner [class*="plan"] {
        max-height: calc(100vh - var(--app-header-h) - var(--app-bottom-h) - var(--app-adminbar-h) - 60px); /* TODO: tokenize — 60px hors scale */
    }
}

/* ----------------------------------------------------------
   10. Forçage cohérence : tout bouton de fermeture interne
   doit être bien visible (croix nette).
   ---------------------------------------------------------- */
.app-workspace__inner [aria-label*="ermer"],
.app-workspace__inner [aria-label*="lose"],
.app-workspace__inner button[class*="close"] {
    color: var(--app-soft);
    transition: color var(--duration) var(--ease),
                background-color var(--duration) var(--ease);
}
.app-workspace__inner [aria-label*="ermer"]:hover,
.app-workspace__inner [aria-label*="lose"]:hover,
.app-workspace__inner button[class*="close"]:hover {
    color: var(--app-brand);
    background-color: var(--app-brand-soft);
}
