/* tutorial-php.css: arquivos do projeto no estilo do VS Code e a prévia do navegador (tutorial-php.js)
   versão 1 · 2026-10-06 · o editor é sempre escuro, nos dois temas do site, como o VS Code */

.tutorial-projeto { margin: 1.2rem 0 1.6rem; display: grid; gap: .9rem; }

.tp-janela { background: #1e1e1e; border: 1px solid #2b2b2b; border-radius: 12px; overflow: hidden; font-family: var(--f-mono); }
.tp-barra { display: flex; align-items: center; gap: .6rem; background: #323233; color: #cccccc; font-size: .78rem; padding: .45rem .8rem; }
.tp-titulo { flex: 1; text-align: center; margin-right: 42px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-abas { display: flex; background: #252526; overflow-x: auto; scrollbar-width: none; }
.tp-aba { display: flex; align-items: center; gap: .45rem; background: #2d2d2d; color: #969696; border: 0; border-top: 2px solid transparent; border-right: 1px solid #1e1e1e; padding: .5rem .9rem; font: inherit; font-size: .8rem; white-space: nowrap; cursor: pointer; }
.tp-aba[aria-selected="true"] { background: #1e1e1e; color: #ffffff; border-top-color: #0078d4; }
.tp-aba:focus-visible { outline: 2px solid var(--menta); outline-offset: -2px; }
.tp-estado { font-size: .65rem; border-radius: 999px; padding: .05rem .45rem; text-transform: uppercase; letter-spacing: .04em; }
.tp-novo { background: #1f4d2b; color: #9fe3b5; }
.tp-mudou { background: #4d3b14; color: #ffd27a; }
.tp-igual { background: #333; color: #aaa; }

.tp-arquivo[hidden] { display: none; }
.tp-codigo { display: grid; grid-template-columns: auto 1fr; max-height: 30rem; overflow: auto; }
.tp-linhas, .tp-texto { margin: 0; padding: .7rem .9rem; font-family: var(--f-mono); font-size: .84rem; line-height: 1.55; white-space: pre; background: transparent; border: 0; box-shadow: none; }
.tp-linhas { color: #6e7681; text-align: right; user-select: none; padding-right: .5rem; position: sticky; left: 0; background: #1e1e1e; }
.tp-texto { color: #d4d4d4; }
.tp-texto code { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.tp-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; padding: .55rem .9rem; border-top: 1px solid #2b2b2b; background: #252526; }
.tp-copiar { font: inherit; font-size: .8rem; font-weight: 700; color: #1e1e1e; background: #a5a8ff; border: 0; border-radius: 999px; padding: .4rem .95rem; cursor: pointer; }
.tp-copiar:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.tp-aviso { font-size: .78rem; color: #9fe3b5; }

.tp-com { color: #6a9955; }
.tp-txt { color: #ce9178; }
.tp-php { color: #ff8a1e; font-weight: 700; }
.tp-var { color: #9cdcfe; }
.tp-tag { color: #569cd6; }
.tp-pal { color: #c586c0; }
.tp-fun { color: #dcdcaa; }
.tp-num { color: #b5cea8; }

.tp-previa { display: grid; gap: .5rem; }
.tp-rotulo { margin: 0; font-size: .82rem; font-weight: 700; color: var(--texto-2); text-transform: uppercase; letter-spacing: .04em; }
.tp-rotulo small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.tp-botoes-previa { display: flex; flex-wrap: wrap; gap: .4rem; }
.tp-botoes-previa button { font: inherit; font-size: .8rem; color: var(--texto); background: var(--superficie); border: 1px solid var(--borda-forte); border-radius: 999px; padding: .3rem .8rem; cursor: pointer; }
.tp-botoes-previa button[aria-pressed="true"] { border-color: var(--menta); color: var(--menta); }
.tp-tela { width: 100%; height: 22rem; border: 1px solid var(--borda-forte); border-radius: 10px; background: #ffffff; }

.tutorial-passo { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
/* comandos longos (ex.: C:\xampp\php\php.exe) quebram a linha em vez de alargar a página no celular */
#tutorial code { overflow-wrap: anywhere; }
.tutorial-passo h3 { margin-top: 1.6rem; }
.tutorial-passo .etiqueta { justify-self: start; }

/* caminho de um cadastro (versões 3 e 4) */
.tutorial-caminho {
  line-height: 2;
}

.tutorial-caminho code {
  white-space: nowrap;
}

/* tabela "quem faz o quê" (versão 4) */
.tutorial-papeis caption {
  padding-bottom: .5rem;
  text-align: left;
  font-family: var(--f-titulo);
  color: var(--texto);
}

/* ilustração do MVC (conceito C7): o restaurante */
.mvc-figura {
  margin: 1.6rem 0 0;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--superficie);
}

.mvc-figura ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mvc-figura li {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .4rem;
  padding: 1.1rem .8rem;
  text-align: center;
  border-top: 3px solid var(--cor);
  border-radius: var(--raio-p);
  background: var(--superficie-2);
}

/* seta entre as etapas */
.mvc-figura li:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -1.55rem;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--texto-3);
}

.mvc-figura svg {
  width: 3.2rem;
  height: 3.2rem;
  fill: none;
  stroke: var(--cor);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mvc-papel {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cor);
}

.mvc-figura strong {
  font-family: var(--f-titulo);
  font-size: 1.05rem;
  color: var(--texto);
}

.mvc-faz {
  font-size: .9rem;
  color: var(--texto-2);
}

.mvc-figura figcaption {
  margin-top: 1.2rem;
  text-align: center;
  color: var(--texto-2);
}

/* tela estreita: uma etapa embaixo da outra, seta para baixo */
@media (max-width: 860px) {
  .mvc-figura ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .mvc-figura li:not(:last-child)::after {
    content: "↓";
    top: auto;
    right: auto;
    bottom: -1.75rem;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* na tabela, nome de arquivo não quebra no meio */
#tutorial .tutorial-papeis code {
  white-space: nowrap;
  overflow-wrap: normal;
}

.tutorial-papeis small {
  color: var(--texto-3);
}

/* respiro entre a apresentação da versão e o "Faça assim" */
.tutorial-passo + p {
  margin-top: 1rem;
}

/* ilustração cliente e servidor (conceito C1): duas cenas, GET e POST */
.cs-figura {
  display: grid;
  gap: 1.4rem;
  margin: 1.6rem 0 0;
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--superficie);
}

.cs-cena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.cs-titulo {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 1.05rem;
  color: var(--texto);
}

.cs-get {
  color: var(--ouro);
}

.cs-post {
  color: var(--menta);
}

/* as duas pontas da conversa */
.cs-ponta {
  display: grid;
  justify-items: center;
  gap: .35rem;
  padding: 1rem .8rem;
  text-align: center;
  border-top: 3px solid var(--cor);
  border-radius: var(--raio-p);
  background: var(--superficie-2);
}

.cs-ponta svg {
  width: 4rem;
  height: 4rem;
  fill: none;
  stroke: var(--cor);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs-ponta .cs-tampa {
  fill: var(--superficie-2);
}

.cs-ponta .cs-luz {
  fill: var(--cor);
}

.cs-papel,
.cs-rotulo {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.cs-papel {
  color: var(--cor);
}

.cs-ponta strong {
  font-family: var(--f-titulo);
  color: var(--texto);
}

.cs-detalhe,
.cs-fala {
  font-size: .9rem;
  color: var(--texto-2);
}

/* as mensagens no meio: pedido (ida) e resposta (volta) */
.cs-meio {
  display: grid;
  gap: .8rem;
}

.cs-msg {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  column-gap: .7rem;
  align-items: center;
  padding: .7rem .9rem;
  border: 1px dashed var(--cor-msg);
  border-radius: var(--raio-p);
}

.cs-pedido {
  --cor-msg: var(--ouro);
  --mx: 5px;
}

.cs-resposta {
  --cor-msg: var(--menta);
  --mx: -5px;
}

.cs-seta {
  font-size: 1.6rem;
  color: var(--cor-msg);
  animation: cs-vai 1.6s ease-in-out infinite;
}

.cs-rotulo {
  color: var(--cor-msg);
}

.cs-figura code {
  overflow-wrap: anywhere;
}

/* a seta "anda" no sentido da mensagem; para com a pausa e com o reduzir movimento */
@keyframes cs-vai {
  50% {
    translate: var(--mx, 0) var(--my, 0);
  }
}

.pausado .cs-seta {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .cs-seta {
    animation: none;
  }
}

.cs-figura figcaption {
  text-align: center;
  color: var(--texto-2);
}

/* tabela GET x POST */
.cs-tabela {
  margin-top: 1.2rem;
}

.cs-tabela caption {
  padding-bottom: .5rem;
  text-align: left;
  font-family: var(--f-titulo);
  color: var(--texto);
}

.cs-tabela thead th:nth-child(2) {
  color: var(--ouro);
}

.cs-tabela thead th:nth-child(3) {
  color: var(--menta);
}

.cs-tabela tbody th {
  font-family: var(--f-titulo);
  font-size: .9rem;
  color: var(--texto);
}

/* tela estreita: cliente, mensagens e servidor um embaixo do outro */
@media (max-width: 860px) {
  .cs-cena {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-seta {
    rotate: 90deg;
  }

  .cs-pedido {
    --mx: 0;
    --my: 5px;
  }

  .cs-resposta {
    --mx: 0;
    --my: -5px;
  }
}

/* a tabela GET x POST cabe inteira no celular */
@media (max-width: 560px) {
  .cs-tabela {
    table-layout: fixed;
    font-size: .88rem;
  }

  .cs-tabela th,
  .cs-tabela td {
    padding: .55rem .4rem;
  }

  .cs-tabela code {
    overflow-wrap: anywhere;
  }
}

/* C1 para leigos: cartão-postal, envelope e página desenhados nas mensagens */
.cs-objeto {
  width: 3.4rem;
  height: auto;
  fill: none;
  stroke: var(--cor-msg);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cs-objeto .cs-luz {
  fill: var(--cor-msg);
}

.cs-texto {
  display: grid;
  gap: .3rem;
}

.cs-endereco {
  justify-self: start;
  padding: .2rem .5rem;
  font-size: .82rem;
  border: 1px solid var(--borda);
  border-radius: var(--raio-p);
  background: var(--superficie-2);
}

/* barra de endereço de mentirinha (ao lado do texto do C1) */
.cs-barras {
  display: grid;
  gap: .7rem;
  padding: clamp(1rem, 3vw, 1.4rem);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  background: var(--superficie);
  color: var(--texto-2);
}

.cs-barras-titulo {
  font-family: var(--f-titulo);
  color: var(--texto);
}

.cs-barra {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .9rem;
  font-family: var(--f-mono);
  font-size: .88rem;
  color: var(--texto);
  border: 1px solid var(--borda-forte);
  border-radius: 999px;
  background: var(--superficie-2);
  overflow-wrap: anywhere;
}

.cs-barra mark {
  padding: 0 .2rem;
  border-radius: 4px;
  color: var(--fundo);
  background: var(--ouro);
}

.cs-cadeado {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--menta);
  stroke-width: 2;
}

/* tabela dos códigos de resposta (200, 404, 500) */
.cs-codigos thead th:nth-child(2),
.cs-codigos thead th:nth-child(3) {
  color: var(--ouro);
}

.cs-codigos thead th:first-child {
  width: 5rem;
}

.cs-codigos tbody th code {
  font-size: 1.05rem;
  color: var(--ouro);
}

/* respiro antes da explicação dos códigos de resposta */
.cs-intro {
  margin-top: 1.8rem;
}

/* parada depois da versão 3: o que vem depois é bônus */
.tutorial-bonus {
  display: grid;
  gap: .6rem;
  margin: 2.4rem 0 1.6rem;
  padding: 1.2rem 1.4rem;
  border: 1px dashed var(--menta);
  border-radius: var(--raio);
  background: var(--superficie);
}

.tutorial-bonus .etiqueta {
  justify-self: start;
}
/* data-sem-copiar: o código fica para ler e digitar, não para selecionar */
.tp-sem-copiar .tp-texto { -webkit-user-select: none; user-select: none; }
