/* ==========================================================================
   Entree · avocloud brand layer (kit v5.0.2)
   The kit is loaded from the CDN at one pinned version, see partials/head.php:

     tailwind CDN → basecoat 1.0.2 → avocloud.base.css (imports the kit)
     → THIS FILE

   Canvas, colours, radii (12 / 20 / 28 / pill), fonts and every component come
   from the kit. Nothing here restates a token value: a hex that exists as a
   --avo-* token is a bug (BRANDING §12.4).

   This file only holds what Entree needs on top of the kit:
     1  page base (the kit styles no bare element unless .avo-reset is set)
     2  names older Entree pages still use, mapped onto kit components
     3  small shared pieces: theme toggle, wordmark lockup, section title
   ========================================================================== */

/* ---- 1 · Page base ------------------------------------------------------ */
html { color-scheme: dark; }
html.avo-light { color-scheme: light; }
body {
  background: var(--avo-canvas);
  color: var(--avo-text);
  font-family: var(--avo-font-body);
  font-size: var(--avo-text-base);
  -webkit-font-smoothing: antialiased;
}
/* Headings: Space Grotesk 600. Syne is for the wordmark only (§4). */
h1, h2, h3, h4 { font-family: var(--avo-font-body); font-weight: 600; letter-spacing: -0.01em; }
code, kbd, samp { font-family: var(--avo-font-mono); }
/* Figures: tabular and mono. */
table, .tabular { font-variant-numeric: tabular-nums; }
.num, .tabular { font-family: var(--avo-font-mono); }
::selection { background: rgba(var(--avo-coral-rgb), 0.35); }
.avo-canvas-content { position: relative; z-index: var(--avo-z-content); }

/* The wordmark stays Syne: the organiser / app name in a top bar or rail. */
.qg-lockup b, .adm-brand b, .tf-brand, .qg-wordmark { font-family: var(--avo-font-wordmark) !important; }

/* Nothing bordered is square (§5): a fallback for boxes generated at runtime
   or styled inline with a 1px border and no radius. */
[style*="border:1px solid"], [style*="border: 1px solid"] { border-radius: var(--avo-radius-lg); }

/* ---- 2 · Names older pages use ----------------------------------------- */
/* Basecoat 1.0 form controls on Entree's `.form` markup take the field radius
   and the control height from the kit; this only reaches the bare inputs. */
.form input[type="text"], .form input[type="email"], .form input[type="number"],
.form input[type="password"], .form input[type="date"], .form input[type="time"],
.form select, .form textarea {
  border-radius: var(--avo-radius);
  border: 1px solid var(--avo-line-strong);
  background-color: var(--avo-canvas);
  font-family: var(--avo-font-body);
  font-size: var(--avo-text-base);
}
.form input:not([type="checkbox"]):not([type="radio"]), .form select { min-height: var(--avo-ui-control-h); }
.form label { font-size: var(--avo-text-small); color: var(--avo-text-muted); }

/* Destructive: an outline in the error colour. Coral is never a status (§3). */
.avo-btn.danger, .avo-btn.adm-btn-danger {
  background: transparent; color: var(--avo-error); border-color: var(--avo-error);
}
.avo-btn.danger:hover, .avo-btn.adm-btn-danger:hover { background: var(--avo-error); border-color: var(--avo-error); color: #fff; }

/* Basecoat cards: header/section/footer slots and the div spellings Entree used. */
.card-header, .card-content, .card-footer { padding-inline: 1.5rem; }

/* Helpers older pages still reference. */
.avo-divider { border: none; border-top: 1px solid var(--avo-line); margin: var(--avo-space-5) 0; }
.show-name, .show-name span { background: transparent; color: var(--avo-primary); }
.bar      { background: var(--avo-primary) !important; }
.bar-dark { background-color: var(--avo-surface-raised) !important; border: 1px solid var(--avo-line); }
.animate-fade-in    { animation: qgFade var(--avo-dur-ui) var(--avo-ease-out) both; }
.animate-fade-in-up { animation: qgRise var(--avo-dur-enter) var(--avo-ease-out) both; }
@keyframes qgFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes qgRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in, .animate-fade-in-up { animation: none; }
}

/* ---- 3 · Shared pieces -------------------------------------------------- */

/* Theme toggle: a round icon button, 40px (§5). */
.avo-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--avo-radius-full);
  border: 1px solid var(--avo-line-strong);
  background: transparent;
  color: var(--avo-text-muted);
  cursor: pointer;
}
.avo-theme-toggle:hover { color: var(--avo-text); background: var(--avo-surface-raised); }
.avo-theme-toggle:active { transform: scale(0.98); }
.avo-theme-toggle svg { width: 16px; height: 16px; stroke-width: var(--avo-icon-stroke); }
.avo-theme-toggle .icon-sun  { display: block; }
.avo-theme-toggle .icon-moon { display: none; }
.avo-light .avo-theme-toggle .icon-sun  { display: none; }
.avo-light .avo-theme-toggle .icon-moon { display: block; }

/* Brand lockup used in headers: the mark plus a Syne word, suffix coral. */
.qg-lockup { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 1.1rem; color: var(--avo-text); text-decoration: none; min-width: 0; }
.qg-lockup img, .qg-lockup svg { width: 22px; height: 22px; flex: none; }
.qg-lockup b {
  font-family: var(--avo-font-wordmark); font-weight: 800; font-size: 1rem;
  letter-spacing: -0.01em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.qg-lockup b span { color: var(--avo-primary); }

/* The Entree wordmark (partials/wordmark.php): the mark is the first letter, then "ntree".
   Sized by font-size; the mark is x-height tall (Space Grotesk 0.486em) with a hair of overshoot. */
.ent-wm { display: inline-flex; align-items: baseline; font-family: var(--avo-font-body); font-weight: 600;
  letter-spacing: -0.006em; line-height: 1; white-space: nowrap; color: inherit; }
.ent-wm svg.ent-wm__e { width: 0.5em; height: 0.5em; flex: none; margin-right: 0.04em; overflow: visible; align-self: baseline; }
.ent-wm__sfx { color: var(--avo-primary); }

/* A card header (§9): a title in Space Grotesk 600, sentence case, no rule.
   Replaces the v4 kicker. */
.qg-title { font-family: var(--avo-font-body); font-weight: 600; font-size: 1rem; line-height: 1.3; color: var(--avo-text); }
/* A meta line next to a title or under a figure: small, muted, never uppercase. */
.qg-meta { font-size: var(--avo-text-small); color: var(--avo-text-muted); letter-spacing: 0; text-transform: none; }
/* Step numbers in a how-to list: a figure, so Plex Mono. */
.qg-step { font-family: var(--avo-font-mono); font-variant-numeric: tabular-nums; font-size: var(--avo-text-small); color: var(--avo-text-muted); }
