/* =====================================================
   Biological Evaluation Strategy Handbook
   Uses the existing MedDev Advisory design tokens.
   ===================================================== */

.handbook-hero {
  position: relative;
  overflow: hidden;
  padding: 154px 0 88px;
  background:
    radial-gradient(circle at 88% 22%, rgba(0, 180, 166, 0.18), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(30, 95, 168, 0.2), transparent 32%),
    linear-gradient(135deg, #071c36 0%, var(--navy) 52%, #0d3155 100%);
}

.handbook-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 58px 58px;
  pointer-events: none;
}

.handbook-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: clamp(44px, 7vw, 92px);
  align-items: center;
}

.handbook-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid rgba(0, 180, 166, 0.36);
  border-radius: 999px;
  background: rgba(0, 180, 166, 0.12);
  color: #a9f3ec;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.handbook-eyebrow i { color: var(--teal); }

.handbook-hero h1 {
  max-width: 780px;
  margin: 24px 0 13px;
  color: var(--white);
  font-family: "Merriweather", Georgia, serif;
  font-size: clamp(2.35rem, 5vw, 4.35rem);
  line-height: 1.09;
  letter-spacing: -0.03em;
}

.handbook-hero-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0 0 19px;
  color: rgba(255, 255, 255, 0.68);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.handbook-hero-byline a {
  color: #c8f7f2;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(0, 180, 166, 0.65);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.handbook-hero-byline a:hover,
.handbook-hero-byline a:focus-visible {
  color: var(--white);
  text-decoration-color: var(--teal);
}

.handbook-hero-byline span::before {
  content: "·";
  margin-right: 10px;
  color: var(--teal);
}

.handbook-hero-lead {
  max-width: 760px;
  margin: 0 0 25px;
  color: rgba(255, 255, 255, 0.83);
  font-size: clamp(1.04rem, 1.5vw, 1.22rem);
  line-height: 1.75;
}

.handbook-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin: 0 0 19px;
}

.handbook-hero-actions .btn {
  min-height: 50px;
  justify-content: center;
}

.handbook-hero-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.84rem;
  line-height: 1.55;
}

.handbook-hero-note i {
  flex: 0 0 auto;
  margin-top: 3px;
  color: var(--teal);
}

.handbook-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 17px;
  margin-top: 27px;
  padding-top: 23px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.handbook-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.77);
  font-size: var(--text-sm);
  font-weight: 600;
}

.handbook-meta i { color: var(--teal); }

.handbook-cover-wrap {
  position: relative;
  width: min(100%, 405px);
  margin-inline: auto;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 32px 74px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.handbook-cover-wrap img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.handbook-proof {
  position: relative;
  z-index: 2;
  margin-top: -1px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(10, 35, 66, 0.06);
}

.handbook-proof-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.handbook-proof-item {
  min-width: 0;
  padding: 27px 18px 25px;
  text-align: center;
  border-right: 1px solid var(--border);
}

.handbook-proof-item:last-child { border-right: 0; }

.handbook-proof-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.15;
}

.handbook-proof-item span {
  color: var(--text-mid);
  font-size: 0.79rem;
  line-height: 1.35;
}

.handbook-section { background: var(--white); }
.handbook-section[id] { scroll-margin-top: 88px; }
.handbook-section.alt { background: var(--light-bg); }
.handbook-section.dark { background: var(--navy); }
.handbook-section.dark .section-title,
.handbook-section.dark h2,
.handbook-section.dark h3 { color: var(--white); }
.handbook-section.dark .section-subtitle { color: rgba(255, 255, 255, 0.72); }

.handbook-section-head {
  max-width: 820px;
  margin: 0 auto 43px;
  text-align: center;
}

.handbook-outcomes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.handbook-outcome-card,
.handbook-package-card,
.handbook-fit-card,
.handbook-compare-card,
.handbook-source-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.handbook-outcome-card {
  padding: 27px;
}

.handbook-card-icon {
  display: inline-flex;
  width: 46px;
  height: 46px;
  margin-bottom: 17px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 180, 166, 0.11);
  color: var(--teal-dark);
  font-size: 1.05rem;
}

.handbook-outcome-card h3,
.handbook-package-card h3,
.handbook-fit-card h3,
.handbook-compare-card h3,
.handbook-source-card h3 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 1.06rem;
}

.handbook-outcome-card p,
.handbook-package-card p,
.handbook-fit-card p,
.handbook-compare-card p,
.handbook-source-card p {
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.68;
}

.handbook-faq p a,
#current-context .handbook-outcome-card p a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.handbook-faq p a:hover,
#current-context .handbook-outcome-card p a:hover { color: var(--teal-dark); }

.handbook-faq p a:focus-visible,
#current-context .handbook-outcome-card p a:focus-visible {
  border-radius: 3px;
  outline: 3px solid rgba(30, 95, 168, 0.28);
  outline-offset: 3px;
}

