/* ══════════════════════════════════════════════════════
   WHITE PAPERS HUB
   Exclusively using existing theme classes and tokens:
   --navy, --navy-ink, --dark, --redorange, --orange,
   --cream, --cream2, --slate2, --white, --ams-line,
   --ams-surface, --ams-surface-2, --ams-ink, --ams-muted, --ams-accent
   .utility-next-heading, .ams-next-eyebrow, .ams-next-button,
   .resources-next-card-meta
   ══════════════════════════════════════════════════════ */

/* ================= RESOURCES PAGE: WHITE PAPERS ================= */
.resources-next-whitepapers {
  padding: clamp(3.5rem, 5.5vw, 6rem) 0;
  background: var(--ams-surface);
  position: relative;
}

.resources-whitepapers-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.resources-whitepaper-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.25rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--ams-line);
  border-radius: 20px;
  padding: 1.75rem;
  box-shadow: 0 16px 40px -28px rgba(30, 58, 138, 0.14);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s;
}

.resources-whitepaper-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px -26px rgba(30, 58, 138, 0.22);
}

.resources-whitepaper-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: var(--navy-ink);
  color: var(--white);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
}

.resources-whitepaper-cover::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -35px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--redorange) 0%, var(--orange) 100%);
  z-index: 0;
  pointer-events: none;
}

.resources-whitepaper-tag,
.resources-whitepaper-cover-title {
  position: relative;
  z-index: 1;
}

.resources-whitepaper-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px 10px;
  border-radius: 999px;
  align-self: flex-start;
  color: var(--white);
  line-height: 1.4;
}

.resources-whitepaper-cover-title {
  font-size: 19px;
  line-height: 1.2;
  max-width: 13ch;
  color: var(--white);
  font-weight: 700;
  font-family: 'Jost', system-ui, sans-serif;
}

.resources-whitepaper-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.resources-whitepaper-body h3 {
  margin: 0.5rem 0 0.85rem;
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--navy-ink);
  font-family: 'Jost', system-ui, sans-serif;
}

.resources-whitepaper-body p {
  color: var(--slate2);
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.resources-whitepaper-body .read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: max-content;
  color: var(--redorange);
  font-weight: 600;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: color 0.18s, gap 0.18s;
}

.resources-whitepaper-body .read-link:hover {
  color: var(--orange);
  gap: 0.6rem;
}

/* ================= POPUP MODAL ================= */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(13, 30, 74, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.popup-overlay.open {
  display: flex;
}
.popup {
  width: 100%;
  max-width: 480px;
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 35px 80px -25px rgba(13, 30, 74, 0.5);
  animation: wpModalFade .25s ease-out;
}
@keyframes wpModalFade {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.popup-head {
  position: relative;
  background: var(--navy-ink);
  color: var(--white);
  padding: 1.75rem 2rem 1.5rem;
  border-bottom: 3px solid var(--orange);
}
.popup-head .eyebrow {
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.popup-head h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  padding-right: 32px;
  line-height: 1.3;
  color: var(--white);
  font-family: 'Jost', system-ui, sans-serif;
}
.popup-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.18s;
}
.popup-close:hover {
  background: rgba(255, 255, 255, 0.25);
}
.popup form {
  padding: 1.75rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.popup label {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy-ink);
  margin: 0;
}
.popup input[type=email] {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--navy-ink);
  border: 1.5px solid var(--ams-line);
  border-radius: 10px;
  background: var(--cream);
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.popup input[type=email]:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--white);
}
.popup .error {
  color: var(--redorange);
  font-size: 13px;
  min-height: 18px;
  margin: 0;
}
.consent {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 13px;
  color: var(--slate2);
  margin: 0.25rem 0 0.5rem;
}
.consent input {
  margin-top: 3px;
  accent-color: var(--redorange);
  cursor: pointer;
}
.popup .ams-next-button {
  width: 100%;
  margin-top: 0.25rem;
}
.note {
  font-size: 12px;
  color: var(--slate2);
  opacity: 0.8;
  text-align: center;
  margin: 0.25rem 0 0;
}

