/* ######################################## *\
    BASE
\* ######################################## */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  background: #fff;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: var(--font-base);
  font-weight: 400;
  line-height: 1.375;
  color: var(--color-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  display: block;
  flex: 1 0 auto;
}

p {
  margin: 0 0 1.375em;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: bottom;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

h1, h2, h3, h4 {
  margin: 0 0 0.6875em;
  line-height: 1.125;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1rem;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  z-index: 100;
  left: 15px;
  top: -100px;
  padding: 0.6875em 1.375em;
  background: var(--color-accent);
  color: #fff;
}
  .skip-link:focus {
    top: 15px;
  }

@media (min-width: 920px) {
  html {
    font-size: 16px;
  }

  body {
    font-size: 0.875rem;
  }

  a:hover, a:focus-visible {
    text-decoration: underline;
  }

  h1 {
    font-size: 3rem;
  }
}

/* ######################################## *\
    HEADER / NAVIGATION
\* ######################################## */

/* <nav-bar> only carries behaviour; display: contents lets .navigation stick relative
   to the whole page instead of being confined to the custom element's own box. */
nav-bar {
  display: contents;
}

.site-header {
  position: relative;
}

.site-branding {
  padding: 1.375em 0;
}

.site-logo {
  display: block;
  width: 240px;
  margin: 0 auto;
}

.site-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.nav-sentinel {
  height: 0;
}

.navigation-logo {
  display: none;
}

/* Hamburger (small and medium screens) */
.nav-button {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-button span,
.nav-button span::before,
.nav-button span::after {
  position: absolute;
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #000;
  transition-duration: 0.3s;
}

.nav-button span {
  top: 19px;
  left: 10px;
}
  .nav-button span::before,
  .nav-button span::after {
    content: '';
    left: 0;
    transition-property: top, bottom, transform;
  }
  .nav-button span::before {
    top: -6px;
  }
  .nav-button span::after {
    bottom: -6px;
  }

.nav-button[aria-expanded="true"] span {
  background: none;
}
  .nav-button[aria-expanded="true"] span::before,
  .nav-button[aria-expanded="true"] span::after {
    background: var(--color-accent);
  }
  .nav-button[aria-expanded="true"] span::before {
    top: 0;
    transform: rotate(45deg);
  }
  .nav-button[aria-expanded="true"] span::after {
    bottom: 0;
    transform: rotate(-45deg);
  }

/* Dropdown menu (small and medium screens) */
.navigation {
  position: relative;
  z-index: 25;
}

.main-menu-container {
  display: none;
  position: absolute;
  top: 0;
  right: 15px;
  width: 50%;
  background: var(--color-accent);
  box-shadow: var(--shadow-soft);
  border-radius: 2px;
}
  .navigation.is-open .main-menu-container {
    display: block;
  }

.main-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-menu .menu-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
  .main-menu .menu-item:last-child {
    border-bottom: 0;
  }

.main-menu a {
  display: block;
  padding: 0.6875em 1.375em;
  font-size: 1.25rem;
  color: #fff;
}
  .main-menu .is-active a {
    font-weight: bold;
  }

@media (min-width: 640px) {
  .site-branding {
    padding: 2.75em 0;
  }

  .site-logo {
    width: 360px;
  }
}

@media (min-width: 920px) {
  .site-branding {
    padding: 3.4375em 0;
  }

  .site-logo {
    width: 480px;
  }

  .nav-button {
    display: none;
  }

  .navigation {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #fff;
    box-shadow: 0 4px 4px -4px rgba(43, 59, 93, 0.29);
  }
    .navigation.is-stuck {
      box-shadow: var(--shadow-soft);
    }

  .navigation.is-stuck .navigation-logo {
    display: block;
    position: absolute;
    left: 40px;
    top: 50%;
    width: 140px;
    transform: translateY(-50%);
  }

  .navigation-logo img {
    display: block;
    width: 100%;
    height: auto;
  }

  /* padding-bottom reproduces the 5px gap the old theme's inline-block menu left below
     the links (baseline/descender space), so the red band starts at the same height. */
  .main-menu-container {
    display: block;
    position: static;
    width: auto;
    padding-bottom: 5px;
    text-align: center;
    background: none;
    box-shadow: none;
    border-radius: 0;
  }

  .main-menu {
    display: inline-flex;
    font-size: 1rem;
  }

  .main-menu .menu-item {
    border-bottom: 0;
  }

  .main-menu a {
    padding: 8px 20px;
    font-size: 1rem;
    color: #000;
  }
    .main-menu .menu-item:first-child a {
      padding-left: 0;
    }
    .main-menu a:hover,
    .main-menu a:focus-visible,
    .main-menu .is-active a {
      color: var(--color-accent);
      text-decoration: none;
    }
}

/* ######################################## *\
    PAGE INTRO (red title band)
\* ######################################## */

.page-intro {
  background: var(--color-band);
  color: var(--color-band-text);
}

.page-intro-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 75px var(--band-gutter) 50px;
}

.page-intro-center h1 {
  text-align: center;
}

.page-intro-home .page-intro-inner {
  max-width: 850px;
  padding-top: 40px;
  padding-bottom: 20px;
}

.page-intro-home p {
  font-size: 20px;
}

@media (min-width: 640px) {
  .page-intro-home p {
    text-align: justify;
  }
}

/* ######################################## *\
    SECTIONS
\* ######################################## */

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 50px var(--gutter);
}

