/* ============================================================
   branike/feature — Feature Grid
   ============================================================ */

/* ── Parent grid ─────────────────────────────────────────── */
.bb-feature {
    display: grid;
    grid-template-columns: repeat( var(--bb-feat-cols, 3), 1fr );
    gap: var(--bb-feat-row-gap, 32px) var(--bb-feat-col-gap, 24px);
}

/* ── Feature item ────────────────────────────────────────── */
.bb-feature__item {
    display:        flex;
    flex-direction: column;
    color:          var(--bb-feat-color, inherit);
    border-radius:  var(--bb-feat-r, 12px);
}

/* Card styles */
.bb-feature--card-flat .bb-feature__item {
    background: var(--bb-feat-card-bg);
    padding:    var(--bb-feat-card-pad, 24px);
}

.bb-feature--card-elevated .bb-feature__item {
    background: var(--bb-feat-card-bg);
    padding:    var(--bb-feat-card-pad, 24px);
    box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.06);
}

/* ── Icon layout: top (default) ──────────────────────────── */
.bb-feature--icon-top .bb-feature__item {
    align-items: var(--bb-feat-align-items, flex-start);
}

.bb-feature--icon-top.bb-feature--align-center .bb-feature__item {
    align-items: center;
    text-align:  center;
}

/* ── Icon layout: left ───────────────────────────────────── */
.bb-feature--icon-left .bb-feature__item {
    flex-direction: row;
    align-items:    flex-start;
    gap:            16px;
}

.bb-feature--icon-left .bb-feature__icon-wrap {
    flex-shrink: 0;
}

/* 🔴 22. 11. 2026 (CI #926, worst-case 320 px, WCAG 1.4.10/1.4.12): dlhé slovo bez miesta na zlom (e-mail, adresa)
   pri medzerách 1.4.12 vytlačilo kartu o ~20 px mimo okna. `break-word` zlom povolí až pri pretečení riadku,
   ale min-content flex položky nezmenší → položka sa nezúži. `anywhere` + `min-width:0` = text sa zalomí
   pri akomkoľvek písme (zmerané v cloude, Chromium 141: 343–380 px → 320 px). */
.bb-feature--icon-left .bb-feature__body {
    flex: 1;
    min-width: 0;
}

