/* =============================================================================
   agContent.css
   The shared foundation for TAUGHT CONTENT: slide decks and notes pages.

   Nothing links this file directly. It is imported by the two medium layers:

       agContent.css          <- this file: palette, colour roles, light/dark,
        |                        text fonts, shared icons
        +- agSlides.css          the deck layer (reveal.js canvas, cover,
        |                        dividers, footer, fit)
        +- agTeachingNotes.css   the page layer (reading measure, contents
                                 list, print)

   It is the same shape as the drawing system (agDrawing.css under
   agDiagrams.css and agTeachingDemos.css), for the same reason: a deck and a
   page of notes should never drift apart in colour, so the colours are
   defined ONCE, here. The test for whether something belongs in this file is
   the one used for the drawing system: if it changed in one medium, should it
   change in the other? Yes means here; no means the layer.

   WHAT IS HERE TODAY: variables only, no rules. The palette, the roles that
   point at it, the dark theme's re-pointing of those roles, the text font
   stacks, and the learning-outcomes icon.

   WHAT IS NOT HERE YET, deliberately: the semantic blocks (.keypoint,
   .definition ...), quotations and figure captions. They belong here in
   principle - they mean the same thing in both media - but in agSlides.css
   every one of those rules is scoped to .reveal and sized against reveal's
   canvas font, so moving them is a refactor of the slide stylesheet with real
   risk of changing every deck. Until that refactor is done and verified,
   agTeachingNotes.css carries its own versions, written to the same design.
   See the CLAUDE.md log entry of 2026-11-03.

   Created 2026-11-03 by MOVING these declarations out of agSlides.css
   (sections 0, 1b, 1c and 6), not by copying them. The decks were verified to
   resolve every variable to exactly the same value afterwards.

   -----------------------------------------------------------------------------
   THE TWO-LAYER COLOUR MODEL (unchanged from agSlides.css, where it began)

   The palette names raw University colours. The ROLES name jobs (heading,
   emphasis, marker ...) and point at the palette. Every rule in the layers
   refers to a role, never to a palette colour directly - which is what lets
   the dark theme switch a whole deck or page by re-pointing a handful of
   roles. If you add a rule anywhere, use a role.

   Variable names never clash with the drawing system's: that one uses
   --ag-c-*, --ag-sw-*, --ag-fs-* and --ag-font-*, which is why the text
   fonts here are --ag-text-*.
============================================================================= */


/* -----------------------------------------------------------------------------
   PALETTE
   -----------------------------------------------------------------------------
   University of Sheffield colours, lifted from
   PresentationTemplate/presentation_files/pres_global.css so the two systems
   cannot drift.
----------------------------------------------------------------------------- */

:root {
  --ag-brand-violet:    #440099;
  --ag-dark-violet:     #24125E;
  --ag-electric-violet: #7000FF;
  --ag-powder-violet:   #A78CFA;
  --ag-pale-violet:     #C6BBFF;
  --ag-wave-white:      #F8F8F9;
  --ag-midnight-black:  #131E29;

  /* Background washes. Plain rgba rather than color-mix() so this works in
     older browsers as well as current ones. */
  --ag-tint-violet: rgba(198, 187, 255, 0.22);   /* pale violet   */
  --ag-tint-tip:    rgba(112,   0, 255, 0.07);   /* electric violet */
}


/* -----------------------------------------------------------------------------
   ROLES - light theme, the default
----------------------------------------------------------------------------- */

