/*
  TLT shared theme — one source of truth for Web and Mobile (TLT.Mobile references
  this same file from TLT.UI.Components' static web assets, not a copy).

  The look follows Quip: a white page, light-grey chrome with hairline borders, one azure
  accent, red notification badges - and one serif typeface everywhere (the only deliberate
  departure from Quip, by request). Two layers:
   1. Palette (--tlt-palette-*) - raw colours.
   2. Semantic tokens (--tlt-*) - what components consume. A per-family theme only
      re-points the accent family (see ThemeCatalog); nothing else needs to change.
*/

@font-face {
    font-family: 'Source Serif 4';
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url('fonts/source-serif-4-latin-wght-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Source Serif 4';
    font-style: italic;
    font-weight: 200 900;
    font-display: swap;
    src: url('fonts/source-serif-4-latin-wght-italic.woff2') format('woff2');
}

:root {
    /* Palette */
    --tlt-palette-azure: #1A6FEB;
    --tlt-palette-azure-dark: #1558C0;
    --tlt-palette-azure-tint: #E8F1FE;
    --tlt-palette-red: #D93B42;
    --tlt-palette-ink: #1F2933;
    --tlt-palette-grey: #5F6B7A;
    --tlt-palette-chrome: #F6F7F9;
    --tlt-palette-hairline: #E3E6EA;
    --tlt-palette-white: #FFFFFF;
    --tlt-palette-black: #000000;

    /* Typography - one serif, everywhere. The sans stack stays only for the rare place that needs it. */
    --tlt-font-serif: 'Source Serif 4', Charter, 'Bitstream Charter', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
    --tlt-font-sans: var(--tlt-font-serif);
    --tlt-font-ui-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Semantic tokens - components reference these, not the palette */
    --tlt-color-bg: var(--tlt-palette-white);
    --tlt-color-surface: var(--tlt-palette-white);
    --tlt-color-chrome: var(--tlt-palette-chrome);
    --tlt-color-text: var(--tlt-palette-ink);
    --tlt-color-text-muted: var(--tlt-palette-grey);

    --tlt-color-primary: var(--tlt-palette-azure);
    --tlt-color-primary-dark: var(--tlt-palette-azure-dark);
    --tlt-color-accent: var(--tlt-palette-azure);
    --tlt-color-link: var(--tlt-palette-azure);
    --tlt-color-link-hover: var(--tlt-palette-azure-dark);
    --tlt-color-active: var(--tlt-palette-azure-tint);
    --tlt-color-badge: var(--tlt-palette-red);

    --tlt-color-border: var(--tlt-palette-hairline);

    --tlt-nav-bg: var(--tlt-palette-azure);
    --tlt-nav-bg-active: var(--tlt-palette-azure-dark);
    --tlt-nav-text: var(--tlt-palette-white);

    --tlt-font-heading: var(--tlt-font-serif);
    --tlt-font-body: var(--tlt-font-serif);
    --tlt-font-reading: var(--tlt-font-serif);

    --tlt-radius: 8px;
    --tlt-radius-sm: 6px;
    /* Quip is flat: a shadow only on things that float (menus, popovers, modals). */
    --tlt-shadow-sm: 0 1px 2px rgba(31, 41, 51, 0.06);
    --tlt-shadow-pop: 0 4px 16px rgba(31, 41, 51, 0.14), 0 0 0 1px rgba(31, 41, 51, 0.05);

    /* Lesson status colors - deliberately no "red/overdue" tone anywhere; Continues
       is real progress, not a warning state (spec: "Calm by default"). */
    --tlt-color-success: #2c9c4a;
    --tlt-color-status-scheduled: var(--tlt-color-primary);
    --tlt-color-status-continues: var(--tlt-color-accent);
    --tlt-color-status-complete: var(--tlt-color-success);
    --tlt-color-status-skipped: var(--tlt-color-text-muted);
    --tlt-color-status-rescheduled: var(--tlt-color-text-muted);
}

body {
    font-family: var(--tlt-font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--tlt-color-text);
    background-color: var(--tlt-color-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tlt-font-heading);
    color: var(--tlt-color-text);
    font-weight: 700;
    line-height: 1.25;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }

a, .btn-link {
    color: var(--tlt-color-link);
}

a:hover, .btn-link:hover {
    color: var(--tlt-color-link-hover);
}

/* .btn-link is also used on real <button> elements (e.g. inline "Cancel"/"Change"
   actions) - those need the native button chrome stripped explicitly, since <a> has
   none to begin with and this rule was only ever overriding color. */
button.btn-link {
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

/* Self-contained button box-model - deliberately not dependent on Bootstrap's
   .btn base class, so this works on <a> or <button> alike wherever it's used
   (landing CTA, form submits). Quip's solid-azure "Share" button. */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--tlt-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--tlt-palette-white);
    background-color: var(--tlt-color-primary);
    border: none;
    border-radius: var(--tlt-radius-sm);
    padding: 0.45rem 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--tlt-color-primary-dark);
    color: var(--tlt-palette-white);
    text-decoration: none;
}

.btn-primary:focus-visible {
    outline: 2px solid var(--tlt-color-accent);
    outline-offset: 2px;
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: default;
}

.btn-primary svg {
    width: 1.1em;
    height: 1.1em;
    flex-shrink: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--tlt-font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tlt-color-text);
    background-color: var(--tlt-color-surface);
    border: 1px solid var(--tlt-color-border);
    border-radius: var(--tlt-radius-sm);
    padding: 0.35rem 0.85rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
    background-color: var(--tlt-color-chrome);
    border-color: #cfd4da;
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--tlt-color-accent);
    outline-offset: 2px;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: default;
}

/* A compact pill variant for chrome that sits beside page content rather than in a button
   row - Quip's small grey pills beside a document title (folder, References). */
.btn-secondary--small {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background-color: var(--tlt-color-chrome);
    border-color: transparent;
}

/* Quip's square, hairline icon button (the compose button beside Share). */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    color: var(--tlt-color-text);
    background-color: var(--tlt-color-surface);
    border: 1px solid var(--tlt-color-border);
    border-radius: var(--tlt-radius-sm);
    cursor: pointer;
}

.btn-icon:hover {
    background-color: var(--tlt-color-chrome);
}

.btn-icon:focus-visible {
    outline: 2px solid var(--tlt-color-accent);
    outline-offset: 2px;
}

/* One serif everywhere now: .tlt-reading is kept so existing markup keeps working, and is simply the body face. */
.tlt-reading {
    font-family: var(--tlt-font-reading);
}
