/*
 * 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.
 */

/* Arial scaled to Public Sans widths, so text barely moves when the web font swaps in */
@font-face {
  font-family: "Public Sans Fallback";
  font-weight: 400;
  size-adjust: 103.6%;
  src: local("Arial");
}

@font-face {
  font-family: "Public Sans Fallback";
  font-weight: 700;
  size-adjust: 98.5%;
  src: local("Arial Bold"), local("Arial");
}

:root {
  /* colors sampled from the SecurGov logo, darkened to meet WCAG AA contrast on white */
  --sg-black: #181c28;
  --sg-white: #fff;
  --sg-navy: #067a88;
  --sg-blue: #06727f;
  --sg-focus: #00b3c7;
  --sg-red: #067a88;
  --sg-red-hover: #06727f;
  --sg-red-active: #055f6a;
  --sg-grey-50: #f4f7f9;
  --sg-grey-200: #dee3e5;
  --sg-grey-500: #929ea4;
  --sg-grey-700: #646974;
  --background-color: var(--sg-white);
  --light-color: var(--sg-grey-50);
  --dark-color: var(--sg-black);
  --text-color: var(--sg-black);
  --link-color: var(--sg-navy);
  --link-hover-color: var(--sg-blue);

  /* fonts */
  --body-font-family: "Public Sans", "Public Sans Fallback", arial, sans-serif;
  --heading-font-family: "Public Sans", "Public Sans Fallback", arial, sans-serif;

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

  /* heading sizes */
  --heading-font-size-xxl: 40px;
  --heading-font-size-xl: 32px;
  --heading-font-size-l: 26px;
  --heading-font-size-m: 22px;
  --heading-font-size-s: 20px;
  --heading-font-size-xs: 18px;

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

@media (width >= 900px) {
  :root {
    --heading-font-size-xxl: 48px;
    --heading-font-size-xl: 38px;
    --heading-font-size-l: 30px;
    --nav-height: 124px;
  }
}

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

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.2;
  scroll-margin: 40px;
}

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: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: break-word;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration-thickness: 2px;
}

/* stylelint-disable no-descending-specificity -- shared focus treatment precedes component button variants */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sg-focus);
  outline-offset: 2px;
}

/* buttons */
a.button:any-link,
button {
  box-sizing: border-box;
  display: inline-block;
  max-width: 100%;
  margin: 12px 0;
  min-height: 48px;
  border: 2px solid var(--sg-red);
  border-radius: 6px;
  padding: 10px 24px;
  font-family: var(--body-font-family);
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  background-color: var(--sg-red);
  color: var(--sg-white);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.button:hover,
a.button:focus,
button:hover,
button:focus {
  border-color: var(--sg-red-hover);
  background-color: var(--sg-red-hover);
  cursor: pointer;
}

button:disabled,
button:disabled:hover {
  background-color: var(--light-color);
  cursor: unset;
}

a.button.secondary,
button.secondary {
  background-color: unset;
  border-color: var(--sg-navy);
  color: var(--sg-navy);
}
/* stylelint-enable no-descending-specificity */

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: 40px 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 */
main .section.light,
main .section.highlight {
  background-color: var(--light-color);
  margin: 0;
  padding: 40px 0;
}

::selection {
  background: var(--sg-navy);
  color: var(--sg-white);
}

html {
  scrollbar-color: var(--sg-grey-700) var(--sg-grey-50);
}
