/* ==========================================================================
   SurfCheck.nz — Learn page (index + article template)

   Sections (top→bottom):
     1. Hero with skill picker
     2. Coaching Videos (3 horizontal rails — YouTube playlists)
     3. Guides & Articles (featured + filterable grid)
     4. Aotearoa Surf Channel (latest videos)
   ========================================================================== */

/* ── Hero ──────────────────────────────────────────────────────────────── */
/* Subtle visual depth: two soft radial blobs (blue + teal) layered behind the
   text, plus a faint diagonal line pattern for texture without distraction. */
.learn-hero-wrap {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 360px at 12% 30%, rgba(95,183,255,0.14) 0%, transparent 60%),
    radial-gradient(700px 360px at 92% 70%, rgba(34,197,173,0.10) 0%, transparent 60%);
}
.learn-hero-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(45deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  pointer-events: none;
}
.learn-hero {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap-7) var(--gap-5) var(--gap-6);
  text-align: left;
}
.learn-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--gap-3);
}
.learn-hero-title {
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.0;
  margin: 0 0 var(--gap-3);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  max-width: 22ch;
}
.learn-hero-subtitle {
  font-size: clamp(16px, 1.7vw, 19px);
  color: var(--text-2);
  margin: 0 0 var(--gap-5);
  max-width: 64ch;
  line-height: 1.55;
}

/* Skill picker pills */
.skill-picker {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  align-items: center;
}
.skill-picker-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: var(--gap-2);
}
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.skill-pill:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.skill-pill.active {
  background: rgba(95,183,255,0.15);
  border-color: rgba(95,183,255,0.5);
  color: var(--accent);
}

/* ── Section frame ─────────────────────────────────────────────────────── */
.learn-section {
  max-width: var(--max-w);
  margin: var(--gap-7) auto 0;
  padding: 0 var(--gap-5);
}
.learn-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap-4);
  margin-bottom: var(--gap-4);
  flex-wrap: wrap;
}
.learn-section-title-block { flex: 1 1 auto; min-width: 0; }
.learn-section-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.learn-section-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.015em;
  color: var(--text);
}
.learn-section-sub {
  font-size: 14.5px;
  color: var(--text-3);
  margin: 0;
  max-width: 60ch;
  line-height: 1.5;
}
.learn-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(224,133,133,0.10);
  border: 1px solid rgba(224,133,133,0.35);
  color: #e08585;
  white-space: nowrap;
}
.learn-section-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #e08585; box-shadow: 0 0 6px rgba(224,133,133,0.7);
}

/* ── Video rails (coaching) ────────────────────────────────────────────── */
.video-rail {
  margin-bottom: var(--gap-6);
}
.video-rail:last-child { margin-bottom: 0; }
.video-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-3);
  margin-bottom: var(--gap-3);
  flex-wrap: wrap;
}
/* Mobile: stack title + level vertically so titles don't get squeezed */
@media (max-width: 600px) {
  .video-rail-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .video-rail-title { font-size: 16px; }
  .video-rail-level {
    font-size: 10px;
    padding: 2px 9px;
    letter-spacing: 0.08em;
  }
}
.video-rail-title {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.video-rail-title .rail-icon { font-size: 20px; }
.video-rail-level {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(95,183,255,0.12);
  border: 1px solid rgba(95,183,255,0.3);
}
.video-rail-desc {
  font-size: 14px;
  color: var(--text-3);
  margin: -4px 0 var(--gap-3);
  line-height: 1.5;
  max-width: 70ch;
}
/* Mobile: horizontal scroll (card width fixed). Desktop: responsive grid. */
.video-rail-scroll {
  display: flex;
  gap: var(--gap-3);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
  padding-bottom: 8px;
  margin: 0 calc(-1 * var(--gap-5));
  padding-left: var(--gap-5);
  padding-right: var(--gap-5);
}
.video-rail-scroll::-webkit-scrollbar { height: 6px; }
.video-rail-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
@media (min-width: 920px) {
  /* On desktop, the rail becomes a grid (4 cols) with show-more pagination */
  .video-rail-scroll {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap-3);
    overflow: visible;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
  }
}
.video-card {
  flex: 0 0 auto;
  width: 280px;
  cursor: pointer;
  border-radius: var(--r-3);
  overflow: hidden;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  transition: transform 0.15s, border-color 0.15s;
}
@media (min-width: 920px) {
  .video-card { width: auto; }   /* grid cell decides width */
}
@media (min-width: 768px) and (max-width: 919.98px) {
  .video-card { width: 320px; }
}
.video-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}
.video-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  overflow: hidden;
}
.video-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.video-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,18,31,0) 50%, rgba(6,18,31,0.7) 100%);
  pointer-events: none;
}
.video-card-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(95,183,255,0.9);
  color: #04101c;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  font-weight: 700;
  z-index: 2;
  transition: transform 0.15s, background 0.15s;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.video-card:hover .video-card-play {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--accent-2);
}
.video-card-body {
  padding: 12px 14px 14px;
}
.video-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rail-loading {
  padding: var(--gap-5);
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  font-style: italic;
}

