/* Shared typography. Fonts are self-hosted under the SIL Open Font License. */
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  size-adjust: 106.6%;
}

@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/SourceSans3-Italic-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
  size-adjust: 106.6%;
}

:root {
  --haba-font-title: "Instrument Serif", Georgia, serif;
  --haba-font-text: "Source Sans 3", Arial, sans-serif;
  --haba-heading-color: #333333;
  --haba-text-color: #696969;
  /* Screen approximation of RAL 5015 Sky blue, consistent with the existing brand. */
  --haba-accent: #007cb0;
}

body {
  font-family: var(--haba-font-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.2px;
  color: var(--haba-text-color);
  -webkit-font-smoothing: antialiased;
}

button, input, optgroup, select, textarea,
.button, .btn, .form-label, .form-input, .tooltip, .popover,
.rd-navbar-nav, .rd-navbar-dropdown, .rd-navbar-megamenu {
  font-family: var(--haba-font-text);
}

/* Explicitly cover heading utility classes and the nested text in headings.
   Icon font declarations and their pseudo-elements remain untouched. */
html body :is(h1, h2, h3, h4, h5, h6,
  .heading-1, .heading-2, .heading-3, .heading-4, .heading-5, .heading-6,
  .custom-heading-1, .custom-heading-2, .custom-heading-3,
  .custom-heading-4, .custom-heading-5, .custom-heading-6) {
  font-family: var(--haba-font-title) !important;
  font-weight: 400 !important;
  font-style: normal;
  line-height: 1.25;
  letter-spacing: normal !important;
  text-transform: none;
  color: var(--haba-heading-color);
}

html body :is(h1, h2, h3, h4, h5, h6,
  .heading-1, .heading-2, .heading-3, .heading-4, .heading-5, .heading-6)
  :is(a, span, strong, b, em, small) {
  font-family: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit;
}

/* Retain contrast over photographs, video, dark panels and blue panels. */
:is(.context-dark, .bg-secondary, .bg-gray-darker, .bg-gray-3,
  .bg-gray-4, .bg-gray-5, .bg-black-1, .bg-image-dark, .bg-primary,
  .pricing-table-creative__item_prefered) {
  --haba-heading-color: #ffffff;
  --haba-text-color: #ffffff;
}

:is(.bg-white, .bg-default, .bg-gray-light, .bg-gray-lighter) {
  --haba-heading-color: #333333;
  --haba-text-color: #696969;
}

/* Text links use the dark neutral from the reference; blue is an accent. */
p a:not(.button):not(.btn):not(.share-btn) {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

p a:not(.button):not(.btn):not(.share-btn):hover,
html body :is(h1, h2, h3, h4, h5, h6) a:hover,
.page .text-primary {
  color: var(--haba-accent);
}

::selection {
  background: var(--haba-accent);
  color: #ffffff;
}
