/* =========================================================================
   EasyStack — Whitepapers page
   Builds on the global design tokens defined in css/main.css (:root --es-*).
   Layout follows the reference design (light hero + decorative visual + card
   grid, NO left category sidebar); colour language follows the site.
   ========================================================================= */

/* ------------------------------ HERO (light, title left + decorative visual right) ------------------------------ */
.articleDownload {
cursor: pointer;
}
.wp-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #f3f6ff 0%, #f8faff 48%, #ffffff 100%);
  border-bottom: 1px solid var(--es-border);
  padding-block: clamp(72px, 9vw, 120px) clamp(64px, 8vw, 104px);
}
.wp-hero__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.wp-hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(67, 56, 202, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(67, 56, 202, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, #000, transparent 78%);
}
.wp-hero__orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.32; }
.wp-hero__orb--1 { width: 420px; height: 420px; top: -180px; left: -80px; background: radial-gradient(circle, rgba(67, 56, 202, 0.4), transparent 70%); }
.wp-hero__orb--2 { width: 380px; height: 380px; top: -160px; right: -60px; background: radial-gradient(circle, rgba(34, 211, 238, 0.32), transparent 70%); }

.wp-hero__inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.wp-hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  border: 1px solid rgba(79, 70, 229, 0.28);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--es-primary-ink);
}
.wp-hero__title { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.1; letter-spacing: -0.03em; }
.wp-hero__lead { margin-top: 22px; max-width: 560px; font-size: clamp(14.5px, 1.6vw, 17px); line-height: 1.72; color: var(--es-text-dim); }

/* Decorative visual (right column): stacked whitepaper covers + floating chips */
.wp-hero__visual { position: relative; height: clamp(300px, 30vw, 400px); }
.wp-visual__halo {
  position: absolute; inset: 6% 4%; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.22), rgba(34, 211, 238, 0.12) 55%, transparent 74%);
  filter: blur(30px);
}
.wp-doc {
  position: absolute; display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: 16px;
  background: var(--es-surface); border: 1px solid var(--es-border);
  box-shadow: 0 24px 60px rgba(15, 18, 43, 0.14);
}
.wp-doc__cap { display: flex; align-items: center; justify-content: center; height: 64px; border-radius: 10px; color: #fff; }
.wp-doc__cap--main { background: var(--es-gradient); }
.wp-doc__cap--ai { background: var(--es-ai-gradient); }
.wp-doc__cap--cyan { background: linear-gradient(120deg, #22d3ee, #0ea5e9); }
.wp-doc__line { height: 8px; border-radius: 4px; background: rgba(15, 18, 43, 0.08); }
.wp-doc__line--t { height: 10px; width: 72%; background: rgba(15, 18, 43, 0.16); }
.wp-doc__line--s { width: 46%; }
.wp-doc__tag {
  margin-top: auto; align-self: flex-start; padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--es-primary-ink); background: rgba(79, 70, 229, 0.1); border: 1px solid rgba(79, 70, 229, 0.25);
}
.wp-doc--main { z-index: 3; width: min(240px, 62%); height: 80%; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-2deg); padding: 16px; gap: 9px; }
.wp-doc--back { z-index: 1; width: min(196px, 52%); height: 62%; opacity: 0.85; }
.wp-doc--left { left: 1%; top: 9%; transform: rotate(-8deg); }
.wp-doc--right { right: 1%; bottom: 7%; transform: rotate(7deg); }
.wp-visual__chip {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--es-border-strong); box-shadow: var(--es-shadow-sm);
  font-size: 12.5px; font-weight: 700; color: var(--es-text);
  animation: es-float 7s ease-in-out infinite;
}
.wp-visual__chip svg { color: var(--es-primary); }
.wp-visual__chip--1 { top: 4%; right: 6%; color: var(--es-primary-ink); }