/* Show-more button (videos + articles) — styled in line with site theme */
.show-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--gap-4);
}
.show-more-btn {
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.show-more-btn:hover {
  background: rgba(95,183,255,0.12);
  border-color: rgba(95,183,255,0.45);
  color: var(--accent);
}
.show-more-btn[hidden] { display: none; }
.show-more-count {
  margin-left: 6px;
  opacity: 0.6;
  font-weight: 500;
}

/* Desktop: hide videos past #8 in each rail until "Show more" expands it.
   Mobile keeps horizontal scroll showing everything. */
@media (min-width: 920px) {
  .video-rail:not(.show-all) .video-rail-scroll > .video-card:nth-child(n+9) {
    display: none;
  }
}
/* Mobile: hide the show-more button (scrolling already shows everything) */
@media (max-width: 919.98px) {
  .video-rail .show-more-wrap { display: none; }
}

/* Article grid: hide cards past initial limit until "Show more" expands.
   Limit lives in JS (.article-grid.show-all class). */
.article-grid:not(.show-all) > .article-card.is-overflow {
  display: none;
}

/* Channel grid: same pattern as articles */
.channel-grid:not(.show-all) > .video-card.is-overflow {
  display: none;
}

/* ── Articles section ──────────────────────────────────────────────────── */
.articles-controls {
  margin: 0 0 var(--gap-5);
  display: grid;
  gap: var(--gap-3);
}
.articles-search {
  display: flex;
  position: relative;
}
.articles-search input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
}
.articles-search input::placeholder { color: var(--text-3); }
.articles-search input:focus {
  outline: none;
  border-color: rgba(95,183,255,0.5);
  background: rgba(255,255,255,0.06);
}
.articles-search::before {
  content: "🔍";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.6;
}
.articles-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  align-items: center;
}
.articles-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  align-items: center;
}
.articles-filter-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 2px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-pill:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.filter-pill.active {
  background: rgba(95,183,255,0.15);
  border-color: rgba(95,183,255,0.5);
  color: var(--accent);
}
.filter-pill .count {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 500;
}

/* Featured article (large card) */
.featured-article {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: var(--gap-5);
  border-radius: var(--r-3);
  overflow: hidden;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border-2);
  transition: border-color 0.15s, transform 0.15s;
}
.featured-article:hover {
  border-color: rgba(95,183,255,0.4);
  transform: translateY(-2px);
}
@media (min-width: 800px) {
  .featured-article {
    grid-template-columns: 5fr 4fr;
  }
}
.featured-article-img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}
@media (min-width: 800px) {
  .featured-article-img { aspect-ratio: auto; height: 100%; min-height: 320px; }
}
.featured-article-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.featured-article:hover .featured-article-img img { transform: scale(1.03); }
.featured-article-body {
  padding: var(--gap-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--gap-3);
}
.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sand);
}
.featured-article-title {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.015em;
  color: var(--text);
}
.featured-article-intro {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}
.featured-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--gap-2);
}

