/*
 * 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 */
  --background-color: #fff;
  --light-color: #ececec;
  --dark-color: #696969;
  --text-color: #333;
  --text-muted-color: #57606c;
  --brand-primary: #041e42;
  --brand-accent: #0048c7;
  --brand-accent-hover: #0037a0;
  --link-color: #0048c7;
  --link-hover-color: #041e42;

  /* fonts */
  --body-font-family: proxima-nova, proxima-nova-fallback, "helvetica neue", helvetica, arial, sans-serif;
  --heading-font-family: var(--body-font-family);

  /* body sizes */
  --body-font-size-m: 16px;
  --body-font-size-s: 14px;
  --body-font-size-xs: 13px;
  --body-font-size-xxs: 12px;

  /* heading sizes */
  --heading-font-size-xxl: 42px;
  --heading-font-size-xl: 30px;
  --heading-font-size-l: 24px;
  --heading-font-size-m: 18px;
  --heading-font-size-s: 16px;
  --heading-font-size-xs: 14px;

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

/* fallback font tuned to match proxima-nova metrics */
@font-face {
  font-family: proxima-nova-fallback;
  size-adjust: 96%;
  src: local('Arial');
}

@media (width >= 768px) {
  :root {
    /* heading sizes */
    --heading-font-size-xxl: 48px;
    --heading-font-size-xl: 30px;
    --heading-font-size-l: 24px;
    --heading-font-size-m: 18px;
    --heading-font-size-s: 16px;
    --heading-font-size-xs: 14px;
  }
}

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 leaderboard ad slot (opt-in via `header-ads` metadata; inserted above
   the header in the eager phase). Reserve its exact height here in core — this
   CSS loads before the block's own CSS/JS, so the space is held from first
   paint and the ad placeholder decorating later causes no layout shift (CLS).
   66px on mobile, 106px from tablet up, matching the source leaderboard. */
.header-ads-container {
  min-height: 66px;
}

@media (width >= 768px) {
  .header-ads-container {
    min-height: 106px;
  }
}

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: 800;
  line-height: 1.2;
  color: #000;
  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: none;
  overflow-wrap: break-word;
}

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

/* 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: 100vmax;
  padding: 0.6em 1.4em;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

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

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

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(--brand-primary);
  background-color: transparent;
  color: var(--brand-primary);
}

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

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(--brand-accent);
  background-color: var(--brand-accent);
  color: #fff;
}

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

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

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

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

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

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

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

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

/* Dark section (Section Metadata → theme: dark). Renders on a dark background
   so a section can blend into the footer; the actual dark color is a theme
   token (defaults to the brand primary) so each brand re-skins it. Structure
   only — foreground text/links flip to a light color for contrast. */
main .section[data-theme='dark'] {
  background-color: var(--dark-section-background, var(--brand-primary));
  color: var(--dark-section-color, #fff);
  margin: 0;
  padding: 40px 0;
}

main .section[data-theme='dark'] :is(h1, h2, h3, h4, h5, h6),
main .section[data-theme='dark'] a:any-link,
main .section[data-theme='dark'] time {
  color: var(--dark-section-color, #fff);
}

/* Light section (Section Metadata → theme: light). A neutral off-white band
   (e.g. framing an ad slot). Fixed base value; not themed per brand. */
main .section[data-theme='light'] {
  background-color: #f4f5f6;
  margin: 0;
  padding: 40px 0;
}

/* Two-column section (Section Metadata → Style: two-column). The section's
   block wrappers lay out side by side on desktop and stack on mobile, so
   authors can pair two blocks (e.g. a hero carousel + a cards list) without a
   dedicated columns block. */
@media (width >= 768px) {
  main .section.two-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 32px;
    box-sizing: border-box;
  }

  main .section.two-column > div {
    max-width: none;
    margin: 0;
    padding: 0;
  }
}

/* two-column: the secondary column often holds a heading + link list (e.g. a
   "What's New" feed). The heading and its "View All" link share one baseline
   row; the list is plain (no dividers) with body-weight links. This is
   structure only — link color/size are look-and-feel and live in the theme. */
main .section.two-column .default-content-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 16px;
}

main .section.two-column .default-content-wrapper h2 {
  margin: 0;
}

/* "View All" sits inline after the heading; stays underlined (incl. on hover) */
main .section.two-column .default-content-wrapper > p {
  margin: 0;
}

main .section.two-column .default-content-wrapper > p a:any-link,
main .section.two-column .default-content-wrapper > p a:hover {
  font-weight: 700;
  text-decoration: underline;
}

main .section.two-column .default-content-wrapper ul {
  flex-basis: 100%;
  margin: 16px 0 0;
  padding-left: 0;
  list-style: none;
}

main .section.two-column .default-content-wrapper li {
  margin-bottom: 16px;
  line-height: 1.3;
}

/* list links are never underlined (overrides the global a:hover underline);
   weight/color/size are look-and-feel and live in the theme */
main .section.two-column .default-content-wrapper li a:any-link,
main .section.two-column .default-content-wrapper li a:hover {
  text-decoration: none;
}

/* Newsletter section (Section Metadata → Style: newsletter): on desktop a
   band with the logo + heading on the left half and the copy + sign-up button
   on the right half. Stacks on mobile. Structure only; colors are theme. */
main .section.newsletter {
  padding: 40px 0;
}

main .section.newsletter .default-content-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
}

main .section.newsletter .default-content-wrapper h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

main .section.newsletter .default-content-wrapper p {
  margin: 0;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.5;
}

/* the brand mark (authored logo image) */
main .section.newsletter .default-content-wrapper > p:first-child {
  line-height: 0;
}

main .section.newsletter .default-content-wrapper img {
  width: 96px;
  height: auto;
}

/* sign-up CTA: a fully-rounded outline pill (color/look from the theme) */
main .section.newsletter a.button {
  margin: 0;
  padding: 12px 40px;
  font-size: 19px;
  font-weight: 700;
  border-radius: 100vmax;
}

@media (width >= 900px) {
  /* columns: logo | heading | right-side content */
  main .section.newsletter .default-content-wrapper {
    grid-template-columns: auto 1fr 1fr;
    gap: 8px 32px;
  }

  main .section.newsletter .default-content-wrapper > p:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  main .section.newsletter .default-content-wrapper > h2 {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  /* right half: copy sits above the button */
  main .section.newsletter .default-content-wrapper > p:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
    align-self: end;
  }

  main .section.newsletter .default-content-wrapper > .button-wrapper {
    grid-column: 3;
    grid-row: 2;
    align-self: start;
    margin: 0;
  }
}
