/* ==========================================================================
   WN Announcement Banner
   Full-width, dùng lại các biến ngữ nghĩa của theme Webnovel:
   --accent / --ok / --warn / --danger, tự đổi màu theo dark/light mode.
   ========================================================================== */

.wnab-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.wnab-banner {
    width: 100%;
    font-family: var(--font-ui, system-ui, sans-serif);
    animation: wnab-slide-down 250ms ease;
}

@keyframes wnab-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wnab-banner.wnab-banner--closing {
    animation: wnab-collapse 200ms ease forwards;
}

@keyframes wnab-collapse {
    from { opacity: 1; max-height: 200px; }
    to   { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
}

.wnab-banner__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-3, 12px);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--sp-3, 12px) clamp(var(--sp-4, 16px), 4vw, var(--sp-8, 32px));
}

.wnab-banner__icon {
    flex-shrink: 0;
    display: flex;
}

.wnab-banner__icon svg {
    width: 20px;
    height: 20px;
}

.wnab-banner__content {
    flex: 1;
    min-width: 0;
    font-size: var(--text-sm, 0.875rem);
    line-height: 1.5;
}

.wnab-banner__content > *:first-child { margin-top: 0; }
.wnab-banner__content > *:last-child  { margin-bottom: 0; }

.wnab-banner__content p {
    margin: 0;
}

.wnab-banner__content a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wnab-banner__cta {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: var(--text-xs, 0.75rem);
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: background 150ms ease;
}

.wnab-banner__cta:hover {
    background: rgba(255, 255, 255, 0.32);
}

.wnab-banner__close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.75;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, opacity 150ms ease;
}

.wnab-banner__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Màu theo mức độ, dùng biến ngữ nghĩa của theme ───
   Theme tự định nghĩa --accent-fg tối ở dark mode (vì --accent sáng) và
   sáng ở light mode (vì --accent đậm hơn). --ok/--warn/--danger của theme
   đi theo đúng quy luật độ sáng tương tự (sáng ở dark mode, đậm hơn ở light
   mode) nên dùng chung --accent-fg cho cả 4 kiểu là đủ tương phản, không
   cần tính màu riêng cho từng biến. */
.wnab-banner--accent { background: var(--accent); }
.wnab-banner--ok     { background: var(--ok, var(--accent)); }
.wnab-banner--warn   { background: var(--warn, var(--accent)); }
.wnab-banner--danger { background: var(--danger); }

.wnab-banner--accent,
.wnab-banner--ok,
.wnab-banner--warn,
.wnab-banner--danger {
    color: var(--accent-fg, #1a1a1a);
}

@media (max-width: 640px) {
    .wnab-banner__inner {
        flex-wrap: wrap;
        padding: var(--sp-3, 12px) var(--sp-4, 16px);
    }
    .wnab-banner__content {
        order: 1;
        flex-basis: 100%;
    }
    .wnab-banner__cta {
        order: 2;
    }
    .wnab-banner__close {
        order: 3;
        margin-left: auto;
    }
}
