/* =========================================================================
   UNBREAKABLE 2.0 FOUNDATION
   Everything here sits on top of the Webflow export and could be ported to
   Webflow if needed. Nothing here is specific to the builder.

   Load order:
   1. normalize.css, components.css, fcd-styleguide.css
      Webflow export. Replaced on each export, so never edit them or copy
      their rules here.
   2. unbreakable-foundation.css (this file)
   3. builder.css
      Builder-only layout. Do not add it here.

   Variable and class names match Webflow exactly.
   ========================================================================= */

/* =========================================================================
   PART 1: SITE CUSTOM CODE
   On the site this lives in Webflow custom code, so the export doesn't
   include it.
   ========================================================================= */

/* Bunny CDN fonts, as loaded by the site */
@import url(https://fonts.bunny.net/css?family=inter:400,500,600,700);
@import url(https://fonts.bunny.net/css?family=mona-sans:400,500,600,700);

/* Font overrides ("Setup CSS") */
:root {
  --font-family--secondary-font: 'Mona Sans', sans-serif;
  --font-family--ui-font: 'Inter', sans-serif;
  --switch-btn-active-bg: var(--_colour-theme---general--white);
}

body.u-theme-dark {
  --switch-btn-active-bg: var(--_colour-theme---grey--300);
}

/* Rem scale: Structural CSS, Wizardry 2.5.2. 1rem = 14px at 1440px */
:root {
  --font-from: 9;
  --font-to: 12;
  --vw-from: calc(1 / 100);
  --vw-to: calc(479 / 100);
  --coefficient: calc((var(--font-to) - var(--font-from)) / (var(--vw-to) - var(--vw-from)));
  --base: calc((var(--font-from) - var(--vw-from) * var(--coefficient)) / 16);
}

html {
  font-size: calc(var(--base) * 1rem + var(--coefficient) * 1vw);
}

@media screen and (min-width: 480px) {
  :root {
    --font-from: 11;
    --font-to: 14;
    --vw-from: calc(479 / 100);
    --vw-to: calc(1440 / 100);
  }
}

@media screen and (min-width: 1441px) {
  :root {
    --font-from: 14;
    --font-to: 14;
    --vw-from: calc(1440 / 100);
    --vw-to: calc(1920 / 100);
  }
}

/* Modal: native <dialog> behaviour for fcd-open-modal.js */
body:has(dialog[open]) {
  overflow: hidden !important;
}

dialog.modal[open] {
  animation: modal-fadein 200ms ease-out forwards;
}

dialog.modal::backdrop {
  background: color-mix(in srgb, var(--_colour-theme---general--black-everywhere) 70%, transparent);
}

@keyframes modal-fadein {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Light / system / dark switch */
.theme-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-btn[aria-pressed="true"] {
  background-color: var(--switch-btn-active-bg);
  color: var(--_colour-theme---general--black);
  box-shadow: var(--_effects---shadow-x) var(--_effects---shadow-y) var(--_effects---shadow-blur) var(--_effects---shadow-size) var(--_effects---shadow-color);
}

/* Noise overlay */
body::before {
  content: "";
  z-index: 9999999999;
  position: fixed;
  opacity: 0.1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: overlay;
  background: url('https://fcd.org.uk/images/noise-500x500.png');
  background-repeat: repeat;
  background-size: 30% auto;
  pointer-events: none;
}

@media screen and (max-width: 767px) {
  body::before {
    background-size: 50% auto;
  }
}

/* Pixel cursors */
body.is--cursor,
body.is--cursor * {
  cursor: url("https://cdn.prod.website-files.com/6708f85ff3d3cba6aff436fb/671251b239d7aeb290a31ac5_cursor-default%402x.svg") 2 0, auto;
}

body.is--cursor p,
body.is--cursor h1,
body.is--cursor h6,
body.is--cursor input[type="text"],
body.is--cursor input[type="url"],
body.is--cursor textarea {
  cursor: url("https://cdn.prod.website-files.com/6708f85ff3d3cba6aff436fb/6714e4e1f367de40becf9029_cursor-text%402x.svg") 9 19, text;
}

body.is--cursor a,
body.is--cursor a *,
body.is--cursor button,
body.is--cursor button *,
body.is--cursor input[type="color"] {
  cursor: url("https://cdn.prod.website-files.com/6708f85ff3d3cba6aff436fb/671251b212e6b71494aa67ff_cursor-pointer%402x.svg") 12 0, pointer;
}

/* =========================================================================
   PART 2: OVERRIDES TO THE WEBFLOW EXPORT
   Each one differs from the export on purpose. Fixing these in Webflow means
   they can be deleted from here.
   ========================================================================= */

/* Webflow doesn't set box-sizing on pseudo-elements */
*::before, *::after {
  box-sizing: border-box;
}

/* Webflow leaves the browser's button background and padding */
button {
  background: none;
  padding: 0;
}

/* Webflow sets images to inline-block */
img, svg {
  display: block;
  vertical-align: middle;
}

/* Webflow's h1 keeps a 20px top margin and bold weight, and only .h1 gets the
   base font */
h1, .h1 {
  font-family: var(--font-family--base-font);
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 400;
}

/* Webflow hard-codes the text colour as #1d1c1a, which fails in dark mode, and
   has no width */
.field_input {
  color: var(--_colour-theme---general--black);
  width: 100%;
}

/* The Disclaimer field is a fixed size */
textarea.field_input {
  resize: none;
}

/* Webflow's border colour is a deleted variable */
.field_input:focus {
  border-color: var(--_colour-theme---general--black);
  outline: none;
}

/* Webflow's border is a deleted variable, and its white background stays white
   in dark mode. Theme variables let the modal follow the theme */
.modal {
  border: 1px solid var(--_colour-theme---grey--300);
  background-color: var(--_colour-theme---general--white);
  color: var(--_colour-theme---general--black);
}

.modal_close-button {
  color: inherit;
}
