/* AI Builds article detail styles — Developer Studio stylesheet.
 * Scopes to body.rl-recipe-article (stamped by ai-builds-article-gate when
 * recipe [SECTION] markers are present). Not tied to category-32 / category-37
 * so chrome follows the post if the customer moves the forum location.
 * SoT twin: widgets/adobe-ai-recipe-library/global-code/insided-article-page.html
 * Target: Figma ExL AI Recipe Library Detail Desktop (2344:2211)
 * Do not paste into Admin Global Code; ship via stylesheets registry.
 */

/* ── Variables (Adobe Spectrum-ish / Figma R3) ─────────────── */
body.rl-recipe-article {
  --rl-brand:        #1473e6;
  --rl-brand-dark:   #0d66d0;
  --rl-text:         #2c2c2c;
  --rl-text-muted:   #686868;
  --rl-border:       #e8e8e8;
  --rl-surface:      #ffffff;
  --rl-page-bg:      #f5f5f5;
  --rl-banner-bg:    #f8f8f8;
  --rl-radius:       12px;
  --rl-radius-sm:    8px;
  --rl-font:         adobe-clean, "Adobe Clean", "Segoe UI", system-ui, sans-serif;
}

/* ── Page background ────────────────────────────────────────── */
body.rl-recipe-article .body-wrapper {
  background: var(--rl-page-bg);
}

/* Soft gradient wash behind content (Figma orbs ≈ subtle) */
body.rl-recipe-article .Template-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  background:
    radial-gradient(ellipse 60% 40% at 10% 20%, rgba(255, 180, 120, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 35% at 90% 15%, rgba(120, 170, 255, 0.2), transparent 50%),
    radial-gradient(ellipse 45% 30% at 70% 60%, rgba(255, 140, 180, 0.12), transparent 50%);
}

body.rl-recipe-article .col--main {
  width: 68%;
}
body.rl-recipe-article .col--side {
  width: 30%;
}

/* ── Breadcrumb ─────────────────────────────────────────────── */
body.rl-recipe-article .main-navigation--breadcrumb-wrapper {
  background: var(--rl-surface);
  border-bottom: 1px solid var(--rl-border);
}
body.rl-recipe-article .breadcrumb-item-link {
  color: var(--rl-brand) !important;
}

/* ── Article card ───────────────────────────────────────────── */
body.rl-recipe-article .box.pagebox {
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

/* ── Header: white, black title (replaces purple gradient) ─── */
body.rl-recipe-article .topic__header {
  background: var(--rl-surface);
  padding: 28px 32px 16px;
  border-radius: 0;
  border-bottom: none;
}
body.rl-recipe-article .topic__title {
  color: var(--rl-text) !important;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 12px 0 8px;
  font-family: var(--rl-font);
}
body.rl-recipe-article .list--dot-seperated.text--meta,
body.rl-recipe-article .topic__header .text--meta {
  color: var(--rl-text-muted) !important;
  font-size: 0.875rem;
}
body.rl-recipe-article .topic__header .text--meta a,
body.rl-recipe-article .topic__header .text--meta li {
  color: var(--rl-text-muted) !important;
}
body.rl-recipe-article .topic__header .text--meta a:hover {
  color: var(--rl-brand) !important;
}

/* Chip-like meta for reply count when it is a link */
body.rl-recipe-article .topic__header a[href*="reply"],
body.rl-recipe-article .topic__header .qa-topic-reply-count a {
  color: var(--rl-brand) !important;
  text-decoration: none;
  font-weight: 500;
}

/* ── Author row ─────────────────────────────────────────────── */
body.rl-recipe-article .post__user__info {
  padding: 0 32px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  /* No border here — a bottom border bled through the disclaimer when
     the banner sat in the same vertical band. Divider is on the banner. */
  border-bottom: none;
  margin-bottom: 0;
}
body.rl-recipe-article .username.qa-username {
  color: var(--rl-text) !important;
  font-weight: 600;
  font-size: 0.9375rem;
}
body.rl-recipe-article .post__user__info .text--meta,
body.rl-recipe-article .post__user__info .user-rank {
  color: var(--rl-text-muted) !important;
  font-size: 0.8125rem;
}

/* ── Community disclaimer (injected) ────────────────────────── */
body.rl-recipe-article .rl-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 32px 16px;
  padding: 12px;
  background: var(--rl-banner-bg);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  font-size: 0.875rem;
  color: var(--rl-text);
  line-height: 1.5;
  font-family: var(--rl-font);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}
