/*--------------------------------------------------------------
# TMT colour system - the ONLY place colours are defined.
#
# Everything is derived from the two colours of the TMT logo:
#   blue-grey  #455768   (TMT lettering, Arabic name)
#   orange     #e6833d   (heartbeat line, dots, "TeleMedicine")
# Light mode is the default; dark mode is html[data-theme="dark"],
# set by assets/js/theme.js (saved choice, else the device setting).
# Load order: tmt-colors.css -> main.css -> theme.css
--------------------------------------------------------------*/

:root {
  /* ---- Palette (logo shades) ---- */
  --tmt-slate-50:  #f1f4f7;
  --tmt-slate-100: #dde4ea;
  --tmt-slate-300: #9fb0bf;
  --tmt-slate-700: #455768;
  --tmt-slate-800: #34424f;
  --tmt-slate-900: #263340;
  --tmt-orange-50:  #fdf1e8;
  --tmt-orange-100: #fadcc3;
  --tmt-orange-300: #f0a068;
  --tmt-orange-500: #e6833d;
  --tmt-orange-700: #a8541a;
  --tmt-page:  #f7f9fb;
  --tmt-white: #ffffff;
  /* dark-mode shades of the same blue-grey */
  --tmt-d-bg:     #141b22;
  --tmt-d-card:   #1c262f;
  --tmt-d-alt:    #243039;
  --tmt-d-border: #34434f;
  --tmt-d-text:   #eef2f5;
  --tmt-d-text-2: #a9b7c4;
  --tmt-d-footer: #0d1217;
  --tmt-hero-end: #2e3b48;

  /* ---- Semantic tokens: LIGHT ---- */
  --bg:          var(--tmt-page);
  --card:        var(--tmt-white);
  --bg-alt:      var(--tmt-slate-50);
  --border:      var(--tmt-slate-100);
  --divider:     var(--tmt-slate-300);
  --field-border: var(--tmt-slate-700);        /* form fields: >= 3:1 on white */
  --text:        var(--tmt-slate-900);
  --text-2:      var(--tmt-slate-700);
  --icon:        var(--tmt-slate-700);          /* line icons */

  --btn-bg:      var(--tmt-slate-700);          /* primary button */
  --btn-fg:      var(--tmt-white);
  --btn-hover:   var(--tmt-slate-800);
  --btn-icon-fg: var(--tmt-slate-700);

  --hi-bg:       var(--tmt-orange-500);         /* secondary / highlight fill */
  --hi-fg:       var(--tmt-slate-900);
  --hi-hover:    var(--tmt-orange-300);

  --accent-text: var(--tmt-orange-700);         /* orange text on light */
  --link-hover:  var(--tmt-slate-900);
  --focus:       var(--tmt-orange-500);

  --notice-bg:     var(--tmt-orange-50);
  --notice-border: var(--tmt-orange-500);
  --ok-bg:         var(--tmt-slate-50);
  --ok-border:     var(--tmt-slate-700);

  --hero-from: var(--tmt-slate-700);
  --hero-to:   var(--tmt-hero-end);
  --hero-fg:   var(--tmt-white);
  --hero-hi:   var(--tmt-orange-300);           /* highlighted words on hero */
  --pulse:     var(--tmt-orange-500);
  /* heartbeat line, stroke #e6833d, used as hero decoration */
  --pulse-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 76 H430 L455 76 L478 34 L505 108 L535 14 L560 84 L582 76 H1200' fill='none' stroke='%23e6833d' stroke-width='3' stroke-linejoin='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");

  --footer-bg:    var(--tmt-slate-900);
  --footer-text:  var(--tmt-slate-100);
  --footer-muted: var(--tmt-slate-300);

  --shadow-rgb: 38, 51, 64;                      /* slate-900 */

  /* ---- Existing template variables, mapped to the tokens ---- */
  --background-color: var(--bg);
  --default-color:    var(--text);
  --heading-color:    var(--text);
  --accent-color:     var(--btn-bg);
  --surface-color:    var(--card);
  --contrast-color:   var(--btn-fg);

  --nav-color:                     var(--text);
  --nav-hover-color:               var(--accent-text);
  --nav-mobile-background-color:   var(--card);
  --nav-dropdown-background-color: var(--card);
  --nav-dropdown-color:            var(--text);
  --nav-dropdown-hover-color:      var(--accent-text);

  --swiper-theme-color: var(--btn-bg);

  /* ---- Bootstrap 5.3 variables ---- */
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--text-2);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border);
  --bs-secondary-bg: var(--bg-alt);
  --bs-tertiary-bg: var(--bg-alt);
  --bs-tertiary-color: var(--text-2);
  --bs-link-color: var(--accent-text);
  --bs-link-color-rgb: 168, 84, 26;
  --bs-link-hover-color-rgb: 38, 51, 64;
  --bs-link-hover-color: var(--link-hover);
  --bs-primary-rgb: 69, 87, 104;
  --bs-secondary-rgb: 69, 87, 104;
  --bs-info-rgb: 69, 87, 104;
  --bs-success-rgb: 168, 84, 26;
  --bs-danger-rgb: 168, 84, 26;
  --bs-warning-rgb: 168, 84, 26;
  --bs-light-rgb: 241, 244, 247;
  --bs-dark-rgb: 38, 51, 64;
  --bs-box-shadow-sm: 0 .125rem .25rem rgba(38, 51, 64, .1);
  --bs-box-shadow: 0 .5rem 1rem rgba(38, 51, 64, .12);
  --bs-box-shadow-lg: 0 1rem 3rem rgba(38, 51, 64, .2);
  --bs-box-shadow-inset: inset 0 1px 2px rgba(38, 51, 64, .1);
  --bs-backdrop-bg: #263340;
}

