/*
 * Blocs WordPress aux couleurs de DalaOne (inc/blocks.php, patterns/*.php).
 * Chargé sur les pages qui contiennent des blocs, et dans l'éditeur.
 * S'appuie sur les variables de site.css (--purple, --purple-light…).
 */

/* ── Conteneur des blocs d'une page (après les sections du thème) ── */
/* Les sections du thème (<section>, bloc « Section DalaOne ») gèrent leurs propres marges. */
.dg-blocks > :not(.alignfull):not(section) { max-width: var(--container); margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
.dg-blocks > :first-child:not(.alignfull):not(section) { margin-top: 64px; }
.dg-blocks > :last-child:not(.alignfull):not(section) { margin-bottom: 64px; }

/* Éditeur : étiquette au-dessus de chaque section du thème ; sections masquées visibles mais grisées. */
.dg-section-block { position: relative; }
.dg-section-block-label {
  position: absolute; top: 10px; left: 10px; z-index: 5; padding: 6px 12px; border-radius: 999px;
  background: var(--ink); color: var(--white); font: 600 12px/1.2 var(--font); pointer-events: none;
}
.editor-styles-wrapper .dg-section-block [data-dalaone-hidden] { display: block !important; opacity: .4; }
.editor-styles-wrapper .dg-section-block a, .editor-styles-wrapper .dg-section-block button { pointer-events: none; }
.dg-blocks-text > :not(.alignfull) { max-width: calc(760px + 48px); }
.dg-blocks-text.page-content { max-width: none; }
/* Texte courant d'une page libre (politique de confidentialité…) : titres de lecture. */
.dg-blocks.dg-blocks-text > h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); color: var(--purple-dark); margin: 2.4rem auto .8rem; }
.dg-b-section { padding: clamp(64px, 9vw, 104px) 24px; margin: 0; }
/* Deux sections blanches qui se suivent : pas de double espace entre elles. */
.dg-blocks > .dg-b-section:not([class*="is-style"]) + .dg-b-section:not([class*="is-style"]) { padding-top: 0; }

/* Titres et textes, comme sur le reste du site */
/* Seulement les blocs ajoutés : jamais les sections du thème (<section>), qui ont leurs propres couleurs. */
:is(.dg-blocks, .editor-styles-wrapper) h2:not(section *) { font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1.12; letter-spacing: -.02em; color: var(--ink); margin: 0 0 1rem; }
:is(.dg-blocks, .editor-styles-wrapper) h3:not(section *) { font-size: 1.2rem; color: var(--purple-dark); margin: 0 0 .5rem; }
:is(.dg-blocks, .editor-styles-wrapper) p:not(section *) { color: var(--grey-deep); }

/* ── Styles de blocs ── */
.is-style-dalaone-surtitre {
  font-size: .8rem !important; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--purple) !important; margin-bottom: .6rem !important;
}

.wp-block-group.is-style-dalaone-card {
  background: var(--white); border: 1px solid #ece4f8; border-radius: var(--radius); padding: 30px;
  height: 100%; transition: transform .2s ease, box-shadow .2s ease;
}
.wp-block-group.is-style-dalaone-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.wp-block-group.is-style-dalaone-card p { margin: 0; }

.wp-block-group.is-style-dalaone-lavande { background: var(--purple-light); }
.wp-block-group.is-style-dalaone-violet {
  background: linear-gradient(160deg, #2a0f5c 0%, var(--purple-deep) 50%, var(--purple) 100%); color: var(--white);
}
.wp-block-group.is-style-dalaone-violet h2, .wp-block-group.is-style-dalaone-violet h3 { color: var(--white); }
.wp-block-group.is-style-dalaone-violet p { color: rgba(255, 255, 255, .85); }
.wp-block-group.is-style-dalaone-violet .wp-block-button:not(.is-style-dalaone-contour) .wp-block-button__link { background: var(--white); color: var(--purple-dark); }
.wp-block-group.is-style-dalaone-violet .is-style-dalaone-contour .wp-block-button__link { color: var(--white); border-color: rgba(255, 255, 255, .5); }

/* Boutons */
.dg-blocks .wp-block-button__link, .editor-styles-wrapper .wp-block-button__link { transition: background .15s ease, transform .15s ease; }
.dg-blocks .wp-block-button__link:hover { transform: translateY(-1px); }
.wp-block-button.is-style-dalaone-contour .wp-block-button__link {
  background: transparent; color: var(--purple-dark); border: 1.5px solid var(--purple-bright);
}
.wp-block-button.is-style-dalaone-contour .wp-block-button__link:hover { background: var(--purple-light); }

/* Image arrondie avec ombre */
.wp-block-image.is-style-dalaone-arrondi img { border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(65, 18, 140, .45); }

/* Liste à coches */
ul.is-style-dalaone-coches { list-style: none; padding-left: 0; display: grid; gap: 10px; }
ul.is-style-dalaone-coches li { position: relative; padding-left: 30px; color: var(--grey-dark); }
ul.is-style-dalaone-coches li::before {
  content: ''; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--purple-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237D3CFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* Citation */
.wp-block-quote.is-style-dalaone-citation {
  border: 0; margin: 0; padding: 36px 36px 30px; border-radius: 22px; background: var(--purple-light); position: relative;
}
.wp-block-quote.is-style-dalaone-citation::before { content: '“'; position: absolute; top: -8px; left: 24px; font-size: 5rem; line-height: 1; color: var(--purple-bright); }
.wp-block-quote.is-style-dalaone-citation p { font-size: 1.3rem; line-height: 1.5; color: var(--ink); font-weight: 500; }
.wp-block-quote.is-style-dalaone-citation cite { display: block; margin-top: 14px; font-style: normal; font-weight: 600; color: var(--purple-deep); }

/* Cartes et colonnes */
.wp-block-columns.dg-b-cards { gap: 22px; }
.wp-block-columns.dg-b-gap { gap: clamp(28px, 5vw, 64px); }

/* Chiffres clés */
.dg-b-chiffres { text-align: center; }
.dg-b-chiffre { font-size: clamp(2.6rem, 6vw, 3.8rem) !important; font-weight: 800; line-height: 1; letter-spacing: -.03em; color: var(--purple) !important; margin: 0 0 8px !important; }

/* Questions fréquentes */
.wp-block-details.dg-b-faq { background: var(--white); border: 1px solid #ebe2f6; border-radius: 16px; padding: 0 20px; margin: 10px 0 0; }
.wp-block-details.dg-b-faq summary { cursor: pointer; min-height: 60px; display: flex; align-items: center; font-weight: 600; color: var(--ink); }
.wp-block-details.dg-b-faq[open] summary { color: var(--purple-deep); }
.wp-block-details.dg-b-faq > p { margin: 0 0 18px; }

@media (max-width: 781px) {
  .wp-block-group.is-style-dalaone-card { padding: 24px; }
  .wp-block-quote.is-style-dalaone-citation { padding: 30px 24px 24px; }
}
