/* ─── DOCUMENT CONTENT AREA ─── */
.document-content-area {
  min-height: 60svh;
  background-color: #ffffff;
  padding: 196px 0 80px 0;
}

@media (max-width: 768px) {
  .document-content-area {
    padding: 152px 0 60px 0;
  }
}

/* ─── DOCUMENT CONTAINER ─── */
.document-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── TYPOGRAPHY FOR MARKDOWN ─── */
.markdown-body {
  color: #1e293b; /* slate-800 */
  font-family: var(--font-family), 'Inter', sans-serif;
  line-height: 1.8;
  font-size: 16px;
  font-weight: 400;
}

/* Headings */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: var(--azul, #1c2545);
  font-weight: 600;
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  line-height: 1.25;
}

.markdown-body h1 {
  font-size: clamp(28px, 4vw, 38px);
  margin-top: 0;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
}

.markdown-body h2 {
  font-size: clamp(22px, 3vw, 26px);
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.markdown-body h3 {
  font-size: 20px;
}

.markdown-body h4 {
  font-size: 18px;
}

/* Block elements */
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
  margin-top: 0;
  margin-bottom: 20px;
}

/* Links */
.markdown-body a {
  color: #c5a880; /* Dourado */
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(197, 168, 128, 0.4);
  transition: color 0.2s, border-color 0.2s;
}

.markdown-body a:hover {
  color: #ab8e65;
  border-bottom-style: solid;
}

/* Blockquotes */
.markdown-body blockquote {
  padding: 8px 16px;
  color: #64748b; /* slate-500 */
  border-left: 4px solid #c5a880; /* Dourado */
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists */
.markdown-body ul,
.markdown-body ol {
  padding-left: 24px;
}

.markdown-body ul {
  list-style-type: disc;
}

.markdown-body ol {
  list-style-type: decimal;
}

.markdown-body li {
  margin-top: 4px;
  margin-bottom: 4px;
}

.markdown-body li > p {
  margin-top: 8px;
}

/* Inline Code */
.markdown-body code {
  padding: 3px 6px;
  margin: 0;
  font-size: 14px;
  font-family: 'Courier New', Courier, monospace;
  background-color: #f1f5f9;
  border-radius: 6px;
  color: #0f172a;
}

/* Fenced Code Blocks */
.markdown-body pre {
  padding: 18px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.6;
  background-color: #0f172a; /* slate-900 para estilo premium escuro */
  border-radius: 12px;
  border: 1px solid #1e293b;
}

.markdown-body pre code {
  padding: 0;
  margin: 0;
  font-size: inherit;
  color: #f8fafc; /* Texto claro */
  background-color: transparent;
  border-radius: 0;
  font-family: 'Courier New', Courier, monospace;
}

/* Horizontal Rule */
.markdown-body hr {
  height: 1px;
  padding: 0;
  margin: 32px 0;
  background-color: #e2e8f0;
  border: 0;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .document-container {
    padding: 0 16px;
  }
  .markdown-body {
    font-size: 15px;
  }
}

/* ─── TABLES STYLING ─── */
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  font-size: 15px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.markdown-body th,
.markdown-body td {
  padding: 14px 20px;
  text-align: left;
}

.markdown-body th {
  background-color: #f8fafc;
  color: var(--azul, #1c2545);
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
}

.markdown-body td {
  border-bottom: 1px solid #e2e8f0;
  color: #334155; /* slate-700 */
}

.markdown-body tr:last-child td {
  border-bottom: none;
}

.markdown-body tr:nth-child(even) {
  background-color: #f8fafc;
}

@media (max-width: 640px) {
  .markdown-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ─── FOLHA DE CONTROLE COLLAPSIBLE ─── */
.control-sheet-details {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background-color: #f8fafc;
  margin-bottom: 32px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.control-sheet-details[open] {
  box-shadow: 0 4px 20px rgba(17, 24, 52, 0.04);
  background-color: #ffffff;
}

.control-sheet-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--azul, #1c2545);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color 0.2s ease;
}

.control-sheet-summary::-webkit-details-marker {
  display: none;
}

.control-sheet-summary::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 6px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%231c2545' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-sheet-details[open] .control-sheet-summary::after {
  transform: rotate(180deg);
}

.control-sheet-summary:hover {
  background-color: #f1f5f9;
}

.control-sheet-content {
  padding: 24px;
  border-top: 1px solid #e2e8f0;
  background-color: #ffffff;
}

/* Ensure the table inside the control sheet matches well */
.control-sheet-content table {
  margin-bottom: 0;
}
