/* ==========================================================================
   Infinite Investor additions to Feedora
   Ad slots, member badges, tag chips, and Micro-Lesson components.
   Brand palette (Visual Identity Guide Section 1): Infinite Red #BC2025,
   black, Charcoal #333333, Medium Grey #666666, Light Grey #E0E0E0,
   Off-White #F7F7F7. Dark mode follows Feedora's html.dark class.
   ========================================================================== */

:root {
  --ii-red: #BC2025;
  --ii-charcoal: #333333;
  --ii-medium: #666666;
  --ii-light: #E0E0E0;
  --ii-offwhite: #F7F7F7;
}

/* --------------------------------------------------------------------------
   Ad slots (Verity sizes: billboard 970 x 250, leaderboard 728 x 90,
   sidebar 300 x 250)
   -------------------------------------------------------------------------- */
.ii-ad {
  display: block;
  margin: 40px auto;
  padding: 0 clamp(16px, 4vw, 40px);
  text-align: center;
  box-sizing: content-box;
}
.ii-ad--billboard { max-width: 970px; }
.ii-ad--leaderboard { max-width: 728px; }
.ii-ad--sidebar { max-width: 300px; padding: 0; }

.ii-ad__label {
  display: block;
  margin-bottom: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fd-ink-3, #9ca3af);
}

.ii-ad__banner { display: block; line-height: 0; }
.ii-ad__img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
}
.ii-ad--billboard .ii-ad__img { aspect-ratio: 970 / 250; object-fit: cover; }
.ii-ad--leaderboard .ii-ad__img { aspect-ratio: 728 / 90; object-fit: cover; }
.ii-ad--sidebar .ii-ad__img,
.ii-ad__banner--mobile .ii-ad__img { aspect-ratio: 300 / 250; object-fit: cover; max-width: 300px; }

/* Phones: the wide banner swaps to the 300 x 250 banner when one is set */
.ii-ad__banner--mobile { display: none; }
@media (max-width: 767px) {
  .ii-ad__banner--has-mobile { display: none; }
  .ii-ad__banner--mobile { display: block; }
}

/* Space reserved for AdSense so the page doesn't jump when an ad loads */
.ii-ad__unit { width: 100%; }
.ii-ad--billboard .ii-ad__unit { min-height: 250px; }
.ii-ad--leaderboard .ii-ad__unit { min-height: 90px; }
.ii-ad--sidebar .ii-ad__unit { width: 300px; min-height: 250px; margin: 0 auto; }

/* Sidebar rail beside public articles: only where there is room beside the
   860 px article column (860 + 2 x 340 = 1540 px) */
.fd-post-body-wrap,
.ii-rail-host { position: relative; }
.ii-ad-rail { display: none; }
@media (min-width: 1560px) {
  .ii-ad-rail {
    display: block;
    position: absolute;
    top: 48px;
    bottom: 64px;
    left: calc(100% + 40px);
    width: 300px;
  }
  .ii-ad-rail .ii-ad {
    position: sticky;
    top: 110px;
    margin: 0;
  }
}

@media print {
  .ii-ad, .ii-ad-rail, #ii-share-btn, #ii-share-overlay { display: none !important; }
}

/* --------------------------------------------------------------------------
   Members-only posts: Feedora draws its own gate (sections/paywall-gate), so
   Ghost's built-in upgrade box from {{content}} is hidden to avoid two boxes.
   -------------------------------------------------------------------------- */
.gh-post-upgrade-cta { display: none !important; }

/* --------------------------------------------------------------------------
   Member badge on cards (carried over from the Reru customization)
   -------------------------------------------------------------------------- */
.ii-badge-members {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--ii-red);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Tag chips in the post header (pillar plus audience, Reru customization) */
.ii-tag-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ii-tag-chip {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 20px;
  text-decoration: none;
  background-color: color-mix(in srgb, var(--fd-accent) 12%, transparent);
  color: var(--fd-accent);
  transition: background 0.15s ease;
}
.ii-tag-chips--center { justify-content: center; margin-bottom: 24px; }
.ii-tag-chips--center .ii-tag-chip { background-color: rgba(255, 255, 255, 0.14); backdrop-filter: blur(8px); }
.ii-tag-chip:hover { background-color: color-mix(in srgb, var(--fd-accent) 20%, transparent); }

/* --------------------------------------------------------------------------
   Micro-Lessons (Micro-Lesson Page Spec v1.2, Sections 4 to 8)
   -------------------------------------------------------------------------- */
.ii-ml {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) clamp(20px, 5vw, 40px) 80px;
  color: var(--fd-ink);
}
.ii-ml--wide { max-width: 1180px; }

.ii-ml-label {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ii-red);
}
.ii-ml-title {
  margin: 8px 0 0;
  font-family: var(--fd-font-head, 'Sora', sans-serif);
  font-size: clamp(1.85rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--fd-ink);
  text-wrap: balance;
}
.ii-ml-lede {
  margin: 14px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--fd-ink-2, #4b5563);
}
.ii-ml-lede strong { color: var(--fd-ink); font-weight: 700; }

.ii-ml-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--fd-border);
  border-bottom: 1px solid var(--fd-border);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--fd-ink-2, #4b5563);
}
.ii-ml-facts span { display: inline-flex; align-items: center; gap: 6px; }