/* ---- Semantic tokens: DARK ---- */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg:          var(--tmt-d-bg);
  --card:        var(--tmt-d-card);
  --bg-alt:      var(--tmt-d-alt);
  --border:      var(--tmt-d-border);
  --divider:     var(--tmt-d-border);
  --field-border: var(--tmt-slate-300);
  --text:        var(--tmt-d-text);
  --text-2:      var(--tmt-d-text-2);
  --icon:        var(--tmt-slate-300);

  --btn-bg:      var(--tmt-orange-500);
  --btn-fg:      var(--tmt-d-bg);
  --btn-hover:   var(--tmt-orange-300);
  --btn-icon-fg: var(--tmt-slate-700);

  --hi-bg:       var(--tmt-orange-500);
  --hi-fg:       var(--tmt-d-bg);
  --hi-hover:    var(--tmt-orange-300);

  --accent-text: var(--tmt-orange-300);
  --link-hover:  var(--tmt-orange-100);
  --focus:       var(--tmt-orange-300);

  --notice-bg:     var(--tmt-d-alt);
  --notice-border: var(--tmt-orange-500);
  --ok-bg:         var(--tmt-d-alt);
  --ok-border:     var(--tmt-slate-300);

  --hero-from: var(--tmt-d-alt);
  --hero-to:   var(--tmt-d-bg);
  --hero-fg:   var(--tmt-d-text);
  --hero-hi:   var(--tmt-orange-300);

  --footer-bg:    var(--tmt-d-footer);
  --footer-text:  var(--tmt-d-text);
  --footer-muted: var(--tmt-d-text-2);

  --shadow-rgb: 13, 18, 23;                      /* #0d1217 */

  --bs-link-color-rgb: 240, 160, 104;
  --bs-link-hover-color-rgb: 250, 220, 195;
  --bs-primary-rgb: 159, 176, 191;
  --bs-secondary-rgb: 159, 176, 191;
  --bs-info-rgb: 159, 176, 191;
  --bs-success-rgb: 240, 160, 104;
  --bs-danger-rgb: 240, 160, 104;
  --bs-warning-rgb: 240, 160, 104;
  --bs-light-rgb: 36, 48, 57;
  --bs-dark-rgb: 13, 18, 23;
  --bs-box-shadow-sm: 0 .125rem .25rem rgba(13, 18, 23, .5);
  --bs-box-shadow: 0 .5rem 1rem rgba(13, 18, 23, .55);
  --bs-box-shadow-lg: 0 1rem 3rem rgba(13, 18, 23, .7);
  --bs-box-shadow-inset: inset 0 1px 2px rgba(13, 18, 23, .5);
  --bs-backdrop-bg: #0d1217;
}

/* Sections that used the template's "light/dark background" presets */
.light-background {
  --background-color: var(--bg-alt);
  --surface-color: var(--card);
}

.dark-background {
  --background-color: var(--tmt-slate-900);
  --default-color: var(--tmt-white);
  --heading-color: var(--tmt-white);
  --surface-color: var(--tmt-slate-800);
  --contrast-color: var(--tmt-white);
}