/* ================= WHITEPAPER DETAILS PAGE ================= */
.wp-hero {
  background: var(--navy-ink);
  color: var(--white);
  padding: clamp(3.5rem, 6vw, 5.5rem) 0 3.5rem;
  border-bottom: 4px solid var(--orange);
}
.wp-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
.wp-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  align-items: flex-start;
}
.wp-hero .back {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.18s;
}
.wp-hero .back:hover {
  color: var(--white);
}
.wp-hero .eyebrow {
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}
.wp-hero h1 {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--white);
  font-family: 'Jost', system-ui, sans-serif;
  margin: 0;
}
.wp-hero .lede {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 60ch;
  line-height: 1.6;
  margin: 0;
}
.wp-hero .meta {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
}
.wp-hero .cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--white);
  box-sizing: border-box;
}
.wp-hero .cover::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--redorange) 0%, var(--orange) 100%);
  z-index: 0;
  pointer-events: none;
}
.wp-hero .cover span,
.wp-hero .cover strong {
  position: relative;
  z-index: 1;
}
.wp-hero .cover span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 999px;
  align-self: flex-start;
  color: var(--white);
}
.wp-hero .cover strong {
  font-size: 24px;
  line-height: 1.2;
  max-width: 12ch;
  color: var(--white);
  font-weight: 700;
  font-family: 'Jost', system-ui, sans-serif;
}

/* Details Page Main Content */
.wp-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3.5rem;
  padding: 4.5rem 2rem;
  min-height: 500px;
}
.wp-main .article {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}
.wp-main .article section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.wp-main .article h2 {
  font-size: clamp(22px, 2vw, 26px);
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--navy-ink);
  font-family: 'Jost', system-ui, sans-serif;
}
.wp-main .article p {
  color: var(--slate2);
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 0.75rem;
}
.wp-main .sidebar {
  align-self: start;
  background: var(--white);
  border: 1px solid var(--ams-line);
  border-radius: 18px;
  padding: 1.75rem;
  box-shadow: 0 16px 40px -28px rgba(30, 58, 138, 0.12);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 110px;
}
.wp-main .sidebar .eyebrow {
  color: var(--redorange);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
}
.wp-main .sidebar ul {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.wp-main .sidebar li {
  color: var(--slate2);
  font-size: 15px;
  line-height: 1.5;
}
.wp-main .sidebar hr {
  border: 0;
  border-top: 1px solid var(--ams-line);
  margin: 0.25rem 0;
}
.wp-main .sidebar p {
  color: var(--slate2);
  font-size: 15px;
  margin: 0;
}
.wp-main .sidebar a {
  color: var(--redorange);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wp-main .sidebar a:hover {
  color: var(--orange);
}

/* ================= GATED READING LOGIC ================= */
.wp-is-locked .wp-gated-locked-content {
  display: none !important;
}
.wp-is-locked .wp-gate-card {
  display: block !important;
}
.wp-is-unlocked .wp-gate-card {
  display: none !important;
}
.wp-is-unlocked .wp-gated-locked-content {
  display: block !important;
  animation: wpContentFadeIn 0.35s ease-out;
}
@keyframes wpContentFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.wp-gate-card {
  display: none;
  background: var(--white);
  border: 1.5px solid var(--ams-line);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 50px -25px rgba(13, 30, 74, 0.14);
  margin: 1.5rem 0 2rem;
  text-align: center;
}
.wp-gate-card .eyebrow {
  color: var(--redorange);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.wp-gate-card h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy-ink);
  margin: 0 0 0.6rem;
  font-family: 'Jost', system-ui, sans-serif;
}
.wp-gate-card p {
  color: var(--slate2);
  font-size: 16px;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}
.wp-gate-row {
  display: flex;
  gap: 0.65rem;
  max-width: 480px;
  margin: 0 auto 0.75rem;
}
.wp-gate-row input[type=email] {
  flex: 1;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 16px;
  border: 1.5px solid var(--ams-line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--navy-ink);
  box-sizing: border-box;
}
.wp-gate-row input[type=email]:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--white);
}
.wp-gate-row .ams-next-button {
  white-space: nowrap;
}
.wp-gate-form .consent {
  justify-content: center;
  margin-top: 0.5rem;
}
.wp-gate-msg {
  min-height: 20px;
  font-size: 13.5px;
  margin-top: 4px;
}
.wp-gate-msg.is-error {
  color: var(--redorange);
}
.wp-gate-msg.is-success {
  color: var(--navy);
}

/* Responsive */
@media (max-width: 860px) {
  .resources-whitepaper-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .resources-whitepaper-cover {
    aspect-ratio: 16 / 9;
  }
  .wp-hero-grid,
  .wp-main {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  .wp-gate-row {
    flex-direction: column;
  }
  .wp-main .sidebar {
    position: static;
  }
}
