/* Temas da página «Oferta formativa» (formacao/templates/formacao/temas/).
   Tudo delimitado a .of-tema; o tema «Padrão» usa os estilos que já existiam. */

.of-tema {
  --of-texto: #2b2f36;
  --of-suave: #6c757d;
  --of-linha: #e1e6ed;
  --of-fundo: #fff;
  --of-fundo-2: #f5f7fa;
  --of-destaque: #08a0c4;
  --of-navy: #0b2e4f;
  --of-raio: 10px;
  color: var(--of-texto);
  font-weight: 400;
}
.of-vazio { color: #b3261e; font-weight: 600; padding: 1rem 0; }
.of-tema a { color: inherit; }
.of-tema a:hover { color: var(--of-destaque); text-decoration: none; }
.of-ref { color: var(--of-suave); font-size: .8rem; letter-spacing: .02em; margin: 0; }

/* Estado da turma */
.of-estado { display: inline-block; padding: .18rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 700; line-height: 1.3; background: #e9ecef; color: #495057; white-space: nowrap; }
.of-estado--0 { background: #e3ecf7; color: #1f4a7a; }             /* prevista */
.of-estado--1 { background: #d6f0c9; color: #1d5a0c; }             /* inscrições abertas */
.of-estado--2 { background: #fff0c2; color: #6b4d00; }             /* inscrições fechadas */
.of-estado--3 { background: #cfeef6; color: #05506a; }             /* a decorrer */
.of-estado--4 { background: #ffe0c7; color: #7a3a07; }             /* adiada */
.of-estado--5, .of-estado--6 { background: #e8e1f7; color: #45307a; } /* avaliação / certificação */
.of-estado--7 { background: #e9ecef; color: #495057; }             /* concluída */
.of-estado--8 { background: #fbd9d6; color: #8a1c14; }             /* cancelada */

/* Contadores e preço */
.of-contadores { display: inline-flex; flex-wrap: wrap; gap: .35rem .75rem; font-size: .82rem; color: var(--of-suave); }
.of-contadores__vagas { color: #1d5a0c; font-weight: 600; }
.of-preco { color: crimson; font-weight: 700; }

.of-botao { display: inline-block; padding: .45rem 1rem; border-radius: 999px; background: var(--of-destaque); color: #fff !important; font-weight: 700; font-size: .85rem; white-space: nowrap; }
.of-botao:hover { background: var(--of-navy); }

/* ---------------------------------------------------------------- Cartões */
.of-cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.of-cartao { display: flex; flex-direction: column; background: var(--of-fundo); border: 1px solid var(--of-linha); border-radius: var(--of-raio); overflow: hidden; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: box-shadow .2s, transform .2s; }
.of-cartao:hover { box-shadow: 0 10px 24px rgba(16, 24, 40, .12); transform: translateY(-2px); }
.of-cartao__imagem { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--of-fundo-2); }
.of-cartao__imagem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.of-cartao__imagem .of-estado { position: absolute; top: .75rem; left: .75rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.of-cartao__corpo { padding: 1rem 1.1rem .5rem; flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.of-cartao__titulo { font-size: 1.08rem; line-height: 1.35; margin: 0; font-weight: 700; color: var(--of-navy); }
.of-publico { margin: 0; font-size: .8rem; font-weight: 700; color: #b3261e; }
.of-meta { list-style: none; margin: .2rem 0 0; padding: 0; font-size: .88rem; color: var(--of-texto); display: grid; gap: .2rem; }
.of-meta .fa { width: 1.1rem; color: var(--of-destaque); }
.of-destinatarios { margin: .3rem 0 0; font-size: .82rem; color: var(--of-suave); line-height: 1.45; }
.of-cartao__rodape { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .75rem 1.1rem 1rem; border-top: 1px solid var(--of-linha); }

/* ---------------------------------------------------------------- Lista compacta */
.of-tabela { width: 100%; border-collapse: collapse; background: var(--of-fundo); border: 1px solid var(--of-linha); border-radius: var(--of-raio); overflow: hidden; font-size: .92rem; }
.of-tabela thead th { background: var(--of-navy); color: #fff; text-align: left; padding: .65rem .8rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.of-tabela td { padding: .7rem .8rem; border-top: 1px solid var(--of-linha); vertical-align: middle; }
.of-tabela tbody tr:nth-child(even) td { background: var(--of-fundo-2); }
.of-tabela tbody tr:hover td { background: #eaf7fb; }
.of-tabela__data { white-space: nowrap; font-weight: 700; color: var(--of-navy); }
.of-tabela__acao a { font-weight: 700; color: var(--of-navy); }
.of-tabela__acao small { display: block; color: var(--of-suave); margin-top: .15rem; }
.of-tabela__num { text-align: right; font-variant-numeric: tabular-nums; }
.of-tabela td .of-contadores { display: flex; margin-top: .3rem; }
.of-tabela__ir a { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: var(--of-destaque); }
.of-tabela__ir a:hover { background: var(--of-destaque); color: #fff; }
.of-tabela a { opacity: 1 !important; float: none !important; }  /* CSS antigo esconde/empurra links de tabelas */
@media (max-width: 767px) {
  .of-tabela thead { display: none; }
  .of-tabela, .of-tabela tbody, .of-tabela tr, .of-tabela td { display: block; width: 100%; }
  .of-tabela tr { border-top: 1px solid var(--of-linha); padding: .5rem 0; }
  .of-tabela td { border: 0; padding: .2rem .9rem; background: transparent !important; }
  .of-tabela td[data-rotulo]::before { content: attr(data-rotulo) ": "; color: var(--of-suave); font-size: .78rem; }
  .of-tabela td.of-tabela__acao::before { content: none; }
  .of-tabela__num { text-align: left; }
  .of-tabela__ir { display: none !important; }
}

/* ---------------------------------------------------------------- Cronologia */
.of-crono__mes { margin-bottom: 1.75rem; }
.of-crono__titulo { font-size: 1.05rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--of-destaque); border-bottom: 2px solid var(--of-destaque); padding-bottom: .35rem; margin: 0 0 1rem; }
.of-crono { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.of-crono__item { display: grid; grid-template-columns: 4.25rem 1fr; gap: 1rem; align-items: start; background: var(--of-fundo); border: 1px solid var(--of-linha); border-radius: var(--of-raio); padding: .85rem 1rem; }
.of-crono__item:hover { border-color: var(--of-destaque); }
.of-crono__data { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--of-navy); color: #fff; border-radius: 8px; padding: .45rem 0; line-height: 1.1; }
.of-crono__dia { font-size: 1.6rem; font-weight: 800; }
.of-crono__sem { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #ceeef6; }
.of-crono__corpo h5 { font-size: 1.02rem; font-weight: 700; margin: 0 0 .2rem; color: var(--of-navy); }
.of-crono__meta { margin: 0 0 .35rem; font-size: .86rem; color: var(--of-suave); }
.of-crono__estado { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }

/* ---------------------------------------------------------------- Detalhe da turma (oferta embutida) */
.of-detalhe { max-width: 72rem; margin: 0 auto; padding: 2rem 1rem 3rem; line-height: 1.6; }
.of-detalhe--embutida { font-family: "Source Sans Pro", system-ui, sans-serif; }
.of-detalhe--site { padding: 1rem 0 2rem; }
.of-detalhe--site .of-detalhe__titulo h1 { text-transform: none; }
.of-voltar { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1rem; padding: .4rem .95rem; border: 1px solid var(--of-linha); border-radius: 999px; background: var(--of-fundo); color: var(--of-navy) !important; font-weight: 600; font-size: .9rem; text-decoration: none; }
.of-voltar:hover { border-color: var(--of-destaque); color: var(--of-destaque) !important; }
.of-voltar .fa { font-size: .85rem; }
.of-detalhe__topo { display: grid; grid-template-columns: minmax(0, 18rem) 1fr; gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.of-detalhe__cartaz img { width: 100%; border-radius: var(--of-raio); box-shadow: 0 6px 20px rgba(16, 24, 40, .12); display: block; }
.of-detalhe__titulo h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; font-weight: 800; color: var(--of-navy); margin: .3rem 0 .6rem; }
.of-detalhe__grelha { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; align-items: start; }
.of-detalhe__texto h2 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--of-destaque); margin: 1.6rem 0 .4rem; }
.of-detalhe__texto h2:first-child { margin-top: 0; }
.of-detalhe__texto p { margin: 0 0 .6rem; color: var(--of-texto); }
.of-detalhe__anexos, .of-detalhe__formadores { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.of-detalhe__anexos a { color: var(--of-destaque); font-weight: 600; }
.of-detalhe__anexos .fa, .of-detalhe__formadores .fa { color: var(--of-suave); width: 1.1rem; }
.of-detalhe__texto .of-tabela { font-size: .9rem; }
.of-detalhe__lado { position: sticky; top: 5rem; background: var(--of-fundo-2); border: 1px solid var(--of-linha); border-radius: var(--of-raio); padding: 1.25rem; }
.of-detalhe__factos { margin: 0; display: grid; gap: .8rem; }
.of-detalhe__factos dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--of-suave); }
.of-detalhe__factos dt .fa { color: var(--of-destaque); width: 1.1rem; }
.of-detalhe__factos dd { margin: .1rem 0 0 1.1rem; font-weight: 600; color: var(--of-navy); overflow-wrap: anywhere; }
.of-detalhe__inscrever { display: block; text-align: center; margin-top: 1.25rem; padding: .7rem 1rem; font-size: 1rem; }
@media (max-width: 860px) {
  .of-detalhe__topo, .of-detalhe__grelha { grid-template-columns: 1fr; }
  .of-detalhe__cartaz { max-width: 22rem; }
  .of-detalhe__lado { position: static; order: -1; }
}

/* ---------------------------------------------------------------- Detalhe da turma: tema «Destaque» */
.of-dest { max-width: none; padding: 0 0 2.5rem; }
.of-dest__heroi { position: relative; overflow: hidden; border-radius: var(--of-raio); background: var(--of-navy); color: #fff; margin-bottom: 1.5rem; }
.of-dest__fundo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px) saturate(1.2); transform: scale(1.15); opacity: .45; }
.of-dest__heroi::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgb(11 46 79 / .95) 30%, rgb(11 46 79 / .55)); }
.of-dest__interior { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr minmax(0, 16rem); gap: 2rem; align-items: center; padding: 1.5rem 2rem 2.25rem; }
.of-dest .of-voltar { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .35); color: #fff !important; }
.of-dest .of-voltar:hover { background: #fff; color: var(--of-navy) !important; }
.of-dest__ref { margin: .25rem 0 0; font-size: .82rem; letter-spacing: .03em; color: #ceeef6; }
.of-dest__titulo h1 { margin: .35rem 0 .8rem; font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.15; font-weight: 800; color: #fff; text-transform: none; }
.of-dest__estado { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 1.25rem; font-size: .9rem; color: #e3ecf7; }
.of-dest__inscrever { padding: .7rem 1.5rem; font-size: 1rem; background: #ffc600; color: var(--of-navy) !important; }
.of-dest__inscrever:hover { background: #fff; }
.of-dest__cartaz { width: 100%; border-radius: var(--of-raio); box-shadow: 0 12px 30px rgb(0 0 0 / .35); display: block; }
.of-dest__factos { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem; margin: 0 0 2rem; }
.of-dest__factos > div { background: var(--of-fundo); border: 1px solid var(--of-linha); border-radius: var(--of-raio); padding: .8rem 1rem; }
.of-dest__factos dt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--of-suave); }
.of-dest__factos dt .fa { color: var(--of-destaque); width: 1.1rem; }
.of-dest__factos dd { margin: .2rem 0 0; font-weight: 700; color: var(--of-navy); overflow-wrap: anywhere; }
.of-dest__texto { max-width: 48rem; margin: 0 auto; font-size: 1.02rem; }
.of-dest__texto h2 { font-size: 1.25rem; text-transform: none; letter-spacing: 0; color: var(--of-navy); margin-top: 2rem; padding-bottom: .35rem; border-bottom: 3px solid var(--of-destaque); display: inline-block; }
.of-dest__apelo { max-width: 48rem; margin: 2.5rem auto 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.4rem; border-radius: var(--of-raio); background: #eaf7fb; border: 1px solid #bfe6f1; }
.of-dest__apelo strong { display: block; color: var(--of-navy); font-size: 1.1rem; }
.of-dest__apelo span { color: var(--of-suave); font-size: .9rem; }
@media (max-width: 760px) {
  .of-dest__interior { grid-template-columns: 1fr; padding: 1.25rem 1.1rem 1.75rem; }
  .of-dest__cartaz { max-width: 14rem; order: -1; }
}

/* ---------------------------------------------------------------- Detalhe da turma: tema «Ficha técnica» */
.of-ficha { max-width: 56rem; padding: 1rem 0 2.5rem; }
.of-ficha__acoes { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.of-ficha__imprimir { cursor: pointer; margin-left: auto; }
.of-ficha__folha { background: #fff; border: 1px solid var(--of-linha); border-top: 6px solid var(--of-navy); border-radius: 4px; box-shadow: 0 8px 28px rgb(16 24 40 / .08); padding: 2rem 2.25rem 2.25rem; }
.of-ficha__cabecalho { display: grid; grid-template-columns: 1fr 7.5rem; gap: 1.5rem; align-items: start; padding-bottom: 1.25rem; border-bottom: 1px solid var(--of-linha); margin-bottom: 1.5rem; }
.of-ficha__rotulo { margin: 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--of-destaque); }
.of-ficha__cabecalho h1 { margin: .3rem 0 .4rem; font-size: clamp(1.4rem, 2.6vw, 1.9rem); line-height: 1.25; font-weight: 800; color: var(--of-navy); text-transform: none; }
.of-ficha__cabecalho .of-ref { margin-bottom: .5rem; }
.of-ficha__cartaz { width: 100%; border-radius: 4px; border: 1px solid var(--of-linha); display: block; }
.of-ficha__dados { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 2rem; border: 1px solid var(--of-linha); border-radius: 4px; overflow: hidden; }
.of-ficha__dados > div { display: grid; grid-template-columns: 9.5rem 1fr; border-bottom: 1px solid var(--of-linha); }
.of-ficha__dados > div:nth-child(odd) { border-right: 1px solid var(--of-linha); }
.of-ficha__dados dt { padding: .55rem .75rem; background: var(--of-fundo-2); font-size: .8rem; font-weight: 700; color: var(--of-suave); }
.of-ficha__dados dt .fa { display: none; }
.of-ficha__dados dd { margin: 0; padding: .55rem .75rem; font-weight: 600; color: var(--of-texto); overflow-wrap: anywhere; min-width: 0; }
.of-ficha__texto { counter-reset: of-seccao; }
.of-ficha__texto h2 { counter-increment: of-seccao; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--of-navy); margin: 1.6rem 0 .45rem; }
.of-ficha__texto h2::before { content: counter(of-seccao) ". "; color: var(--of-destaque); }
.of-ficha__rodape { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--of-linha); font-weight: 600; color: var(--of-navy); }
@media (max-width: 700px) {
  .of-ficha__folha { padding: 1.25rem 1rem 1.5rem; }
  .of-ficha__cabecalho { grid-template-columns: 1fr; }
  .of-ficha__cartaz { max-width: 9rem; }
  .of-ficha__dados { grid-template-columns: 1fr; }
  .of-ficha__dados > div:nth-child(odd) { border-right: 0; }
  .of-ficha__dados > div { grid-template-columns: 8rem 1fr; }
}
@media print {
  body * { visibility: hidden; }
  .of-ficha__folha, .of-ficha__folha * { visibility: visible; }
  .of-ficha__folha { position: absolute; left: 0; top: 0; width: 100%; border: 0; box-shadow: none; padding: 0; }
  .of-ficha__rodape .of-botao { display: none; }
}
