/* /learn pages (built by scripts/build-learn.js). Loaded after style.css and
   reuses its tokens, header, download section, newsletter and footer.
   Editorial layout: cream page, image cards with the title over the photo. */

.learn-page {
  background: var(--sand-300);
}

/* HEADER: the hero's logo + download row on its green band */
.learn-header {
  background-color: var(--evernight-500);
  padding: 20px 16px;
}

.learn-header-inner {
  max-width: 1120px;
  margin: 0 auto;
}

.learn-logo-link {
  display: block;
}

.learn-draft-banner {
  background: var(--twilight-500);
  color: var(--white);
  font-size: var(--fs-sm);
  text-align: center;
  padding: 10px 16px;
}

/* LAYOUT */
.learn-main,
.learn-related {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.learn-page h1 {
  color: var(--onyx-600);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: var(--space-sm);
}

.learn-dek {
  font-size: var(--fs-lg);
  color: var(--onyx-500);
}

.learn-section-head {
  margin-bottom: 24px;
}

.learn-section-head h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 300;
  line-height: 1.15;
  color: var(--onyx-600);
  margin-bottom: 8px;
}

.learn-section-head p {
  max-width: 640px;
  margin-bottom: 0;
}

/* MEDIA: a photo, or a brand card with the site's blob shapes */
.learn-media-img,
.learn-media-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.learn-media-fallback {
  position: relative;
  overflow: hidden;
}

.learn-tone-0 {
  background: var(--evernight-500);
}

.learn-tone-1 {
  background: var(--twilight-500);
}

.learn-media-blob {
  position: absolute;
  pointer-events: none;
}

.learn-tone-0 .learn-media-blob-1 {
  width: 90%;
  top: -35%;
  right: -25%;
}

.learn-tone-0 .learn-media-blob-2 {
  width: 75%;
  bottom: -45%;
  left: -20%;
}

.learn-tone-1 .learn-media-blob-1 {
  width: 110%;
  top: -60%;
  left: -30%;
}

.learn-tone-1 .learn-media-blob-2 {
  width: 55%;
  bottom: -20%;
  right: -10%;
}

/* CARDS: title over the image, darkened at the bottom so it reads */
.learn-cards,
.learn-featured ul {
  list-style: none;
}

.learn-cards {
  display: grid;
  gap: 16px;
}

.learn-card a {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  color: var(--white);
  text-decoration: none;
  isolation: isolate;
}

.learn-card a > .learn-media-img,
.learn-card a > .learn-media-fallback {
  position: absolute;
  inset: 0;
  z-index: -2;
  transition: transform 0.4s ease;
}

.learn-card a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(20, 20, 18, 0.7), rgba(20, 20, 18, 0) 60%);
}

.learn-card a:hover > .learn-media-img,
.learn-card a:hover > .learn-media-fallback {
  transform: scale(1.03);
}

.learn-card-text {
  position: absolute;
  left: 20px;
  right: 72px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.learn-card-title {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.25;
}

.learn-card-desc {
  font-size: var(--fs-sm);
  opacity: 0.9;
}

.learn-card-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  color: var(--onyx-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

.learn-card-grid a {
  aspect-ratio: 4 / 3;
}

.learn-card-side a {
  min-height: 150px;
}

.learn-card-side .learn-card-text {
  right: 20px;
}

.learn-card-side .learn-card-title {
  font-size: var(--fs-lg);
}

.learn-card-feature a {
  aspect-ratio: 4 / 3;
}

.learn-card-feature .learn-card-text {
  right: 20px;
  left: 24px;
  bottom: 24px;
}

/* On phones the photo is short, so the title goes alone */
.learn-card-feature .learn-card-desc {
  display: none;
}

.learn-card-feature .learn-card-title {
  font-size: clamp(1.5rem, 3.5vw, 2.25rem);
  font-weight: 300;
  line-height: 1.15;
}

/* INDEX */
.learn-index-intro {
  margin-bottom: var(--space-md);
}

.learn-featured {
  display: grid;
  gap: 16px;
  margin-bottom: var(--space-lg);
}

.learn-featured-side {
  display: grid;
  gap: 16px;
}

.learn-topic {
  margin-bottom: var(--space-lg);
}

/* ARTICLE */
.learn-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.learn-kicker a {
  color: var(--evernight-500);
  text-decoration: none;
}

.learn-kicker a:hover {
  text-decoration: underline;
}

.learn-hero {
  margin: 24px 0 16px;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.learn-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: var(--fs-sm);
  color: var(--onyx-500);
  border-bottom: 1px solid var(--sand-500);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}


/* QUICK ANSWER */
.learn-summary {
  background: var(--white);
  border-left: 4px solid var(--evernight-500);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: var(--space-md);
}

.learn-summary-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--evernight-500);
  margin-bottom: 6px;
}

.learn-summary p:last-child {
  margin-bottom: 0;
}

/* ARTICLE BODY (Markdown output) */
.learn-body {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.learn-body p,
.learn-body li {
  font-size: inherit;
}

.learn-body h2 {
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--onyx-600);
  margin: 40px 0 12px;
}