:root {
  --ag-surface:    var(--ag-wave-white);      /* page or slide background */
  --ag-heading:    var(--ag-midnight-black);  /* main headings            */
  --ag-subheading: var(--ag-brand-violet);    /* lower headings           */
  --ag-body-text:  var(--ag-dark-violet);     /* paragraphs, list items   */
  --ag-emphasis:   var(--ag-brand-violet);    /* strong, em, kicker       */
  --ag-accent:     var(--ag-electric-violet); /* second-string accent     */
  --ag-marker:     var(--ag-brand-violet);    /* bullet and number markers*/
  --ag-rule:       rgba(68, 0, 153, 0.12);    /* the line under a title   */

  /* Links and selected text. agSlides.css hands these to reveal through its
     own --r-link-color and --r-selection-background-color. */
  --ag-link:       var(--ag-electric-violet);
  --ag-link-hover: var(--ag-brand-violet);
  --ag-selection:  var(--ag-pale-violet);

  /* Labelled panels - a box with a coloured header band, currently only
     .learning-outcomes. Modelled on the MEE Labs 2.0 callouts so a student
     moving between a lab sheet, a lecture and the notes sees the same thing. */
  --ag-panel-head:      var(--ag-powder-violet);  /* header band and border */
  --ag-panel-head-text: var(--ag-midnight-black); /* ~7:1 on powder violet  */
  --ag-panel-body:      #F1EFF7;                  /* a touch darker than the
                                                     surface so the box reads */

  /* Text fonts. Named first so they are used when installed; the University
     fonts are not fetched from Google (a third-party runtime dependency), so
     most machines fall back to Segoe UI and Georgia. Self-hosting the woff2
     files in framework/fonts/ is the proper fix, and would land here. */
  --ag-text-sans:  "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
  --ag-text-serif: "Source Serif 4", Georgia, serif;
  --ag-text-mono:  Consolas, "Cascadia Mono", "Courier New", monospace;
}


/* -----------------------------------------------------------------------------
   ROLES - dark theme
   -----------------------------------------------------------------------------
   Switched by data-theme="dark" on <html>, set by the toggle on every deck and
   notes page and remembered in localStorage. NOT auto-detected from the OS:
   an explicit control the student can see beats inferring what they want.

   Not an inversion: emphasis moves from brand violet to POWDER violet,
   because brand violet on a dark ground is close to unreadable. That is the
   whole reason a dark theme needs designing rather than computing.
----------------------------------------------------------------------------- */

:root[data-theme="dark"] {
  --ag-surface:    var(--ag-midnight-black);
  --ag-heading:    var(--ag-wave-white);
  --ag-subheading: var(--ag-powder-violet);
  --ag-body-text:  var(--ag-wave-white);
  --ag-emphasis:   var(--ag-powder-violet);
  --ag-accent:     var(--ag-pale-violet);
  --ag-marker:     var(--ag-pale-violet);
  --ag-rule:       rgba(198, 187, 255, 0.12);

  --ag-link:       var(--ag-powder-violet);
  --ag-link-hover: var(--ag-pale-violet);
  --ag-selection:  var(--ag-brand-violet);

  /* Washes behind the semantic blocks have to lift off a dark ground rather
     than sit on a light one. */
  --ag-tint-violet: rgba(198, 187, 255, 0.10);
  --ag-tint-tip:    rgba(167, 140, 250, 0.13);

  /* The panel header stays powder violet with dark text in BOTH themes - it
     reads as a solid label either way. Only the body has to change, from a
     light grey that sits on white to a wash that lifts off black. */
  --ag-panel-body:  rgba(198, 187, 255, 0.08);
}


/* -----------------------------------------------------------------------------
   ICONS
   -----------------------------------------------------------------------------
   Used as CSS MASKS, not background images: a mask takes its colour from
   background-color, so an icon follows a colour role like the text beside it
   instead of having a colour baked into the SVG.
----------------------------------------------------------------------------- */

:root {
  /* The learning-outcomes target: two rings, a bullseye, and an arrow flying
     in from the top right. Stroke colour inside the SVG is irrelevant - only
     its SHAPE is used. */
  --ag-icon-target: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M20 11.5A8.5 8.5 0 1 1 12.5 3.5'/%3E%3Cpath d='M15.5 11.8A3.8 3.8 0 1 1 12.2 8.2'/%3E%3Ccircle cx='12' cy='12' r='0.6' fill='black'/%3E%3Cpath d='M12 12L21 3M17 3h4v4'/%3E%3C/svg%3E");
}
