/* =========================================================
   curso.css — página pública de curso (/curso/{slug})
   ---------------------------------------------------------
   Carregado só por curso-publico.php (junto de home.css, para
   os cards de relacionados, e auth.css, para o form do buy box).
   Trazido das regras .coursep-* do page.css do IncluiEduca com o
   prefixo .curso- e os tokens daqui — nenhum hex fora do spec
   (só #fff). Terracota SÓ no botão de compra/CTA.

   Layout: .curso-hero__grid é UM grid com 3 áreas —
     mobile   : main → aside (buy box) → body   (ordem do DOM)
     ≥ 980px  : [main | aside]  — o aside ocupa as duas linhas
                [body | aside]    e o buy box fica sticky nele
   Assim o buy box acompanha a leitura (intro, ementa, para quem)
   sem prender as seções de largura total (certificado, FAQ, CTA).
   ========================================================= */

/* ---------------------------------------------------------
   Hero (faixa clara no topo que dilui para o fundo da página)
   --------------------------------------------------------- */
.curso-hero {
    padding-block: var(--s-5) var(--s-7);
    background: linear-gradient(to bottom, var(--c-primary-soft) 0, var(--c-bg) 420px);
    border-bottom: 1px solid var(--c-border);
}
@media (min-width: 880px) {
    .curso-hero { padding-block: var(--s-6) var(--s-8); }
}

.curso-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
    align-items: start;
}
.curso-hero__main { min-width: 0; }
.curso-hero__aside { min-width: 0; }
.curso-body { min-width: 0; }

@media (min-width: 980px) {
    .curso-hero__grid {
        grid-template-columns: minmax(0, 1fr) 380px;
        grid-template-rows: auto 1fr;
        column-gap: var(--s-7);
        row-gap: var(--s-7);
    }
    .curso-hero__main  { grid-column: 1; grid-row: 1; }
    .curso-body        { grid-column: 1; grid-row: 2; }
    .curso-hero__aside {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: stretch;       /* a coluna precisa da altura toda para o sticky rolar */
    }
    .curso-hero__aside .buybox {
        position: sticky;
        top: 96px;                 /* header (68) + folga */
    }
}

/* ---------------------------------------------------------
   Breadcrumb
   --------------------------------------------------------- */
.curso-crumb {
    font-size: var(--fs-sm);
    color: var(--c-muted);
    margin-bottom: var(--s-5);
}
.curso-crumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-1) var(--s-2);
    list-style: none;
    margin: 0;
    padding: 0;
}
.curso-crumb li { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.curso-crumb li + li::before { content: "›"; color: var(--c-muted); }
.curso-crumb a { color: var(--c-primary); text-decoration: none; }
.curso-crumb a:hover { text-decoration: underline; text-underline-offset: 2px; }
.curso-crumb [aria-current="page"] {
    color: var(--c-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60vw;
}

/* ---------------------------------------------------------
   Tag do tema, título, sub, facts, capa
   --------------------------------------------------------- */
.curso-tag {
    display: inline-flex;
    align-items: center;
    margin-bottom: var(--s-3);
    padding: 3px var(--s-3);
    border-radius: var(--r-pill);
    background: var(--c-bg-alt);
    color: var(--c-secondary-dark);
    border: 1px solid var(--c-border);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
}
a.curso-tag:hover { border-color: var(--c-primary); color: var(--c-primary-dark); }
/* variante do brinde: mantém o âmbar do .badge--brinde (esta folha carrega depois do components.css) */
.curso-tag.badge--brinde {
    text-transform: none;
    letter-spacing: 0;
    background: var(--c-brinde-soft);
    color: var(--c-brinde);
    border-color: var(--c-brinde-border);
}

.curso-title {
    margin: 0 0 var(--s-3);
    font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3rem);
    line-height: 1.12;
    max-width: 24ch;
}
.curso-fullname {
    margin: calc(-1 * var(--s-1)) 0 var(--s-3);
    color: var(--c-muted);
    font-size: var(--fs-sm);
}
.curso-sub {
    margin: 0 0 var(--s-4);
    color: var(--c-text);
    font-size: var(--fs-lg);
    line-height: 1.55;
    max-width: 60ch;
}
@media (min-width: 880px) {
    .curso-sub { font-size: var(--fs-xl); line-height: 1.45; }
}

.curso-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-4);
    margin: 0 0 var(--s-5);
    padding: 0;
    list-style: none;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-text);
}
.curso-facts li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.curso-facts li > span { display: inline-flex; color: var(--c-secondary-dark); }
.curso-facts svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