/* Article grid */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-4);
}
@media (min-width: 600px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .article-grid { grid-template-columns: repeat(3, 1fr); }
}
.article-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-3);
  overflow: hidden;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  transition: transform 0.15s, border-color 0.15s;
}
.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
}
.article-card-img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}
.article-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.article-card:hover .article-card-img img { transform: scale(1.04); }
/* Read badge sits TOP-LEFT (star occupies TOP-RIGHT — primary action slot) */
.article-card-read-badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: var(--text-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: none;
}
.article-card.is-read .article-card-read-badge { display: inline-flex; align-items: center; gap: 4px; }
.article-card.is-read .article-card-read-badge::before { content: "✓"; }

/* ── Save star (article + video cards) — top-right primary action slot ──
   Implemented as <span role="button"> rather than <button> so it can sit
   inside a clickable parent without nested-interactive HTML breakage. */
.save-star {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s, color 0.15s, transform 0.05s, border-color 0.15s;
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
  padding: 0;
}
.save-star:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Hover styles ONLY on devices with true pointer-hover (mice). On touch
   devices, :hover sticks after tap and looks like "saved" — bug Che hit. */
@media (hover: hover) {
  .save-star:hover {
    background: rgba(0,0,0,0.7);
    color: var(--sand);
    border-color: rgba(232,184,75,0.5);
  }
}
.save-star.saved {
  background: rgba(232,184,75,0.22);
  color: var(--sand);
  border-color: rgba(232,184,75,0.6);
  box-shadow: 0 0 12px rgba(232,184,75,0.4);
}
.save-star:active { transform: scale(0.92); }
.article-card-body {
  padding: var(--gap-4);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.article-card-cat { color: var(--accent); }
.article-card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.article-card-intro {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 6px;
}
.article-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-3);
}
.no-results {
  padding: var(--gap-6);
  text-align: center;
  color: var(--text-3);
  font-size: 15px;
  font-style: italic;
}

/* ── Aotearoa channel grid ─────────────────────────────────────────────── */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap-3);
}
/* Channel cards must fill their grid cell (override the fixed 280px width
   from .video-card which is meant for horizontal-scroll rails on mobile). */
.channel-grid .video-card {
  width: 100%;
}

/* ── Video player modal (YouTube embed) ───────────────────────────────── */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(4, 12, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: var(--gap-5);
}
.video-modal.open { display: flex; }
.video-modal-frame {
  position: relative;
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.video-modal-frame iframe {
  width: 100%; height: 100%;
  border: 0;
}
.video-modal-close {
  position: absolute;
  top: -50px; right: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.video-modal-close:hover { background: rgba(255,255,255,0.2); }

/* ============================================================================
   ARTICLE PAGE (individual article)
   ============================================================================ */

.article-hero {
  position: relative;
  width: 100%;
  height: clamp(280px, 50vh, 480px);
  overflow: hidden;
  background: var(--bg-2);
}
.article-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 40%;
}
.article-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(6,18,31,0) 30%,
    rgba(6,18,31,0.65) 75%,
    rgba(6,18,31,0.92) 100%);
  pointer-events: none;
}
.article-hero-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: var(--gap-5) var(--gap-5) var(--gap-6);
}
.article-hero-overlay-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* Article hero save-star.
   Mobile (<920px): TOP-RIGHT of the hero image, away from the title.
   Desktop (≥920px): aligns to the right edge of the ARTICLE COLUMN (not the
   full content max-w — i.e. matches the layout grid below the hero), and
   vertically aligns to the first line of the title. */
.article-hero-actions {
  position: absolute;
  top: var(--gap-4);
  bottom: auto;
  left: 0; right: 0;
  z-index: 3;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap-5);
  display: flex;
  justify-content: flex-end;
  pointer-events: none;   /* let image clicks pass through */
}
/* Desktop: mirror the article-layout grid so the star sits at the right edge
   of the main article column (not the full max-w right edge). */
@media (min-width: 920px) {
  .article-hero-actions {
    top: auto;
    bottom: var(--gap-7);   /* pulls up to roughly the first-line of title */
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: var(--gap-7);
  }
  .article-hero-actions .save-star {
    grid-column: 1;
    justify-self: end;
  }
}
@media (min-width: 1280px) {
  .article-hero-actions {
    grid-template-columns: minmax(0, 1fr) 400px;
  }
}
.article-hero-actions .save-star {
  position: relative;
  top: auto; right: auto; left: auto; bottom: auto;
  pointer-events: auto;
  width: 42px; height: 42px;
  font-size: 19px;
  background: rgba(0,0,0,0.55);
  border-color: rgba(255,255,255,0.25);
}
.article-hero-actions .save-star.saved {
  background: rgba(232,184,75,0.28);
}
/* Breadcrumb sits on its OWN row above the pills, styled as a plain text link
   (not a pill) so it's clearly a "go back" affordance. */
