/* The few additions WordPress needs on top of the prototype's stylesheet (app.css). */

[hidden] {
  display: none !important;
}

/* signed-in editors see WordPress's bar at the top: the fixed header sits under it */
body.admin-bar .hd {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .hd {
    top: 46px;
  }
}

/* topics and pages are links here (real addresses), styled exactly as the prototype's buttons */
a.if-item,
a.pg-step,
a.pg-num {
  text-decoration: none;
}
.if-item[aria-current] {
  color: var(--ink);
}
.pg-step[aria-disabled="true"] {
  opacity: 0.3;
  cursor: default;
}
.ig-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-70);
  font-size: 2rem;
  line-height: 2.8rem;
}

/* a plain page (for example one built in Elementor) inside the blog's frame */
main.page {
  min-height: 60vh;
  padding-top: calc(var(--hd-h) + 4rem + env(safe-area-inset-top, 0px));
  padding-bottom: 8rem;
}

/* without the script, nothing waits to be revealed */
html:not(.js) .lines.reveal .lw {
  transform: none !important;
}

/* pictures fade in when they arrive (the script marks them .is-loaded; one already
   there when the script starts is shown at once). If the script never runs they show
   anyway after a moment. */
html.js .sc-img img:not(.is-loaded),
html.js .art-prose img:not(.is-loaded) {
  opacity: 0;
  animation: mp-show 0.6s 4s forwards;
}
@keyframes mp-show {
  to {
    opacity: 1;
  }
}

/* the first visit to the home builds itself in: until the script takes over (a frame
   or two), the parts that will be revealed are already in their starting places */
html.mp-intro .ih-a .lw,
html.mp-intro .ih-b .lw,
html.mp-intro .ih-main,
html.mp-intro .hd-inner,
html.mp-intro .ig > .sc {
  opacity: 0;
}
html.mp-intro .ih-pic {
  background-color: transparent;
}
html.mp-intro .ih-line .lw,
html.mp-intro .if .lw {
  transform: translateY(135%);
}

/* opening a story and coming back are real page loads here; the browser carries the
   prototype's page transitions across them (moneypedia.js picks open or back) */
@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}