.ii-ml-image { margin: 32px 0 0; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--fd-surface); }
.ii-ml-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ii-ml-body { margin-top: 32px; }

.ii-ml-steps-heading {
  margin: 48px 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fd-ink-3, #9ca3af);
}
.ii-ml-steps { list-style: none; margin: 12px 0 0; padding: 0; }
.ii-ml-steps li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--fd-border);
}
.ii-ml-step-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ii-ml-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fd-surface-2, var(--fd-surface));
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--fd-ink-2, #4b5563);
}
.ii-ml-step-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--fd-ink);
  text-decoration: none;
}
.ii-ml-step-link:hover { color: var(--ii-red); }
.ii-ml-access {
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--ii-red);
}

.ii-ml-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--ii-red);
  color: #fff !important;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.ii-ml-btn:hover { opacity: 0.88; }

/* Step page: lesson back-link, tracker, navigation */
.ii-ml-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--fd-ink-2, #4b5563);
  text-decoration: none;
}
.ii-ml-back:hover { color: var(--ii-red); }
.ii-ml-tracker { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.ii-ml-tracker-segs { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.ii-ml-tracker-seg {
  display: block;
  width: 32px;
  height: 8px;
  border-radius: 999px;
  background: var(--ii-light);
}
/* Completed and current segments are red (spec Section 6). Segments before the
   current one are found with :has(), so no script is needed. */
.ii-ml-tracker-seg.is-current,
.ii-ml-tracker-seg:has(~ .is-current) { background: var(--ii-red); }
.ii-ml-tracker-seg:has(~ .is-current) { opacity: 0.5; }
.ii-ml-tracker-text {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--fd-ink-2, #4b5563);
}
.ii-ml-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--fd-border);
}
.ii-ml-nav .ii-ml-btn { margin-top: 0; }
.ii-ml-prev {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fd-ink-2, #4b5563);
  text-decoration: none;
}
.ii-ml-prev:hover { color: var(--ii-red); }
.ii-ml-steplist { display: none; }

/* "Your move" box authored at the end of every step */
.ml-move {
  margin: 40px 0 0;
  padding: 20px 24px;
  border-left: 4px solid var(--ii-red);
  border-radius: 0 12px 12px 0;
  background: var(--ii-offwhite);
}
.ml-move-label {
  margin: 0 0 6px !important;
  font-family: 'Inter', sans-serif;
  font-size: 12px !important;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ii-red) !important;
}
.ml-move p:not(.ml-move-label) { margin: 0; color: var(--ii-charcoal); }
html.dark .ml-move { background: var(--fd-surface-2, #1f2937); }
html.dark .ml-move p:not(.ml-move-label) { color: var(--fd-ink); }
html.dark .ii-ml-tracker-seg { background: #4b5563; }
html.dark .ii-ml-tracker-seg.is-current,
html.dark .ii-ml-tracker-seg:has(~ .is-current) { background: var(--ii-red); }

/* Courses index and lesson cards (spec Sections 4 and 7) */
.ii-ml-path { margin-top: 56px; }
.ii-ml-path h2 {
  margin: 0;
  font-family: var(--fd-font-head, 'Sora', sans-serif);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--fd-ink);
}
.ii-ml-path > p { margin: 4px 0 0; font-size: 14px; color: var(--fd-ink-2, #4b5563); }
.ii-ml-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.ii-lesson-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 170px;
  padding: 20px;
  border-left: 4px solid var(--ii-red);
  border-radius: 16px;
  background: var(--fd-surface);
  transition: background 0.15s ease;
}
.ii-lesson-card:hover { background: var(--fd-surface-2, var(--fd-surface)); }
.ii-lesson-card__link { position: absolute; inset: 0; z-index: 1; }
.ii-lesson-card__label {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ii-red);
}
.ii-lesson-card__title {
  margin: 8px 0 0;
  font-family: var(--fd-font-head, 'Sora', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fd-ink);
}
.ii-lesson-card__outcome { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--fd-ink-2, #4b5563); }
.ii-lesson-card__outcome strong { font-weight: 600; }
.ii-lesson-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: auto;
  padding-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--fd-ink-3, #9ca3af);
}
.ii-lesson-card__pill {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ii-red) 10%, transparent);
  font-size: 11px;
  font-weight: 700;
  color: var(--ii-red);
}
.ii-ml-band {
  margin-top: 72px;
  padding: 40px 32px;
  border-radius: 24px;
  background: var(--fd-surface);
  text-align: center;
}
.ii-ml-band p { margin: 0; }
.ii-ml-band .ii-ml-band__title { font-size: 1.05rem; font-weight: 700; color: var(--fd-ink); }
.ii-ml-band .ii-ml-band__sub { margin-top: 6px; font-size: 14px; color: var(--fd-ink-2, #4b5563); }
.ii-ml-band .ii-ml-btn { margin-top: 20px; }

/* --------------------------------------------------------------------------
   Subtitles: standard upright text, not Feedora's italic serif (Steve,
   November 24, 2026). Heading accent words are unchanged.
   -------------------------------------------------------------------------- */
.fd-auth-subtext,
.fd-authors-subtext,
.fd-authors-empty,
.fd-search-empty-sub,
.fd-tags-subtext,
.fd-tag-bento-kicker,
.fd-paywall-subtext,
.fd-post-dek {
  font-family: var(--fd-font-sans) !important;
  font-style: normal !important;
}
