/*
 * office.css — den Atelier additions on top of the committed Nexus bundle.
 * Token- and component-level CSS only; utility classes stay in app.css.
 * Currently: self-hosted Inclusive Sans (replaces the Google Fonts
 * @imports that were removed from app.css — see docs/ui-design-review.md, Plan 2).
 *
 * The woff2 files are Google's variable builds (wght 400-700); weights
 * outside that range render with the nearest available instance.
 */

/* latin (variable, wght 400-700) */
@font-face {
  font-family: 'Inclusive Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inclusive-sans-var-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext (variable, wght 400-700) */
@font-face {
  font-family: 'Inclusive Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inclusive-sans-var-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------
 * Display face: Bricolage Grotesque (variable: opsz 12-96, wght 200-800).
 * Used via .font-display for page titles, the dashboard hero and the auth
 * wordmark; body text stays Inclusive Sans.
 * ------------------------------------------------------------------------ */
/* latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-var-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../fonts/bricolage-grotesque-var-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.font-display {
    font-family: 'Bricolage Grotesque', var(--font-sans);
    letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------------------
 * Toast stack for flash messages (the bundle has no .toast classes).
 * Fed by base.html on full loads and by HtmxMessagesMiddleware (OOB) on
 * HTMX responses; armed by js/office.js.
 * ------------------------------------------------------------------------ */
.toast-stack {
    position: fixed;
    top: 4.5rem;
    inset-inline-end: 1rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 24rem;
}
.toast-stack .alert {
    transition: opacity 0.4s ease, translate 0.4s ease;
}
.toast-stack .alert.toast-hide {
    opacity: 0;
    translate: 0 -0.5rem;
}

/* Alert color variants — the committed bundle only ships .alert/.alert-info. */
.alert-success {
    border-color: color-mix(in oklab, var(--color-success) 40%, transparent);
    background-color: color-mix(in oklab, var(--color-success) 18%, var(--color-base-100));
}
.alert-error {
    border-color: color-mix(in oklab, var(--color-error) 40%, transparent);
    background-color: color-mix(in oklab, var(--color-error) 18%, var(--color-base-100));
}
.alert-warning {
    border-color: color-mix(in oklab, var(--color-warning) 40%, transparent);
    background-color: color-mix(in oklab, var(--color-warning) 18%, var(--color-base-100));
}

/* ---------------------------------------------------------------------------
 * Auto-save feedback for data-autosave controls (hx-swap="none" saves).
 * Green pulse on success (removed on animationend); sticky red outline on
 * failure until the next successful save.
 * ------------------------------------------------------------------------ */
@keyframes autosave-ok {
    0%   { outline: 2px solid var(--color-success); outline-offset: 1px; }
    70%  { outline: 2px solid var(--color-success); outline-offset: 1px; }
    100% { outline: 2px solid transparent; outline-offset: 1px; }
}
.autosave-ok {
    animation: autosave-ok 1.2s ease-out 1;
}
.autosave-err {
    outline: 2px solid var(--color-error);
    outline-offset: 1px;
}

/* ---------------------------------------------------------------------------
 * Lock state. `.is-locked` neutralizes a single control (e.g. selects on the
 * read-only event form — selects can't be readonly natively). `[data-locked]`
 * containers dim their editable fields; actual disabling stays in page JS
 * (CLAUDE.md note 7: values must remain readable/copy-pasteable).
 * ------------------------------------------------------------------------ */
.is-locked {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}
[data-locked] input:not(.computed):not([type="hidden"]),
[data-locked] textarea,
[data-locked] select {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
 * Brand accent — the logo red. Identity moments only (active nav, hero,
 * empty-state glyphs, auth wordmark); NEVER buttons or status colors
 * (red already means error/cancelled in this app).
 * ------------------------------------------------------------------------ */
:root {
    --color-brand: #c30e1a;
}
[data-theme="dark"],
[data-theme="dim"],
[data-theme="material-dark"] {
    --color-brand: #e4444f; /* brightened for dark surfaces */
}

/* Active sidebar item: brand bar + tinted icon */
.menu-item.active {
    position: relative;
}
.menu-item.active::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 22%;
    bottom: 22%;
    width: 3px;
    border-radius: 9999px;
    background: var(--color-brand);
}
.menu-item.active iconify-icon {
    color: var(--color-brand);
}

/* Empty-state glyph: faint brand tint instead of plain gray */
.empty-state-glyph {
    color: color-mix(in oklab, var(--color-brand) 35%, transparent);
}

/* Dashboard hero eyebrow ("Tonight" / "Next show") */
.hero-eyebrow {
    color: var(--color-brand);
}

/* ---------------------------------------------------------------------------
 * Accessibility helpers.
 * .sr-only — visually hidden, screen-reader readable (not in the bundle).
 * [data-href] — keyboard-activatable clickable rows (handled in office.js).
 * ------------------------------------------------------------------------ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
[data-href] {
    cursor: pointer;
}
[data-href]:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

/* Mobile search overlay (topbar) — below md the search field drops below
 * the bar; the bundle lacks top-full/z-* utilities, hence a component class. */
.topbar-search-overlay {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    z-index: 40;
    display: flex;
    padding: 0.75rem;
    background: var(--color-base-100);
    box-shadow: 0 8px 24px -12px rgb(0 0 0 / 0.25);
}
