/* ——— CONTENT BLUR ——————————————————————————— */
body.sa-spoiler-active .entry-content,
body.sa-spoiler-active .page-content {
    filter: blur(8px);
    transition: filter 0.25s ease;
    pointer-events: none;
}

/* ——— BACKDROP ——————————————————————————— */
/* The background light is calculated from the accent color (—sa-accent-rgb). */
.sa-spoiler-backdrop {
    position: fixed;
    inset: 0;
    background: radial-gradient(
            ellipse at center,
            rgba(var(--sa-accent-rgb, 255, 45, 45), .18),
            rgba(0, 0, 0, .72) 60%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}
@supports (backdrop-filter: blur(3px)) {
    .sa-spoiler-backdrop { backdrop-filter: blur(3px); }
}

/* ——— MODAL ——————————————————————————— */
/* Every "red" tone comes from the --sa-accent and --sa-accent-rgb variables. */
.sa-spoiler-modal {
    position: relative;
    max-width: 640px;
    width: min(640px, calc(100% - 2rem));
    color: #fff;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

    background: linear-gradient(180deg, #1b0608 0%, #120507 55%, #0b0204 100%);
    border: 2px solid var(--sa-accent, #c91919);
    border-radius: 12px;
    padding: 28px 24px 22px;
    box-shadow:
            0 0 0 3px rgba(var(--sa-accent-rgb, 201, 25, 25), .18) inset,
            0 0 28px 8px rgba(var(--sa-accent-rgb, 201, 25, 25), .35),
            0 10px 28px rgba(0,0,0,.55);

    z-index: 100000;
    isolation: isolate;
}

/* ——— STRIPES ——————————————————————————— */
@keyframes sa-stripes {
    from { background-position: 0 0; }
    to   { background-position: 48px 0; }
}

/* Top full-width stripe */
.sa-spoiler-modal::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 18px;
    background: repeating-linear-gradient(
            -45deg,
            transparent 0 12px,
            rgba(var(--sa-accent-rgb, 201,25,25), .9) 12px 24px
    );
    border-bottom: 1px solid rgba(var(--sa-accent-rgb, 201,25,25), .55);
    box-shadow: inset 0 0 6px rgba(var(--sa-accent-rgb, 201,25,25), .35);
    animation: sa-stripes 3.5s linear infinite;
}

/* Bottom inner stripe above the buttons */
.sa-spoiler-modal::after {
    content: "";
    position: absolute;
    left: 20px; right: 20px; bottom: 66px;
    height: 12px;
    background: repeating-linear-gradient(
            -45deg,
            transparent 0 12px,
            rgba(var(--sa-accent-rgb, 201,25,25), .9) 12px 24px
    );
    border: 1px solid rgba(var(--sa-accent-rgb, 201,25,25), .55);
    box-shadow: inset 0 0 6px rgba(var(--sa-accent-rgb, 201,25,25), .35);
    animation: sa-stripes 3.5s linear infinite;
}

/* ——— TYPO ——————————————————————————— */
.sa-spoiler-modal h3 {
    margin: 14px 0 8px;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--sa-accent, #c91919);
    text-shadow:
            0 0 10px rgba(var(--sa-accent-rgb, 201,25,25), .65),
            0 0 2px  rgba(var(--sa-accent-rgb, 201,25,25), .90);
}
.sa-spoiler-modal p {
    margin: 0 0 18px;
    line-height: 1.6;
    color: #ffdada;
}

/* ——— ACTIONS ——————————————————————————— */
.sa-spoiler-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: 18px;
}

/* ——— BUTTONS ——————————————————————————— */
.sa-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}
.sa-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Primary: if there is no inline background, then it is the accent color */
.sa-btn-primary {
    background: linear-gradient(180deg, var(--sa-accent, #c91919), var(--sa-accent, #c91919));
    color: #1a0202;
    box-shadow:
            0 0 10px rgba(var(--sa-accent-rgb, 201,25,25), .45),
            inset 0 0 0 1px rgba(0,0,0,.2);
}
.sa-btn-primary:hover  { filter: brightness(1.06); transform: translateY(-1px); }
.sa-btn-primary:active { transform: translateY(0); }

.sa-btn-ghost {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
    border-radius: 12px;
}
.sa-btn-ghost:hover  { background: rgba(255,255,255,.07); }
.sa-btn-ghost:active { background: rgba(255,255,255,.10); }

/* ——— RESPONSIVE ——————————————————— */
@media (max-width: 480px) {
    .sa-spoiler-modal { padding: 22px 16px 18px; }
    .sa-spoiler-modal::after { left: 14px; right: 14px; bottom: 62px; }
    .sa-spoiler-modal h3 { font-size: 26px; }
}

/* ——— REDUCED MOTION ————————————————— */
@media (prefers-reduced-motion: reduce) {
    .sa-spoiler-modal, .sa-btn { transition: none !important; }
    .sa-spoiler-modal::before, .sa-spoiler-modal::after { animation: none !important; }
}