/* Editorial motion layer: loaded after the site-specific theme overrides. */

#page-header.full_page {
  height: min(840px, 88vh) !important;
  height: min(840px, 88svh) !important;
  min-height: 560px;
  isolation: isolate;
  overflow: hidden;
}

#page-header.full_page::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  background:
    linear-gradient(90deg, rgba(9, 11, 15, 0.82) 0%, rgba(9, 11, 15, 0.5) 36%, rgba(9, 11, 15, 0.06) 66%),
    linear-gradient(0deg, rgba(9, 11, 15, 0.34) 0%, rgba(9, 11, 15, 0) 42%);
  content: '';
  pointer-events: none;
}

#page-header.full_page::after {
  position: absolute;
  inset: 18px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.24);
  content: '';
  pointer-events: none;
}

#page-header.full_page #nav,
#page-header.full_page #site-info,
#page-header.full_page #scroll-down {
  z-index: 3;
}

#page-header.full_page #site-info::before {
  margin-bottom: 18px;
  padding: 8px 12px;
  content: 'CHZZZ / WEB + DEVOPS + FIELD NOTES';
}

#page-header.full_page #site-title {
  position: relative;
  text-shadow: 3px 3px 0 rgba(120, 34, 27, 0.9), 0 10px 24px rgba(0, 0, 0, 0.52);
}

#page-header.full_page #site-title::after {
  display: block;
  margin-top: 20px;
  width: 78px;
  height: 5px;
  background: var(--editorial-yellow);
  content: '';
}

#page-header.full_page #site-subtitle {
  margin-top: 17px;
}

#page-header.full_page #scroll-down {
  border: 1px solid rgba(255, 255, 255, 0.72);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

#page-header.full_page #scroll-down:hover,
#page-header.full_page #scroll-down:focus-visible {
  background: var(--editorial-yellow);
  color: #17191f;
  transform: translateY(-3px);
}

#page-header.full_page #scroll-down:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.hero-motion-frame {
  position: absolute;
  inset: 30px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translate3d(var(--hm-frame-x, 0px), var(--hm-frame-y, 0px), 0);
  transition: transform 0.22s ease-out;
  pointer-events: none;
}

.hero-motion-frame::before,
.hero-motion-frame::after {
  position: absolute;
  width: 32px;
  height: 32px;
  border-color: var(--editorial-yellow);
  border-style: solid;
  content: '';
}

.hero-motion-frame::before {
  top: -1px;
  left: -1px;
  border-width: 3px 0 0 3px;
}

.hero-motion-frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 3px 3px 0;
}

.hero-motion-frame__mark {
  position: absolute;
  right: 94px;
  bottom: 15px;
  padding: 5px 8px;
  background: rgba(9, 11, 15, 0.7);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

/* Issue index keeps the home grid intact while giving the feed a clear opening beat. */
#page-header.full_page + #content-inner {
  grid-template-areas:
    'edition edition'
    'posts profile';
}

.editorial-index {
  grid-area: edition;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  min-height: 54px;
  border-top: 2px solid var(--editorial-ink);
  border-bottom: 1px solid var(--editorial-line);
  background: transparent;
  color: var(--editorial-ink);
}

.editorial-index__lead,
.editorial-index__count {
  display: flex;
  align-items: center;
  min-height: 52px;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.2;
}

.editorial-index__lead {
  padding: 0 16px;
  border-right: 1px solid var(--editorial-line);
  background: var(--editorial-ink);
  color: var(--editorial-paper);
}