body.rl-recipe-article .rl-info-banner__icon {
  flex-shrink: 0;
  color: var(--rl-text-muted);
  font-size: 0.875rem;
  margin-top: 1px;
}

/* ── Post body ──────────────────────────────────────────────── */
body.rl-recipe-article .post__content {
  padding: 8px 32px 28px;
  font-family: var(--rl-font);
  color: var(--rl-text);
  line-height: 1.65;
  font-size: 0.9375rem;
}

/*
 * FOUC gate (AI Builds categories only).
 * Page Targeting cannot select topic pages by category — DOM classes are the
 * filter: 37 = AI Builds SEO path, 32 = Tips & Tricks (Share-a-Build default).
 * CSS loads community-wide but every rule is scoped here. Hide recipe body
 * until the script rewrites [SECTION] markers; 2s fallback if JS never runs.
 */
body.rl-recipe-article:not(.rl-article-ready) .post__content.qa-topic-post-content {
  opacity: 0;
  animation: rl-article-reveal-fallback 0s linear 2s forwards;
}
body.rl-recipe-article.rl-article-ready .post__content.qa-topic-post-content {
  opacity: 1;
  animation: none;
}
@keyframes rl-article-reveal-fallback {
  to { opacity: 1; }
}

/* Section group titles (About / Try it) */
body.rl-recipe-article .ai-section-group {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rl-text);
  margin: 28px 0 16px;
  line-height: 1.25;
  font-family: var(--rl-font);
}
body.rl-recipe-article .ai-section-group:first-child {
  margin-top: 12px;
}

/* Field labels (Summary, Goals, etc.) */
body.rl-recipe-article .ai-section-header {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--rl-text);
  margin: 20px 0 8px;
  font-family: var(--rl-font);
}
body.rl-recipe-article .ai-section-header:first-child {
  margin-top: 0;
}

/* Prompt / try-it pre block */
body.rl-recipe-article .rl-try-it-box {
  margin: 12px 0 16px;
  background: var(--rl-banner-bg);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius-sm);
  overflow: hidden;
}
body.rl-recipe-article .rl-try-it-pre {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--rl-text);
  max-height: 280px;
  overflow: auto;
}
body.rl-recipe-article .rl-try-it-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  flex-wrap: wrap;
}
body.rl-recipe-article .rl-copy-btn {
  appearance: none;
  border: 1px solid var(--rl-border);
  background: var(--rl-surface);
  color: var(--rl-text);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--rl-font);
}
body.rl-recipe-article .rl-copy-btn:hover {
  border-color: var(--rl-brand);
  color: var(--rl-brand);
}
body.rl-recipe-article .rl-copy-btn:focus-visible {
  outline: 2px solid var(--rl-brand);
  outline-offset: 2px;
}
body.rl-recipe-article .rl-copy-btn.copied {
  border-color: #2d9f6f;
  color: #2d9f6f;
}

/* ── Post footer actions ────────────────────────────────────── */
body.rl-recipe-article .post__footer {
  padding: 14px 32px;
  border-top: 1px solid var(--rl-border);
  background: var(--rl-surface);
}
body.rl-recipe-article .post__action-link {
  color: var(--rl-text) !important;
  font-weight: 500;
  font-size: 0.875rem;
}
body.rl-recipe-article .post__action-link:hover {
  color: var(--rl-brand) !important;
}

