/* ============================================
   TODAY BRIEF — Enne's short note on the day, under the greeting
   (templates/pages/dashboard.html #brief-section, loadDailyBrief in
   static/js/dashboard.js). Violet throughout: Enne is speaking. No card:
   the note sits on the canvas behind one 2px violet-tinted rule. The only
   surface is the loading shimmer, on --surface-soft (whose reduced-
   transparency and no-color-mix fallbacks live in modern.css); nothing
   here uses backdrop-filter.
   ============================================ */

.brief-section {
    position: relative;
    margin: -16px 0 30px;
    padding: 2px 0 4px 16px;
    border-left: 2px solid color-mix(in srgb, var(--ai) 38%, transparent);
}

/* [hidden] must win over the display values below. */
.brief-section[hidden],
.brief-section [hidden] {
    display: none;
}

/* Arrives with the welcome block's stagger (dashboard.css fadeSlideUp at
   0.05s); when the brief lands later, it fades in on arrival instead. */
@keyframes brief-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

html.page-revealed .brief-section {
    animation: brief-in 0.5s ease 0.06s both;
}

/* Eyebrow: sparkles + "Today · Tuesday, 27 October" + refresh. */
.brief-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    color: var(--ai);
}

.brief-spark {
    display: inline-flex;
    flex-shrink: 0;
}

.brief-spark svg,
.brief-spark [data-lucide],
.brief-refresh svg,
.brief-refresh [data-lucide] {
    width: 14px;
    height: 14px;
}

.brief-label {
    font-size: var(--fs-eyebrow);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

.brief-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

.brief-refresh:hover:not(:disabled) {
    color: var(--ai);
    background: var(--ai-tint);
}

.brief-refresh:focus-visible {
    outline-color: var(--ai);
}

.brief-refresh:disabled {
    cursor: default;
    opacity: 0.4;
}

.brief-refresh.is-spinning {
    color: var(--ai);
    opacity: 1;
    cursor: progress;
}

@keyframes brief-spin {
    to {
        transform: rotate(360deg);
    }
}

.brief-refresh.is-spinning svg {
    animation: brief-spin 0.9s linear infinite;
}

.brief-text {
    max-width: 64ch;
    margin: 4px 0 0;
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.55;
    color: var(--foreground);
    text-wrap: pretty;
    overflow-wrap: break-word;
}

/* One quiet line when there is no brief: nothing due and no calendar, or
   (admins only) the plan or the workspace setting that turns AI off. */
.brief-note {
    max-width: 64ch;
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted-foreground);
    text-wrap: pretty;
}

/* Loading: two quiet lines with a slow violet sweep. */
.brief-shimmer {
    display: grid;
    gap: 11px;
    max-width: 64ch;
    margin-top: 10px;
    padding-bottom: 6px;
    font-size: 17px; /* 64ch matches the text it stands in for */
}

@keyframes brief-shimmer {
    from {
        background-position: 150% 0;
    }
    to {
        background-position: -50% 0;
    }
}

.brief-shimmer-line {
    display: block;
    height: 12px;
    border-radius: 6px;
    background-color: var(--surface-soft);
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        color-mix(in srgb, var(--ai) 9%, transparent) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 1px var(--surface-border);
    animation: brief-shimmer 1.6s ease-in-out infinite;
}

.brief-shimmer-line:last-child {
    width: 62%;
}

/* No color-mix(): a var() inside it is invalid at use time, which would
   leave the rule currentColor and the sweep unpainted. */
@supports not (color: color-mix(in srgb, red 50%, transparent)) {
    .brief-section {
        border-left-color: var(--ai-tint);
    }

    .brief-shimmer-line {
        background-image: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.page-revealed .brief-section {
        animation: none;
    }

    .brief-refresh.is-spinning svg,
    .brief-shimmer-line {
        animation: none;
    }
}

@media (max-width: 640px) {
    .brief-section {
        margin: -8px 0 24px;
        padding-left: 14px;
    }
}
