/*
  This combination should override any default Quarto
  or theme styles that are keeping captions left-aligned.
*/

/* This targets the container <figcaption> element */
figcaption {
  text-align: center;
  font-size: 110%;
}

/* This targets the <p> tag with the caption class.
  The !important flag gives it top priority.
*/
.figure-caption {
  text-align: center !important;
}

/* Delimitador de fim de exemplo e prova (símbolo QED / Halmos) */
.theorem.example::after,
div.example::after,
.proof::after,
div.proof::after {
  content: "■";
  display: block;
  text-align: right;
  font-size: 0.9em;
  color: #6c757d;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* Suprime o delimitador se vier um cabeçalho/seção logo em seguida */
.theorem.example:has(+ :is(h1, h2, h3, h4, h5, h6, header, section, [class*="level"]))::after,
div.example:has(+ :is(h1, h2, h3, h4, h5, h6, header, section, [class*="level"]))::after,
.proof:has(+ :is(h1, h2, h3, h4, h5, h6, header, section, [class*="level"]))::after,
div.proof:has(+ :is(h1, h2, h3, h4, h5, h6, header, section, [class*="level"]))::after,
section > .theorem.example:last-child::after,
section > div.example:last-child::after,
section > .proof:last-child::after,
section > div.proof:last-child::after {
  display: none;
}

/* Remove a linha horizontal superior das tabelas */
table,
.table,
.table > thead,
.table > thead > tr:first-child > th,
.table > thead > tr:first-child > td {
  border-top: none !important;
}