/*
 * Public tag chips (Figma Tags row on Detail Desktop 2344:2211 / 2344:2366).
 * CC only renders *public* tags here (.qa-tags-list). Moderator tags
 * (type:/stage:/cat: …) are Control-only and never appear in the DOM —
 * see figma-gap-todo.md. Native "+ Modify tags" (li.canEditTags) is hidden;
 * public chips stay visible. Tags still via dual-write / Control / widget.
 */
body.rl-recipe-article .topic-public-tags-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 12px;
  padding: 0;
  min-height: 0;
}
/* Hide empty public-tags band when no chips (script also collapses it). */
body.rl-recipe-article .rl-tags-label {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--rl-text);
  margin: 0;
  line-height: 1.5;
  font-family: var(--rl-font);
}
body.rl-recipe-article .qa-tags-list,
body.rl-recipe-article .public-tags.list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: auto;
  height: auto;
  float: none;
}
body.rl-recipe-article .qa-tags-list > li,
body.rl-recipe-article .public-tags > li {
  float: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
body.rl-recipe-article .qa-tags-list a,
body.rl-recipe-article .qa-tags-list .tag,
body.rl-recipe-article .public-tags a,
body.rl-recipe-article .public-tags .tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  box-sizing: border-box;
  background: #e8e8e8;
  color: var(--rl-text) !important;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 7px;
  text-decoration: none !important;
  white-space: nowrap;
  font-family: var(--rl-font);
}
body.rl-recipe-article .qa-tags-list a:hover,
body.rl-recipe-article .public-tags a:hover {
  background: #dedede;
  color: var(--rl-text) !important;
}
body.rl-recipe-article .qa-tags-list a:focus-visible,
body.rl-recipe-article .public-tags a:focus-visible {
  outline: 2px solid var(--rl-brand);
  outline-offset: 2px;
}
/* Hide native "+ Modify tags" (mod Control still edits tags; dual-write / widget too) */
body.rl-recipe-article li.canEditTags,
body.rl-recipe-article .canEditTags {
  display: none !important;
}

/* Header labels (CC badges), when present — same chip language */
body.rl-recipe-article .topic__labels-list:not(:empty) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
body.rl-recipe-article .topic__labels-list a,
body.rl-recipe-article .topic__labels-list .label,
body.rl-recipe-article .topic__labels-list .tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  background: #e8e8e8;
  color: var(--rl-text) !important;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 7px;
  text-decoration: none !important;
  font-family: var(--rl-font);
}

/* Hide off-brand emoji helpfulness */
body.rl-recipe-article .topic-helpfulness {
  display: none;
}

/* ── Contribute CTA (injected) ──────────────────────────────── */
body.rl-recipe-article .rl-contribute-cta {
  margin: 0 0 20px;
  padding: 24px 28px;
  background: var(--rl-brand);
  border-radius: var(--rl-radius);
  color: #fff;
  font-family: var(--rl-font);
}
body.rl-recipe-article .rl-contribute-cta__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
body.rl-recipe-article .rl-contribute-cta__body {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  max-width: 36rem;
}
body.rl-recipe-article .rl-contribute-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
body.rl-recipe-article .rl-contribute-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: #fff;
  color: var(--rl-brand) !important;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 6px;
  text-decoration: none !important;
  border: none;
}
body.rl-recipe-article .rl-contribute-cta__btn:hover {
  background: #f0f6ff;
}
body.rl-recipe-article .rl-contribute-cta__link {
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/*
 * ── Replies / comments (Figma Comments `2344:2492`) ──────────
 * Target: compose → “N replies” + Sort → individual reply cards.
 * CC limits (cannot match pixel-perfect): threaded nesting lines,
 * “— N replies” collapse, Reply vs Quote, Translate, ellipsis menu,
 * Spectrum single-line field (hub uses Froala RTE). See figma-gap-todo.
 */
body.rl-recipe-article .topic-view-replies {
  margin-top: 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
}
body.rl-recipe-article .topic-replies__wrapper {
  background: transparent;
}

/* Count + sort row (was gray banner inside one mega-card) */
body.rl-recipe-article .list__items--header.qa-topic-reply-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: transparent;
  padding: 8px 0 16px;
  border: none;
  margin: 0;
}
body.rl-recipe-article .qa-total-replies,
body.rl-recipe-article .qa-total-replies span {
  color: var(--rl-text);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  font-family: var(--rl-font);
  margin: 0;
}
body.rl-recipe-article .topic-replies__header-item-list {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--rl-text-muted);
  font-size: 0.875rem;
  font-family: var(--rl-font);
}
body.rl-recipe-article .topic-replies__header-item-list select,
body.rl-recipe-article .topic-replies__header-item-list button,
body.rl-recipe-article .topic-replies__header-item-list a {
  color: var(--rl-text) !important;
  font-size: 0.875rem;
  font-family: var(--rl-font);
}