.curso-cover {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 9;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--c-primary-soft);
    border: 1px solid var(--c-border);
    box-shadow: var(--sh-md);
}
.curso-cover picture,
.curso-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.curso-cover__inicial {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ff-head);
    font-size: 4rem;
    font-weight: 700;
    color: var(--c-secondary);
}

/* ---------------------------------------------------------
   Buy box (#comprar) — card branco, um preço, uma ação
   --------------------------------------------------------- */
.buybox {
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    padding: var(--s-5);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}
@media (min-width: 560px) { .buybox { padding: var(--s-6); } }
@media (min-width: 980px) { .buybox { padding: var(--s-5); } }

.buybox__hello {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--c-muted);
}

.buybox__price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--c-border);
}
.buybox__price .price { font-size: var(--fs-4xl); line-height: 1; }
.buybox__price-note { font-size: var(--fs-sm); color: var(--c-muted); }

.buybox__inc {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--fs-sm);
    line-height: 1.45;
    color: var(--c-text);
}
.buybox__inc li { display: flex; align-items: flex-start; gap: var(--s-2); }
.buybox__inc li > span:last-child { flex: 1 1 auto; min-width: 0; }
.buybox__inc li a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px; }
.buybox__inc li > span:first-child {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--c-success-soft);
    color: var(--c-success);
    margin-top: 1px;
}
.buybox__inc svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

/* a única menção ao brinde no buy box — âmbar (informação), nunca terracota */
.buybox__brinde {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    margin: 0;
    padding: var(--s-3);
    background: var(--c-brinde-soft);
    border: 1px solid var(--c-brinde-border);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    line-height: 1.45;
    color: var(--c-text);
}
.buybox__brinde .badge { flex-shrink: 0; margin-top: 1px; }
.buybox__brinde strong { color: var(--c-brinde); }
.buybox__brinde-lead { margin: 0; color: var(--c-text); font-size: var(--fs-sm); line-height: 1.6; }

.buybox__btn { width: 100%; }
/* botão desligado (vendas ainda não abertas): sem terracota, sem promessa */
.buybox__btn--off,
.buybox__btn--off:disabled {
    background: var(--c-bg-soft);
    color: var(--c-muted);
    border-color: var(--c-border);
    box-shadow: none;
    opacity: 1;
    cursor: not-allowed;
}

.buybox__note {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--c-muted);
    line-height: 1.5;
}

/* form de inscrição embutido: o .auth-card perde o "card dentro do card" */
.buybox__form .auth-card {
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}
.buybox__form .auth-card__title { font-size: var(--fs-lg); }
.buybox__form .auth-card__lead  { font-size: var(--fs-sm); }
.buybox__form .auth-form__foot  { font-size: var(--fs-xs); }

.buybox__trust {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-4);
    margin: 0;
    padding-top: var(--s-3);
    border-top: 1px solid var(--c-border);
    list-style: none;
    font-size: var(--fs-xs);
    color: var(--c-muted);
}
.buybox__trust li { display: inline-flex; align-items: center; gap: 6px; }
.buybox__trust svg { width: 16px; height: 16px; stroke: currentColor; fill: none; color: var(--c-secondary-dark); }

/* estados de venda: o form (visitante) e o botão (logado) ganham um separador */
.buybox--visitante .buybox__form {
    padding-top: var(--s-3);
    border-top: 1px solid var(--c-border);
}
.buybox--comprar .buybox__btn { margin-top: var(--s-2); }