.handbook-parts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px;
  align-items: start;
}

.handbook-part {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.055);
}

.handbook-part:last-child:nth-child(odd) { grid-column: 1 / -1; }

.handbook-part summary {
  position: relative;
  display: grid;
  grid-template-columns: 51px minmax(0, 1fr) 24px;
  gap: 16px;
  align-items: center;
  min-height: 88px;
  padding: 17px 21px;
  color: var(--white);
  cursor: pointer;
  list-style: none;
}

.handbook-part summary::-webkit-details-marker { display: none; }

.handbook-part summary::after {
  content: "+";
  color: var(--teal);
  font-size: 1.4rem;
  font-weight: 400;
  text-align: center;
}

.handbook-part[open] summary::after { content: "−"; }

.handbook-part-number {
  display: inline-flex;
  width: 49px;
  height: 49px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 180, 166, 0.14);
  color: #a9f3ec;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.045em;
}

.handbook-part-title {
  display: block;
  color: var(--white);
  font-size: 1.02rem;
  line-height: 1.35;
}

.handbook-part-count {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.76rem;
  font-weight: 500;
}

.handbook-chapter-list {
  margin: 0;
  padding: 0 22px 22px 86px;
  color: rgba(255, 255, 255, 0.77);
}

.handbook-chapter-list li {
  margin: 0 0 10px;
  padding-left: 5px;
  font-size: 0.87rem;
  line-height: 1.45;
}

.handbook-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.handbook-gallery figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.handbook-gallery figure:last-child { grid-column: 1 / -1; }

.handbook-gallery a {
  display: block;
  overflow: hidden;
  background: #e7edf4;
}

.handbook-gallery img {
  display: block;
  width: 100%;
  height: min(58vw, 620px);
  object-fit: contain;
  transition: transform 0.35s ease;
}

.handbook-gallery figure:last-child img {
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.handbook-gallery a:hover img { transform: scale(1.015); }

.handbook-gallery figcaption {
  padding: 17px 20px 19px;
  color: var(--text-mid);
  font-size: 0.86rem;
  line-height: 1.55;
}

.handbook-gallery figcaption strong { color: var(--navy); }

.handbook-sample-action { margin-top: 30px; }

.handbook-package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.handbook-package-card {
  position: relative;
  padding: 25px 24px 24px 56px;
}

.handbook-package-card > i {
  position: absolute;
  top: 26px;
  left: 23px;
  color: var(--teal-dark);
}

.handbook-offer-boundary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid rgba(30, 95, 168, 0.22);
  border-radius: var(--radius-lg);
  background: #edf4fb;
}

.handbook-offer-boundary i {
  margin-top: 3px;
  color: var(--blue);
  font-size: 1.1rem;
}

.handbook-offer-boundary p {
  margin: 0;
  color: var(--text-mid);
  font-size: 0.9rem;
  line-height: 1.65;
}

.handbook-offer-boundary strong { color: var(--navy); }

.handbook-fit-grid,
.handbook-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.handbook-fit-card,
.handbook-compare-card { padding: 28px; }

.handbook-fit-card.is-fit {
  border-top: 4px solid var(--teal);
}

.handbook-fit-card.is-not-fit {
  border-top: 4px solid #d4a62a;
}

.handbook-check-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.handbook-check-list li {
  position: relative;
  padding-left: 27px;
  color: var(--text-mid);
  font-size: 0.89rem;
  line-height: 1.55;
}

.handbook-check-list li::before {
  content: "✓";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--teal-dark);
  font-weight: 800;
}

.handbook-fit-card.is-not-fit .handbook-check-list li::before {
  content: "—";
  color: #9a6f00;
}

.handbook-compare-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.handbook-compare-card {
  padding: 24px;
}

.handbook-compare-card.is-handbook {
  border-color: rgba(0, 180, 166, 0.42);
  box-shadow: 0 14px 32px rgba(0, 135, 127, 0.1);
}

.handbook-author-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) minmax(280px, 0.62fr);
  gap: 38px;
  align-items: center;
}

.handbook-author-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.handbook-author-copy h2 {
  margin: 12px 0 14px;
  color: var(--navy);
  font-size: clamp(1.8rem, 3vw, 2.45rem);
}

.handbook-author-copy p {
  color: var(--text-mid);
  line-height: 1.72;
}

.handbook-author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 18px;
}

.handbook-author-links a {
  display: inline-flex;
  min-height: 24px;
  padding-block: 2px;
  align-items: center;
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 700;
}

.handbook-source-card {
  padding: 27px;
  background: var(--navy);
  border-color: rgba(255, 255, 255, 0.1);
}

.handbook-source-card h3 { color: var(--white); }
.handbook-source-card p { color: rgba(255, 255, 255, 0.72); }