.section-narrow {
  max-width: 850px;
}

/* ######################################## *\
    COUNTERS (homepage)
\* ######################################## */

/* 760px of content, as in the old theme, plus the page gutters. */
.section-counters {
  max-width: calc(760px + 2 * var(--gutter));
  padding-top: 0;
  padding-bottom: 25px;
}

counter-slider {
  display: block;
}

/* Until the component is defined, lay the counters out like the carousel's first view
   so the page doesn't jump when it takes over. */
counter-slider:not(:defined) {
  display: flex;
  overflow: hidden;
}
  counter-slider:not(:defined) > .counter {
    flex: 0 0 100%;
  }

.counter {
  padding: 2.75em 1.375em;
  text-align: center;
  font-weight: bold;
  user-select: none;
}

.counter-icon {
  display: block;
  font-size: 4rem;
  font-weight: normal;
  color: var(--color-muted);
}

.counter-before,
.counter-after {
  display: block;
  font-size: 1rem;
}

.counter-number {
  display: block;
  font-size: 2.5rem;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  counter-slider:not(:defined) > .counter {
    flex-basis: 50%;
  }
}

@media (min-width: 1140px) {
  counter-slider:not(:defined) > .counter {
    flex-basis: 33.333%;
  }
}

/* ######################################## *\
    REFERENCES
\* ######################################## */

.reference-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  padding: 1.375em;
  background: var(--color-tile);
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.24);
}

.reference-tile img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  filter: grayscale(1);
  transition: filter 0.3s ease;
}
  .reference-tile.is-muted img {
    filter: grayscale(1) contrast(0);
  }
  .reference-tile:hover img {
    filter: grayscale(0);
  }

@media (min-width: 600px) {
  .reference-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 782px) {
  .reference-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ######################################## *\
    CONTACT
\* ######################################## */

.contact-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px 32px;
}

.contact-address h2 {
  font-size: 1rem;
}