/* estados "já tem" (compra aqui ou pacote do IncluiEduca) */
.buybox--owned {
    background: var(--c-success-soft);
    border-color: var(--c-success);
}
/* pelo pacote do IncluiEduca: mesmo fundo verde, mas o status em navy (institucional,
   "vem de outra casa") em vez do verde de "comprou aqui" */
.buybox--pacote .buybox__status,
.buybox--pacote .buybox__status-icon { color: var(--c-primary); }
.buybox__status {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin: 0;
    color: var(--c-success);
    font-size: var(--fs-lg);
    line-height: 1.3;
}
.buybox__status strong { color: inherit; }
.buybox__status-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: var(--c-success);
}
.buybox__status-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.buybox--owned .buybox__note { color: var(--c-text); font-size: var(--fs-sm); }

/* estado brinde: âmbar */
.buybox--brinde {
    background: var(--c-brinde-soft);
    border-color: var(--c-brinde-border);
}
.buybox--brinde .buybox__note { color: var(--c-brinde); }

/* ---------------------------------------------------------
   Corpo (intro, resultados, ementa, para quem)
   --------------------------------------------------------- */
.curso-section { margin: 0 0 var(--s-7); }
.curso-section:last-child { margin-bottom: 0; }
/* alvos de âncora (#resultados, #ementa, #para-quem, #faq): folga para o header sticky */
.curso-vai,
.curso-modulos,
.curso-quem,
.curso-faq { scroll-margin-top: 96px; }
.curso-h2 {
    font-size: var(--fs-2xl);
    margin: 0 0 var(--s-4);
}
.curso-section__sub {
    margin: calc(-1 * var(--s-2)) 0 var(--s-4);
    color: var(--c-muted);
    font-size: var(--fs-md);
}

.curso-intro {
    max-width: 65ch;
    font-size: var(--fs-lg);
    line-height: 1.7;
    color: var(--c-text);
}
.curso-intro p { margin: 0 0 var(--s-4); }
.curso-intro p:last-child { margin-bottom: 0; }

.curso-vai__list { max-width: 65ch; }
.curso-vai__list li { font-size: var(--fs-md); line-height: 1.55; }

/* Ementa — cada módulo é um <details>; numeral em serifa (--c-secondary, ≥ 24px,
   como o .step__num do "Como funciona") */
.curso-modulos__list {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin: 0;
    padding: 0;
    list-style: none;
}
.curso-modulo {
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: border-color var(--t), box-shadow var(--t);
}
.curso-modulo[open] { border-color: var(--c-secondary); box-shadow: var(--sh-sm); }
.curso-modulo__summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    cursor: pointer;
    user-select: none;
}
.curso-modulo__summary::-webkit-details-marker { display: none; }
.curso-modulo__summary::marker { content: ""; }
.curso-modulo__num {
    flex-shrink: 0;
    width: 2.4rem;
    font-family: var(--ff-head);
    font-weight: 700;
    font-size: 1.75rem;           /* ≥ 24px: o azul médio passa no contraste */
    line-height: 1;
    color: var(--c-secondary);
    font-variant-numeric: tabular-nums;
}
.curso-modulo__title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: var(--fs-md);
    line-height: 1.35;
    color: var(--c-primary);
}
.curso-modulo__chevron {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-primary);
    font-weight: 700;
    line-height: 1;
    transition: transform var(--t), background var(--t), color var(--t);
}
.curso-modulo[open] .curso-modulo__chevron {
    transform: rotate(45deg);
    background: var(--c-primary);
    color: #fff;
}
.curso-modulo__body {
    padding: 0 var(--s-4) var(--s-4) calc(var(--s-4) + 2.4rem + var(--s-3));
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--c-text);
}
@media (max-width: 559px) {
    .curso-modulo__body { padding-left: var(--s-4); }
}
.curso-modulo__desc { margin: 0 0 var(--s-3); color: var(--c-muted); }
.curso-modulo__label { margin: 0 0 var(--s-2); font-weight: 600; color: var(--c-primary); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.curso-modulo__obj { margin: 0; padding-left: 1.2em; list-style: disc; }
.curso-modulo__obj li { margin-bottom: var(--s-1); }

/* Para quem é + pré-requisitos */
.curso-quem__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-3);
    margin: 0 0 var(--s-5);
    padding: 0;
    list-style: none;
}
@media (min-width: 560px) { .curso-quem__list { grid-template-columns: repeat(2, 1fr); } }
.curso-quem__list li {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--c-text);
}
.curso-quem__list li > span {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--c-primary-soft);
    color: var(--c-secondary-dark);
}
.curso-quem__list svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

