/*
 * Copyright 2020 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

:root {
  /* SAFRA palette */
  --ink: #171719;
  --muted: #68666a;
  --cream: #f5f0e7;
  --red: #eb003f;
  --red-dark: #bf0034;
  --yellow: #ffd43b;
  --line: rgb(23 23 25 / 14%);

  /* colors */
  --background-color: #fffdf9;
  --light-color: var(--cream);
  --dark-color: var(--muted);
  --text-color: var(--ink);
  --link-color: var(--red);
  --link-hover-color: var(--red-dark);

  /* fonts */
  --body-font-family: 'Source Sans 3', 'Source Sans 3 Fallback', sans-serif;
  --heading-font-family: 'Source Sans 3', 'Source Sans 3 Fallback', 'Arial Black', sans-serif;

  /* body sizes */
  --body-font-size-m: 17px;
  --body-font-size-s: 16px;
  --body-font-size-xs: 15px;

  /* heading sizes */
  --heading-font-size-xxl: 55px;
  --heading-font-size-xl: 44px;
  --heading-font-size-l: 34px;
  --heading-font-size-m: 27px;
  --heading-font-size-s: 24px;
  --heading-font-size-xs: 22px;

  /* layout */
  --max-width: 1240px;
  --gutter: 24px;
  --nav-height: 64px;

  /*
   * horizontal padding that lets a full-bleed block keep its content in the
   * --max-width column; resolves against the element it is used on
   */
  --content-inset: max(var(--gutter), calc((100% - var(--max-width)) / 2));

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* fallback fonts */
@font-face {
  font-family: 'Source Sans 3 Fallback';
  size-adjust: 98%;
  src: local('Arial');
}

@media (width <= 640px) {
  :root {
    --gutter: 18px;
  }
}

@media (width >= 900px) {
  :root {
    /* heading sizes */
    --heading-font-size-xxl: 45px;
    --heading-font-size-xl: 36px;
    --heading-font-size-l: 28px;
    --heading-font-size-m: 22px;
    --heading-font-size-s: 20px;
    --heading-font-size-xs: 18px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  display: none;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-m);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.appear {
  display: block;
}

header {
  height: var(--nav-height);
}

header .header,
footer .footer {
  visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
  font-family: var(--heading-font-family);
  font-weight: 700;
  line-height: 1.25;
  scroll-margin: 40px;
}

h1,
h2,
h3 {
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: var(--heading-font-size-xxl); }
h2 { font-size: var(--heading-font-size-xl); }
h3 { font-size: var(--heading-font-size-l); }
h4 { font-size: var(--heading-font-size-m); }
h5 { font-size: var(--heading-font-size-s); }
h6 { font-size: var(--heading-font-size-xs); }

p,
dl,
ol,
ul,
pre,
blockquote {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
}

code,
pre {
  font-size: var(--body-font-size-s);
}

pre {
  padding: 16px;
  border-radius: 8px;
  background-color: var(--light-color);
  overflow-x: auto;
  white-space: pre;
}

main > div {
  margin: 40px 16px;
}

input,
textarea,
select,
button {
  font: inherit;
}

/* links */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #1265a8;
  outline-offset: 3px;
}

/* buttons */
p.button-wrapper {
  margin: 12px 0;
}

a.button:any-link,
button.button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 50px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 24px;
  gap: 10px;
  font: inherit;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  a.button:any-link,
  button.button {
    transition:
      background-color 200ms ease,
      transform 200ms var(--ease);
  }

  a.button:hover,
  button.button:hover {
    transform: translateY(-3px);
  }
}

@media (width <= 640px) {
  a.button:any-link,
  button.button {
    min-height: 48px;
    padding: 0 16px;
    font-size: 0.92rem;
  }
}

a.button[aria-disabled="true"],
button.button:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

a.button.primary,
button.button.primary {
  border-color: var(--yellow);
  background-color: var(--yellow);
  color: var(--ink);
}

a.button.primary:hover,
a.button.primary:focus-visible,
button.button.primary:hover,
button.button.primary:focus-visible {
  border-color: white;
  background-color: white;
  color: var(--ink);
}

a.button.primary[aria-disabled="true"],
a.button.primary[aria-disabled="true"]:hover,
a.button.primary[aria-disabled="true"]:focus-visible,
button.button.primary:disabled,
button.button.primary:disabled:hover,
button.button.primary:disabled:focus-visible {
  background-color: var(--light-color);
  border-color: var(--light-color);
  color: var(--dark-color);
}

a.button.secondary,
button.button.secondary {
  border-color: var(--text-color);
  background-color: transparent;
  color: var(--text-color);
}

a.button.secondary:hover,
a.button.secondary:focus-visible,
button.button.secondary:hover,
button.button.secondary:focus-visible {
  border-color: var(--text-color);
  background-color: var(--text-color);
  color: var(--background-color);
}

a.button.secondary[aria-disabled="true"],
a.button.secondary[aria-disabled="true"]:hover,
a.button.secondary[aria-disabled="true"]:focus-visible,
button.button.secondary:disabled,
button.button.secondary:disabled:hover,
button.button.secondary:disabled:focus-visible {
  background-color: var(--light-color);
  border-color: var(--light-color);
  color: var(--dark-color);
}

/* high-impact call-to-action */
a.button.accent,
button.button.accent {
  border-color: var(--link-color);
  background-color: var(--link-color);
  color: white;
}

a.button.accent:hover,
a.button.accent:focus-visible,
button.button.accent:hover,
button.button.accent:focus-visible {
  border-color: var(--link-hover-color);
  background-color: var(--link-hover-color);
  color: white;
}

a.button.accent[aria-disabled="true"],
a.button.accent[aria-disabled="true"]:hover,
a.button.accent[aria-disabled="true"]:focus-visible,
button.button.accent:disabled,
button.button.accent:disabled:hover,
button.button.accent:disabled:focus-visible {
  background-color: var(--light-color);
  border-color: var(--light-color);
  color: var(--dark-color);
}

main img {
  max-width: 100%;
  width: auto;
  height: auto;
}

.icon {
  display: inline-block;
  height: 24px;
  width: 24px;
}

.icon img {
  height: 100%;
  width: 100%;
}

/* eyebrow label shared by the SAFRA campaign blocks */
.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.19em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* campaign headings: authored italics render as the accent colour */
.section-heading {
  letter-spacing: normal;
  text-wrap: wrap;
}

.section-heading span {
  color: var(--red);
}

.section-kicker::before {
  width: 26px;
  height: 2px;
  background: currentcolor;
  content: '';
}

/* sections */
main > .section {
  margin: 40px 0;
}

main > .section > div {
  max-width: var(--max-width);
  margin: auto;
  padding: 0 24px;
}

main > .section:first-of-type {
  margin-top: 0;
}

@media (width >= 900px) {
  main > .section > div {
    padding: 0 32px;
  }
}

/* section metadata */
main .section.light,
main .section.highlight {
  background-color: var(--light-color);
  margin: 0;
  padding: 40px 0;
}
