/**
 * MDR Icon Block — styles
 *
 * Three variations are controlled entirely via CSS custom properties set
 * inline by render.php:
 *
 *   --mdr-icon-primary    The main chosen color.
 *                         Variation 1: icon fill color
 *                         Variation 2: icon fill + border color
 *                         Variation 3: background color
 *
 *   --mdr-icon-secondary  Only set for variation 3.
 *                         Variation 3: icon fill color (contrasts with bg)
 *
 * The .icon wrapper already has fill: currentColor via icons.css.
 * Setting color: on the .icon span is all that's needed to drive the fill.
 */

/* ============================================================================
   Base
   ============================================================================ */

.mdr-icon-block {
    display: flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.mdr-icon-block .icon {
    width: auto;
    height: 45px;
}

.mdr-icon-block .icon svg {
    width: auto;
    height: 100%;
}

.mdr-icon-block--left {
    margin-left: 0;
    margin-right: auto;
}

/* ============================================================================
   Variation 1 — Solid
   Icon renders in the chosen primary color, no container decoration.
   ============================================================================ */

.mdr-icon-block--solid .icon {
    color: var(--mdr-icon-primary, currentColor);
}

/* ============================================================================
   Variation 2 — Bordered
   Fixed-size circle container; icon constrained to 45×45 square inside.
   SVG preserveAspectRatio handles scaling — circle is always perfectly round.
   ============================================================================ */

.mdr-icon-block--bordered {
    border: 4px solid var(--mdr-icon-primary, currentColor);
    border-radius: 50%;
    width: 85px;
    height: 85px;
    box-sizing: border-box;
}

.mdr-icon-block--bordered .icon {
    color: var(--mdr-icon-primary, currentColor);
    width: 45px;
    height: 45px;
}

.mdr-icon-block--bordered .icon svg {
    width: 45px;
    height: 45px;
}

/* ============================================================================
   Variation 3 — Filled
   Fixed-size circle container; icon constrained to 45×45 square inside.
   SVG preserveAspectRatio handles scaling — circle is always perfectly round.
   ============================================================================ */

.mdr-icon-block--filled {
    background-color: var(--mdr-icon-primary, currentColor);
    border-radius: 50%;
    width: 85px;
    height: 85px;
}

.mdr-icon-block--filled .icon {
    color: var(--mdr-icon-secondary, #ffffff);
    width: 45px;
    height: 45px;
}

.mdr-icon-block--filled .icon svg {
    width: 45px;
    height: 45px;
}

/* ============================================================================
   Editor placeholder
   ============================================================================ */

.mdr-icon-block--placeholder {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.75em 1em;
    border: 2px dashed #ccc;
    border-radius: 4px;
    color: #999;
    font-size: 0.875rem;
    pointer-events: none;
}