.curso-prereq {
    max-width: 65ch;
    padding: var(--s-4) var(--s-5);
    background: var(--c-primary-soft);
    border-left: 3px solid var(--c-secondary-dark);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    line-height: 1.6;
}
.curso-prereq__title { margin: 0 0 var(--s-2); font-size: var(--fs-md); color: var(--c-primary); }
.curso-prereq p { margin: 0; }

/* ---------------------------------------------------------
   "O certificado vale?" — card branco dentro do #certificado escuro
   --------------------------------------------------------- */
.curso-vale {
    max-width: 820px;
    margin: 0 auto;
    background: var(--c-bg-alt);
    color: var(--c-text);
    border: 1px solid var(--c-border);
    border-left: 4px solid var(--c-secondary-dark);
    border-radius: var(--r-md);
    padding: var(--s-5);
    font-size: var(--fs-sm);
    line-height: 1.65;
}
.curso-vale__title { margin: 0 0 var(--s-3); color: var(--c-primary); font-size: var(--fs-lg); }
.curso-vale p { margin: 0 0 var(--s-3); color: var(--c-text); }
.curso-vale p:last-child { margin-bottom: 0; }
.curso-vale p strong { color: var(--c-primary); }
.curso-vale__more a {
    color: var(--c-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.curso-vale__more a:hover { color: var(--c-primary-dark); }

/* ---------------------------------------------------------
   Relacionados e FAQ
   --------------------------------------------------------- */
.curso-rel .cursos-grid { max-width: 1040px; margin-inline: auto; }   /* 3 cards centrados, não esticados */
.curso-rel__all { margin: var(--s-5) 0 0; font-weight: 600; }
.curso-rel__all a { text-decoration: underline; text-underline-offset: 2px; }

.curso-faq__more { margin-top: var(--s-5); font-size: var(--fs-sm); }
.curso-faq__more a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------
   Preço na primeira tela (mobile): o buy box só aparece depois
   do hero, e o sticky só depois de rolar — sem esta linha a
   primeira tela do celular não tinha preço nem caminho.
   --------------------------------------------------------- */
.curso-hero__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin: var(--s-4) 0 0;
    font-size: var(--fs-sm);
    color: var(--c-muted);
}
.curso-hero__price .price { font-size: var(--fs-xl); color: var(--c-text); }
.curso-hero__price a {
    font-weight: 700;
    color: var(--c-cta);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.curso-hero__price a:hover { color: var(--c-cta-hover); }
@media (min-width: 980px) {
    /* No desktop o buy box está à direita, sempre visível: a linha vira redundante. */
    .curso-hero__price { display: none; }
}

/* ---------------------------------------------------------
   "Como funciona" — o formato dito UMA vez (antes era o 3º
   parágrafo repetido em cada uma das 21 copies).
   --------------------------------------------------------- */
.curso-como__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--s-3);
}
@media (min-width: 720px) {
    .curso-como__list { grid-template-columns: repeat(2, 1fr); gap: var(--s-4); }
}
.curso-como__list li {
    display: flex;
    gap: var(--s-3);
    align-items: flex-start;
    font-size: var(--fs-sm);
    line-height: 1.55;
    color: var(--c-text);
}
.curso-como__list svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    stroke: currentColor;
    fill: none;
    color: var(--c-secondary-dark);
}
