.hero-photo-credit {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: min(calc(100% - 3rem), 1160px);
  margin: 0 auto 6px;
  color: #0f8b8d;
  font-family: Muli, Arial, sans-serif;
  font-size: clamp(11px, 0.9vw, 13px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.015em;
  text-align: right;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.hero-photo-credit__byline,
.hero-photo-credit__rights {
  display: block;
  color: #0f8b8d;
}

.hero-photo-credit__symbol {
  color: #9b6c0f;
}

.hero-photo-credit--subpage {
  position: absolute;
  z-index: 30;
  right: clamp(14px, 2.2vw, 28px);
  bottom: 12px;
  left: auto;
  width: auto;
  max-width: calc(100% - 24px);
  margin: 0;
  transform: none;
  flex-direction: row;
  justify-content: flex-end;
  align-items: baseline;
  gap: 0.35em;
  white-space: nowrap;
  font-size: clamp(11px, 0.9vw, 13px);
  letter-spacing: 0;
}

.hero-photo-credit--subpage .hero-photo-credit__byline,
.hero-photo-credit--subpage .hero-photo-credit__rights {
  display: inline;
}

body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #header-image-main {
  position: relative;
  overflow: visible !important;
}

.hero-photo-credit--hero {
  position: absolute;
  right: clamp(14px, 2.2vw, 28px);
  bottom: 12px;
  z-index: 30;
  width: auto;
  max-width: calc(100% - 24px);
  margin: 0;
  font-size: clamp(11px, 0.9vw, 13px);
}

body.home .hero-photo-credit--hero .hero-photo-credit__byline,
body.home .hero-photo-credit--hero .hero-photo-credit__rights {
  color: #0f8b8d;
}

body.home .hero-photo-credit--hero .hero-photo-credit__symbol {
  color: #9b6c0f;
}

body.page-id-125 #post-125 .entry-content.about-page-content {
  padding-top: 61px;
}

@media (max-width: 760px) {
  .hero-photo-credit--subpage {
    right: 16px;
    max-width: calc(100% - 32px);
  }

  body.page-id-125 #post-125 .entry-content.about-page-content {
    padding-top: 38px;
  }
}

@media (max-width: 420px) {
  .hero-photo-credit--subpage {
    font-size: 11px;
  }
}

/* Keep the homepage tint unchanged. */
body.home #header-overlay {
  display: block !important;
  background: linear-gradient(
    180deg,
    rgba(17, 39, 48, 0.38) 0%,
    rgba(17, 65, 63, 0.22) 56%,
    rgba(17, 65, 63, 0.12) 100%
  ) !important;
  opacity: 1 !important;
}

/* Darken subpage heroes enough to keep the white navigation legible. */
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #header-overlay {
  display: block !important;
  background: linear-gradient(
    180deg,
    rgba(17, 39, 48, 0.58) 0%,
    rgba(17, 65, 63, 0.42) 56%,
    rgba(17, 65, 63, 0.28) 100%
  ) !important;
  opacity: 1 !important;
}

body:is(.page-id-112, .page-id-145) #header-overlay {
  background: linear-gradient(
    180deg,
    rgba(17, 39, 48, 0.66) 0%,
    rgba(17, 65, 63, 0.52) 56%,
    rgba(17, 65, 63, 0.38) 100%
  ) !important;
}

body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #content::before {
  display: none !important;
  content: none !important;
}

body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) {
  --archive-hero-frame-height: clamp(420px, 50vw, 620px);
  --shared-hero-frame-height: clamp(420px, 50vw, 620px);
}

body.home #header-image-main .header-image,
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #header-image-main .header-image {
  opacity: 1 !important;
  filter: none !important;
}

body.home #header-page-title .entry-title,
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #header-page-title .entry-title {
  text-shadow: none !important;
}

body.home #site-header-main .topmenu ul li a,
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #site-header-main .topmenu ul li a {
  text-shadow: none !important;
}

body.home #header-page-title .byline,
body.home #site-header-main #site-title a,
body.home #site-header-main #site-description,
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #header-page-title .byline,
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #site-header-main #site-title a,
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #site-header-main #site-description {
  text-shadow: none !important;
}

body.home #header-page-title .byline {
  color: #ffffff !important;
}

body.home #header-image-main div.header-image,
body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page):not(.bravada-responsive-headerimage) #header-image-main div.header-image {
  background-size: cover !important;
  background-position: center center !important;
  background-attachment: scroll !important;
}

body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page):not(.bravada-responsive-headerimage) #header-image-main div.header-image {
  display: block !important;
}

body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page):not(.bravada-responsive-headerimage) #header-image-main img.header-image {
  display: none !important;
}

body.bravada-responsive-headerimage:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #header-image-main div.header-image {
  display: none !important;
}

body.bravada-responsive-headerimage:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #header-image-main img.header-image {
  display: block !important;
  object-fit: cover;
  object-position: center center;
}