.editorial-index__topics {
  display: flex;
  align-items: stretch;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.editorial-index__topics::-webkit-scrollbar {
  display: none;
}

.editorial-index__topic {
  display: flex;
  align-items: center;
  flex: 1 0 auto;
  padding: 0 16px;
  border-right: 1px solid var(--editorial-line);
  color: var(--editorial-muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.editorial-index__topic::before {
  display: inline-block;
  margin-right: 8px;
  width: 6px;
  height: 6px;
  background: var(--editorial-red);
  content: '';
}

.editorial-index__topic:nth-child(2)::before {
  background: var(--editorial-yellow);
}

.editorial-index__topic:nth-child(3)::before {
  background: var(--editorial-blue);
}

.editorial-index__count {
  padding: 0 16px;
  color: var(--editorial-ink);
}

/* Cards gain depth only after the script has confirmed the relevant page. */
html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item {
  --hm-card-lift: 0px;
  --hm-card-rotate-x: 0deg;
  --hm-card-rotate-y: 0deg;
  --hm-reveal-y: 0px;
  transform: perspective(1100px) translate3d(0, calc(var(--hm-card-lift) + var(--hm-reveal-y)), 0) rotateX(var(--hm-card-rotate-x)) rotateY(var(--hm-card-rotate-y));
  transition: transform 0.32s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.42s ease, box-shadow 0.32s ease;
}

html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item::before {
  position: absolute;
  inset: 10px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.28);
  content: '';
  opacity: 0.58;
  pointer-events: none;
  transition: inset 0.32s ease, opacity 0.32s ease;
}

html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item.hm-reveal {
  opacity: 0;
  --hm-reveal-y: 28px;
}

html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item.hm-reveal.is-visible {
  opacity: 1;
  --hm-reveal-y: 0px;
  transition-delay: var(--hm-reveal-delay, 0ms);
}

html.hm-enhanced #page-header.full_page + #content-inner > #aside-content.hm-profile-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

html.hm-enhanced #page-header.full_page + #content-inner > #aside-content.hm-profile-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 130ms;
}

@media (hover: hover) and (pointer: fine) {
  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:hover,
  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:focus-within {
    --hm-card-lift: -6px;
    box-shadow: 0 24px 48px rgba(32, 34, 38, 0.2);
  }

  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:hover::before,
  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:focus-within::before {
    inset: 14px;
    opacity: 0.9;
  }

  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:hover .post_cover .post-bg,
  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:focus-within .post_cover .post-bg {
    transform: scale(1.075);
  }

  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:hover > .recent-post-info,
  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item:focus-within > .recent-post-info {
    transform: translate3d(0, -4px, 0);
  }
}

#recent-posts .recent-post-items > .recent-post-item:focus-within {
  outline: 3px solid var(--editorial-yellow);
  outline-offset: 3px;
}

#recent-posts .recent-post-item > .recent-post-info {
  transition: transform 0.32s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 250;
  width: 100%;
  height: 4px;
  background: rgba(32, 34, 38, 0.14);
  pointer-events: none;
}

.reading-progress__bar {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--editorial-red);
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left center;
}

.reading-progress__bar::after {
  position: absolute;
  top: 0;
  right: -5px;
  width: 5px;
  height: 100%;
  background: var(--editorial-yellow);
  content: '';
}

@media screen and (max-width: 1100px) {
  #page-header.full_page + #content-inner {
    grid-template-areas:
      'edition'
      'posts'
      'profile';
  }
}

@media screen and (max-width: 768px) {
  #page-header.full_page {
    height: 86vh !important;
    height: 86svh !important;
    min-height: 0;
  }

  #page-header.full_page::after {
    inset: 12px;
  }

  #page-header.full_page #site-title {
    text-shadow: 2px 2px 0 rgba(120, 34, 27, 0.88), 0 8px 20px rgba(0, 0, 0, 0.48);
  }

  #page-header.full_page #site-title::after {
    margin-top: 16px;
    width: 58px;
    height: 4px;
  }

  #page-header.full_page #site-info::before {
    padding: 7px 9px;
  }

  .hero-motion-frame {
    inset: 20px;
  }

  .hero-motion-frame__mark {
    display: none;
  }

  .editorial-index {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .editorial-index__lead,
  .editorial-index__count {
    min-height: 48px;
  }

  .editorial-index__lead {
    padding: 0 12px;
  }

  .editorial-index__topic {
    padding: 0 13px;
  }

  .editorial-index__topic:nth-child(3) {
    display: none;
  }

  .editorial-index__count {
    display: none;
  }

  #page-header.full_page + #content-inner {
    gap: 30px;
  }

  #rightside {
    right: -54px;
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  #rightside.rightside-show {
    opacity: 0.9;
    transform: translate(-64px, 0);
  }

  #rightside > div > button,
  #rightside > div > a {
    width: 40px;
    height: 40px;
    line-height: 40px;
  }

  #rightside-config {
    display: block !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-header.full_page #site-info,
  #page-header.full_page #scroll-down,
  .hero-motion-frame,
  #recent-posts .recent-post-item,
  #recent-posts .recent-post-item::before,
  #recent-posts .recent-post-item .post-bg,
  #recent-posts .recent-post-item > .recent-post-info,
  #page-header.full_page + #content-inner > #aside-content,
  #rightside {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  html.hm-enhanced #recent-posts .recent-post-items > .recent-post-item,
  html.hm-enhanced #page-header.full_page + #content-inner > #aside-content.hm-profile-reveal,
  #page-header.full_page #scroll-down:hover,
  #page-header.full_page #scroll-down:focus-visible {
    transform: none !important;
  }
}
