/* Final design and accessibility guardrails.
   This file loads after the historical theme layers in styles.css. */

.cover-hero__title {
  width: 100% !important;
  max-width: none !important;
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
}

.cover-hero__title span:nth-child(2) {
  font-style: normal !important;
}

.ai-book-title {
  font-family: var(--font-book-ai) !important;
  font-style: normal;
  font-weight: 500 !important;
  letter-spacing: 0;
  text-wrap: balance;
}

.cover-hero__screen-card .ai-book-title {
  line-height: 1.12;
}

body:has(.cover-hero) .home-featured-book__copy h2 {
  max-width: 18ch;
  font-size: clamp(2.45rem, 4.5vw, 4.5rem);
  line-height: 1.02;
}

body:has(.cover-hero) .home-featured-book__cover {
  padding: 0;
  border: 0;
  background: transparent;
}

body:has(.cover-hero) .home-featured-book__cover img,
body:has(.books-hero) .purchase-book__cover img,
body:has(.books-hero) .book-card__cover img,
body:has(.release-hero) .release-hero__cover img {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: none;
  transform: none;
}

body:has(.cover-hero) .home-featured-book__cover span {
  margin-top: 0.8rem;
}

body:has(.books-hero) .purchase-book__cover,
body:has(.release-hero) .release-hero__cover {
  border-bottom-width: 1px;
}

body:has(.books-hero) .purchase-book--ai h3 {
  max-width: 21ch;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1.03;
}

body:has(.release-hero) .release-hero__copy .ai-book-title {
  line-height: 1.02;
}

.cover-hero__screen-toggle {
  min-height: 32px;
  padding: 0.15rem 0.35rem;
  border: 1px solid rgba(251, 243, 227, 0.28);
  border-radius: 4px;
  background: rgba(6, 18, 37, 0.32);
  color: rgba(251, 243, 227, 0.88);
  font: inherit;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.cover-hero__screen-toggle:hover,
.cover-hero__screen-toggle:focus-visible {
  border-color: var(--gold-400);
  color: var(--ivory);
}

.cover-hero__memory-screen[data-paused="true"]::before,
.cover-hero__memory-screen[data-paused="true"] .cover-hero__screen-card,
.cover-hero__memory-screen[data-paused="true"] .cover-hero__screen-pips span {
  animation: none !important;
}

.cover-hero__memory-screen[data-paused="true"] .cover-hero__screen-card {
  opacity: 0;
  transform: none;
}

.cover-hero__memory-screen[data-paused="true"] .cover-hero__screen-card:first-child {
  opacity: 1;
}

.cover-hero__memory-screen[data-paused="true"] .cover-hero__screen-pips span {
  background: rgba(251, 243, 227, 0.24);
  box-shadow: none;
}

.cover-hero__memory-screen[data-paused="true"] .cover-hero__screen-pips span:first-child {
  background: var(--cyan-400);
}

body.book-detail-open {
  overflow: hidden;
}

/* Keep editorial cards readable after the interior pages switch to white. */
body:has(.page-hero) .media-brief-grid article {
  border-color: #c9d2cf;
}

body:has(.page-hero) .media-brief-grid article::before {
  height: 2px;
}

body:has(.page-hero) .media-brief-grid span {
  color: #93442f;
}

body:has(.page-hero) .media-brief-grid p {
  color: var(--ink-soft);
}

/* Book details use an opaque reading surface so every description stays legible. */
.book-detail__backdrop {
  background: rgba(4, 12, 25, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.book-detail__panel {
  border-color: #c9d2cf;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 38px 100px rgba(4, 12, 25, 0.46);
}

.book-detail__close {
  border-color: #b7c2bf;
  background: #ffffff;
  color: var(--ink);
}

.book-detail__close:hover,
.book-detail__close:focus-visible {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
  color: #ffffff;
}

.book-detail__body h2,
.book-detail__highlights strong,
.book-detail__facts strong {
  color: var(--ink);
}

.book-detail__authors {
  color: var(--clay);
}

.book-detail__sub {
  color: var(--teal-deep);
}

.book-detail__description {
  margin: 1rem 0;
  padding: 1rem 1.05rem;
  border-left: 3px solid var(--clay);
  background: var(--paper-warm);
}

.book-detail__description span,
.book-detail__grid span,
.book-detail__highlights > span,
.book-detail__retail > span,
.book-detail__facts > span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--clay);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.book-detail__description p,
.book-detail__grid p,
.book-detail__highlights p,
.book-detail__facts p {
  margin: 0;
  color: var(--ink-soft);
}

.book-detail__grid div,
.book-detail__highlights,
.book-detail__retail,
.book-detail__facts {
  border-color: #d5dad5;
  background: #ffffff;
}

.book-detail__highlights article {
  border-left-color: var(--clay);
}

.book-detail__retail a {
  border-color: #b7c2bf;
  background: var(--paper-warm);
  color: var(--teal-deep);
}

.book-detail__retail a:hover,
.book-detail__retail a:focus-visible {
  border-color: var(--teal-deep);
  background: var(--teal-deep);
  color: #ffffff;
}

.book-detail .btn--ghost {
  border-color: var(--teal-deep);
  background: transparent;
  color: var(--teal-deep);
}

.book-detail .btn--ghost:hover,
.book-detail .btn--ghost:focus-visible {
  background: var(--teal-deep);
  color: #ffffff;
}

.site-footer__nav a,
.site-footer__social a,
.site-footer__legal a,
.purchase-book__retail a,
.book-detail__retail a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding-block: 0.35rem;
}

@media (min-width: 761px) {
  .cover-hero__title {
    font-size: clamp(3rem, 3.8vw, 4.35rem) !important;
    line-height: 1 !important;
  }
}

@media (max-width: 980px) {
  .site-header {
    top: 10px;
    width: min(calc(100% - 20px), var(--container));
  }

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

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 0.5rem;
  }

  .site-header__inner > .nav,
  .header-action {
    display: none;
  }

  .mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0 1.25rem;
    border-top: 1px solid rgba(34, 59, 89, 0.6);
  }

  .mobile-nav[data-open="true"] {
    display: flex;
  }
}

