/*
 * 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 — calm teal + warm sand; all text pairings meet WCAG AA */
  --color-ink: #1b2a29; /* 14.6:1 on white */
  --color-muted: #4a5b59; /* 6.9:1 on white, 6.2:1 on sand */
  --color-primary: #1e5b56; /* 7.7:1 on white, white text 7.7:1 */
  --color-primary-dark: #143f3c;
  --color-primary-soft: #e5efec;
  --color-sand: #f6f1e9;
  --color-sand-dark: #ebe3d6;
  --color-accent: #b5773f; /* decorative only, never text */
  --color-border: #d7e0dd;
  --background-color: #fff;
  --light-color: var(--color-sand);
  --dark-color: var(--color-primary-dark);
  --text-color: var(--color-ink);
  --link-color: var(--color-primary);
  --link-hover-color: var(--color-primary-dark);
  --focus-color: #0b6bcb;

  /* fonts */
  --body-font-family: source-sans, source-sans-fallback, system-ui, sans-serif;
  --heading-font-family: lora, lora-fallback, georgia, serif;

  /* body sizes */
  --body-font-size-m: 1.125rem;
  --body-font-size-s: 1rem;
  --body-font-size-xs: 0.875rem;

  /* heading sizes */
  --heading-font-size-xxl: clamp(2.25rem, 1.7rem + 2.2vw, 3.5rem);
  --heading-font-size-xl: clamp(1.875rem, 1.5rem + 1.5vw, 2.625rem);
  --heading-font-size-l: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  --heading-font-size-m: 1.375rem;
  --heading-font-size-s: 1.1875rem;
  --heading-font-size-xs: 1.0625rem;

  /* layout */
  --content-width: 1160px;
  --text-width: 46rem;
  --gutter: 24px;
  --radius-s: 8px;
  --radius-m: 16px;
  --radius-l: 28px;
  --shadow-s: 0 1px 2px rgb(27 42 41 / 6%), 0 2px 8px rgb(27 42 41 / 6%);
  --shadow-m: 0 2px 6px rgb(27 42 41 / 6%), 0 12px 32px rgb(27 42 41 / 10%);

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

/* fallback fonts */
@font-face {
  font-family: lora-fallback;
  size-adjust: 112%;
  src: local('Georgia'), local('Times New Roman');
}

@font-face {
  font-family: source-sans-fallback;
  size-adjust: 93%;
  src: local('Arial');
}

@media (width >= 900px) {
  :root {
    --body-font-size-m: 1.1875rem;
    --gutter: 40px;
    --nav-height: 84px;
  }
}

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.65;
  -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: 1.6em;
  margin-bottom: 0.5em;
  color: var(--color-ink);
  font-family: var(--heading-font-family);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
  scroll-margin: calc(var(--nav-height) + 16px);
}

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

h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child {
  margin-top: 0;
}

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

p,
li {
  overflow-wrap: break-word;
  hyphens: auto;
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 1.25em;
}

li + li {
  margin-top: 0.4em;
}

li::marker {
  color: var(--color-primary);
}

strong {
  font-weight: 650;
}

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

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

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

/* links */
a:any-link {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentcolor 45%, transparent);
  overflow-wrap: break-word;
  transition: color 0.15s, text-decoration-color 0.15s;
}

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

:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 3px;
  border-radius: 4px;
}

/* skip link */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-s);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
  color: #fff;
}

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

a.button:any-link,
button.button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  max-width: 100%;
  min-height: 48px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.6em 1.5em;
  font: inherit;
  font-size: var(--body-font-size-s);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

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

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

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

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

a.button.secondary:hover,
a.button.secondary:focus-visible,
button.button.secondary:hover,
button.button.secondary:focus-visible {
  background-color: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

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

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

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

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

main > .section > div {
  box-sizing: border-box;
  max-width: var(--content-width);
  margin: auto;
  padding: 0 var(--gutter);
}

/* readable measure for running text */
main > .section > .default-content-wrapper {
  max-width: calc(var(--text-width) + 2 * var(--gutter));
}

main > .section > div + div {
  margin-top: 40px;
}

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

/* sections below the first are laid out and painted only when they approach the viewport */
main > .section:not(:first-of-type, .light, .highlight, .sand, .soft) {
  content-visibility: auto;
  contain-intrinsic-size: auto 800px;
  overflow-clip-margin: 48px;
}

/* containment stops edge margins from collapsing into the section margin; section margins are
   always larger than these, so dropping them reproduces the collapsed result exactly */
main > .section:not(:first-of-type, .light, .highlight, .sand, .soft) > div:first-child > :first-child,
main > .section:not(:first-of-type, .light, .highlight, .sand, .soft) > div:first-child > :is(blockquote, ul, ol, figure):first-child > :first-child {
  margin-top: 0;
}

main > .section:not(:first-of-type, .light, .highlight, .sand, .soft) > div:last-child > :last-child,
main > .section:not(:first-of-type, .light, .highlight, .sand, .soft) > div:last-child > :is(blockquote, ul, ol, figure):last-child > :last-child {
  margin-bottom: 0;
}

main > .section:last-of-type {
  margin-bottom: 96px;
}

@media (width >= 900px) {
  main > .section {
    margin: 80px 0;
  }
}

/* images in running text */
main .default-content-wrapper picture img {
  display: block;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}

main .default-content-wrapper p:has(> picture:only-child) {
  margin: 32px 0;
}

/* image at the start of a text paragraph: float beside the text on wider screens */
main .default-content-wrapper p.has-inline-image > picture img {
  margin-bottom: 20px;
}

@media (width >= 600px) {
  main .default-content-wrapper p.has-inline-image > picture {
    float: right;
    width: min(42%, 340px);
    margin: 6px 0 20px 32px;
  }

  main .default-content-wrapper p.has-inline-image > picture img {
    width: 100%;
    margin: 0;
  }
}

/* blockquote in running text */
main blockquote {
  margin: 40px 0;
  padding: 0 0 0 24px;
  border-left: 3px solid var(--color-accent);
  font-family: var(--heading-font-family);
  font-size: var(--heading-font-size-s);
  font-style: italic;
}

/* page title band (built in scripts.js for pages without a hero) */
main > .section.page-title {
  margin: 0;
  padding: 56px 0 48px;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--color-primary-soft) 0%, transparent 60%),
    var(--color-sand);
}

main > .section.page-title h1 {
  margin: 0;
}

main > .section.page-title .default-content-wrapper::before {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  margin-bottom: 20px;
  border-radius: 2px;
  background: var(--color-accent);
}

main > .section.page-title + .section {
  margin-top: 56px;
}

@media (width >= 900px) {
  main > .section.page-title {
    padding: 88px 0 72px;
  }

  main > .section.page-title + .section {
    margin-top: 72px;
  }
}

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

main .section.soft {
  margin: 0;
  padding: 64px 0;
  background-color: var(--color-primary-soft);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
