/*
 * Blog do TH
 
 */

:root {
  color-scheme: dark;
  --bg: #2B1A12;
  --text: #ECE5D8;
  --link: #E08A3C;
  --visited: #B98A5E;
  --muted: color-mix(in srgb, var(--text) 55%, var(--bg));
  --surface: color-mix(in srgb, var(--text) 6%, var(--bg));
  --surface-2: color-mix(in srgb, var(--text) 11%, var(--bg));
  --panel: color-mix(in srgb, var(--surface) 72%, transparent);
  --border: color-mix(in srgb, var(--text) 16%, var(--bg));
  --font-small: 0.9rem;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   
   ============================================================ */
body {
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
  max-width: 720px;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: transparent;   /* embedado */
  overflow-wrap: break-word;
}

/* ============================================================
   TÍTULOS E TEXTO
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  margin-block: 2rem 0.8rem;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

h1#title {
  margin-top: 0;
  line-height: 1.4;
  font-size: 0;            /* esconde o "Guestbook for https://..." */
}
h1#title::before {
  content: "Deixe sua mensagem";   /* mostra no lugar */
  font-size: 1.7rem;
  line-height: 1.4;
}

p { margin-block: 1.2em; }

strong, b { color: var(--text); font-weight: 700; }
em, i { color: var(--text); }

a {
  color: var(--link);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease-out;
}
a:hover, a:active {
  color: color-mix(in srgb, var(--text) 45%, var(--link));
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:visited { color: var(--visited); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--link) 60%, transparent);
  outline-offset: 3px;
}

hr {
  margin: 1.8rem 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* Embedado dentro do blog: sem painel/borda próprios pra não duplicar
   a moldura que a página do blog já fornece. */
main {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}
main > h1:first-child,
main > h2:first-child { margin-top: 0; }

/* ============================================================
   FORMULÁRIO
   ============================================================ */
form {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--font-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="url"],
textarea,
select {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.65rem 0.8rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }

/* Esconde os placeholders ("Name", "Website (optional)"...).
   Os rótulos via ::before mais abaixo. */
input::placeholder,
textarea::placeholder { color: transparent; }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--link) 55%, var(--border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent);
}

/* Botão de enviar */
button,
input[type="submit"],
.button-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bg);
  background: var(--link);
  border: 1px solid var(--link);
  border-radius: var(--radius);
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
@media (hover: hover) {
  button:hover,
  input[type="submit"]:hover,
  .button-link:hover { filter: brightness(1.08); transform: translateY(-1px); }
}
button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--link) 60%, transparent);
  outline-offset: 3px;
}

/* Variante de link "botão" textual (herdada do tema antigo) */
.button-link.as-text {
  padding: 0;
  color: var(--link);
  background: none;
  border: none;
  text-decoration: underline;
}
.button-link.as-text:hover { text-decoration: wavy underline; filter: none; transform: none; }

/* ============================================================
   FORMULÁRIO EM PORTUGUÊS
   Os textos do formulário (placeholders e o botão "Submit") são fixos
  
   Como o servidor está em inglês, recriamos os rótulos em PT via CSS.
   ============================================================ */

/* Rótulo em cima de cada campo (substitui o placeholder escondido acima) */
.guestbooks___input-container { position: relative; }
.guestbooks___input-container::before {
  display: block;
  margin-bottom: 0.4rem;
  font-size: var(--font-small);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.guestbooks___input-container:has(#name)::before    { content: "Nome"; }
.guestbooks___input-container:has(#website)::before  { content: "Site (opcional)"; }
.guestbooks___input-container:has(#text)::before     { content: "Mensagem (somente texto)"; }

/* Botão "Submit" -> "Enviar".
   <input type="submit"> ignora ::before/::after, então escondemos o texto
   ("color: transparent") e sobrepomos "Enviar" usando o div vazio que vem
   logo acima do botão (#guestbooks___pow-status), ancorado no topo do botão.
   Obs.: funciona com o proof-of-work desativado (esse div fica vazio). */
#guestbooks___guestbook-form input[type="submit"] {
  display: block;
  width: 100%;
  text-align: center;
  color: transparent;
}
#guestbooks___pow-status:empty { position: relative; height: 0; }
#guestbooks___pow-status:empty::after {
  content: "Enviar";
  position: absolute;
  top: 100%;            /* o botão começa exatamente aqui */
  left: 0;
  right: 0;
  padding: 0.6rem 0;    /* mesmo padding vertical do botão -> centraliza o texto */
  text-align: center;
  font: 700 1rem/1.2 "Sora", system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: var(--bg);
  pointer-events: none; /* o clique passa direto para o botão real embaixo */
}

/* Cabeçalho da lista: "Messages" -> "Recados" */
#guestbooks___guestbook-messages-header { font-size: 0; }
#guestbooks___guestbook-messages-header::before {
  content: "Recados";
  font-size: 1.25rem;
}

/* ============================================================
   MENSAGENS DO LIVRO DE VISITAS
   Estrutura gerada pelo meadow.cafe:
   <div class="guestbook-message"> (ou ...-reply)
     <p><b>Nome</b> <small> - data</small></p>
     <blockquote>texto</blockquote>
   </div>
   ============================================================ */
#guestbooks___guestbook-messages-header { margin-top: 2rem; }

.guestbook-message { margin: 1.4rem 0; }

/* Cabeçalho do recado: nome + data */
.guestbook-message > p {
  margin: 0 0 0.45rem;
  font-size: var(--font-small);
}
.guestbook-message > p b { color: var(--link); font-weight: 700; }
.guestbook-message > p small {
  font-family: ui-monospace, monospace;
  color: var(--muted);
}

/* Corpo do recado */
.guestbook-message blockquote {
  margin: 0;
  padding: 0.9rem 1.25rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  white-space: pre-wrap;       /* preserva as quebras de linha do texto */
}

/* RESPOSTAS (suas respostas) — recuadas e com cores próprias */
.guestbook-message-reply { margin-left: 1.5rem; }
.guestbook-message-reply > p b { color: #9B9857; }
.guestbook-message-reply blockquote {
  color: #371406;
  background: #9B9857;
  border: 1px solid #9B9857;
}

time {
  font-family: ui-monospace, monospace;
  font-size: var(--font-small);
  color: var(--muted);
  white-space: nowrap;
}

code {
  padding: 0.15em 0.4em;
  background: color-mix(in srgb, var(--link) 14%, var(--surface));
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: var(--font-small);
}

/* ============================================================
   RODAPÉ
   ============================================================ */
footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: var(--font-small);
  color: var(--muted);
  text-align: center;
}
footer p { margin: 0.5rem 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 48rem) {
  body { padding: 1rem; }
  main { padding: 1.25rem 1.1rem; }
  form { padding: 1rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}