/**
 * Callout block.
 *
 * Static stylesheet on purpose. It is registered against the block with
 * wp_enqueue_block_style(), so WordPress loads it only on pages that actually
 * use the block, and loads it into the editor as well — which is what makes the
 * server-rendered preview look like the front end. Nothing here goes through
 * Vite, so the demo works in a checkout with no npm install.
 */

.callout {
  --callout-accent: #2563eb;
  --callout-surface: #eff6ff;

  display: flex;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  color: #1f2937;
  background: var(--callout-surface);
  border-left: 4px solid var(--callout-accent);
  border-radius: 0.375rem;
  gap: 1rem;
}

.callout--success {
  --callout-accent: #059669;
  --callout-surface: #ecfdf5;
}

.callout--warning {
  --callout-accent: #d97706;
  --callout-surface: #fffbeb;
}

.callout__icon {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 0.25rem;
}

/* The Figure of studiometa/ui fills the 48 px box. Written out rather than left to
   the Tailwind classes of the Figure template, which the theme build does not scan. */
.callout__figure,
.callout__figure .figure__inner,
.callout__figure .figure__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.callout__figure .figure__img {
  max-width: none;
  object-fit: cover;
}

.callout__content {
  flex: 1 1 auto;
  min-width: 0;
}

.callout__title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  line-height: 1.3;
}

/* The inline column-count comes from the block's `columns` attribute. */
.callout__body {
  margin: 0;
  line-height: 1.6;
  column-gap: 1.5rem;
}

.callout__dismiss {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  font-size: 1.125rem;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
  opacity: 0.6;
}

.callout__dismiss:hover,
.callout__dismiss:focus-visible {
  background: color-mix(in srgb, var(--callout-accent) 15%, transparent);
  opacity: 1;
}
