/* Marx Que Nunca — estilo */
:root {
  --accent: #c93a30;
  --accent-dark: #a82e26;
  --text: #1c1c1e;
  --muted: #72727a;
  --line: #ebe8e8;
  --soft: #f7f5f5;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px 100px; }

header.site { padding: 56px 0 28px; text-align: center; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--accent);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-decoration: none;
}
.brand:hover { color: var(--accent-dark); }
.tagline { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; letter-spacing: 0.02em; }
.brand img { width: 56px; height: 56px; border-radius: 14px; flex: none; }

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 600; text-decoration: none; z-index: 20; transition: top 0.15s;
}
.skip:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }

.post .meta { margin: 0 0 14px; color: var(--muted); font-size: 0.85rem; }
.post .meta .sep { margin: 0 2px; }

.cite { flex: 1; font-size: 0.88rem; color: var(--muted); }
.cite summary { cursor: pointer; color: var(--muted); list-style: none; display: inline-block; padding: 4px 0; }
.cite summary::-webkit-details-marker { display: none; }
.cite summary::before { content: "▸"; display: inline-block; margin-right: 6px; font-size: 0.8em; }
.cite[open] summary::before { content: "▾"; }
.cite summary:hover { color: var(--accent); }
.cite p { margin: 8px 0; }
.cite a { color: var(--accent); }
.cite-text { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; background: var(--soft); padding: 10px 12px; border-radius: 10px; color: var(--text); user-select: all; word-break: break-word; }
.cite-links { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.small { font-size: 0.82rem; padding: 7px 14px; text-decoration: none; display: inline-block; }

.neighbors { display: flex; gap: 16px; justify-content: space-between; margin: 0 0 20px; }
.neighbors a {
  flex: 1; display: block; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); text-decoration: none; font-size: 0.95rem; line-height: 1.35;
}
.neighbors a span { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 4px; }
.neighbors a.newer { text-align: right; }
.neighbors a:hover { border-color: var(--accent); color: var(--accent); }

footer.site .license { margin: 12px auto 0; max-width: 560px; font-size: 0.78rem; line-height: 1.5; }
footer.site .license a { text-decoration: underline; }

.index-link { text-align: center; margin: 4px 0 24px; }
.index-link a {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.15s, border-color 0.15s;
}
.index-link a:hover { background: #fdeeed; border-color: var(--accent); }

.index-list { list-style: none; margin: 18px 0 0; padding: 0; }
.index-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.index-list a { color: var(--accent); font-weight: 600; text-decoration: none; line-height: 1.35; }
.index-list a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.index-list time { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.muted { color: var(--muted); }

.post {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px 20px;
  margin: 0 0 24px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), 0 8px 24px -16px rgba(0, 0, 0, 0.12);
}
.post.empty { color: var(--muted); text-align: center; padding: 48px 32px; }
.post .title {
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.post .title a { color: inherit; text-decoration: none; }
.post .title a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.post .date { display: inline-block; color: var(--muted); font-size: 0.85rem; text-decoration: none; margin-bottom: 14px; }
.post .date:hover { color: var(--accent); }

.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body h1, .body h2, .body h3, .body h4 { color: var(--accent); line-height: 1.25; letter-spacing: -0.015em; margin: 1.6em 0 0.5em; }
.body h1 { font-size: 1.35rem; }
.body h2 { font-size: 1.12rem; }
.body h3 { font-size: 1.02rem; }
.body h4 { font-size: 0.95rem; }
.body p { margin: 0 0 1em; }
.body a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.body a:hover { color: var(--accent-dark); }
.body blockquote {
  margin: 1.2em 0;
  padding: 4px 20px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  border-radius: 0 12px 12px 0;
  color: #3a3a3f;
}
.body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--soft); padding: 2px 6px; border-radius: 6px; }
.body pre { background: var(--soft); padding: 16px 18px; border-radius: 12px; overflow-x: auto; }
.body pre code { background: none; padding: 0; }
.body img { max-width: 100%; height: auto; border-radius: 12px; }
.body hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.body ul, .body ol { padding-left: 1.4em; }
.body li { margin: 0.25em 0; }
.body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.95em; }
.body th, .body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.body th { background: var(--soft); }

.post-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.edit {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 0 0;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.edit:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

footer.site { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 16px 0; }
footer.site a { color: inherit; text-decoration: none; }
footer.site a:hover { color: var(--accent); }

.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 38px;
  font-weight: 300;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(201, 58, 48, 0.4);
  transition: transform 0.15s, background 0.15s;
  z-index: 10;
}
.fab:hover { background: var(--accent-dark); transform: scale(1.06); }

dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  width: min(94vw, 780px);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  color: var(--text);
}
dialog::backdrop { background: rgba(20, 10, 10, 0.4); backdrop-filter: blur(3px); }
.pane { padding: 28px 28px 22px; display: flex; flex-direction: column; gap: 12px; }
.pane h3 { margin: 0; color: var(--accent); font-size: 1.25rem; }
#pw { width: min(94vw, 380px); }
.pane input[type="password"], .pane textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  border: 1px solid #d9d5d5;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
}
.pane input:focus, .pane textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 58, 48, 0.15); }
.pane textarea {
  min-height: 55vh;
  resize: vertical;
  font: 15px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.hint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.hint code { background: var(--soft); padding: 1px 5px; border-radius: 5px; }
.error { margin: 0; color: var(--accent); font-size: 0.9rem; }
.error.ok { color: #2e7d32; }
.when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 0.9rem; }
.when label { color: var(--text); }
.when input[type="date"] { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.when input[type="date"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201, 58, 48, 0.15); outline: none; }
.when .hint { flex-basis: 100%; }
.scheduled ul { margin: 2px 0 0; padding-left: 18px; font-size: 0.88rem; }
.scheduled li { margin: 2px 0; }
.scheduled .link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.scheduled .link.danger { color: var(--muted); }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.spacer { flex: 1; }
.btn {
  font: 600 0.95rem/1 inherit;
  border: 0;
  border-radius: 999px;
  padding: 11px 20px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn.ghost { background: var(--soft); color: var(--text); }
.btn.ghost:hover { background: var(--line); }
.btn.danger { background: #fff; color: var(--accent); border: 1px solid var(--line); }
.btn.danger:hover { background: #fdeeed; border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .fab, .edit, .skip, dialog, .index-link, .neighbors, .cite-links { display: none !important; }
  .post { border: 0; box-shadow: none; padding: 0; }
  .cite { display: block; }
  .cite summary { display: none; }
  .cite[open], .cite { font-size: 0.8rem; }
  a { color: inherit; }
  .body a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: var(--muted); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  header.site { padding: 36px 0 20px; }
  .brand { font-size: 1.9rem; gap: 14px; }
  .brand img { width: 46px; height: 46px; border-radius: 12px; }
  .post { padding: 20px 20px 14px; border-radius: 16px; }
  .post .title { font-size: 1.4rem; }
  .body h1 { font-size: 1.2rem; }
  .body h2 { font-size: 1.05rem; }
  .body h3, .body h4 { font-size: 0.98rem; }
  .index-list li { flex-direction: column; gap: 2px; }
  .neighbors { flex-direction: column; }
  .neighbors a.newer { text-align: left; }
  .fab { right: 16px; bottom: 16px; width: 54px; height: 54px; font-size: 32px; }
  .pane { padding: 20px 18px 16px; }
  .pane textarea { min-height: 38vh; }
  .when { font-size: 0.88rem; }
}