.wp-topics { margin-top: 30px; }
.wp-topics__label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--es-text-mute); margin-bottom: 10px; }
.wp-topics__list { display: flex; flex-wrap: wrap; gap: 8px; }
.wp-topic {
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--es-border); background: rgba(15, 18, 43, 0.03);
  color: var(--es-text-dim); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.wp-topic:hover { color: var(--es-primary-ink); border-color: rgba(79, 70, 229, 0.5); background: rgba(79, 70, 229, 0.08); transform: translateY(-2px); }
.wp-topic.is-active { color: #fff; background: var(--es-gradient); border-color: transparent; box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }

/* ------------------------------ BROWSE (head + sort + grid, no sidebar) ------------------------------ */
.wp-browse { padding-block: clamp(48px, 7vw, 88px); background: var(--es-bg); }
.wp-browse__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.wp-browse__head .es-section-head { margin-bottom: 0; }
.wp-sort { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--es-text-mute); }
.wp-sort select {
  height: 42px; padding: 0 14px;
  border-radius: var(--es-radius-sm); border: 1px solid var(--es-border-strong);
  background: var(--es-surface); color: var(--es-text);
  font-size: 14px; outline: none; cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.wp-sort select:focus { border-color: var(--es-primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); }

/* Card grid — 4 across on desktop (list currently holds 4 items) */
.wp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.wp-card {
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--es-radius);
  background: var(--es-surface); border: 1px solid var(--es-border);
  overflow: hidden; text-decoration: none; color: inherit;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.wp-card:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(15, 18, 43, 0.12); border-color: var(--es-border-strong); color: inherit; }
.wp-card__image { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--es-surface-2); }
.wp-card__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.wp-card:hover .wp-card__thumb { transform: scale(1.06); }
.wp-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 20px; }
.wp-card__badge {
  align-self: flex-start; padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--es-primary-ink); background: rgba(79, 70, 229, 0.1); border: 1px solid rgba(79, 70, 229, 0.25);
}
.wp-card__title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; color: var(--es-text); transition: color 0.25s ease; }
.wp-card:hover .wp-card__title { color: var(--es-primary-ink); }
.wp-card__excerpt { font-size: 13px; line-height: 1.65; color: var(--es-text-dim); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wp-card__date { margin-top: auto; padding-top: 8px; font-size: 12.5px; color: var(--es-text-mute); }

.wp-empty { display: none; padding: 48px 20px; text-align: center; font-size: 14.5px; color: var(--es-text-mute); border: 1px dashed var(--es-border-strong); border-radius: var(--es-radius); }

/* ------------------------------ DETAIL PAGE (whitepaper-post.html) ------------------------------ */
.wpp-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #f5f7ff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--es-border);
  padding-block: clamp(16px, 2.5vw, 28px) clamp(36px, 5vw, 56px);
  text-align: left;
}
.wpp-crumbs { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--es-text-mute); margin-bottom: 20px; }
.wpp-crumbs a { color: var(--es-text-dim); text-decoration: none; transition: color 0.2s ease; }
.wpp-crumbs a:hover { color: var(--es-primary-ink); }
.wpp-crumbs span[aria-current] { color: var(--es-primary-ink); font-weight: 600; }
.wpp-title { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.15; letter-spacing: -0.03em; }
.wpp-deck { margin: 18px 0 0; max-width: 720px; font-size: clamp(15px, 1.7vw, 18px); line-height: 1.7; color: var(--es-text-dim); }
.wpp-meta { display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 22px; font-size: 13.5px; color: var(--es-text-mute); }
.wpp-meta__sep { width: 4px; height: 4px; border-radius: 50%; background: var(--es-border-strong); }
.wpp-actions { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.wpp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(32px, 4vw, 56px); padding-block: clamp(48px, 6vw, 76px); }
.wpp-content { font-size: 15.5px; line-height: 1.85; color: var(--es-text-dim); }
.wpp-content > * + * { margin-top: 18px; }
.wpp-content h2 { margin-top: 38px; font-size: clamp(21px, 2.4vw, 26px); letter-spacing: -0.02em; color: var(--es-text); }
.wpp-content p strong { color: var(--es-text); }
.wpp-content ul { padding-left: 22px; }
.wpp-content li { margin-top: 8px; }
.wpp-content li::marker { color: var(--es-primary); }