.article-breadcrumb {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--gap-4);
}
.article-breadcrumb a {
  color: rgba(255,255,255,0.85);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  border-bottom: 1px dotted rgba(255,255,255,0.4);
  padding-bottom: 1px;
}
.article-breadcrumb a:hover { color: #fff; border-bottom-color: var(--accent); }

.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--gap-3);
}
.article-meta-row .pill {
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border-color: rgba(255,255,255,0.18);
  color: #f3f7fc;
}
.article-meta-row .pill.cat { color: var(--accent); border-color: rgba(95,183,255,0.5); background: rgba(95,183,255,0.2); }
.article-meta-row .pill.featured { color: var(--sand); border-color: rgba(232,184,75,0.5); background: rgba(232,184,75,0.18); }
.article-title {
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.05;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0,0,0,0.55), 0 1px 2px rgba(0,0,0,0.4);
  max-width: 22ch;
}

.article-layout {
  max-width: var(--max-w);
  margin: var(--gap-6) auto 0;
  padding: 0 var(--gap-5) var(--gap-5);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-6);
}
@media (min-width: 920px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: var(--gap-7);
  }
}

.article-intro {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
  margin: 0 0 var(--gap-5);
  padding-bottom: var(--gap-5);
  border-bottom: 1px solid var(--border);
}
.article-body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-2);
}
.article-body p { margin: 0 0 var(--gap-4); }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  margin: var(--gap-6) 0 var(--gap-3);
  color: var(--text);
  letter-spacing: -0.01em;
}
.article-body h3 {
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 700;
  margin: var(--gap-5) 0 var(--gap-2);
  color: var(--text);
}
.article-body ul, .article-body ol {
  margin: 0 0 var(--gap-4);
  padding-left: var(--gap-5);
}
.article-body li { margin-bottom: 8px; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--gap-4) 0;
  font-size: 15px;
  background: rgba(255,255,255,0.025);
  border-radius: var(--r-2);
  overflow: hidden;
}
.article-body th {
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-2);
}
.article-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.article-body tr:last-child td { border-bottom: 0; }
.article-body blockquote {
  margin: var(--gap-4) 0;
  padding: var(--gap-3) var(--gap-4);
  border-left: 3px solid var(--accent);
  background: rgba(95,183,255,0.06);
  color: var(--text);
  font-size: 16px;
  font-style: italic;
}

.article-sidebar {
  display: grid;
  gap: var(--gap-4);
  align-content: start;
}
@media (min-width: 920px) {
  .article-sidebar {
    position: sticky;
    top: calc(var(--header-h) + var(--gap-4));
  }
}

.article-related h3 {
  margin: 0 0 var(--gap-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.related-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-2);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.related-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-2);
}
.related-item img {
  width: 64px; height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.related-item-body {
  flex: 1;
  min-width: 0;
}
.related-item-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.related-item-title {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.35;
  font-weight: 600;
}

/* ── Page-hero override (matches the look of all other pages) ───────────
   When .page-hero-bg is on .learn-hero-wrap the photo + dark gradient
   should win over the subtle hatched texture this page used to ship with.
   Also centre the title block so the layout matches /lessons/, /home/,
   /favourites/, /stories/. */
.learn-hero-wrap.page-hero-bg::before {
  background-image:
    linear-gradient(180deg,
      rgba(6, 18, 31, 0.55) 0%,
      rgba(6, 18, 31, 0.20) 40%,
      rgba(6, 18, 31, 0.30) 75%,
      rgba(6, 18, 31, 0.65) 100%) !important;
  background-size: 100% 100% !important;
  opacity: 1 !important;
}
/* Learn hero stays left-aligned (per Che) — distinct from the other
   page heroes which centre. No alignment overrides; the original
   .learn-hero { text-align: left } from earlier in this file wins. */
