/* ==========================================================================
   academy-post.css — individual Academy article page
   ========================================================================== */

.ap {
  display: block;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.ap-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0a0f1c 0%, #0f1a2e 50%, #0a0f1c 100%);
  padding: clamp(6.5rem, 11vw, 8.5rem) var(--section-pad-x) clamp(9rem, 15vw, 12rem);
}

.ap-header::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 55% at 50% 0%, rgba(0, 153, 64, 0.14) 0%, transparent 60%);
}

/* Three columns — the outer two are equal, so the title column (2)
   stays centered on the page no matter how the back-link column (1)
   is positioned within its own gutter. */
.ap-header__inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(8.75rem, 1fr) minmax(0, 47.5rem) minmax(8.75rem, 1fr);
  gap: 2rem;
}

.ap-header__content {
  grid-column: 2;
  min-width: 0;
}

.ap-back {
  grid-column: 1;
  justify-self: start;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  padding-top: 0.4rem;
  transition: color 0.2s ease, gap 0.2s ease;
}

.ap-back:hover {
  color: #5ee6a8;
  gap: 0.7rem;
}

.ap-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--tag-pad);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #5ee6a8;
  background: rgba(94, 230, 168, 0.1);
  border: 1px solid rgba(94, 230, 168, 0.25);
  margin-bottom: 1.25rem;
}

.ap-title {
  font-weight: 900;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #f8fafc;
  margin-bottom: 1.1rem;
}

.ap-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--fs-sm);
}

.ap-meta__dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 720px) {
  .ap-header__inner {
    grid-template-columns: 1fr;
  }
  .ap-back {
    grid-column: 1;
    margin-bottom: 1.5rem;
  }
  .ap-header__content {
    grid-column: 1;
  }
}

/* ── Hero image ───────────────────────────────────────────────────────────
   Pulled up by exactly 1/3 of its own rendered height (a width-relative
   percentage margin equals a fixed fraction of height for a fixed aspect
   ratio) so the dark header background ends 1/3 of the way down the image
   instead of stopping flush above it. ────────────────────────────────── */
.ap-media {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
}

.ap-media__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-xl);
  display: block;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
  margin-top: calc(-12% - 1.5rem);
}

/* ── Body ─────────────────────────────────────────────────────────────── */
.ap-body-wrap {
  background: var(--bg);
  padding: clamp(3rem, 6vw, 4rem) var(--section-pad-x);
}

.ap-body {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text);
  font-size: var(--fs-md);
  line-height: 1.8;
}

.ap-body p {
  margin-bottom: 1.5rem;
}

.ap-body h2 {
  font-weight: 800;
  font-size: var(--fs-lg);
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 2.5rem 0 1.1rem;
}

.ap-body ul {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ap-body li {
  line-height: 1.65;
}

.ap-body li::marker {
  color: var(--accent);
}

/* ── CTA band ─────────────────────────────────────────────────────────── */
.ap-cta {
  padding: 0 var(--section-pad-x) clamp(3.5rem, 6vw, 5rem);
  background: var(--bg);
}

.ap-cta__inner {
  position: relative;
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  background: #0a0e14;
  padding: clamp(2.25rem, 5vw, 3rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.ap-cta__inner::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 55% 70% at 15% 30%, rgba(0, 201, 87, 0.18) 0%, transparent 60%);
}

.ap-cta__text {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.ap-cta__title {
  color: #fff;
  font-weight: 900;
  font-size: var(--fs-lg);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.ap-cta__copy {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--fs-base);
  line-height: 1.6;
}

.ap-cta__btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--btn-pad-md);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ap-cta__btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ── Related posts ────────────────────────────────────────────────────── */
.ap-related {
  padding: 0 var(--section-pad-x) clamp(4rem, 7vw, 5.5rem);
  background: var(--bg);
}

.ap-related__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.ap-related__title {
  font-weight: 900;
  font-size: var(--fs-h3);
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0.5rem 0 1.75rem;
}

.ap-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.25rem, 1fr));
  gap: 1.25rem;
}

.ap-related-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ap-related-card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-hover);
}

.ap-related-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0f172a;
}

.ap-related-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  display: block;
}

.ap-related-card__tag {
  align-self: flex-start;
  margin: 1.25rem 1.5rem 0;
  padding: var(--tag-pad);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border-card);
}

.ap-related-card__title {
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1.4;
  color: var(--text);
  margin: 0.85rem 1.5rem 0;
  transition: color 0.2s ease;
}

.ap-related-card:hover .ap-related-card__title {
  color: var(--accent);
}

.ap-related-card__meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  margin: 0.85rem 1.5rem 1.5rem;
}

.ap-related-card__dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 50%;
  background: #e2e8f0;
}