.wpp-chapters { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.wpp-chapters li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--es-radius-sm); border: 1px solid var(--es-border); background: var(--es-surface); transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease; }
.wpp-chapters li:hover { border-color: var(--es-border-strong); transform: translateX(4px); box-shadow: var(--es-shadow-sm); }
.wpp-chapters__num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(79, 70, 229, 0.1); border: 1px solid rgba(79, 70, 229, 0.25); color: var(--es-primary-ink); font-size: 13px; font-weight: 800; }
.wpp-chapters__t { font-size: 14.5px; font-weight: 700; color: var(--es-text); }
.wpp-chapters__d { margin-top: 2px; font-size: 13px; line-height: 1.6; color: var(--es-text-dim); }

.wpp-highlight {
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 28px; padding: 20px 22px;
  border-radius: var(--es-radius); border: 1px solid rgba(79, 70, 229, 0.25);
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.08), rgba(79, 70, 229, 0.08));
  font-size: 14.5px; line-height: 1.7; color: var(--es-text);
}
.wpp-highlight svg { flex: none; margin-top: 2px; color: var(--es-primary); }

/* Sticky download sidebar */
.wpp-side__stick { position: sticky; top: calc(var(--es-header-h) + 24px); display: flex; flex-direction: column; gap: 20px; }
.wpp-dl { padding: 22px; border-radius: var(--es-radius-lg); border: 1px solid var(--es-border); background: var(--es-surface); box-shadow: var(--es-shadow-sm); }
.wpp-dl__cover { display: block; border-radius: var(--es-radius-sm); overflow: hidden; border: 1px solid var(--es-border); }
.wpp-dl__cover img { display: block; width: 100%; }
.wpp-dl__title { margin-top: 14px; font-size: 15.5px; font-weight: 700; line-height: 1.4; color: var(--es-text); }
.wpp-specs { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.wpp-specs__row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.wpp-specs__row span:first-child { color: var(--es-text-mute); }
.wpp-specs__row span:last-child { color: var(--es-text); font-weight: 600; }
.wpp-dl .es-btn { width: 100%; justify-content: center; margin-top: 16px; }
.wpp-dl__note { margin-top: 10px; font-size: 12px; text-align: center; color: var(--es-text-mute); }
.wpp-side__card { padding: 22px; border-radius: var(--es-radius); border: 1px solid var(--es-border); background: var(--es-surface); }
.wpp-side__title { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--es-text-mute); margin-bottom: 12px; }
.wpp-side__links { display: flex; flex-direction: column; gap: 10px; }
.wpp-side__links a { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--es-text-dim); text-decoration: none; transition: color 0.2s ease, gap 0.2s ease; }
.wpp-side__links a:hover { color: var(--es-primary-ink); gap: 12px; }
.wpp-side__links svg { color: var(--es-primary); }

.wpp-related { padding-block: clamp(48px, 6vw, 76px); background: var(--es-bg-alt); border-top: 1px solid var(--es-border); }
.wp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ------------------------------ RESPONSIVE ------------------------------ */
@media (max-width: 1080px) {
  .wp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wp-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wpp-layout { grid-template-columns: 1fr; }
  .wpp-side__stick { position: static; }
}
@media (max-width: 960px) {
  .wp-hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .wp-hero__visual { order: -1; width: 100%; max-width: 460px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .wp-grid { grid-template-columns: 1fr; }
  .wp-grid--3 { grid-template-columns: 1fr; }
  .wp-hero__visual { height: 280px; }
  .wpp-actions .es-btn { width: 100%; justify-content: center; }
}

/* ------------------------------ REDUCED MOTION ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .wp-card:hover .wp-card__thumb { transform: none; }
  .wp-topic:hover { transform: none; }
  .wp-visual__chip { animation: none; }
}