.handbook-source-facts {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.handbook-source-fact {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr);
  gap: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  line-height: 1.4;
}

.handbook-source-fact strong { color: #a9f3ec; }

.handbook-faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  align-items: start;
}

.handbook-faq details {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.handbook-faq summary {
  position: relative;
  padding: 20px 50px 20px 21px;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.4;
}

.handbook-faq summary::-webkit-details-marker { display: none; }

.handbook-faq summary::after {
  content: "+";
  position: absolute;
  top: 17px;
  right: 19px;
  color: var(--teal-dark);
  font-size: 1.25rem;
}

.handbook-faq details[open] summary::after { content: "−"; }

.handbook-faq p {
  margin: 0;
  padding: 0 21px 21px;
  color: var(--text-mid);
  font-size: 0.88rem;
  line-height: 1.68;
}

.handbook-final-cta {
  padding-bottom: 0;
  background: var(--book-paper);
}

.handbook-final-card {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 64px);
  border-radius: 22px;
  background:
    radial-gradient(circle at 88% 14%, rgba(0, 180, 166, 0.23), transparent 31%),
    linear-gradient(135deg, var(--navy), #12375f);
  box-shadow: 0 24px 60px rgba(10, 35, 66, 0.22);
  text-align: center;
}

.handbook-final-card h2 {
  max-width: 820px;
  margin: 14px auto 15px;
  color: var(--white);
  font-size: clamp(1.75rem, 3.6vw, 2.75rem);
}

.handbook-final-card > p {
  max-width: 780px;
  margin: 0 auto 25px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.7;
}

.handbook-final-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 13px;
}

@media (max-width: 1080px) {
  .handbook-hero-grid { grid-template-columns: minmax(0, 1.15fr) 330px; gap: 44px; }
  .handbook-proof-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .handbook-proof-item:nth-child(3) { border-right: 0; }
  .handbook-proof-item:nth-child(-n + 3) { border-bottom: 1px solid var(--border); }
  .handbook-proof-item:nth-child(4) { grid-column: 1 / 2; }
  .handbook-proof-item:nth-child(5) { grid-column: 2 / 3; border-right: 1px solid var(--border); }
  .handbook-compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handbook-author-grid { grid-template-columns: 210px minmax(0, 1fr); }
  .handbook-source-card { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .handbook-hero { padding: 128px 0 72px; }
  .handbook-hero-grid { grid-template-columns: 1fr; }
  .handbook-cover-wrap { width: min(78vw, 365px); }
  .handbook-outcomes,
  .handbook-package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handbook-parts,
  .handbook-fit-grid,
  .handbook-faq { grid-template-columns: 1fr; }
  .handbook-part:last-child:nth-child(odd) { grid-column: auto; }
  .handbook-gallery { gap: 17px; }
  .handbook-author-grid { align-items: start; }
}

@media (max-width: 620px) {
  .handbook-hero { padding: 112px 0 58px; }
  .handbook-hero h1 { font-size: clamp(2.05rem, 11vw, 3rem); }
  .handbook-hero-actions { flex-direction: column; }
  .handbook-hero-actions .btn { width: 100%; }
  .handbook-proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .handbook-proof-item,
  .handbook-proof-item:nth-child(3),
  .handbook-proof-item:nth-child(5) { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .handbook-proof-item:nth-child(even) { border-right: 0; }
  .handbook-proof-item:nth-child(4),
  .handbook-proof-item:nth-child(5) { grid-column: auto; }
  .handbook-proof-item:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .handbook-outcomes,
  .handbook-package-grid,
  .handbook-gallery,
  .handbook-compare-grid,
  .handbook-author-grid { grid-template-columns: 1fr; }
  .handbook-gallery figure:last-child,
  .handbook-source-card { grid-column: auto; }
  .handbook-gallery img { height: auto; max-height: none; }
  .handbook-author-photo { width: min(70vw, 240px); }
  .handbook-part summary { grid-template-columns: 44px minmax(0, 1fr) 20px; gap: 12px; padding-inline: 16px; }
  .handbook-part-number { width: 44px; height: 44px; }
  .handbook-chapter-list { padding: 0 18px 20px 72px; }
  .handbook-source-fact { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 480px) {
  .handbook-hero-byline span { flex-basis: 100%; }
  .handbook-hero-byline span::before { content: none; margin-right: 0; }
}

@media (max-width: 390px) {
  .handbook-eyebrow { font-size: 0.68rem; }
  .handbook-meta { gap: 10px; }
  .handbook-meta span { width: 100%; }
  .handbook-proof-item { padding-inline: 10px; }
  .handbook-outcome-card,
  .handbook-package-card,
  .handbook-fit-card,
  .handbook-compare-card,
  .handbook-source-card { padding: 22px; }
  .handbook-package-card { padding-left: 50px; }
  .handbook-package-card > i { left: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .handbook-gallery img { transition: none; }
}
