/* ============================================================================
   rpc-rc rich content system — components + design tokens
   ----------------------------------------------------------------------------
   Loaded AFTER rich-content.css (the Tailwind build output) so component-level
   rules can refine utilities when needed. Everything is scoped under `.rpc-rc`
   to avoid leaking into the base Nuvemshop theme.

   See docs/rich-content/README.md for usage.
   ========================================================================= */


/* ---------- Design tokens (override inline on the wrapper) -------------- */

.rpc-rc {
  /* Colors */
  --rpc-rc-color-primary: #1A8A64;
  --rpc-rc-color-secondary: #146B4E;
  --rpc-rc-color-accent: #F0CC5B;
  --rpc-rc-color-text: #1F2937;
  --rpc-rc-color-text-muted: #6B7280;
  --rpc-rc-color-bg-soft: #F9FAFB;
  --rpc-rc-color-bg-dark: #0B3D2C;

  /* Fonts */
  --rpc-rc-font-heading: Georgia, 'Times New Roman', serif;
  --rpc-rc-font-body: 'DM Sans', system-ui, -apple-system, sans-serif;

  /* Baseline typography for content inside the wrapper.
     Stays minimal — Tailwind utilities handle most of the styling. */
  font-family: var(--rpc-rc-font-body);
  color: var(--rpc-rc-color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.rpc-rc * {
  box-sizing: border-box;
}

/* Images inserted raw by the admin editor should stay responsive. */
.rpc-rc img {
  max-width: 100%;
  height: auto;
}

/* <em> is treated as a plain inline marker everywhere inside the rich
   content system. The default italic is neutralized so authors must opt
   into emphasis explicitly via utility classes (e.g. rpc-rc-italic,
   rpc-rc-text-primary, rpc-rc-text-accent).

   Rationale:
   - Consistency: one rule to remember ("always classify <em>") instead of
     the subtler "<em> is neutral only in headings".
   - Safety: an <em> with auto-italic + inherited color can become invisible
     whenever the parent has a background that matches the inherited color.
   - Predictability: agents generating HTML don't need to reason about
     context ("am I inside a heading or a paragraph?").

   Accent word pattern (works in any context):
     <p>Nossa fórmula é <em class="rpc-rc-text-primary rpc-rc-italic">100% natural</em></p>
     <h2>Os 5 pilares da <em class="rpc-rc-text-primary rpc-rc-italic">saúde completa</em></h2>
*/
.rpc-rc em {
  font-style: normal;
}

/* Text selection uses the primary color for a consistent brand feel. */
.rpc-rc ::selection {
  background: var(--rpc-rc-color-primary);
  color: #ffffff;
}


/* ---------- Component: Accordion (exclusive by default) ----------------- */

.rpc-rc .rpc-rc-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rpc-rc .rpc-rc-accordion-item {
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  background: #FFFFFF;
}

.rpc-rc .rpc-rc-accordion-item:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
}

.rpc-rc .rpc-rc-accordion-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  cursor: pointer;
  background: #FFFFFF;
  transition: background 0.2s ease;
  user-select: none;
}

.rpc-rc .rpc-rc-accordion-head:hover,
.rpc-rc .rpc-rc-accordion-item.is-open .rpc-rc-accordion-head {
  background: var(--rpc-rc-color-bg-soft);
}

.rpc-rc .rpc-rc-accordion-num {
  width: 38px;
  height: 38px;
  background: var(--rpc-rc-color-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--rpc-rc-font-heading);
  font-size: 17px;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}

.rpc-rc .rpc-rc-accordion-info {
  flex: 1;
}

.rpc-rc .rpc-rc-accordion-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--rpc-rc-color-bg-dark);
  margin: 0 0 1px;
}

.rpc-rc .rpc-rc-accordion-sub {
  font-size: 12px;
  color: var(--rpc-rc-color-text-muted);
  margin: 0;
}

.rpc-rc .rpc-rc-accordion-arrow {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: #9CA3AF;
  transition: transform 0.3s ease;
}

.rpc-rc .rpc-rc-accordion-item.is-open .rpc-rc-accordion-arrow {
  transform: rotate(180deg);
}

.rpc-rc .rpc-rc-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.rpc-rc .rpc-rc-accordion-item.is-open .rpc-rc-accordion-body {
  max-height: 1200px;
}

.rpc-rc .rpc-rc-accordion-content {
  padding: 0 24px 24px;
}


/* ---------- Component: FAQ (independent toggle) ------------------------- */

.rpc-rc .rpc-rc-faq {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rpc-rc .rpc-rc-faq-item {
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
  transition: border-color 0.2s ease;
}

.rpc-rc .rpc-rc-faq-item:hover {
  border-color: var(--rpc-rc-color-primary);
}

.rpc-rc .rpc-rc-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--rpc-rc-color-text);
  background: #FFFFFF;
  transition: background 0.2s ease;
  user-select: none;
}

.rpc-rc .rpc-rc-faq-q:hover,
.rpc-rc .rpc-rc-faq-item.is-open .rpc-rc-faq-q {
  background: var(--rpc-rc-color-bg-soft);
}

.rpc-rc .rpc-rc-faq-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.rpc-rc .rpc-rc-faq-item.is-open .rpc-rc-faq-icon {
  transform: rotate(45deg);
}

.rpc-rc .rpc-rc-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.rpc-rc .rpc-rc-faq-item.is-open .rpc-rc-faq-a {
  max-height: 600px;
}

.rpc-rc .rpc-rc-faq-a-inner {
  padding: 0 20px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: #4B5563;
}
