/* Individual book pages: same hero + translucent reading panel as the rest of the site. */
body.book-detail-page,
.book-detail-embedded {
  --shared-hero-photo: url("/media/archive/1705.jpeg");
  --book-ink: #162521;
  --book-ink-soft: #4e5b57;
  --book-teal: #176f70;
  --book-teal-bright: #0f8b8d;
  --book-gold: #9b701e;
}

html.page-window-initializing body.book-detail-page #content {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

body.book-detail-page #header-image-main div.header-image {
  background-image: var(--shared-hero-photo) !important;
}

/* Long book titles stay readable and inside the viewport. */
body.book-detail-page #header-page-title,
body.book-detail-page #header-page-title-inside {
  box-sizing: border-box;
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

body.book-detail-page #header-page-title .entry-title {
  max-width: min(100%, 15em);
  margin-left: auto;
  margin-right: auto;
  line-height: 1.1;
  text-wrap: balance;
  overflow-wrap: break-word;
}

body.book-detail-page .page-window-sticky-title {
  text-wrap: balance;
  overflow-wrap: break-word;
  line-height: 1.08 !important;
}

/* The landing title carries the heading; keep the article h1 for assistive tech only. */
:is(body.book-detail-page #content, .book-detail-embedded) .schema-image {
  display: none !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) article {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  background: transparent !important;
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  transition: none !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .article-inner > header {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:is(body.book-detail-page #content, .book-detail-embedded) .article-inner {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  padding: 24px clamp(22px, 4.5vw, 64px) 44px !important;
  color: var(--book-ink);
  font: 400 16px/1.75 Muli, Arial, sans-serif;
}

:is(body.book-detail-page #content, .book-detail-embedded) .entry-content {
  margin: 0 !important;
  padding: 0 !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .entry-content > p {
  max-width: 64ch;
  margin: 0 0 34px;
  color: var(--book-ink) !important;
  font-size: clamp(16px, 1.45vw, 18.5px);
  line-height: 1.8;
  text-align: left;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-spacer {
  height: 16px !important;
}

/* Cover and purchase on one side, words on the other. */
:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-columns {
  display: grid !important;
  grid-template-columns: minmax(190px, 290px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
  margin: 0 !important;
  padding: 0 !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-column {
  flex-basis: auto !important;
  width: auto !important;
  min-width: 0;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col {
  order: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col > .wp-block-spacer {
  height: 8px !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col {
  order: 1;
  max-width: 64ch;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > :is(
  p,
  blockquote,
  ul,
  ol
) {
  color: var(--book-ink) !important;
  font-family: Muli, Arial, sans-serif;
  font-size: clamp(16px, 1.45vw, 18.5px);
  line-height: 1.8;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > :is(
  h2,
  h3,
  h4,
  h5,
  h6
) {
  margin: 1.2em 0 0.45em;
  color: var(--book-teal) !important;
  font: 500 clamp(21px, 2vw, 27px)/1.25 "Playfair Display", Georgia, serif;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > p:not(.book-review-credit) {
  margin: 0 0 0.55em;
  padding-left: 20px;
  border-left: 2px solid rgba(233, 180, 76, 0.9);
  color: var(--book-ink) !important;
  text-align: left !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > p.book-review-credit {
  margin: -0.55em 0 0.4em;
  padding: 0.55em 0 0 20px;
  border-left: 2px solid rgba(233, 180, 76, 0.9);
  color: var(--book-gold) !important;
  font: 600 14px/1.5 Muli, Arial, sans-serif;
  letter-spacing: 0.02em;
  text-align: right !important;
}

/* Use the same gap after inline and separate review attributions. */
:is(body.book-detail-page #content, .book-detail-embedded) .book-review-spacer {
  display: none !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > p.book-blurb-start {
  margin-top: 22px !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-attribution {
  display: block;
  width: 100%;
  margin-top: 0.35em;
  color: var(--book-gold) !important;
  font: 600 14px/1.5 Muli, Arial, sans-serif;
  letter-spacing: 0.02em;
  text-align: right !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) a:not(.wp-block-button__link) {
  color: #8c6416 !important;
  text-decoration-line: underline !important;
  text-decoration-color: #e9b44c !important;
  text-decoration-thickness: 1.5px !important;
  text-underline-offset: 3px !important;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

:is(body.book-detail-page #content, .book-detail-embedded) a:not(.wp-block-button__link):hover {
  color: #0f8b8d !important;
  text-decoration-color: #0f8b8d !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) a:focus-visible {
  outline: 2px solid #e9b44c;
  outline-offset: 4px;
}

/* Covers keep their own proportions, including the square Carrier Wave jacket. */
:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-image {
  width: 100%;
  margin: 0 !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) figure.wp-block-image,
:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-image figure {
  display: block;
  width: 100%;
  max-width: 290px;
  margin: 0 auto !important;
  text-align: center;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-image figure > a,
:is(body.book-detail-page #content, .book-detail-embedded) figure.wp-block-image > a {
  display: block;
  transform-origin: center bottom;
  transition: transform 220ms ease;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-image img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100%;
  border-radius: 3px;
  box-shadow: 0 16px 36px rgba(10, 20, 20, 0.22), 0 2px 6px rgba(10, 20, 20, 0.12);
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-element-caption {
  display: block !important;
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  margin: 14px 0 0 !important;
  color: var(--book-ink-soft);
  font: 400 12px/1.5 Muli, Arial, sans-serif;
  text-align: center;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-caption__publication {
  color: var(--book-ink);
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-caption-award {
  display: block;
  margin-top: 3px;
  color: var(--book-teal);
  font: 400 clamp(18px, 1.8vw, 24px)/1.3 "Playfair Display", Georgia, serif;
  text-align: center;
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-caption__award {
  color: var(--book-teal);
}

:is(body.book-detail-page #content, .book-detail-embedded) .book-detail-caption__note {
  color: var(--book-teal);
}

@media (hover: hover) {
  :is(body.book-detail-page #content, .book-detail-embedded) .wp-block-image figure > a:hover,
  :is(body.book-detail-page #content, .book-detail-embedded) figure.wp-block-image > a:hover {
    transform: scale(1.03);
  }
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-buttons {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 4px 0 0 !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button {
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button__link::before,
:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button__link::after {
  display: none !important;
  content: none !important;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button__link {
  display: inline-block;
  padding: 9px 24px !important;
  border: 1px solid #0f8b8d !important;
  border-bottom: 2px solid #e9b44c !important;
  border-radius: 18px !important;
  background: rgba(247, 250, 249, 0.4) !important;
  color: var(--book-teal) !important;
  outline: 0 !important;
  box-shadow: none !important;
  font: 600 13px/1.4 Muli, Arial, sans-serif;
  letter-spacing: 0.065em;
  text-decoration: none !important;
  text-transform: uppercase;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button__link:hover,
:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button__link:focus-visible {
  border-color: #0f8b8d !important;
  border-bottom-color: #e9b44c !important;
  background: var(--book-teal) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

:is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button__link:focus-visible {
  outline: 2px solid #e9b44c;
  outline-offset: 3px;
}

/* No dropdown on the centered nav. */
body.book-detail-page #access .sub-menu {
  display: none !important;
}

body.book-detail-page #access > div > ul > li {
  order: 0 !important;
}

body.book-detail-page #access > div > ul > li.current-menu-ancestor > a {
  color: #fff !important;
}

body.book-detail-page #access > div > ul > li.current-menu-ancestor > a:hover {
  color: #e9b44c !important;
}

@media (max-width: 781px) {
  :is(body.book-detail-page #content, .book-detail-embedded) .wp-block-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col {
    max-width: 240px;
    margin: 0 auto;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .entry-content > p {
    margin-bottom: 28px;
  }
}

@media (max-width: 781px),
  (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  :is(body.book-detail-page #content, .book-detail-embedded)
    .book-detail-cover-col > .wp-block-spacer {
    display: none !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded)
    .wp-block-columns > .book-detail-mobile-purchase {
    order: 2;
    grid-column: 1 / -1;
    justify-self: center;
    width: 100%;
    max-width: 240px;
    margin: -16px auto 0 !important;
  }
}

@media (max-width: 781px) and (orientation: portrait) {
  :is(body.book-detail-page #content, .book-detail-embedded)
    .wp-block-columns > .book-detail-mobile-purchase {
    margin-top: 12px !important;
  }
}

@media (max-width: 700px) {
  :is(body.book-detail-page #content, .book-detail-embedded) .article-inner {
    padding: 22px 20px 32px !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .article-inner,
  :is(body.book-detail-page #content, .book-detail-embedded) .entry-content > p,
  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > p:not(.book-review-credit) {
    color: var(--book-ink-soft) !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > p:not(.book-review-credit),
  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > p.book-review-credit {
    padding-left: 14px;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col > p.book-review-credit {
    font-size: 13px !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) a:not(.wp-block-button__link) {
    text-underline-offset: 2px;
  }

  body.book-detail-page #header-page-title .entry-title {
    max-width: 100%;
  }
}

/* Keep the cover and its purchase control together while the description scrolls. */
@media (min-width: 782px),
  (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  body.book-detail-page #content .main,
  body.book-detail-page #content .one-column,
  .book-detail-embedded .main,
  .book-detail-embedded .one-column {
    overflow: visible !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col {
    position: sticky;
    top: calc(var(--page-window-title-offset, 68px) + 8px);
    align-self: start;
    z-index: 3;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col .wp-block-image {
    width: 100%;
    max-width: 290px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col figure.wp-block-image,
  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col .wp-block-image figure {
    display: block;
    width: 100%;
    text-align: center;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col .wp-block-image img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    margin: 0 auto;
    object-fit: contain;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col .wp-element-caption {
    display: block;
    width: 100%;
    text-align: center;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col > .wp-block-buttons {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 782px) {
  :is(body.book-detail-page #content, .book-detail-embedded) .article-inner {
    margin-top: -40px !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col {
    --book-sticky-cover-height: max(
      120px,
      calc(var(--subpage-window-height, 70vh) - var(--page-window-title-offset, 68px) - 170px)
    );
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col .wp-block-image img {
    max-height: var(--book-sticky-cover-height);
  }

  :is(body.book-detail-page #content, .book-detail-embedded)
    .book-detail-cover-col.book-detail-cover-note {
    --book-sticky-cover-height: max(
      120px,
      calc(var(--subpage-window-height, 70vh) - var(--page-window-title-offset, 68px) - 144px)
    );
  }

  :is(body.book-detail-page #content, .book-detail-embedded)
    .book-detail-cover-col.book-detail-award-cover {
    --book-sticky-cover-height: max(
      120px,
      calc(var(--subpage-window-height, 70vh) - var(--page-window-title-offset, 68px) - 222px)
    );
  }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 1000px) {
  :is(body.book-detail-page #content, .book-detail-embedded) .article-inner {
    margin-top: -20px !important;
    padding: 10px clamp(14px, 2.2vw, 28px) 14px !important;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .wp-block-columns {
    display: grid;
    grid-template-columns: minmax(220px, 0.5fr) minmax(0, 1fr);
    gap: clamp(12px, 2.2vw, 20px);
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col {
    --book-sticky-cover-height: max(
      70px,
      calc(var(--subpage-window-height, 70vh) - var(--page-window-title-offset, 58px) - 106px)
    );
    max-width: none;
    margin: 0;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-text-col {
    min-width: 0;
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col .wp-block-image img {
    max-height: var(--book-sticky-cover-height);
  }

  :is(body.book-detail-page #content, .book-detail-embedded)
    .book-detail-cover-col.book-detail-award-cover {
    --book-sticky-cover-height: max(
      70px,
      calc(var(--subpage-window-height, 70vh) - var(--page-window-title-offset, 58px) - 130px)
    );
  }

  :is(body.book-detail-page #content, .book-detail-embedded)
    .book-detail-cover-col.book-detail-cover-note {
    --book-sticky-cover-height: max(
      70px,
      calc(var(--subpage-window-height, 70vh) - var(--page-window-title-offset, 58px) - 126px)
    );
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-caption-award {
    font-size: clamp(15px, 1.8vw, 17px);
  }

  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col .wp-element-caption,
  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-cover-col > .wp-block-buttons {
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  :is(body.book-detail-page #content, .book-detail-embedded) .book-detail-caption-award {
    font-size: clamp(17px, 4.8vw, 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(body.book-detail-page #content, .book-detail-embedded) .wp-block-image figure > a,
  :is(body.book-detail-page #content, .book-detail-embedded) figure.wp-block-image > a,
  :is(body.book-detail-page #content, .book-detail-embedded) a,
  :is(body.book-detail-page #content, .book-detail-embedded) .wp-block-button__link {
    transition: none;
  }
}

/* Multi-line landing titles lift upward so they never sit on the centered nav. */
body.book-detail-page #header-page-title .entry-title {
  position: relative;
  top: calc(-1 * var(--book-title-lift, 0px));
}
