/* Tokens: every value the site uses. Other CSS files reference these and nothing else.
   Breakpoints (Bootstrap, mobile first, min-width): sm 576px · md 768px · lg 992px · xl 1200px · xxl 1400px.
   Custom properties cannot be used inside media queries, so the numbers are written out there. */

:root {
  /* Colours: neutral placeholders until the site's house style sets its palette. */
  --c-page:       rgb(255, 255, 255);
  /* Doctor Beran's admin layout (views/layouts/area.php, components/admin.css), from the drberan site's house style. */
  --c-off-white:  rgb(250, 250, 250);  /* behind the page in /admin, /staff, /user */
  --c-ground:     rgb(250, 248, 244);  /* warm cream: a menu row under the pointer */
  --c-heading:    rgb(78, 78, 78);     /* soft black for headings */
  --c-anthracite: rgb(84, 88, 92);     /* dark grey: the band with a partner's or clinic's name above their menu */
  --c-accent:     rgb(238, 248, 255);  /* palest blue: the avatar's circle */
  --c-accent-text: rgb(27, 85, 126);   /* deep blue: the area's name under the logo, the avatar's letter */
  --c-menu-button: rgb(47, 149, 220);  /* the open page's row in the menu */
  --c-menu-button-text: var(--c-off-white);
  --c-hex:        rgba(47, 149, 220, 0.2); /* the hexagon texture (components/hex.css): thin lines of that blue at 20% */
  --c-hex-area:   rgba(47, 149, 220, 0.15); /* the hexagons behind the page in /admin, /staff, /user: softer, at 15% */
  --c-bar:        rgb(196, 229, 255);   /* light blue: a bar in a small chart (the dashboard's Consultations held) */
  --c-menu-button-hover: rgb(30, 105, 160); /* the bright button on hover (button--bright) */
  --c-blue-glow:  rgb(228, 234, 239);  /* the soft blue glow behind the coming soon page's browser window */
  --c-tick:       rgb(25, 135, 84);    /* green: a tick on a confirmation */
  --c-pay-top:    rgb(30, 140, 88);    /* the checkout's Pay button: a green gradient, white words readable on both ends */
  --c-pay-bottom: rgb(20, 110, 68);
  --c-pay-hover:  rgb(14, 90, 55);     /* its bottom on hover */
  --c-photo-label: rgba(255, 255, 255, 0.92); /* the webinar page: the white box with Dr Beran's name over her photo */
  /* The browser window on the coming soon page: its three dots, as on a Mac. */
  --c-window-close: rgb(255, 95, 87);
  --c-window-min:   rgb(254, 188, 46);
  --c-window-max:   rgb(40, 200, 64);
  --c-chip:         rgb(236, 245, 252); /* the calendar's availability slots and Add: pale blue */
  --c-chip-border:  rgb(196, 229, 255);
  --c-linen:        rgba(255, 255, 255, 0.025); /* the calendar's title band: the very faint crosshatch over anthracite */
  --c-on-dark-muted: rgba(255, 255, 255, 0.8); /* the dialog's × on its anthracite bar */
  --c-on-dark-hover: rgba(255, 255, 255, 0.1); /* behind it on hover */
  --c-glass-top:    rgba(255, 255, 255, 0.95); /* glass buttons: white at the top fading to see-through */
  --c-glass-bottom: rgba(255, 255, 255, 0.55);
  --c-glass-edge:   rgba(255, 255, 255, 0.9);  /* their bright top edge */
  --c-glass-toast:  rgba(255, 255, 255, 0.6);  /* under a toast's glass, so its words stay easy to read */
  --c-surface:    rgb(245, 245, 244);
  --c-line:       rgb(222, 222, 220);
  --c-text:       rgb(28, 28, 30);
  --c-text-muted: rgb(92, 92, 96);
  --c-action:     rgb(38, 84, 160);
  --c-action-hover: rgb(28, 64, 124);
  --c-error:      rgb(179, 38, 30);
  /* Focus (Bootstrap's): a soft 4px ring of the action colour at 25%, and a lighter border on fields.
     When the site changes --c-action, update these two to match. */
  --c-focus-ring:   rgba(38, 84, 160, 0.25);
  --c-focus-border: rgb(147, 170, 208);  /* --c-action mixed 50% with white */
  --c-error-ring:   rgba(179, 38, 30, 0.25); /* --c-error at 25%, for fields in error */
  --c-error-hover:  rgb(150, 30, 24);
  --c-backdrop:     rgba(28, 28, 30, 0.5);   /* behind dialogs */

  /* Message colours (Bootstrap 5.3's soft alert colours): background, border, text. */
  --c-success-bg:     rgb(209, 231, 221);
  --c-success-border: rgb(163, 207, 187);
  --c-success-text:   rgb(10, 54, 34);
  --c-info-bg:        rgb(207, 244, 252);
  --c-info-border:    rgb(158, 234, 249);
  --c-info-text:      rgb(5, 81, 96);
  --c-warning-bg:     rgb(255, 243, 205);
  --c-warning-border: rgb(255, 230, 156);
  --c-warning-text:   rgb(102, 77, 3);
  --c-warning-dot:    rgb(214, 150, 20); /* the warning toast's amber dot */
  --c-error-bg:       rgb(248, 215, 218);
  --c-error-border:   rgb(241, 174, 181);
  --c-error-text:     rgb(88, 21, 28);

  /* Fonts: self-hosted Google Fonts (assets/css/fonts.css), with the system font as the fallback. */
  --font-body:    "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "STIX Two Text", Georgia, "Times New Roman", serif;

  /* Type scale: base 16px. Ratio 1.2 on phones, 1.25 from md (768px).
     A site changes its scale by changing --fs-ratio only. */
  --fs-ratio: 1.2;
  --fs-xxs:   1rem;                                           /* 10px: the smallest; small capitals in the dashboard's tile bands */
  --fs-xs:    1.1rem;                                         /* 11px: small capitals (the area's name under the logo) */
  --fs-menu:  1.4rem;                                         /* 14px: the rows of the areas' menu */
  --fs-hello-max: 3.1rem;                                     /* 31px: the most the dashboard's greeting grows to on phones (its desktop size) */
  --fs-body:  1.6rem;                                         /* 16px, also the minimum for inputs */
  --fs-small: calc(var(--fs-body) / var(--fs-ratio));          /* 13.3 / 12.8px */
  --fs-lead:  calc(var(--fs-body) * var(--fs-ratio));          /* 19.2 / 20px */
  --fs-h4:    calc(var(--fs-body) * pow(var(--fs-ratio), 2));  /* 23 / 25px */
  --fs-h3:    calc(var(--fs-body) * pow(var(--fs-ratio), 3));  /* 27.6 / 31.3px */
  --fs-h2:    calc(var(--fs-body) * pow(var(--fs-ratio), 4));  /* 33.2 / 39.1px */
  --fs-h1:    calc(var(--fs-body) * pow(var(--fs-ratio), 5));  /* 39.8 / 48.8px */

  --lh-body:    1.5;
  --lh-heading: 1.2;

  /* Spacing: 4px grid. */
  --sp-1:  0.4rem;  /* 4px */
  --sp-2:  0.8rem;  /* 8px */
  --sp-3:  1.2rem;  /* 12px */
  --sp-4:  1.6rem;  /* 16px */
  --sp-5:  2rem;    /* 20px */
  --sp-6:  2.4rem;  /* 24px */
  --sp-8:  3.2rem;  /* 32px */
  --sp-10: 4rem;    /* 40px */
  --sp-12: 4.8rem;  /* 48px */
  --sp-16: 6.4rem;  /* 64px */
  --sp-24: 9.6rem;  /* 96px */

  /* Lines and corners. */
  --border-1: 0.1rem;  /* 1px */
  --radius-1: 0.4rem;  /* 4px */
  --radius-2: 0.8rem;  /* 8px: dialogs (Bootstrap's large radius) */
  --radius-pill: 99rem; /* fully rounded: the avatar, the window's address bar */
  --radius-window: 1.2rem; /* 12px: the browser window on the coming soon page */
  --tracking-caps: 0.2em; /* letter spacing for small capitals */
  --focus-ring: 0 0 0 var(--sp-1) var(--c-focus-ring);
  --shadow-glass:
    inset 0 var(--border-1) 0 var(--c-page),
    0 0 0 var(--border-1) rgba(28, 28, 30, 0.08),
    0 0.2rem 0.6rem rgba(28, 28, 30, 0.1); /* glass buttons (the calendar's Availability): bright top edge, faint ring, soft shadow */
  --shadow-glass-hover:
    inset 0 var(--border-1) 0 var(--c-page),
    0 0 0 var(--border-1) rgba(28, 28, 30, 0.16),
    0 0.2rem 0.8rem rgba(28, 28, 30, 0.14);
  --shadow-pressed: inset 0 0.2rem 0.3rem rgba(28, 28, 30, 0.1); /* a joined button that looks pressed in: the chosen one */
  --shadow-seg: 0 var(--border-1) 0.2rem rgba(28, 28, 30, 0.08); /* the faint lift under a row of joined buttons */
  --shadow-1:   0 var(--sp-2) var(--sp-4) rgba(28, 28, 30, 0.15);

  /* Icons drawn in CSS (data: images are allowed by the content security policy). The chevron of every select, in --c-text-muted. */
  --icon-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='rgb(92,92,96)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
  --shadow-bright: 0 var(--sp-1) var(--sp-3) rgba(47, 149, 220, 0.35); /* a soft blue glow under the bright button */
  --shadow-pay:    0 var(--sp-1) var(--sp-3) rgba(20, 110, 68, 0.35);  /* a soft green glow under Pay */
  --shadow-window: 3rem 4rem 8rem rgba(27, 85, 126, 0.18), 0.8rem 1.2rem 2.4rem rgba(28, 28, 30, 0.08); /* the browser window, lifted off the page */  /* things that float: dialogs, toasts (Bootstrap's shadow) */
  /* The hexagon texture: one 56 x 100px tile of honeycomb lines (only its shape is used; the colour is --c-hex),
     and its default fade, strongest in the middle and gone at the edges. */
  --hex-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='black' stroke-width='1'/%3E%3C/svg%3E");
  --hex-size: 5.6rem 10rem;
  --hex-fade: radial-gradient(closest-side, rgb(0, 0, 0), rgba(0, 0, 0, 0.5) 45%, rgba(0, 0, 0, 0));

  /* Stacking: toasts sit above everything on the page (dialogs use the browser's top layer). */
  --z-toast: 1000;

  /* Form fields: 24 top + 24 text line + 8 bottom + 2 border = 58px (Bootstrap's floating-label height). */
  --field-h: calc(var(--sp-6) + var(--fs-body) * var(--lh-body) + var(--sp-2) + 2 * var(--border-1));

  /* Buttons: three sizes on the 4px grid, close to Bootstrap's 31 / 38 / 48px. */
  --button-h-sm: var(--sp-8);   /* 32px */
  --button-h:    var(--sp-10);  /* 40px */
  --button-h-lg: var(--sp-12);  /* 48px */
  --admin-top-h: calc(2 * var(--sp-3) + var(--button-h-sm) + var(--border-1)); /* the phone top bar of the areas: its padding, menu button and line (57px) */

  /* Transitions: Bootstrap's timings. Turned off for visitors who ask for reduced motion (base.css). */
  --ease:          ease-in-out;
  --duration-fast: 0.15s;  /* hover and focus on buttons and fields */
  --duration-base: 0.2s;   /* anything larger that moves or fades */
  --duration-slow: 0.3s;   /* dialogs sliding in */
  --ease-out:      ease-out;

  /* Page container widths per breakpoint (Bootstrap's). */
  --container-sm:  54rem;   /* 540px from 576px */
  --container-md:  72rem;   /* 720px from 768px */
  --container-lg:  96rem;   /* 960px from 992px */
  --container-xl:  114rem;  /* 1140px from 1200px */
  --container-xxl: 132rem;  /* 1320px from 1400px */
  --gutter: var(--sp-6);    /* 24px: the space at each side of the page in the areas (40px from 768px, 64px from 1200px) */

  /* Floating boxes. */
  --dialog-w: 50rem;  /* 500px, Bootstrap's modal width */
  --auth-w:   40rem;  /* 400px, the sign-in pages' single column */
  --text-w:   72rem;  /* 720px, a comfortable line length for reading (Pages module text) */
  --area-menu-w: 28rem; /* 280px (Bootstrap's sidebar), the menu beside the page in /admin, /staff, /user (from 992px) */
  --logo-h:      2rem;  /* 20px: the logo at the top of the area menu */
  /* The coming soon page: its widest content, the words' width, and the browser window's turn in 3D (less on phones). */
  --soon-max:    144rem; /* 1440px */
  --soon-text-w: 52rem;  /* 520px */
  --window-depth:  160rem;
  --window-turn-y: -16deg;
  --window-turn-x: 6deg;
  --window-turn-phone: 0.6;
  --qr-size:  20rem;  /* 200px, the QR code for setting up a code generator app */
  /* The Calendar module (pages/calendar.css). */
  --calendar-row:     var(--sp-4); /* 16px: a quarter of an hour, so an hour is 64px */
  --calendar-time-w:  var(--sp-16); /* 64px: the column of hours */
  --calendar-panel-w: 48rem;        /* 480px: the Availability drop-down */
  --calendar-menu-w: 26.4rem;      /* 264px: Availability's Templates menu */
  --calendar-edit-w: 32rem;        /* 320px: Availability's Edit menu (Add a slot) */
  --calendar-time-pick-w: 12.8rem;  /* 128px: the Availability's From and To from 768px */
  /* A client's file (pages/client.css). */
  --client-min-h:  64rem; /* 640px: the shortest the file's box gets; on a shorter screen the page scrolls instead */
  --client-side-w: 26rem; /* 260px: the journey and the list of reports beside the page (from 992px) */
  --client-qty-w: 12rem;  /* 120px: How many, beside the product picker in an order */
  --client-dose-panel-w: 46rem; /* 460px: the Change dose drop-down */
  --client-tag-w: 12.8rem; /* 128px: the Prescription or Shop column of an order's lines, so the tags line up */
  --client-step-w: 17rem; /* 170px: one step in the journey's sideways row (below 992px) */
  /* Booking a consultation (pages/book.css). */
  --book-pick-w:  20rem; /* 200px: the narrowest a consultant's button gets before they stack */
  --book-label-w: 14rem; /* 140px: the labels on Check and book */
  /* Orders: the How many field beside each item of an order being made. */
  --quantity-w: 12rem; /* 120px */
  /* The shop (pages/shop.css). */
  --c-hex-shop: rgba(47, 149, 220, 0.3); /* the shop's hexagons: stronger than the rest of the site (20%) */
  --shop-max: 144rem;     /* 1440px: the shop's widest content */
  --shop-top-h: calc(2 * var(--sp-4) + var(--button-h-sm) + var(--border-1)); /* the phone top bar while the menu is open (65px) */
  --shop-hero-gap: var(--sp-12); /* 48px: the least space between the hero and the first box of products */
  --shop-help-w: 56rem;   /* 560px: Help me choose's drop-down */
  --shop-prices-w: 28rem; /* 280px: the Prices in drop-down */
  --shop-hex-h: 140rem;   /* 1400px: how far down the hexagons reach behind the top of the shop */
  --shop-hex-bottom-h: 90rem; /* 900px: how far up the hexagons reach from the bottom left */
  --shop-cart-w: 36rem;   /* 360px: the basket's drop-down */
  --shop-add-w: 28rem;    /* 280px: the widest a product page's Add to basket gets */
  --c-glass-bar: rgba(255, 255, 255, 0.72);      /* the sticky header's white glass, once the page scrolls under it */
  --c-glass-bar-line: rgba(222, 222, 220, 0.8);  /* the faint line under it */
  --shadow-bar: 0 var(--sp-1) var(--sp-4) rgba(28, 28, 30, 0.06);
  --blur-bar: blur(1.4rem) saturate(1.4);        /* what shows through the shop's sticky header and every toast, blurred */
  /* The drawn bottle of a product without a photo (as on the first site). */
  --bottle-w: 36%;      /* of its card's photo box */
  --bottle-w-lg: 45%;   /* of a product page's photo box */
  --c-bottle-cap: rgb(240, 120, 40);   /* orange, on every other product */
  --c-bottle-band: rgb(90, 185, 190);  /* the teal label */
  --shadow-bottle: 0 var(--sp-2) var(--sp-3) rgba(27, 85, 126, 0.12);
}

@media (min-width: 768px) {
  :root {
    --fs-ratio: 1.25;
    --gutter: var(--sp-10); /* 40px */
  }
}

@media (min-width: 1200px) {
  :root {
    --gutter: var(--sp-16); /* 64px */
  }
}