@media (max-width: 760px) {
  body:has(.cover-hero) .home-featured-book__inner {
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

@media (max-width: 560px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  body:has(.page-hero) .page-hero__title {
    font-size: clamp(2.3rem, 11.6vw, 4.2rem) !important;
    line-height: 1.02;
  }

  body:has(.cover-hero) .home-featured-book__copy h2 {
    font-size: clamp(2.2rem, 10vw, 3.15rem);
    line-height: 1.04;
  }

  body:has(.cover-hero) .cover-hero__memory-screen {
    min-height: 208px !important;
  }

  body:has(.cover-hero) .cover-hero__screen-top {
    align-items: center;
    gap: 0.4rem;
    padding-inline: 0.75rem;
    letter-spacing: 0.1em;
  }

  body:has(.cover-hero) .cover-hero__screen-stage {
    min-height: 150px !important;
    padding: 0.82rem 0.78rem 0.55rem !important;
  }

  body:has(.cover-hero) .cover-hero__screen-card {
    grid-template-columns: minmax(0, 1fr) 72px !important;
    gap: 0.65rem !important;
  }

  body:has(.cover-hero) .cover-hero__screen-card > span {
    font-size: 0.62rem !important;
    letter-spacing: 0.1em !important;
  }

  body:has(.cover-hero) .cover-hero__screen-card strong {
    font-size: 0.9rem !important;
    line-height: 1.15 !important;
  }

  body:has(.cover-hero) .cover-hero__screen-card p {
    font-size: 0.76rem !important;
    line-height: 1.34 !important;
  }

  body:has(.cover-hero) .cover-hero__screen-card img {
    width: 68px !important;
    max-height: 104px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    filter: none !important;
  }

  .cover-hero__screen-toggle {
    min-height: 30px;
    padding-inline: 0.3rem;
    font-size: 0.58rem;
  }
}
