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

/* fallback fonts: Arial scaled to the web fonts' widths, so text doesn't reflow when they load */
@font-face {
  font-family: figtree-fallback;
  size-adjust: 90%;
  src: local('Arial');
}

@font-face {
  font-family: bricolage-fallback;
  size-adjust: 86%;
  src: local('Arial Bold'), local('Arial-BoldMT');
  font-weight: 700;
}

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: var(--line-height-body);
}

body.appear {
  display: block;
}

body > header {
  height: var(--nav-height);
}

body > header .header,
body > footer .footer {
  visibility: hidden;
}

body > header .header[data-block-status="loaded"],
body > footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 1.4em;
  margin-bottom: 0.5em;
  color: var(--heading-color);
  font-family: var(--heading-font-family);
  font-weight: 700;
  line-height: var(--line-height-heading);
  letter-spacing: -0.015em;
  text-wrap: balance;
  scroll-margin: 40px;
}

h1 {
  font-size: var(--heading-font-size-xxl);
  font-weight: 750;
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--heading-font-size-xl);
  letter-spacing: -0.025em;
}

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: 1em;
}

p {
  text-wrap: pretty;
}

blockquote {
  margin-inline: 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  background-color: var(--background-color);
}

blockquote > :last-child {
  margin-bottom: 0;
}

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

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

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

/* links: sea blue, coral underline that thickens on hover */
a:any-link {
  color: var(--link-color);
  text-decoration: underline 1px var(--link-underline-color);
  text-underline-offset: 3px;
  overflow-wrap: break-word;
}

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

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

/* buttons: harbour pill */
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: 0;
  border-radius: 999px;
  padding: 12px 22px;
  background-color: var(--band-color);
  color: var(--surface-color);
  font-family: var(--heading-font-family);
  font-size: var(--body-font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.button:hover,
button.button:hover {
  color: var(--on-band-hover-color);
}

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

a.button.secondary,
button.button.secondary {
  box-shadow: inset 0 0 0 2px var(--band-color);
  background-color: transparent;
  color: var(--band-color);
}

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

/* hides content visually but keeps it for assistive technology (e.g. the homepage h1) */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* the slab: a white postcard on the sand, holding the page's sections and the explore band */
main {
  box-sizing: border-box;
  max-width: var(--content-width);
  margin: 0 auto;
  border-radius: var(--radius-slab) var(--radius-slab) 0 0;
  background-color: var(--surface-color);
  box-shadow: var(--slab-shadow);
}

main > .section {
  margin: 0;
  padding: var(--section-padding) var(--gutter) 0;
}

main > .section:empty {
  display: none;
}

main > .section > div {
  max-width: var(--measure);
  margin: 0 auto;
}

/* post pages: date line, title, then the body in one reading column */
main .post-date {
  margin: 0 0 8px;
  color: var(--text-color);
  font-family: var(--heading-font-family);
  font-size: var(--body-font-size-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

main .post-card > h1:first-child {
  margin: 0 0 32px;
}

main .post-card > :first-child {
  margin-top: 0;
}

/* post photos: column width at most, never upscaled, rounded; tall photos capped to the screen */
main p:has(> picture),
main p:has(> a > picture) {
  margin: 24px 0;
  text-align: center;
}

main p > picture img,
main p > a > picture img {
  display: block;
  margin-inline: auto;
  max-height: 85vh;
  border-radius: var(--radius);
}

main p > a:any-link:has(> picture) {
  display: inline-block;
  border-radius: var(--radius);
}

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

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

/* explore band: the shared archive months and labels, at the end of every page */
main > .sidebar {
  margin-top: var(--section-padding);
  padding: var(--section-padding) var(--gutter);
  border-top: 1px solid var(--card-border-color);
}

main > .sidebar .explore-groups {
  display: grid;
  gap: 40px;
  max-width: var(--measure);
  margin: 0 auto;
}

main > .sidebar h2 {
  margin: 0 0 8px;
  font-size: var(--heading-font-size-l);
  letter-spacing: -0.015em;
}

main > .sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

main > .sidebar li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--list-separator-color);
  font-size: var(--body-font-size-s);
  break-inside: avoid;
}

main > .sidebar li a:any-link {
  text-decoration: none;
}

main > .sidebar li a:hover {
  text-decoration: underline 2px var(--link-underline-color);
}

main > .sidebar .explore-labels ul {
  columns: 9.25rem 2;
  column-gap: 24px;
}

@media (width >= 600px) {
  main {
    width: calc(100% - 48px);
    border-radius: var(--radius-slab);
  }

  main > .sidebar .explore-labels ul {
    column-gap: 40px;
  }
}

@media (width >= 900px) {
  main > .sidebar .explore-groups {
    grid-template-columns: 1fr 2fr;
    gap: 64px;
  }
}

/* editorial motion: photos and the explore band settle in as they scroll into view.
   Decorative only — without scroll-timeline support, or with reduced motion, nothing moves. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) and (animation-range: entry) {
    main p:has(> picture),
    main p:has(> a > picture),
    main > .sidebar .explore-group {
      animation: settle-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
  }

  main p > a > picture img {
    transition: transform 900ms var(--ease-entrance);
  }

  main p > a:any-link:has(> picture) {
    overflow: clip;
  }

  main p > a:hover > picture img {
    transform: scale(1.02);
  }
}

@keyframes settle-in {
  from { opacity: 0; }
}

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