/* =========================================================================
   IMD Logic Enterprise — block editor bridge
   Maps the block styles registered in inc/setup.php onto the design system,
   and gives core blocks the same visual language as the hand-built templates.
   ========================================================================= */

/* ---- Registered block styles ------------------------------------------ */
.is-style-imd-card {
  padding: var(--imd-s-6);
  background: var(--imd-white);
  border: 1px solid var(--imd-border);
  border-radius: var(--imd-radius);
  box-shadow: var(--imd-shadow-xs);
}
.is-style-imd-card > :last-child { margin-bottom: 0; }

.is-style-imd-panel {
  padding: clamp(1.5rem, 2.5vw, 2rem);
  background: var(--imd-gray-50);
  border: 1px solid var(--imd-border);
  border-radius: var(--imd-radius);
}
.is-style-imd-panel > :last-child { margin-bottom: 0; }

.is-style-imd-lead {
  font-size: clamp(1.0625rem, 0.45vw + 1rem, 1.3125rem);
  line-height: 1.6;
  color: var(--imd-ink-2);
  max-width: 62ch;
}

.is-style-imd-eyebrow {
  font-size: var(--imd-fs-xs) !important;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--imd-blue);
  margin-bottom: var(--imd-s-3);
  line-height: 1.4;
}

.is-style-imd-rule {
  width: 52px;
  height: 3px;
  max-width: 52px;
  margin-left: 0;
  background: var(--imd-brand);
  border: 0;
  border-radius: 3px;
  opacity: 1;
}

/* Checklist and tag list built from a core list block */
ul.is-style-imd-checklist {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}
ul.is-style-imd-checklist li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: var(--imd-s-3);
  color: var(--imd-ink-2);
}
ul.is-style-imd-checklist li::before {
  content: "";
  position: absolute; left: 0; top: 0.28em;
  width: 1.15rem; height: 1.15rem;
  border-radius: 50%;
  background: var(--imd-blue-tint);
}
ul.is-style-imd-checklist li::after {
  content: "";
  position: absolute; left: 0.36rem; top: 0.52em;
  width: 0.28rem; height: 0.55rem;
  border-right: 2px solid var(--imd-blue-deep);
  border-bottom: 2px solid var(--imd-blue-deep);
  transform: rotate(42deg);
}

ul.is-style-imd-taglist {
  display: flex; flex-wrap: wrap; gap: var(--imd-s-2) var(--imd-s-3);
  list-style: none; margin-left: 0; padding-left: 0;
}
ul.is-style-imd-taglist li {
  margin: 0;
  padding: 0.42em 0.9em;
  background: var(--imd-white);
  border: 1px solid var(--imd-border);
  border-radius: 100px;
  color: var(--imd-ink-2);
  font-size: var(--imd-fs-sm);
  font-weight: 550;
}

/* ---- Core colour classes generated from theme.json -------------------- */
.has-imd-navy-color        { color: #0B1A2D !important; }
.has-imd-ink-color         { color: #141A22 !important; }
.has-imd-blue-color        { color: #0A6FA8 !important; }
.has-imd-brand-color       { color: #29ABE2 !important; }
.has-imd-muted-color       { color: #5A6675 !important; }
.has-imd-white-color       { color: #FFFFFF !important; }

.has-imd-navy-background-color       { background-color: #0B1A2D !important; }
.has-imd-ink-background-color        { background-color: #141A22 !important; }
.has-imd-blue-background-color       { background-color: #0A6FA8 !important; }
.has-imd-brand-background-color      { background-color: #29ABE2 !important; }
.has-imd-blue-tint-background-color  { background-color: #E8F4FB !important; }
.has-imd-gray-background-color       { background-color: #F5F7FA !important; }
.has-imd-white-background-color      { background-color: #FFFFFF !important; }

/* Text on the dark backgrounds stays readable without extra editor work. */
.has-imd-navy-background-color,
.has-imd-ink-background-color { color: #D5E0EC; }
.has-imd-navy-background-color :where(h1,h2,h3,h4,h5,h6),
.has-imd-ink-background-color :where(h1,h2,h3,h4,h5,h6) { color: #FFFFFF; }
.has-imd-navy-background-color a:not(.imd-btn),
.has-imd-ink-background-color a:not(.imd-btn) { color: #29ABE2; }

/* ---- Core blocks ------------------------------------------------------- */
.wp-block-columns { gap: var(--imd-s-6); }

.wp-block-quote {
  border-left: 3px solid var(--imd-brand);
  padding-left: var(--imd-s-5);
  margin-left: 0;
  font-size: var(--imd-fs-lg);
}
.wp-block-quote cite {
  display: block;
  margin-top: var(--imd-s-3);
  font-size: var(--imd-fs-sm);
  font-style: normal;
  color: var(--imd-muted);
}

.wp-block-pullquote {
  border-top: 2px solid var(--imd-border);
  border-bottom: 2px solid var(--imd-border);
  padding: var(--imd-s-7) 0;
}

.wp-block-table table { border: 1px solid var(--imd-border); }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--imd-gray-50); }
.wp-block-table figcaption { font-size: var(--imd-fs-xs); color: var(--imd-muted); }

.wp-block-button__link {
  background: var(--imd-blue);
  color: var(--imd-white);
  border-radius: var(--imd-radius-sm);
  font-size: var(--imd-fs-sm);
  font-weight: 650;
  padding: 0.9em 1.65em;
  min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.wp-block-button__link:hover { background: var(--imd-blue-deep); color: var(--imd-white); }
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--imd-blue-deep);
  border: 1px solid var(--imd-border-strong);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--imd-blue-tint);
  border-color: var(--imd-blue);
  color: var(--imd-blue-deep);
}

.wp-block-details {
  border: 1px solid var(--imd-border);
  border-radius: var(--imd-radius);
  padding: var(--imd-s-5);
}
.wp-block-details summary {
  font-weight: 650;
  color: var(--imd-navy);
  cursor: pointer;
  min-height: 32px;
}

.wp-block-code {
  background: var(--imd-navy);
  color: #E7EEF6;
  border: 0;
  border-radius: var(--imd-radius);
  padding: var(--imd-s-5);
}

.wp-block-cover { border-radius: var(--imd-radius); overflow: hidden; }

.wp-block-media-text { border-radius: var(--imd-radius); overflow: hidden; }

/* Group blocks used as full-bleed sections */
.wp-block-group.imd-section > .wp-block-group__inner-container {
  width: 100%;
  max-width: var(--imd-container);
  margin-inline: auto;
  padding-inline: var(--imd-gutter);
}