/* Individual reply cards (Figma white rounded cards on page bg) */
body.rl-recipe-article .topic-reply-box-wrapper > .post.qa-topic-post-box,
body.rl-recipe-article .topic-reply-box-wrapper > .qa-topic-post-box {
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 20px 22px 12px;
  margin: 0 0 16px;
  box-sizing: border-box;
  /* Avatar (.post__user__info) and name (.post__user__meta) are siblings.
     Hub clears the absolute avatar with meta padding-left; card chrome must
     lay them out as a flex row instead of zeroing that padding. */
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 10px;
}
body.rl-recipe-article .topic-reply-box-wrapper .seperator,
body.rl-recipe-article .topic-view-replies hr.seperator {
  display: none;
}

/* Reply author row */
body.rl-recipe-article .topic-reply-box-wrapper .post__user__info {
  position: static !important;
  left: auto !important;
  top: auto !important;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0;
  float: none;
  display: block;
  flex: 0 0 auto;
}
body.rl-recipe-article .topic-reply-box-wrapper .avatar,
body.rl-recipe-article .topic-reply-box-wrapper .avatar--responsive {
  width: 38px;
  height: 38px;
  float: none !important;
  flex-shrink: 0;
}
body.rl-recipe-article .topic-reply-box-wrapper .profilepicture,
body.rl-recipe-article .topic-reply-box-wrapper .profilepicture img,
body.rl-recipe-article .topic-reply-box-wrapper .default-avatar {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50%;
}
/* Figma reply cards omit community badges */
body.rl-recipe-article .topic-reply-box-wrapper .list--badges-small {
  display: none !important;
}
body.rl-recipe-article .topic-reply-box-wrapper .post__user__meta {
  padding: 0;
  margin: 0;
  float: none;
  flex: 1 1 0;
  min-width: 0;
  align-self: center;
}
/* Content + footer sit on their own rows under the author */
body.rl-recipe-article .topic-reply-box-wrapper .topic-view-content-wrapper,
body.rl-recipe-article .topic-reply-box-wrapper .post__footer {
  flex: 1 1 100%;
  width: 100%;
  max-width: 100%;
}
body.rl-recipe-article .topic-reply-box-wrapper .post__user__meta .list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  margin: 0;
  padding: 0;
}
body.rl-recipe-article .topic-reply-box-wrapper .username.qa-username {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--rl-text) !important;
}
body.rl-recipe-article .topic-reply-box-wrapper .usertitle,
body.rl-recipe-article .topic-reply-box-wrapper .post__user__meta .text--meta,
body.rl-recipe-article .topic-reply-box-wrapper .post__user__meta li {
  color: var(--rl-text-muted) !important;
  font-size: 0.8125rem;
}
body.rl-recipe-article .topic-reply-box-wrapper .list-item--publish-date,
body.rl-recipe-article .topic-reply-box-wrapper .list-item--float-right {
  float: none !important;
  margin-left: 0 !important;
}
body.rl-recipe-article .topic-reply-box-wrapper .post__content {
  padding: 8px 0 12px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--rl-text);
}
body.rl-recipe-article .topic-reply-box-wrapper .post__footer {
  padding: 0;
  border-top: none;
  background: transparent;
}
body.rl-recipe-article .topic-reply-box-wrapper .post__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 4px 0 0;
}
body.rl-recipe-article .topic-reply-box-wrapper .post__action-link {
  color: var(--rl-text-muted) !important;
  font-weight: 500;
  font-size: 0.8125rem;
}
body.rl-recipe-article .topic-reply-box-wrapper .post__action-link:hover {
  color: var(--rl-brand) !important;
}

