/*
 * 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 {
  /* colors - Amazon Ads design tokens */
  --color-background: #fff;
  --color-background-alt: #f5f3ef;
  --color-text: #161d26;
  --color-text-body: #252f3e;
  --color-text-secondary: #36475d;
  --color-accent: #f55600;
  --color-accent-hover: #e55800;
  --color-accent-dark: #cc4e00;
  --color-border: #cecac0;
  --color-border-light: #e5e1d6;
  --color-surface: #fff;
  --color-dark: #161d26;
  --color-dark-surface: #252f3e;
  --color-focus: #005ee5;

  /* legacy vars for EDS compatibility */
  --background-color: var(--color-background-alt);
  --light-color: var(--color-surface);
  --dark-color: var(--color-dark);
  --text-color: var(--color-text);
  --link-color: var(--color-text);
  --link-hover-color: var(--color-accent);

  /* fonts */
  --font-body: 'Amazon Ember', -apple-system, blinkmacsystemfont, 'Segoe UI', roboto, sans-serif;
  --font-heading: 'Ember Modern Display Standard', 'Amazon Ember', -apple-system, blinkmacsystemfont, sans-serif;
  --font-mono: 'Amazon Ember Mono', 'Courier New', monospace;

  /* legacy font vars */
  --body-font-family: var(--font-body);
  --heading-font-family: var(--font-heading);

  /* body sizes */
  --body-font-size-m: 18px;
  --body-font-size-s: 16px;
  --body-font-size-xs: 14px;

  /* heading sizes (mobile) */
  --heading-font-size-xxl: 48px;
  --heading-font-size-xl: 40px;
  --heading-font-size-l: 32px;
  --heading-font-size-m: 24px;
  --heading-font-size-s: 20px;
  --heading-font-size-xs: 18px;

  /* nav */
  --nav-height: 60px;
}

/* font fallbacks */
@font-face {
  font-family: 'Amazon Ember';
  size-adjust: 100%;
  src: local('Arial');
}

@font-face {
  font-family: 'Ember Modern Display Standard';
  size-adjust: 105%;
  src: local('Arial Black');
}

@font-face {
  font-family: 'Amazon Ember Mono';
  size-adjust: 95%;
  src: local('Courier New');
}

/* desktop heading sizes */
@media (width >= 900px) {
  :root {
    --heading-font-size-xxl: 80px;
    --heading-font-size-xl: 64px;
    --heading-font-size-l: 48px;
    --heading-font-size-m: 28px;
    --heading-font-size-s: 24px;
    --heading-font-size-xs: 20px;
  }
}

body {
  display: none;
  margin: 0;
  background-color: var(--color-background);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: var(--body-font-size-s);
  line-height: 1.5;
}

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;
}

/* headings */
h1,
h2,
h3,
h4,
h5 {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.32px;
  scroll-margin: 40px;
  color: var(--color-text);
}

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); }

/* eyebrow label (h6) */
h6 {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
  font-family: var(--font-mono);
  font-size: var(--body-font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1;
  color: var(--color-text-body);
  scroll-margin: 40px;
}

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(--color-background-alt);
  overflow-x: auto;
  white-space: pre;
}

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

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

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

a:hover {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 0.15rem;
  text-underline-offset: 2px;
}

/* 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%;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 15px 18px;
  font-family: var(--font-body);
  font-size: 18.66px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s;
}

a.button:any-link:hover {
  text-decoration: none;
}

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

/* primary: orange filled */
a.button.primary,
button.button.primary {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
  color: #fff;
}

a.button.primary:hover,
a.button.primary:focus-visible,
button.button.primary:hover,
button.button.primary:focus-visible {
  border-color: var(--color-accent-hover);
  background-color: var(--color-accent-hover);
  color: #fff;
}

/* secondary: dark filled */
a.button.secondary,
button.button.secondary {
  border-color: var(--color-dark);
  background-color: var(--color-dark);
  color: #fff;
}

a.button.secondary:hover,
a.button.secondary:focus-visible,
button.button.secondary:hover,
button.button.secondary:focus-visible {
  border-color: var(--color-dark-surface);
  background-color: var(--color-dark-surface);
  color: #fff;
}

/* accent: large hero CTA */
a.button.accent,
button.button.accent {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
  color: #fff;
  border-radius: 12px;
  padding: 15px 24px;
  font-size: 32px;
  font-family: var(--font-heading);
}

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

main img {
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 8px;
}

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

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

/* section default-content headings are centered */
main > .section > .default-content-wrapper {
  text-align: center;
}

main > .section > .default-content-wrapper p {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

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

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

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

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

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

main .section.dark {
  background-color: var(--color-dark);
  border-radius: 8px;
  margin: 40px 16px;
  padding: 64px 24px;
  color: #fff;
}

main .section.dark h1,
main .section.dark h2,
main .section.dark h3,
main .section.dark h4,
main .section.dark h5,
main .section.dark h6,
main .section.dark p {
  color: #fff;
}

main .section.dark a.button.primary {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

@media (width >= 900px) {
  main .section.dark {
    margin: 40px 32px;
    padding: 64px;
  }
}