body.page-id-1212 #header-image-main div.header-image,
body.page-id-125 #header-image-main div.header-image {
  background-image: var(--shared-hero-photo) !important;
}

body:is(.page-id-112, .page-id-114, .page-id-143, .page-id-145) #header-image-main div.header-image {
  background-image: var(--archive-hero-photo) !important;
}

body:is(.page-id-125, .book-detail-page, .page-id-145) #header-image-main div.header-image {
  background-position: center top !important;
}

body:is(.page-id-125, .book-detail-page, .page-id-145) #header-image-main img.header-image {
  object-position: center top !important;
}

@media (max-width: 700px) {
  body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) {
    --archive-hero-frame-height: clamp(320px, 68vw, 420px);
    --shared-hero-frame-height: clamp(320px, 68vw, 420px);
  }

  body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) #content {
    padding-top: 20px !important;
  }
}

@media (max-width: 420px) {
  body:is(.page-id-1212, .page-id-112, .page-id-114, .page-id-143, .page-id-145, .page-id-125, .book-detail-page) {
    --archive-hero-frame-height: 320px;
    --shared-hero-frame-height: 320px;
  }
}

body.page-id-125 {
  --shared-hero-frame-height: clamp(480px, 58vw, 680px);
}

body.page-id-125 #header-image-main div.header-image {
  background-position: 50% 0% !important;
}

body.page-id-125 #header-image-main img.header-image {
  object-position: 50% 0% !important;
}

body.page-id-125:not(.bravada-responsive-headerimage) #header-image-main div.header-image {
  display: none !important;
}

body.page-id-125:not(.bravada-responsive-headerimage) #header-image-main img.header-image {
  display: block !important;
  position: absolute !important;
  z-index: 0;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: 50% 0% !important;
  opacity: 1 !important;
}

@media (max-width: 700px) {
  body.page-id-125 {
    --shared-hero-frame-height: clamp(320px, 68vw, 420px);
  }
}

@media (max-width: 420px) {
  body.page-id-125 {
    --shared-hero-frame-height: 320px;
  }
}

/* Mobile fallback for iOS: use a real image element. */
@media (max-width: 760px) {
  body.home #header-image-main-inside {
    position: relative !important;
  }

  body.home #header-image-main div.header-image {
    display: none !important;
  }

  body.home #header-image-main img.header-image {
    position: absolute !important;
    z-index: 0;
    inset: 0;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.home #header-overlay {
    z-index: 1 !important;
    background: linear-gradient(
      180deg,
      rgba(17, 39, 48, 0.18) 0%,
      rgba(17, 65, 63, 0.12) 56%,
      rgba(17, 65, 63, 0.05) 100%
    ) !important;
  }

  body.home #header-page-title {
    z-index: 2;
  }

  body.home #header-image-main .meta-arrow {
    z-index: 3;
  }

}

@media (max-width: 760px) {
  body.home #masthead .site-header-bottom .hamburger:focus-visible,
  body.home #mobile-menu a:focus-visible,
  body.home #mobile-menu button:focus-visible {
    outline: 3px solid #e9b44c !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 2px rgba(22, 37, 33, 0.95) !important;
  }
}

/* Keep mobile archive entries aligned to the same vertical rhythm. */
@media (max-width: 700px) {
  body:is(.page-id-112, .page-id-114) .poems-refresh-year,
  body:is(.page-id-143, .page-id-145) .events-year {
    row-gap: 11px !important;
  }

  body:is(.page-id-112, .page-id-114) .poems-refresh-year + .poems-refresh-year,
  body:is(.page-id-143, .page-id-145) .events-year + .events-year {
    margin-top: 24px !important;
  }

  body:is(.page-id-112, .page-id-114) .poems-refresh-entry,
  body:is(.page-id-143, .page-id-145) .events-entry {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 14px 8px 15px 10px !important;
  }

  body:is(.page-id-143, .page-id-145) .events-entry-meta p.events-entry-venue,
  body:is(.page-id-143, .page-id-145) .events-entry-meta p > .events-entry-venue,
  body:is(.page-id-143, .page-id-145) .events-entry-meta p.events-appearance-venue,
  body:is(.page-id-143, .page-id-145) .events-entry-meta p > .events-appearance-venue {
    margin-top: 1.5em !important;
    margin-bottom: 0.5em !important;
  }

  body:is(.page-id-143, .page-id-145) .events-entry-meta p.events-entry-date,
  body:is(.page-id-143, .page-id-145) .events-entry-meta p > .events-entry-date,
  body:is(.page-id-143, .page-id-145) .events-entry-meta p.events-appearance-date,
  body:is(.page-id-143, .page-id-145) .events-entry-meta p > .events-appearance-date {
    margin: 6px 0 1em !important;
  }

  body:is(.page-id-143, .page-id-145) .events-entry-detail p {
    margin-bottom: 8px !important;
  }

  body:is(.page-id-143, .page-id-145) .events-entry-detail p:last-child {
    margin-bottom: 0 !important;
  }
}