/*
 * Composer (moved above replies by script; class .rl-reply-composer).
 * Figma: avatar + “Add your reply” field. Hub: Froala RTE + SEND — style only.
 */
body.rl-recipe-article .rl-reply-composer,
body.rl-recipe-article .box.box__pad:has([data-preact*="TopicAddReply"]) {
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 20px 24px;
  margin: 20px 0 12px;
  box-sizing: border-box;
  font-family: var(--rl-font);
}
body.rl-recipe-article .rl-reply-composer > h2,
body.rl-recipe-article .rl-reply-composer > h3,
body.rl-recipe-article .box.box__pad:has([data-preact*="TopicAddReply"]) > h2,
body.rl-recipe-article .box.box__pad:has([data-preact*="TopicAddReply"]) > h3 {
  /* Figma has no “Reply” heading above the field */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body.rl-recipe-article .rl-reply-composer .fr-box,
body.rl-recipe-article .rl-reply-composer .fr-wrapper,
body.rl-recipe-article .box.box__pad:has([data-preact*="TopicAddReply"]) .fr-box {
  border-radius: var(--rl-radius-sm);
  border-color: var(--rl-border) !important;
}
body.rl-recipe-article .rl-reply-composer .fr-toolbar,
body.rl-recipe-article .box.box__pad:has([data-preact*="TopicAddReply"]) .fr-toolbar {
  background: var(--rl-banner-bg);
  border-color: var(--rl-border) !important;
  border-radius: var(--rl-radius-sm) var(--rl-radius-sm) 0 0;
}
body.rl-recipe-article .rl-reply-composer .btn-primary,
body.rl-recipe-article .box.box__pad:has([data-preact*="TopicAddReply"]) .btn-primary {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: 6px;
  margin-top: 12px;
}

body.rl-recipe-article .btn-primary {
  background: var(--rl-brand) !important;
  border-color: var(--rl-brand) !important;
}
body.rl-recipe-article .btn-primary:hover {
  background: var(--rl-brand-dark) !important;
  border-color: var(--rl-brand-dark) !important;
}

/* ── Related recipes sidebar ────────────────────────────────── */
body.rl-recipe-article .widget--related-topics {
  background: var(--rl-surface);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 20px;
  position: sticky;
  top: 16px;
}
body.rl-recipe-article .related-topics__widget-title {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--rl-text-muted);
  margin: 0 0 14px;
}
body.rl-recipe-article .related-topics__topic {
  padding: 10px 0;
  border-bottom: 1px solid var(--rl-border);
}
body.rl-recipe-article .related-topics__topic:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
body.rl-recipe-article .related-topics__topic-title a {
  color: var(--rl-text) !important;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
  text-decoration: none;
}
body.rl-recipe-article .related-topics__topic-title a:hover {
  color: var(--rl-brand) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.rl-recipe-article .related-topics__topic .text--meta {
  color: var(--rl-text-muted) !important;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  body.rl-recipe-article .col--main,
  body.rl-recipe-article .col--side {
    width: 100%;
  }
  body.rl-recipe-article .topic__header,
  body.rl-recipe-article .post__content,
  body.rl-recipe-article .post__user__info,
  body.rl-recipe-article .post__footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  body.rl-recipe-article .rl-info-banner {
    margin-left: 20px;
    margin-right: 20px;
  }
}
