/* ==========================================================================
   CMSSM · Colegiul Medicilor Stomatologi Satu Mare
   Design tokens · direction 2 „Cercul” (the ring of the logo), 2026-11-11
   Previous direction: /_research/design-direction.md (kept for history)

   Fonts (load once, in <head>, before this file):
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@400;500;600;700;800&display=swap" rel="stylesheet">
   The family ships the latin-ext subset (ă â î ș ț with comma below).
   ========================================================================== */

:root {
  color-scheme: light;

  /* ---- 1. Colour: raw palette ------------------------------------------ */
  /* Brand, measured from the logo and the current site (see _research/brand.md):
     teal #42b4b0, grey #58595b, navy #151a36, light section ground #e5e9f1.
     Contrast ratios below are WCAG 2.x, computed, not estimated.            */
  --teal-500: #c9a15b;   /* 2026-11-11: AURIU (paleta din macheta clientului; numele vechi „teal” păstrat ca să nu schimbăm regulile). Navy pe el 7.1:1; text alb pe el NU (2.3:1). */
  --teal-700: #7d5c20;   /* 2026-11-11: auriu închis pentru linkuri/iconițe. Pe alb 6.1:1, pe mist 5.5:1. */
  --teal-900: #5f4515;   /* 2026-11-11: hover pe auriu închis. Pe alb 8.9:1. */
  --teal-100: #f3ead8;   /* 2026-11-11: nuanță aurie. Navy pe ea 14.3:1. */
  --navy-900: #151a36;   /* BRAND navy (current header band and footer). Ink, dark tiles, footer.
                            On white 17.0:1. Brand teal on it 6.8:1. */
  --grey-600: #58595b;   /* BRAND grey (logo). Secondary text on white only: 7.0:1. */

  --paper:    #ffffff;   /* Ground. */
  --mist:     #f0f3f6;   /* First tone step: tiles, list rows, section fields. */
  --mist-2:   #e5e9f1;   /* Second tone step (the current site's section ground): picture tiles, hover. */
  --ink:      var(--navy-900);
  --ink-soft: #4d4f55;   /* Secondary text on tiles. 7.4:1 on mist, 6.7:1 on mist-2 and tint. */

  --line:        #c9d0da;  /* Table row lines only. */
  --line-strong: #6e7686;  /* Form field borders. 4.6:1 on paper. */

  --danger:   #a3271b;   /* Errors, "sold out". 7.3:1 on paper, 6.2:1 on its tint. */
  --danger-bg:#f9e9e6;
  --warn:     #8a5a00;   /* Deadlines, "last seats". 5.9:1 on paper, 5.3:1 on its tint. */
  --warn-bg:  #fbf1d9;
  --ok:       #7d5c20;   /* Succes: auriul închis; fără un al doilea verde. */
  --ok-bg:    #f3ead8;

  /* ---- 2. Colour: roles (use these in components) ----------------------- */
  --color-bg:            var(--paper);
  --color-surface:       var(--mist);
  --color-surface-2:     var(--mist-2);
  --color-text:          var(--ink);
  --color-text-soft:     var(--ink-soft);
  --color-brand:         var(--teal-500);
  --color-on-brand:      var(--ink);        /* text on the brand teal is INK, not white */
  --color-action:        var(--teal-500);   /* butoanele principale: auriu cu text bleumarin */
  --color-action-hover:  #b8904a;           /* navy pe el 5.8:1 */
  --color-on-action:     var(--navy-900);
  --color-link:          var(--teal-700);
  --color-dark:          var(--navy-900);
  --color-on-dark:       #ffffff;
  --color-on-dark-soft:  #b9c0d8;           /* 9.4:1 on navy */
  --color-selected:      var(--teal-100);
  --color-focus:         var(--ink);

  /* ---- 3. Typography ----------------------------------------------------- */
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-text:    "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;

  --weight-display: 800;      /* heavy grotesk, letters almost touching */
  --weight-display-strong: 800;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Scale: fluid between 390px and 1440px viewports. Five working steps
     (display, title, lead, body, small) plus two helpers.                   */
  --text-display: clamp(2.375rem, 1.3rem + 4.4vw, 5.75rem);   /* 38 → 84  h1 */
  --text-title:   clamp(1.875rem, 1.2rem + 2.8vw, 4rem);      /* 30 → 60  h2 */
  --text-heading: clamp(1.375rem, 1.2rem + 0.75vw, 1.875rem); /* 22 → 30  h3, card titles */
  --text-lead:    var(--text-heading);                        /* 22 → 28  statements, standfirst (same step, serif) */
  --text-large:   clamp(1.125rem, 1.08rem + 0.19vw, 1.25rem); /* 18 → 20  table/ticket rows */
  --text-body:    1.0625rem;                                  /* 17 */
  --text-small:   0.875rem;                                   /* 14 (floor: never below 13px) */
  --text-figure:  clamp(3rem, 1.4rem + 6.6vw, 8.5rem);        /* 48 → 136 dates, prices as figures */

  --leading-display: 0.9;
  --leading-title:   0.96;
  --leading-lead:    1.25;
  --leading-body:    1.55;
  --leading-tight:   1.3;

  --tracking-display: -0.05em;
  --tracking-title:   -0.04em;
  --tracking-text:    0;

  --measure: 62ch;           /* max line length for running text */
  --measure-narrow: 38ch;

  /* ---- 4. Space (4px base) ----------------------------------------------- */
  --space-1:  0.25rem;   /*  4 */
  --space-2:  0.5rem;    /*  8 */
  --space-3:  0.75rem;   /* 12 */
  --space-4:  1rem;      /* 16 */
  --space-5:  1.5rem;    /* 24 */
  --space-6:  2rem;      /* 32 */
  --space-7:  3rem;      /* 48 */
  --space-8:  4rem;      /* 64 */
  --space-9:  6rem;      /* 96 */
  --space-10: 9rem;      /* 144 */

  --section-gap: clamp(5rem, 3.4rem + 6.7vw, 10rem);   /* 80 → 160 between sections */
  --block-gap:   clamp(2rem, 1.6rem + 1.7vw, 3.25rem); /* 32 → 52 heading to content */

  /* ---- 5. Layout ---------------------------------------------------------- */
  --page-max:    1680px;
  --page-margin: clamp(1rem, 0.63rem + 1.52vw, 1.5rem);  /* 16 → 24, equal on both sides */
  --grid-columns: 12;
  --grid-gutter: clamp(1rem, 0.63rem + 1.52vw, 1.5rem);  /* 16 → 24 */
  --tile-gap:    0.5rem;                                 /* 8: gap between flush tiles */
  --tile-pad:    clamp(1.25rem, 0.9rem + 1.4vw, 2rem);   /* 20 → 32 */
  --axis-start:  6;       /* THE AXIS: main content starts on grid column 6 (41.7%) from 900px up */
  --header-h:    4rem;    /* 64 */

  --bp-sm: 600px;   /* reference only: custom properties do not work in @media */
  --bp-md: 900px;
  --bp-lg: 1200px;

  /* ---- 6. Shape ------------------------------------------------------------ */
  --radius: 0;                 /* tiles, fields, tables stay square */
  --radius-round: 999px;       /* THE MOTIF: the ring of the logo. Buttons, pictures, discs, bullets */
  --border-table: 1px solid var(--line);
  --border-table-head: 2px solid var(--ink);
  --border-field: 1px solid var(--line-strong);
  --focus-ring: 3px solid var(--color-focus);
  --focus-offset: 2px;

  /* Shadow: only for things that float (open menu, dialog, toast). Nothing at rest. */
  --shadow-float: 0 12px 32px -8px rgb(21 26 54 / 0.28);

  /* ---- 7. Controls ---------------------------------------------------------- */
  --control-h:    3rem;      /* 48 buttons, inputs */
  --control-h-sm: 2.5rem;    /* 40 steppers, filters */
  --control-pad-x: 1.25rem;
  --icon-size:    1.25rem;   /* Phosphor regular, 20px, currentColor */

  /* ---- 8. Motion ------------------------------------------------------------- */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:  120ms;    /* press, colour */
  --dur-base:  240ms;    /* hover moves, underline */
  --dur-enter: 700ms;    /* section parts entering */
  --dur-shutter: 1100ms; /* the one hero picture */
  --stagger:   80ms;
  --rise:      20px;

  /* ---- 9. Layers --------------------------------------------------------------- */
  --z-header: 100;
  --z-menu:   200;
  --z-dialog: 300;
  --z-toast:  400;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-enter: 0ms;
    --dur-shutter: 0ms;
    --stagger: 0ms;
    --rise: 0px;
  }
}

/* ==========================================================================
   Base layer. Low priority on purpose (@layer): any page stylesheet wins.
   ========================================================================== */
@layer base {
  *, *::before, *::after { box-sizing: border-box; }

  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

  body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-text);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    font-weight: var(--weight-regular);
    font-kerning: normal;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  h1, h2, h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    text-wrap: balance;
  }
  h1 { font-size: var(--text-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); }
  h2 { font-size: var(--text-title);   line-height: var(--leading-title);   letter-spacing: var(--tracking-title); }
  h3 { font-size: var(--text-heading); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }

  p { margin: 0; text-wrap: pretty; }
  img, svg, video { display: block; max-width: 100%; height: auto; }

  a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
  a:hover { color: var(--color-action-hover); text-decoration-thickness: 2px; }

  :focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); }
  ::selection { background: var(--teal-500); color: var(--ink); }

  /* Numbers that line up: put .tnum on price, date and quantity cells only
     (on whole tables it also widens full stops and commas inside titles). */
  .tnum { font-variant-numeric: tabular-nums lining-nums; }
}
