/* Althea Power brand (AP-MKT-002 Rev 01), applied over the existing layout.
   Loaded only while the brand is in preview (logged-in editors) or after it
   is switched on for everyone; see althea_brand_on() in functions.php.
   One later layer, so it wins over base.css and theme.css without
   !important and can be removed whole. */

/* Palette and type ------------------------------------------------------ */
@layer tokens {
  :root {
    --brand-black: #0B0B0B;
    --gold: #D9A21B;
    --charcoal: #24282E;
    --gold-text: #8C680E;
    --deep-gold: #9C7410;
    --steel: #9AA0A8;
    --slate: #6B7280;
    --mist: #C9CDD3;
    --panel: #F4F5F7;
    --gold-tint: #FBF3DC;
    /* Logo gradient only: never a flat colour, ground or text. */
    --logo-gold: linear-gradient(180deg, #F5D477 0%, #B8883A 100%);

    /* The old role names, pointed at the brand. */
    --ink: #1A1D21;
    --ground: #FFFFFF;
    --surface: var(--panel);
    --live: var(--gold);
    --live-deep: var(--gold-text);
    --black: var(--brand-black);
    --black-2: var(--charcoal);
    --black-3: #2E333A;
    --clay: var(--mist);
    --clay-2: var(--steel);

    --bg: var(--ground);
    --fg: var(--ink);
    --fg-2: var(--slate);
    --rule: color-mix(in srgb, var(--ink) 14%, transparent);

    --font: "Open Sans", Arial, sans-serif;
    --head: "Montserrat", Arial, sans-serif;
    --mono: var(--head);

    /* Web scale (Table 12). Phones take display and H1 down 25%. */
    --t-xs: .75rem;
    --t-s: .875rem;
    --t-m: 1.0625rem;
    --t-lede: clamp(1.125rem, 1.05rem + .3vw, 1.3125rem);
    --t-h3: 1.25rem;
    --t-h2: clamp(1.875rem, 1.6rem + 1.1vw, 2.5rem);
    --t-h1: clamp(2.625rem, 2.1rem + 2.2vw, 3.5rem);

    --radius: 0;
  }
}

/* Element defaults sit in the base layer, after base.css's own, so every
   component rule in theme.css still sets its own sizes. */
@layer base {
  html, body { font-family: var(--font); }
  body { font-size: var(--t-m); line-height: 1.647; }
  ::selection { background: var(--gold); color: var(--brand-black); }
  h1, h2, h3, .display { font-family: var(--head); font-weight: 600; letter-spacing: -.005em; }
  h1 { font-size: var(--t-h1); line-height: 1.11; font-weight: 700; letter-spacing: -.01em; }
  h2 { font-size: var(--t-h2); line-height: 1.2; }
  h3 { font-size: var(--t-h3); line-height: 1.4; }
  .display { font-size: var(--t-h2); line-height: 1.2; max-width: 22ch; letter-spacing: -.005em; }
  .display--xl { font-size: var(--t-h1); line-height: 1.11; font-weight: 700; max-width: 16ch; }
  .lede { letter-spacing: 0; line-height: 1.55; }
  .mono {
    font-family: var(--head); font-size: var(--t-xs); line-height: 1.33;
    font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  }
  .prose a { font-weight: 700; color: var(--gold-text); text-decoration: none; }
  .prose a:hover { text-decoration: underline; text-underline-offset: 3px; }
  :focus-visible { outline-color: var(--gold); }
}

@layer brand {
  /* Square corners everywhere (Table 17). */
  *, *::before, *::after { border-radius: 0; font-variation-settings: normal; }

  /* Headings, names, big numbers and labels in Montserrat; components keep
     their own sizes. */
  .stat__value, .stage__label, .scope__title, .area__title, .mkt__title,
  .index__title, .group__title, .approach__item dt, .focus__line,
  .taglines__list li, .foot__h, .checks__h, .siblings__h, .nav__overview {
    font-family: var(--head); font-weight: 600; letter-spacing: -.005em;
  }
  .hero__title, .phero__title { font-size: var(--t-h1); line-height: 1.11; font-weight: 700; letter-spacing: -.01em; }
  .stat__value { font-size: clamp(1.625rem, 1.2rem + 1.1vw, 2.125rem); letter-spacing: -.01em; }
  .hero__title { max-width: 14ch; }
  .phero__title { max-width: 18ch; }

  /* A short gold rule under the page headline (Section 06). */
  .hero__title::after, .phero__title::after {
    content: ""; display: block; width: 35px; height: 2px; margin-top: .45em; background: var(--gold);
  }

  /* Form labels as eyebrows. Links in running text are bold and gold. */
  .field__l { font-family: var(--head); font-weight: 600; letter-spacing: .16em; }
  .band--dark .prose a { color: var(--gold); }

  /* Grounds ------------------------------------------------------------- */
  .band--light { --fg-2: var(--slate); }
  .band--surface { --fg-2: var(--slate); }
  .band--dark { --fg: #FFFFFF; --fg-2: var(--mist); --rule: rgba(255, 255, 255, .14); --pill: rgba(255, 255, 255, .08); color: #FFFFFF; }
  .hero__lede, .phero__intro { color: var(--mist); }
  .band--light .phero__intro { color: var(--slate); }

  /* Gold on light grounds is Gold Text; Althea Gold only on dark. */
  .band--light .focus__line, .band--surface .focus__line { color: var(--gold-text); }
  .stat__rail i, .index__points li::before, .checks li::before { background: var(--gold); }

  /* Header (Table 18): a Brand Black bar, gold gradient logo, white
     Montserrat capitals, the current item in gold. The bar is solid on
     every band, so the tone switching in theme.js has nothing to change. */
  .masthead, .masthead.is-on-light {
    background: var(--brand-black); color: #FFFFFF;
    border-bottom: 1px solid var(--charcoal);
    --pill: transparent; --pill-hi: transparent;
  }
  .admin-bar .masthead { top: 32px; }
  @media (max-width: 782px) { .admin-bar .masthead { top: 46px; } }
  @media (max-width: 600px) { .admin-bar .masthead { top: 0; } }

  .wordmark__logo { background: var(--logo-gold); }
  .nav__link {
    font-family: var(--head); font-size: .8125rem; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    transition: color var(--mo-ui) var(--ease);
  }
  .nav__link:hover, .nav__item.is-open > .nav__link, .nav__item:focus-within > .nav__link { color: var(--gold); }
  .nav__item.is-here > .nav__link { box-shadow: none; color: var(--gold); }
  .nav__panel-in { background: var(--charcoal); border-color: rgba(255, 255, 255, .08); }
  .nav__overview { font-size: .9375rem; }
  .nav__overview .mono { color: var(--gold); }
  .nav__overview:hover, .nav__sub a:hover { background: rgba(255, 255, 255, .06); }
  .nav__sub a { color: var(--mist); }
  .nav__sub a:hover { color: #FFFFFF; }

  @media (max-width: 960px) {
    .masthead, .masthead.is-on-light, .masthead.is-scrolled, .masthead.is-open {
      background: var(--brand-black); border-color: var(--charcoal);
      backdrop-filter: none; -webkit-backdrop-filter: none; color: #FFFFFF;
    }
    .wordmark, .wordmark__logo { height: 40px; }
    .nav { background: var(--charcoal); border-color: rgba(255, 255, 255, .08); --pill: transparent; --pill-hi: rgba(255, 255, 255, .06); }
    .nav__link { font-size: .875rem; }
    .nav-toggle { --pill: transparent; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
  }

  /* Buttons (Table 18): gold fill with black text, or a 1px outline.
     Sentence case, square. */
  .btn { font-family: var(--head); font-weight: 600; letter-spacing: .01em; }
  .btn--live { background: var(--gold); color: var(--brand-black); }
  .btn--live:hover { background: color-mix(in srgb, var(--gold) 80%, #FFFFFF); }
  .btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .btn--ghost:hover { background: var(--ink); color: #FFFFFF; }
  .band--dark .btn--ghost, .masthead .btn--ghost { color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
  .band--dark .btn--ghost:hover, .masthead .btn--ghost:hover { background: var(--gold); color: var(--brand-black); }
  .btn--ink { background: var(--ink); color: #FFFFFF; }
  .btn--ink:hover { background: var(--brand-black); }
  .siblings__x a { background: var(--gold); color: var(--brand-black); }
  .siblings__x .mono { color: rgba(11, 11, 11, .6); }

  /* Smaller pieces that used the old pill and lime styling. */
  .area__groups li { background: rgba(255, 255, 255, .06); color: var(--mist); }
  .stage.is-on .stage__kv { color: var(--gold); }
  .stage__kv { color: var(--mist); }
  .build__dot.is-on { background: var(--gold); }
  .field__i:focus { border-color: var(--gold-text); }
  .form__note { border-left-color: var(--gold); background: var(--gold-tint); }

  /* Footer: Charcoal, so it separates from a Brand Black band above it.
     The full rebuild (legal links, motto) is part of the page work. */
  .foot {
    background: var(--charcoal); color: #FFFFFF;
    --fg-2: var(--mist); --rule: rgba(255, 255, 255, .12);
  }
  .foot__h { font-size: var(--t-xs); letter-spacing: .16em; text-transform: uppercase; color: #FFFFFF; }
  .foot__col a:hover { color: var(--gold); text-decoration: none; }
  .foot__base .mono { color: var(--mist); }
}