/* ── Icon wrap ───────────────────────────────────────────── */
.bb-feature__icon-wrap {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           var(--bb-feat-icon-size, 40px);
    height:          var(--bb-feat-icon-size, 40px);
    flex-shrink:     0;
    margin-bottom:   12px;
    color:           var(--bb-feat-icon-color, #ffffff);
}

.bb-feature--icon-left .bb-feature__icon-wrap {
    margin-bottom: 0;
}

/* Icon shape styles */
.bb-feature--icon-circle .bb-feature__icon-wrap {
    background:    var(--bb-feat-icon-bg, var(--bb-primary, #7C3AED));
    border-radius: 50%;
}

.bb-feature--icon-square .bb-feature__icon-wrap {
    background:    var(--bb-feat-icon-bg, var(--bb-primary, #7C3AED));
    border-radius: 0;
}

.bb-feature--icon-rounded .bb-feature__icon-wrap {
    background:    var(--bb-feat-icon-bg, var(--bb-primary, #7C3AED));
    border-radius: calc( var(--bb-feat-icon-size, 40px) * 0.25 );
}

/* Dashicon inside wrap */
/* 🔴🔴 ŤAH IKONY SA NESMIE ŠKÁLOVAŤ S VEĽKOSŤOU (28. 8. 2026)
   Vstavané ikony sú kreslené v mriežke 24 jednotiek so `stroke-width: 1.5`.
   Keď ich blok vykreslí na 64 px, ťah sa natiahne 2,7× — na 4 px — a z obrysovej
   ikony je fialová škvrna. Odmerané na `features-3col` a `features-4col`:
   `stroke-width` computed 1.5px v 24-jednotkovom priestore, box 64 × 64 px.
   `non-scaling-stroke` drží hrúbku v pixeloch bez ohľadu na veľkosť ikony,
   takže tá istá ikona vyzerá rovnako pri 24 aj pri 120 px. */
.bb-feature__icon--builtin svg,
.bb-feature__icon--builtin svg * {
    vector-effect: non-scaling-stroke;
}
.bb-feature__icon--builtin svg {
    width:  var( --bb-feat-icon-size, 40px );
    height: var( --bb-feat-icon-size, 40px );
    color:  var( --bb-feat-icon-color, currentColor );
}

.bb-feature__icon {
    font-size:   calc( var(--bb-feat-icon-size, 40px) * 0.55 ) !important;
    width:       auto !important;
    height:      auto !important;
    line-height: 1 !important;
}

/* Number badge (replaces icon when showNumber=true) */
.bb-feature__num {
    font-size:   calc( var(--bb-feat-icon-size, 40px) * 0.45 );
    font-weight: 700;
    line-height: 1;
    color:       var(--bb-feat-icon-color, #ffffff);
}

/* Image icon */
.bb-feature__icon-img {
    width:       var(--bb-feat-icon-size, 40px);
    height:      var(--bb-feat-icon-size, 40px);
    object-fit:  contain;
    display:     block;
}

/* ── Body ────────────────────────────────────────────────── */
.bb-feature__body {
    flex: 1;
    min-width: 0;
}

/* ── Title ───────────────────────────────────────────────── */
.bb-feature__title {
    margin:      0 0 8px;
    font-size:   1.125em;
    font-weight: 700;
    line-height: 1.3;
    color:       var(--bb-feat-accent, inherit);
    overflow-wrap: anywhere;
}

/* ── Text content ────────────────────────────────────────── */
.bb-feature__text {
    margin:      0;
    font-size:   0.9375em;
    line-height: 1.65;
    color:       var(--bb-feat-color, inherit);
    opacity:     0.85;
    overflow-wrap: anywhere;
}

.bb-feature__text > *:last-child {
    margin-bottom: 0;
}

/* ── Animácie ────────────────────────────────────────────── */
.bb-feature--anim-fade-up .bb-feature__item,
.bb-feature--anim-fade-in .bb-feature__item,
.bb-feature--anim-stagger .bb-feature__item {
    opacity:    0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    will-change: opacity, transform;
}

.bb-feature--anim-fade-up .bb-feature__item {
    transform: translateY(28px);
}

.bb-feature--anim-fade-in .bb-feature__item {
    transform: none;
}

/* Stagger delays via nth-child */
.bb-feature--anim-stagger .bb-feature__item:nth-child(1) { transition-delay:   0ms; }
.bb-feature--anim-stagger .bb-feature__item:nth-child(2) { transition-delay: 100ms; }
.bb-feature--anim-stagger .bb-feature__item:nth-child(3) { transition-delay: 200ms; }
.bb-feature--anim-stagger .bb-feature__item:nth-child(4) { transition-delay: 300ms; }
.bb-feature--anim-stagger .bb-feature__item:nth-child(5) { transition-delay: 400ms; }
.bb-feature--anim-stagger .bb-feature__item:nth-child(6) { transition-delay: 500ms; }
.bb-feature--anim-stagger .bb-feature__item:nth-child(7) { transition-delay: 600ms; }
.bb-feature--anim-stagger .bb-feature__item:nth-child(8) { transition-delay: 700ms; }

/* Visible state */
.bb-feature--anim-ready.bb-feat-visible .bb-feature__item {
    opacity:   1;
    transform: translateY(0);
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .bb-feature--anim-fade-up .bb-feature__item,
    .bb-feature--anim-fade-in .bb-feature__item,
    .bb-feature--anim-stagger .bb-feature__item {
        opacity:    1;
        transform:  none;
        transition: none;
    }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
    .bb-feature {
        grid-template-columns: repeat( min( var(--bb-feat-cols, 3), 2 ), 1fr );
    }
}

@media (max-width: 640px) {
    .bb-feature {
        grid-template-columns: 1fr;
    }
}

/* ── Fotka namiesto ikony ────────────────────────────────────────────────────
   🔴 Obal ikony nesie tvar (kruh/štvorec) a akcentové pozadie. Pri fotke to
   nedáva zmysel: fotka sa `contain`-om vpasovala doprostred fialového disku.
   Fotka teda rám vyplní a chrome ikony sa vypne. */
.bb-feature__icon-wrap--image {
    background:    none !important;
    border:        0 !important;
    border-radius: var( --bb-feat-radius, 12px );
    overflow:      hidden;
    width:         calc( var( --bb-feat-icon-size, 40px ) * 1.6 );
    height:        calc( var( --bb-feat-icon-size, 40px ) * 1.2 );
}
.bb-feature__icon-wrap--image .bb-feature__icon-img {
    width:      100%;
    height:     100%;
    object-fit: cover;
}
