@import url('brand.css');

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

html {
  font-size: var(--root-font-size);
}

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 spacing lives on the element itself so the space is reserved before the block loads */
header {
  min-height: var(--nav-height);
  padding: 4rem 1rem 1rem;
}

@media (width >= 32em) {
  header {
    padding: 0.5rem 1rem 1rem;
  }
}

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: 1em;
  margin-bottom: 0.5em;
  color: var(--text-color);
  font-family: var(--heading-font-family);
  font-weight: 900;
  line-height: 1.25;
  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;
  margin-bottom: 1rem;
}

ol,
ul {
  padding-left: 2rem;
}

strong,
b {
  font-weight: 900;
}

code,
pre,
samp {
  font-family: var(--code-font-family);
  font-size: inherit;
}

code {
  border-radius: 3px;
  background-color: var(--code-background-color);
  color: var(--dark-color);
}

pre {
  margin-bottom: 0.88em;
  padding: 1.125em;
  background-color: var(--light-color);
  line-height: 1.11;
  overflow-x: auto;
  white-space: pre;
}

pre code {
  border-radius: 0;
  background-color: transparent;
}

blockquote {
  margin: 2rem 40px 2rem 0.5rem;
  border-left: 5px solid var(--dark-color);
  padding: 0.5rem;
  font-style: italic;
}

blockquote,
blockquote p {
  font-size: var(--body-font-size-l);
  font-style: italic;
}

hr {
  margin: 2rem 0;
  border: 0;
  border-bottom: 1px solid var(--rule-color);
}

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

/* links: the theme draws its own underline with a background gradient */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
}

main a:any-link {
  background-image: var(--link-underline);
  text-shadow: var(--background-color) 1px 0 0, var(--background-color) -1px 0 0;
}

main a:hover,
main a:focus,
main a:active {
  color: var(--link-hover-color);
  background-image: var(--link-hover-underline);
}

main a:any-link:has(picture, img) {
  background-image: none;
}

/* buttons */
main .button-container,
main .button-wrapper {
  display: inline;
}

main a.button:any-link {
  margin: 0;
  border: none;
  border-radius: 0;
  padding: 0;
  background: none;
  color: var(--link-color);
  font-size: inherit;
  font-weight: inherit;
  text-decoration: underline;
  white-space: normal;
}

/* the theme's solid blue button (.button.button-blue) */
button.button,
a.button.primary:any-link,
a.button.accent:any-link {
  box-sizing: border-box;
  display: inline-block;
  height: auto;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 0.5rem 1rem;
  background-color: var(--link-color);
  background-image: none;
  color: var(--background-color);
  font-family: var(--heading-font-family);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 1px;
  line-height: 1.125rem;
  text-decoration: none;
  text-shadow: none;
  vertical-align: middle;
  cursor: pointer;
  transition: box-shadow 0.1s ease-out, background-color 0.1s ease-out;
}

button.button:hover,
a.button.primary:hover,
a.button.accent:hover {
  color: var(--background-color);
  background-image: none;
  opacity: 0.875;
}

button.button:focus-visible,
a.button.primary:focus-visible,
a.button.accent:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 50%), 0 0 1px 4px rgb(0 118 223 / 50%);
}

button.button:active,
a.button.primary:active,
a.button.accent:active {
  box-shadow: inset 0 0 0 32px rgb(0 0 0 / 12.5%), inset 0 2px 3px 0 rgb(0 0 0 / 25%);
}

button.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

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

/* content images are framed, as in the original theme */
main .default-content-wrapper picture img {
  box-sizing: border-box;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--image-border-color);
  border-radius: 5px;
  padding: 6px;
}

/* sections: one centred reading column */
main > .section {
  margin: 0;
}

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

main > .section:first-of-type {
  padding-top: var(--section-padding);
}

main > .section:last-of-type {
  padding-bottom: var(--section-padding);
}

/* the listing section holds the reading column plus the post browser beside it */
@media (width >= 64em) {
  main > .section.blog-list-container > .blog-list-wrapper {
    max-width: calc(var(--content-max-width) + var(--browser-gap) + var(--browser-width) + 2 * var(--section-padding));
  }
}

@media (width >= 32em) {
  blockquote {
    margin-left: 2rem;
    padding: 2rem;
  }
}

/* section metadata */
main .section.light,
main .section.highlight {
  background-color: var(--light-color);
}

/* blog post */
.blog-post main .post-meta {
  margin: 0 0 1rem;
  padding: 0.25em 0;
  color: var(--dark-color);
  font-style: italic;
  font-weight: 300;
}

.blog-post main .post-meta a:any-link {
  color: var(--dark-color);
  text-decoration: none;
}

.blog-post main .post-read-time {
  display: block;
  padding-top: 0.25em;
  font-size: 0.707rem;
  line-height: 1.5;
}

.blog-post main > .section:first-of-type h1:first-child {
  margin-top: 1em;
}

main > .section.post-footer {
  font-style: italic;
  text-align: center;
}

main > .section.post-footer > .default-content-wrapper {
  margin-top: 0.75rem;
  padding: 1rem 0;
}

main > .section.post-footer .default-content-wrapper picture img {
  display: inline-block;
  width: 100px;
  height: 100px;
  margin: 2rem 0;
  border: 0;
  border-radius: 50%;
  padding: 0;
  object-fit: cover;
}

main > .section.post-footer .default-content-wrapper p:has(picture) {
  margin: 0;
}