@media (min-width: 600px) {
  .contact-columns {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 782px) {
  .contact-columns {
    grid-template-columns: 2fr 1fr;
  }
}

/* contact-form */
contact-form {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 25px;
}

.field {
  margin-bottom: 1.375em;
}

.field-label {
  display: block;
  margin: 0 0 0.171875em 0.171875em;
  font-size: 12px;
  font-weight: 700;
}

.field-label .required {
  color: var(--color-error);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea,
.styled-select select {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 0;
  background: var(--color-field);
  font-size: 0.875rem;
  transition: border-color 0.3s ease 0s;
}
  .contact-form input:focus,
  .contact-form textarea:focus,
  .styled-select select:focus {
    border-color: var(--color-accent);
    outline: none;
  }

.contact-form textarea {
  resize: vertical;
}

.styled-select {
  display: block;
  position: relative;
}

.styled-select select {
  padding: 10px 28px 10px 8px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.styled-select option {
  background: #fff;
}

.styled-select i {
  position: absolute;
  z-index: 1;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}

.field-acceptance .notice {
  display: block;
  margin-bottom: 0.6875em;
}

.checkbox-label {
  display: block;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

.checkbox-label input {
  float: left;
  position: relative;
  top: 2px;
}

.checkbox-label span {
  display: block;
  margin-left: 1.375em;
  line-height: 1.375em;
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: block;
  width: 100%;
  padding: 0.6875em 1.375em;
  border: 0;
  border-radius: 4px;
  background-color: var(--color-accent);
  box-shadow: var(--shadow-soft);
  color: #fff;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
  -webkit-appearance: none;
}
  .btn[disabled] {
    opacity: 0.5;
    cursor: progress;
  }

.field-submit {
  margin-bottom: 0;
}

/* validation (element-qualified so it outranks the field background rules above) */
.contact-form input.is-invalid,
.contact-form textarea.is-invalid,
.styled-select select.is-invalid {
  background: rgba(199, 0, 0, 0.06);
}

.field-acceptance.is-invalid .checkbox-label span {
  color: var(--color-error);
}

.field-error {
  display: block;
  position: relative;
  margin-top: 3px;
  padding: 2px 6px 4px 1.375em;
  font-size: 12px;
  line-height: 16px;
  color: var(--color-error);
}
  .field-error::before {
    content: '\f148';
    position: absolute;
    left: 4px;
    top: 2px;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transform: scaleX(-1);
  }

.form-response {
  position: relative;
  margin: 1.375em 0 0;
  padding: 1.375em 1.375em 1.375em 3.4375em;
  border-left: 5px solid var(--color-error);
  border-radius: 0 2px 2px 0;
  background: rgba(199, 0, 0, 0.06);
  color: var(--color-error);
  font-weight: 700;
}
  .form-response::before {
    content: '\f06a';
    position: absolute;
    left: 1.25em;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.25rem;
  }
  .form-response.is-success {
    border-color: var(--color-success);
    background: rgba(68, 157, 68, 0.06);
    color: var(--color-success);
  }
    .form-response.is-success::before {
      content: '\f1d8';
    }

@media (min-width: 640px) {
  .form-row-1-1,
  .form-row-3-1,
  .form-row-1-3 {
    grid-template-columns: 1fr 1fr;
  }

  .form-row-1-2-2 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* The old form sized its columns as a share of (row width + gutter) minus the gutter:
   20% / 40% / 40% and 75% / 25%. With a 25px gutter that is p * width - (1 - p) * 25px. */
@media (min-width: 920px) {
  .form-row-1-2-2 {
    grid-template-columns: calc(20% - 20px) 1fr 1fr;
  }

  .form-row-3-1 {
    grid-template-columns: 1fr calc(25% - 18.75px);
  }

  .form-row-1-3 {
    grid-template-columns: calc(25% - 18.75px) 1fr;
  }

  .btn:hover,
  .btn:focus-visible {
    opacity: 0.75;
    text-decoration: none;
  }
}

/* ######################################## *\
    LEGAL TEXTS
\* ######################################## */

.legal-content ul {
  margin: 0.6875em 0 1.375em;
  padding: 0;
  list-style: none;
}
  .legal-content p + ul {
    margin-top: -0.6875em;
  }

.legal-content li {
  padding: 4px 0 4px 1.375em;
}
  .legal-content li::before {
    content: '\f105';
    display: inline-block;
    position: relative;
    top: -1px;
    width: 0.859375em;
    margin-left: -0.859375em;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.875rem;
    vertical-align: middle;
  }

.legal-content > :last-child {
  margin-bottom: 0;
}

.notice-box {
  padding: 6px 10px;
  border: 1px solid #000;
}

/* ######################################## *\
    FOOTER
\* ######################################## */

main-footer {
  display: block;
}

.site-footer {
  padding: 1.375em var(--gutter);
  background: var(--color-footer);
}

.footer-menu {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.footer-menu a {
  display: block;
  padding: 1.03125em 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.875rem;
  text-align: center;
  color: #fff;
}
  .footer-menu li:last-child a {
    border-bottom: 0;
  }

@media (min-width: 640px) {
  .footer-menu {
    display: flex;
    justify-content: center;
  }

  .footer-menu li {
    position: relative;
    margin-left: 25px;
  }
    .footer-menu li:first-child {
      margin-left: 0;
    }
    .footer-menu li::before {
      content: '';
      position: absolute;
      z-index: 1;
      left: -13px;
      top: 2px;
      width: 1px;
      height: 16px;
      background: rgba(255, 255, 255, 0.24);
    }
    .footer-menu li:first-child::before {
      display: none;
    }

  .footer-menu a {
    padding: 0;
    border-bottom: 0;
    text-align: left;
  }
}
