/* Overrides to increase table line visibility */
/* These rules are high-specificity and use !important to ensure
   they take precedence over the theme's minified CSS. */

.chapter-content table,
.container table,
table {
  border-collapse: collapse;
}

.chapter-content table td,
.chapter-content table th,
.container table td,
.container table th,
table td,
table th {
  border: 1px solid rgba(255,255,255,0.12) !important;
  padding: .6rem;
}

.chapter-content table th,
table th {
  background: rgba(255,255,255,0.04) !important;
}

/* Light-theme adjustments so borders are visible on light backgrounds */
.light-theme .chapter-content table td,
.light-theme table td,
.light-theme .chapter-content table th,
.light-theme table th {
  border-color: rgba(0,0,0,0.12) !important;
}
.light-theme .chapter-content table th,
.light-theme table th {
  background: rgba(0,0,0,0.03) !important;
}

/* Smooth theme change to avoid flash when toggling */
html.theme-transition,
html.theme-transition * {
  transition: background-color 300ms ease, color 300ms ease, border-color 300ms ease;
}

/* Theme toggle icon color: ensure icon is dark on light theme */
.theme-toggle .theme-icon{
  color: var(--emergence, #f5f5f5);
  transition: color 200ms ease;
}
.light-theme .theme-toggle .theme-icon{
  color: #111 !important;
}

/* Glass-style home button (botão vidro) */
.home-button,
#crio-home {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .7rem;
  border-radius: 10px;
  color: var(--emergence, #f0f0f0);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 22px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  transition: background-color 180ms ease, color 180ms ease, transform 120ms ease, box-shadow 120ms ease, border-color 180ms ease;
  cursor: pointer;
}
.home-button .home-icon,
#crio-home .home-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* Light theme variant: lighter glass with dark text/icon */
.light-theme .home-button,
.light-theme #crio-home {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255,255,255,.005));
  color: #111;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

.home-button:hover,
#crio-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(0,0,0,0.22);
}
.home-button:active,
#crio-home:active { transform: translateY(0); }
.home-button:focus,
#crio-home:focus {
  outline: 2px solid rgba(106,209,255,0.9);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .home-button, #crio-home { transition: none; }
}

/* EPUB download button (matches glass-style home button) */
.epub-download,
#crio-epub-download {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .7rem;
  border-radius: 10px;
  color: var(--emergence, #f0f0f0);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 22px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  transition: background-color 180ms ease, color 180ms ease, transform 120ms ease, box-shadow 120ms ease, border-color 180ms ease;
  text-decoration: none;
}
.epub-download .epub-icon,
#crio-epub-download .epub-icon { font-size: 1.05rem; line-height: 1; }

.epub-download:hover,
#crio-epub-download:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(0,0,0,0.22); }
.epub-download:active,
#crio-epub-download:active { transform: translateY(0); }
.epub-download:focus,
#crio-epub-download:focus { outline: 2px solid rgba(106,209,255,0.9); outline-offset: 3px; }

.light-theme .epub-download,
.light-theme #crio-epub-download {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255,255,255,.005));
  color: #111;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

@media (prefers-reduced-motion: reduce) {
  .epub-download, #crio-epub-download { transition: none; }
}

/* Centralizar títulos h1–h5 como override global */
h1,
h2,
h3,
h4,
h5,
h6 {
  text-align: center;
}

/* Override chapter-scoped left-alignment coming from theme (higher specificity).
   Use a matching selector with !important so this file can force centering
   without editing the upstream/minified theme CSS. */
.chapter-content h1,
.chapter-content h2,
.chapter-content h3,
.chapter-content h4,
.chapter-content h5,
.chapter-content h6 {
  text-align: center !important;
}