.learn-body h3 {
  font-size: 1.1875rem;
  font-weight: 500;
  color: var(--onyx-600);
  margin: 28px 0 8px;
}

.learn-body ul,
.learn-body ol {
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
}

.learn-body li {
  margin-bottom: 6px;
}

/* Links: brand green with a soft underline (color alone isn't enough to
   tell a link from the dark gray text); solid on hover. */
.learn-byline a,
.learn-body a,
.learn-sources a {
  color: var(--evernight-500);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(39, 91, 80, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}

.learn-byline a:hover,
.learn-body a:hover,
.learn-sources a:hover {
  text-decoration-color: var(--evernight-500);
}

.learn-body strong {
  font-weight: 600;
}

.learn-body img {
  max-width: 100%;
  border-radius: 12px;
}

/* Images placed in an article (<figure class="learn-figure">); app
   screenshots use learn-figure-narrow so a tall card stays phone-sized. */
.learn-figure {
  margin: 28px 0;
}

.learn-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.learn-figure-narrow img {
  max-width: 360px;
  margin: 0 auto;
  border-radius: 28px;
}

.learn-body blockquote {
  border-left: 3px solid var(--mint-500);
  padding-left: 16px;
  margin: 0 0 var(--space-sm);
  font-style: italic;
}

/* Wide tables scroll inside the column instead of widening the page */
.learn-body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
  font-size: var(--fs-sm);
}

.learn-body td {
  background: var(--white);
}

.learn-body th,
.learn-body td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--sand-500);
  vertical-align: top;
}

.learn-body th {
  background: var(--sand-500);
  font-weight: 600;
}

/* SOURCES, REVIEWER, DISCLAIMER */
.learn-sources {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--sand-500);
  font-size: var(--fs-sm);
}

.learn-sources h2,
.learn-sidebar h2 {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--onyx-600);
  margin-bottom: 12px;
}

.learn-sources ol {
  padding-left: 1.25rem;
}

.learn-sources li {
  margin-bottom: 6px;
}


.learn-reviewer {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  margin-top: var(--space-md);
}

.learn-reviewer img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.learn-reviewer p {
  margin-bottom: 4px;
  font-size: var(--fs-sm);
}

.learn-reviewer-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--evernight-500);
}

.learn-reviewer .learn-reviewer-name {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--onyx-600);
}

.learn-reviewer-date {
  opacity: 0.8;
}

/* Download card inside an article (<!-- kyha-cta --> marker) */
.learn-cta {
  background: var(--evernight-500);
  color: var(--white);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 28px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.learn-cta p {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.4;
  flex: 1 1 260px;
}

.learn-cta .btn-nav,
.learn-body .learn-cta .btn-nav {
  flex-shrink: 0;
  text-decoration: none;
  font-weight: 600;
}

.learn-disclaimer {
  font-size: var(--fs-sm);
  opacity: 0.8;
  margin-top: var(--space-md);
}

/* SIDEBAR: recent articles + a download card */
.learn-sidebar {
  display: grid;
  gap: 24px;
  align-content: start;
  margin-top: var(--space-lg);
}

.learn-sidebar-recent ul {
  list-style: none;
}

.learn-sidebar-recent li {
  border-bottom: 1px solid var(--sand-500);
}

.learn-sidebar-recent a {
  display: block;
  padding: 12px 0;
  font-size: var(--fs-sm);
  color: var(--onyx-500);
  text-decoration: none;
}

.learn-sidebar-recent a:hover {
  color: var(--evernight-500);
}

.learn-promo {
  position: relative;
  overflow: hidden;
  background: var(--evernight-500);
  border-radius: 16px;
  padding: 32px 24px 24px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-height: 280px;
  justify-content: flex-end;
}

.learn-promo-blob {
  position: absolute;
  width: 140%;
  top: -40%;
  right: -50%;
  pointer-events: none;
}

.learn-promo-text {
  position: relative;
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1.3;
  margin: 0;
}

.learn-promo-btn {
  position: relative;
}

.learn-related {
  padding-top: 0;
  padding-bottom: var(--space-lg);
}

@media (min-width: 767px) {
  .learn-header {
    padding: 24px 32px;
  }

  .learn-main,
  .learn-related {
    padding-left: 32px;
    padding-right: 32px;
  }

  .learn-main {
    padding-top: 48px;
  }

  .learn-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .learn-featured {
    grid-template-columns: 1.6fr 1fr;
  }

  /* A lone featured story takes the full width */
  .learn-featured:not(:has(.learn-featured-side)) {
    grid-template-columns: 1fr;
  }

  .learn-featured-lead,
  .learn-featured-lead .learn-card,
  .learn-featured-lead .learn-card a {
    height: 100%;
  }

  .learn-card-feature a {
    aspect-ratio: auto;
    min-height: 420px;
  }

  .learn-featured-side {
    grid-auto-rows: 1fr;
  }

  .learn-card-feature .learn-card-desc {
    display: block;
  }
}

@media (min-width: 1024px) {
  .learn-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 64px;
  }

  .learn-article {
    max-width: 720px;
  }

  .learn-sidebar {
    position: sticky;
    top: 24px;
    margin-top: 0;
  }
}
