/* Reading page: kicker, title, spot and byline first, then a photo wider
   than the text, then 660 px of text with the share rail beside it. */

.g-article {
  max-width: 860px;
  padding: 20px 16px 24px;
}

.g-article > * {
  margin-block: 0 16px;
}

.g-article__kicker {
  font-size: 0.875rem;
  font-weight: 700;
}

.g-article__kicker a {
  color: var(--wp--preset--color--brand-deep);
  text-decoration: none;
}

.g-article h1 {
  max-width: 820px;
  font-weight: 800;
  line-height: 1.06;
}

.g-article .gorunum-spot {
  max-width: 760px;
  font-size: var(--wp--preset--font-size--spot);
  font-weight: 500;
  line-height: 1.45;
}

.g-article .gorunum-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  color: var(--wp--preset--color--stone);
  font-size: var(--wp--preset--font-size--meta);
}

.g-article .gorunum-byline a {
  color: var(--wp--preset--color--ink);
  font-weight: 700;
  text-decoration: none;
}

.g-article .gorunum-byline .g-avatar {
  width: 32px;
  height: 32px;
}

.g-article__photo {
  margin-inline: -16px;
}

/* Every photo keeps its own shape; a tall one is held to the screen. */
.g-article__photo img,
.gorunum-article .g-article__photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(80vh, 760px);
  background: var(--wp--preset--color--mist);
  object-fit: contain;
}

.g-article__body {
  display: grid;
  /* A column never grows to fit a long word or address. */
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

/* The reading defaults themselves live in content.css, shared with the editor. */
.g-article .wp-block-post-content {
  font-size: calc(var(--g-body) * var(--gorunum-text-scale, 1));
}

.g-article .g-byline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--wp--preset--color--stone);
  font-size: var(--wp--preset--font-size--meta);
}

.g-article__photo figcaption {
  color: var(--wp--preset--color--stone);
  font-size: var(--wp--preset--font-size--meta);
}

/* A full-width block reaches the sheet's edges. The sheet is the container, so
   the block knows its width; the start offset is the sheet's padding plus any
   share rail in front of the text. */
.g-article {
  --g-pad-start: 16px;
  --g-pad-end: 16px;
  --g-text-offset: 0px;
  container-type: inline-size;
}

.g-article .wp-block-post-content > .alignfull {
  width: calc(100cqw + var(--g-pad-start) + var(--g-pad-end));
  max-width: none;
  margin-left: calc(-1 * (var(--g-pad-start) + var(--g-text-offset)));
}

.g-article .wp-block-post-content > .alignwide {
  max-width: 100%;
}

.gorunum-author-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 32px;
  padding: 20px;
  background: var(--wp--preset--color--mist);
}

.gorunum-author-box .g-avatar {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
}

.gorunum-author-box p {
  margin: 0 0 4px;
}

.gorunum-author-box__name {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.25rem;
  font-weight: 700;
}

.gorunum-author-box__name a,
.gorunum-author-box__all {
  color: inherit;
}

.gorunum-author-box__role {
  color: var(--wp--preset--color--stone);
  font-size: var(--wp--preset--font-size--meta);
}

.gorunum-author-box__all {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
}

@media (min-width: 1024px) {
  .g-article {
    --g-pad-start: 32px;
    --g-pad-end: 32px;
    /* The share rail and its gap stand before the text. */
    --g-text-offset: 84px;
    padding: 32px 32px 40px;
  }

  .g-article__photo {
    margin-inline: 0;
  }


  .g-article__body {
    grid-template-columns: 44px minmax(0, 700px);
    gap: 40px;
    justify-content: start;
  }

  .g-article .gorunum-tags,
  .g-article .gorunum-author-box,
  .g-article .gorunum-related {
    max-width: 744px;
  }
}

/* Wide enough screens: the text starts at the title's edge and the share rail
   hangs in the margin to its left. */
@media (min-width: 1100px) {
  .g-article {
    max-width: 980px;
    --g-pad-start: 116px;
    --g-pad-end: 84px;
    /* Here the rail hangs in the padding, so the text starts at the content edge. */
    --g-text-offset: 0px;
    padding-inline: 116px 84px;
  }

  .g-article__body {
    margin-left: -84px;
  }
}

/* Column pages put the writer first. */
.g-columnist-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.g-columnist-head .g-avatar {
  width: 88px;
  height: 88px;
}

.g-columnist-head__name {
  color: inherit;
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.g-columnist-head__name:hover {
  text-decoration: underline;
  text-decoration-color: var(--wp--preset--color--brand);
  text-decoration-thickness: 2px;
}

.g-columnist-more {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

@media (min-width: 1024px) {
  .g-article__photo--narrow {
    max-width: 744px;
  }

  .g-article .g-columnist-more {
    max-width: 744px;
  }
}

/* Reading progress: a 3px red line under the header that fills as the page
   scrolls. CSS only; browsers without scroll timelines simply show nothing. */
@supports (animation-timeline: scroll()) {
  .single .g-header::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 3;
    height: 3px;
    background: var(--wp--preset--color--brand);
    transform-origin: 0 50%;
    animation: g-progress linear both;
    animation-timeline: scroll(root);
  }

  @keyframes g-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

/* An obituary is read like any story; only its share row sits under the text. */
.g-obit .g-share.g-obit__share {
  display: flex;
  margin-block: 24px;
}

.g-obit .g-memorial {
  margin-top: 32px;
}

/* Video story: the video opens the text at the full sheet width, above the
   share rail's column. */
.g-article--video .wp-block-post-content > .g-embed-video:first-child {
  margin: 0 -16px 20px;
}

@media (min-width: 1024px) {
  .g-article--video .wp-block-post-content > .g-embed-video:first-child {
    width: 100cqw;
    max-width: none;
    margin-right: 0;
    margin-left: calc(-1 * var(--g-text-offset));
  }
}

/* Story photos open large on a click (plugin's lightbox.js). */
.gorunum-article .g-article__photo img[role="button"],
.gorunum-article .wp-block-post-content figure img[role="button"] {
  cursor: zoom-in;
}

.gorunum-article img[role="button"]:focus-visible {
  outline: 3px solid var(--wp--preset--color--brand);
  outline-offset: 2px;
}

.g-lightbox-open {
  overflow: hidden;
}

.g-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
}

.g-lightbox::backdrop {
  background: rgb(0 0 0 / 90%);
}

.g-lightbox__figure {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  box-sizing: border-box;
  height: 100%;
  margin: 0;
  padding: 56px 12px 16px;
}

.g-lightbox__image {
  max-width: 100%;
  max-height: calc(100dvh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-out;
}

.g-lightbox__caption {
  max-width: 70ch;
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

.g-lightbox__close {
  position: fixed;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 15%);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.g-lightbox__close:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@media (min-width: 1024px) {
  .g-lightbox__figure {
    padding: 64px 48px 24px;
  }

  .g-lightbox__close {
    top: 16px;
    right: 16px;
  }
}

/* Printing prints one story: the page's own, or the added story whose print button was pressed. */
@media print {
  .g-stream {
    display: none;
  }

  .g-print-one .g-stream {
    display: block;
  }

  .g-print-one main.gorunum-article,
  .g-print-one .g-stream__story:not(.is-printing) {
    display: none;
  }
}
