/**
 * Branike Blocks — Text block styles  v1.5.1
 * Frontend + Editor (načítava WP cez "style": "file:style.css" v block.json)
 */

/* Dlhé slovo (e-mail, URL) sa zalomí namiesto pretečenia — viď heading/style.css
   (zmerané 21. 11. 2026). */
.wp-block-branike-text { overflow-wrap: anywhere; }

/* ── Text alignment ───────────────────────────────────────────────────────── */
.wp-block-branike-text.has-text-align-left    { text-align: left; }
.wp-block-branike-text.has-text-align-center  { text-align: center; }
.wp-block-branike-text.has-text-align-right   { text-align: right; }
.wp-block-branike-text.has-text-align-justify { text-align: justify; }

/* ── Format types ─────────────────────────────────────────────────────────── */

.bb-u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

mark.bb-hl {
    color: inherit;
    padding: 0 0.1em;
    border-radius: 2px;
}

kbd.bb-kbd {
    font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875em;
    background: var(--bb-surface-subtle, #f0f0f0);
    color: var(--bb-text, #333);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    border: 1px solid var(--bb-border, #ccc);
    border-bottom-width: 2px;
    line-height: 1;
    white-space: nowrap;
}

/* Spoiler — skrytý text, klik ho odhalí (frontend.js) */
span.bb-spoiler {
    background-color: currentColor;
    color: transparent;
    border-radius: 3px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s, color 0.3s;
}

span.bb-spoiler.bb-spoiler--revealed {
    background-color: transparent;
    color: inherit;
    cursor: auto;
}

/* ── Drop cap ─────────────────────────────────────────────────────────────── */
.wp-block-branike-text.has-drop-cap:not(:focus)::first-letter,
.editor-styles-wrapper .wp-block-branike-text.has-drop-cap::first-letter {
    float: left;
    font-size: 3.4em;
    line-height: 0.68;
    font-weight: 700;
    margin: 0.1em 0.12em 0 0;
}

/* ── Gradient text ────────────────────────────────────────────────────────── */
/* CSS fallback gradient — inline style z computeStyles() alebo WP color panel ho prepisuje */
.wp-block-branike-text.has-gradient-text {
    background-image: linear-gradient(135deg, #5B21B6 0%, #7C3AED 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Typing cursor animation (CSS-only, 0 JS) ────────────────────────────── */
.wp-block-branike-text.has-typing-animation::after {
    content: '|';
    display: inline-block;
    margin-left: 1px;
    font-weight: 400;
    opacity: 1;
    animation: bb-cursor-blink 1.1s step-end infinite;
}

@keyframes bb-cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .wp-block-branike-text.has-typing-animation::after {
        animation: none;
        content: '';
    }
}

/* ── Entrance animations ──────────────────────────────────────────────────── */

/* Initial states — aplikujú sa po pridaní .bb-text-anim-ready (JS) */
.wp-block-branike-text.bb-text-anim-ready[data-bb-anim="fade-in"]     { opacity: 0; }
.wp-block-branike-text.bb-text-anim-ready[data-bb-anim="slide-up"]    { opacity: 0; transform: translateY(28px); }
.wp-block-branike-text.bb-text-anim-ready[data-bb-anim="slide-left"]  { opacity: 0; transform: translateX(-28px); }
.wp-block-branike-text.bb-text-anim-ready[data-bb-anim="slide-right"] { opacity: 0; transform: translateX(28px); }
.wp-block-branike-text.bb-text-anim-ready[data-bb-anim="scale-in"]    { opacity: 0; transform: scale(0.92); }
.wp-block-branike-text.bb-text-anim-ready[data-bb-anim="blur-in"]     { opacity: 0; filter: blur(8px); }

/* Animated state — JS pridá .bb-text-anim-in */
.wp-block-branike-text.bb-text-anim-in {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition:
        opacity   var(--bb-text-dur, 0.6s) var(--bb-text-ease, ease) var(--bb-text-delay, 0s),
        transform var(--bb-text-dur, 0.6s) var(--bb-text-ease, ease) var(--bb-text-delay, 0s),
        filter    var(--bb-text-dur, 0.6s) var(--bb-text-ease, ease) var(--bb-text-delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
    .wp-block-branike-text.bb-text-anim-ready,
    .wp-block-branike-text.bb-text-anim-in {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }
}

/* ── Predefined block styles ──────────────────────────────────────────────── */

.wp-block-branike-text.is-style-lead {
    font-size: 1.25em;
    line-height: 1.6;
    font-weight: 400;
}

.wp-block-branike-text.is-style-caption {
    font-size: 0.875em;
    color: var(--bb-text-muted, #6b7280);
    font-style: italic;
}

.wp-block-branike-text.is-style-small {
    font-size: 0.8em;
}

.wp-block-branike-text.is-style-highlight-block {
    border-left: 4px solid currentColor;
    padding-left: 1em;
    font-style: italic;
    margin-left: 0;
}
