/* ==========================================================================
   LMMS em Português - Main Stylesheet
   Audio-themed palette: blue/slate tones
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables
   -------------------------------------------------------------------------- */

:root {
  /* Colors - Audio theme (blue/slate) */
  --primary-blue: #1e6091;
  --primary-blue-light: #2980b9;
  --primary-blue-dark: #154360;
  --slate-dark: #2c3e50;
  --slate-medium: #34495e;
  --slate-light: #5d6d7e;

  --ink: #2c3e50;
  --ink-light: #5d6d7e;
  --ink-lighter: #7f8c8d;
  --bg: #fff;
  --bg-alt: #f4f6f7;
  --sidebar-bg: #f4f6f7;
  --border: #d5dbdb;
  --border-light: #eaecee;

  /* Accent */
  --accent: #1e6091;
  --accent-hover: #154360;
  --accent-light: #d6eaf8;

  /* Callout colors */
  --note-bg: #e8f4fd;
  --note-border: #2196f3;
  --note-icon: #1976d2;
  --note-ink: #0d47a1;

  --warning-bg: #fff8e1;
  --warning-border: #ff9800;
  --warning-icon: #f57c00;
  --warning-ink: #e65100;

  --tip-bg: #e8f5e9;
  --tip-border: #27ae60;
  --tip-icon: #1e8449;
  --tip-ink: #1b5e20;

  --danger-bg: #fce4ec;
  --danger-border: #c0392b;
  --danger-icon: #a93226;
  --danger-ink: #b71c1c;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo,
    monospace;

  --fs-base: 16px;
  --fs-sm: 0.875rem;
  --fs-xs: 0.75rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.75rem;

  --lh-tight: 1.25;
  --lh-normal: 1.6;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --header-height: 56px;
  --sidebar-width: 240px;
  --toc-width: 200px;
  --content-max: 800px;

  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

  --transition: 0.2s ease;
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--fs-base);
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); text-decoration: underline; }

img, svg, video { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: var(--space-6); }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--slate-dark);
  margin-bottom: var(--space-4);
  scroll-margin-top: calc(var(--header-height) + var(--space-4));
}

h1 { font-size: var(--fs-3xl); margin-top: var(--space-8); }
h2 { font-size: var(--fs-2xl); margin-top: var(--space-10); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-light); }
h3 { font-size: var(--fs-xl); margin-top: var(--space-8); }

p { margin-bottom: var(--space-4); }

h1 > a.zola-anchor, h2 > a.zola-anchor, h3 > a.zola-anchor,
h4 > a.zola-anchor, h5 > a.zola-anchor, h6 > a.zola-anchor {
  margin-left: var(--space-2);
  opacity: 0;
  text-decoration: none;
  font-size: 0.85em;
  transition: opacity var(--transition);
}
h1:hover > a.zola-anchor, h2:hover > a.zola-anchor, h3:hover > a.zola-anchor,
h4:hover > a.zola-anchor, h5:hover > a.zola-anchor, h6:hover > a.zola-anchor {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  background-color: var(--slate-dark);
  color: #fff;
  border-bottom: 3px solid var(--primary-blue);
  box-shadow: var(--shadow-sm);
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
}

.site-header .site-logo {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.site-header .site-logo:hover { color: var(--primary-blue-light); text-decoration: none; }

.site-header .search-box { flex: 1; max-width: 400px; position: relative; }
.site-header .search-box input {
  width: 100%;
  height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-family: inherit;
  background-color: var(--bg-alt);
}
.site-header .search-box input:focus { outline: none; border-color: var(--accent); background-color: var(--bg); }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
  grid-template-areas: "sidebar content toc";
  gap: 0;
  max-width: calc(var(--sidebar-width) + var(--content-max) + var(--toc-width) + var(--space-12));
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: var(--space-6) var(--space-4);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.sidebar-nav { font-size: var(--fs-sm); }

.nav-section { margin-bottom: var(--space-4); }

.nav-section-title {
  display: block;
  font-weight: 600;
  color: var(--slate-dark);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition), color var(--transition);
}
.nav-section-title:hover, .nav-section-title.active {
  color: var(--primary-blue);
  background-color: var(--accent-light);
  text-decoration: none;
}

.nav-pages { list-style: none; padding: 0; margin: 0; padding-left: var(--space-3); }
.nav-page {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink-light);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
}
.nav-page:hover, .nav-page.active {
  color: var(--primary-blue);
  text-decoration: none;
}

.main-content {
  grid-area: content;
  padding: var(--space-8) var(--space-10);
  max-width: var(--content-max);
  min-width: 0;
}

.toc-aside {
  grid-area: toc;
  position: sticky;
  top: var(--header-height);
  align-self: start;
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: var(--space-8) var(--space-4);
  font-size: var(--fs-xs);
}
.toc-aside:empty { display: none; }
.toc-title {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-lighter);
  margin-bottom: var(--space-3);
}
.toc-list, .toc-sublist { list-style: none; padding: 0; margin: 0; }
.toc-sublist { padding-left: var(--space-3); }
.toc-aside a {
  display: block;
  padding: var(--space-1) 0;
  color: var(--ink-light);
  line-height: var(--lh-normal);
}
.toc-aside a:hover { color: var(--accent); text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--ink-light);
  background-color: var(--slate-dark);
  color: #fff;
}
.site-footer a { color: var(--primary-blue-light); }

/* --------------------------------------------------------------------------
   5. Page Elements
   -------------------------------------------------------------------------- */

.page-header { margin-bottom: var(--space-8); padding-bottom: var(--space-4); border-bottom: 2px solid var(--border); }
.page-header h1 { margin-top: 0; }
.page-description { font-size: var(--fs-lg); color: var(--ink-light); }

.breadcrumbs { font-size: var(--fs-sm); color: var(--ink-light); margin-bottom: var(--space-4); }
.breadcrumbs a { color: var(--ink-light); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 var(--space-2); color: var(--ink-lighter); }

.prev-next { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid var(--border); }
.prev-next-inner { display: flex; justify-content: space-between; gap: var(--space-4); }
.prev-link, .next-link {
  flex: 1;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.prev-link:hover, .next-link:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); text-decoration: none; }
.prev-link.disabled, .next-link.disabled { visibility: hidden; }
.prev-link .label, .next-link .label { display: block; font-size: var(--fs-xs); color: var(--ink-lighter); text-transform: uppercase; letter-spacing: 0.05em; }
.prev-link .title, .next-link .title { font-weight: 600; color: var(--accent); }
.next-link { text-align: right; }

.page-tags { margin-top: var(--space-4); }
.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background-color: var(--accent-light);
  color: var(--primary-blue-dark);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  margin-right: var(--space-2);
}

/* Section pages */
.section-header { margin-bottom: var(--space-6); }
.section-description { font-size: var(--fs-lg); color: var(--ink-light); }

.pages-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5); margin: var(--space-6) 0; }
.page-card { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); transition: border-color var(--transition), box-shadow var(--transition); }
.page-card:hover { border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.page-card h3 { margin-top: 0; color: var(--primary-blue); font-size: var(--fs-lg); }
.page-card p { font-size: var(--fs-sm); color: var(--ink-light); margin-bottom: 0; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5); margin: var(--space-6) 0; }
.section-card { display: block; padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); color: var(--ink); }
.section-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); text-decoration: none; }
.section-card h3 { margin-top: 0; margin-bottom: var(--space-2); font-size: var(--fs-lg); color: var(--primary-blue); }
.section-card p { margin-bottom: var(--space-2); font-size: var(--fs-sm); color: var(--ink-light); }
.card-meta { font-size: var(--fs-xs); color: var(--ink-lighter); }

/* Homepage */
.hero { text-align: center; padding: var(--space-12) 0 var(--space-8); }
.hero h1 { font-size: var(--fs-3xl); margin-top: 0; }
.hero-description { font-size: var(--fs-lg); color: var(--ink-light); max-width: 600px; margin: 0 auto; }
.intro-content { margin-bottom: var(--space-8); }
.sections-grid h2 { text-align: center; }

/* Error 404 */
.error-404 { text-align: center; padding: var(--space-16) var(--space-4); }
.error-code { font-size: 5rem; color: var(--primary-blue); margin-bottom: 0; }
.error-title { font-size: var(--fs-2xl); margin-top: var(--space-4); }
.error-message { color: var(--ink-light); margin: var(--space-4) auto; max-width: 500px; }
.btn-primary {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background-color: var(--primary-blue);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background-color var(--transition);
}
.btn-primary:hover { background-color: var(--primary-blue-dark); color: #fff; text-decoration: none; }

/* --------------------------------------------------------------------------
   6. Callouts
   -------------------------------------------------------------------------- */

.note, .tip, .warning, .armadilhas, .desafio, .feynman, .por-que,
.objetivos, .recap, .pre-requisitos, .quiz, .relacionados {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  margin: var(--space-6) 0;
  border-left: 4px solid;
  border-radius: var(--radius);
}
.note > *, .tip > *, .warning > *, .armadilhas > *, .desafio > *,
.feynman > *, .por-que > *, .objetivos > *, .recap > *,
.pre-requisitos > *, .quiz > *, .relacionados > * { flex-basis: 100%; }
.note p:last-child, .tip p:last-child, .warning p:last-child,
.armadilhas p:last-child, .desafio p:last-child { margin-bottom: 0; }

.note { background-color: var(--note-bg); border-left-color: var(--note-border); color: var(--note-ink); }
.tip { background-color: var(--tip-bg); border-left-color: var(--tip-border); color: var(--tip-ink); }
.warning, .armadilhas { background-color: var(--warning-bg); border-left-color: var(--warning-border); color: var(--warning-ink); }
.desafio { background-color: var(--danger-bg); border-left-color: var(--danger-border); color: var(--danger-ink); }
.feynman { background-color: #f3e5f5; border-left-color: #8e24aa; color: #4a148c; }
.por-que { background-color: #e0f2f1; border-left-color: #00897b; color: #004d40; }
.objetivos { background-color: #e3f2fd; border-left-color: var(--primary-blue); color: var(--primary-blue-dark); }
.recap { background-color: var(--tip-bg); border-left-color: var(--tip-border); color: var(--tip-ink); }
.pre-requisitos { background-color: var(--bg-alt); border-left-color: var(--slate-light); color: var(--slate-dark); }
.quiz { background-color: #fff3e0; border-left-color: #ff9800; color: var(--warning-ink); }
.relacionados { background-color: var(--bg-alt); border-left-color: var(--primary-blue-light); color: var(--slate-dark); }

/* --------------------------------------------------------------------------
   7. Keyboard (<kbd>)
   -------------------------------------------------------------------------- */

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1;
  color: var(--ink);
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   8. Code Blocks
   -------------------------------------------------------------------------- */

pre {
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
  background-color: #1e1e2e;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: var(--lh-normal);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-sm);
}
pre code { padding: 0; font-family: var(--font-mono); font-size: inherit; color: #cdd6f4; background: transparent; border: none; }

:not(pre) > code {
  padding: 2px 5px;
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--primary-blue-dark);
  background-color: var(--accent-light);
  border-radius: var(--radius-sm);
}

.code-block { margin: var(--space-5) 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.code-block .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background-color: #181825;
  color: #a6adc8;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  border-bottom: 1px solid #313244;
}
.code-block .copy-btn {
  padding: var(--space-1) var(--space-3);
  border: 1px solid #313244;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #a6adc8;
  font-family: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.code-block .copy-btn:hover { background-color: #313244; color: #cdd6f4; }
.code-block .copy-btn.copied { color: #a6e3a1; border-color: #a6e3a1; }
.code-block pre { margin: 0; border-radius: 0; box-shadow: none; }

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */

table {
  width: 100%;
  margin: var(--space-5) 0;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  display: block;
  overflow-x: auto;
}
thead { border-bottom: 2px solid var(--border); }
th { padding: var(--space-3) var(--space-4); text-align: left; font-weight: 600; white-space: nowrap; }
td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-light); vertical-align: top; }
tbody tr:nth-child(even) { background-color: var(--bg-alt); }
tbody tr:hover { background-color: var(--accent-light); }

/* --------------------------------------------------------------------------
   10. Tabs
   -------------------------------------------------------------------------- */

.tabs { margin: var(--space-5) 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tab-buttons { display: flex; background-color: var(--sidebar-bg); border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-light);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.tab-btn:hover { color: var(--ink); background-color: var(--bg-alt); }
.tab-btn.active { color: var(--accent); border-bottom: 2px solid var(--accent); background-color: var(--bg); }
.tab-panel { display: none; padding: var(--space-4) var(--space-5); }
.tab-panel.active { display: block; }

/* --------------------------------------------------------------------------
   11. Figures & SVG
   -------------------------------------------------------------------------- */

.figure { margin: var(--space-6) 0; text-align: center; }
.figure img, .figure svg { max-width: 100%; margin: 0 auto; border-radius: var(--radius); }
.figure figcaption { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--ink-light); font-style: italic; }

.svg-diagram { display: block; max-width: 100%; margin: var(--space-6) auto; padding: var(--space-4); background-color: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); }
.svg-diagram svg { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   12. LMMS-specific shortcodes
   -------------------------------------------------------------------------- */

.lmms-screenshot { margin: 1.5rem 0; }
.lmms-screenshot img { max-width: 100%; border: 1px solid var(--border); border-radius: 4px; }
.lmms-screenshot figcaption { margin-top: 0.5rem; font-size: 0.9em; color: var(--ink-lighter); text-align: center; }
.lmms-screenshot.is-placeholder .placeholder {
  padding: 2rem;
  background: var(--bg-alt);
  border: 2px dashed var(--border);
  border-radius: 4px;
  text-align: center;
  color: var(--ink-lighter);
  font-style: italic;
}
.lmms-screenshot.is-placeholder .placeholder code {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85em;
  background: #eee;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
}

.lmms-version {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: #eee;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--ink-lighter);
}
.lmms-version em { font-weight: normal; opacity: 0.8; }

.lmms-project {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1.5rem 0;
}
.lmms-project.is-placeholder { border-style: dashed; }
.lmms-project .project-icon { font-size: 2rem; }
.lmms-project .project-info code {
  display: inline-block;
  margin-top: 0.25rem;
  background: #eee;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
  font-size: 0.85em;
}

/* --------------------------------------------------------------------------
   13. Term links & tooltips
   -------------------------------------------------------------------------- */

.term-link { color: var(--primary-blue); text-decoration-style: dotted; text-underline-offset: 2px; }
.term-link:hover { text-decoration-style: solid; }

.term-tooltip {
  position: absolute;
  max-width: 300px;
  padding: 0.5rem 0.75rem;
  background: var(--slate-dark);
  color: #fff;
  border-radius: 4px;
  font-size: 0.85em;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.term-tooltip.visible { opacity: 1; }

/* --------------------------------------------------------------------------
   14. Search
   -------------------------------------------------------------------------- */

.search-results {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  right: 0;
  max-height: 400px;
  overflow-y: auto;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
}
.search-results.active { display: block; }
.search-result { display: block; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-light); color: var(--ink); }
.search-result:last-child { border-bottom: none; }
.search-result:hover { background-color: var(--accent-light); color: var(--accent); text-decoration: none; }
.search-result-title { font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--space-1); }
.search-result-excerpt { font-size: var(--fs-xs); color: var(--ink-light); }
.search-no-results { padding: var(--space-4); text-align: center; color: var(--ink-light); font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   15. Misc
   -------------------------------------------------------------------------- */

hr { border: none; border-top: 1px solid var(--border); margin: var(--space-8) 0; }
::selection { background-color: var(--accent-light); color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sidebar::-webkit-scrollbar, .toc-aside::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track, .toc-aside::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb, .toc-aside::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-sm); }

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-areas: "sidebar content";
    max-width: calc(var(--sidebar-width) + var(--content-max) + var(--space-10));
  }
  .toc-aside { display: none; }
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "content";
    max-width: 100%;
  }
  .sidebar { display: none; }
  .main-content { padding: var(--space-6) var(--space-4); }
  pre { border-radius: var(--radius-sm); font-size: var(--fs-xs); }
  .cards-grid, .pages-grid { grid-template-columns: 1fr; }
  .prev-next-inner { flex-direction: column; }
  .next-link { text-align: left; }
  .site-header { padding: 0 var(--space-3); }
  table { font-size: var(--fs-xs); }
  th, td { padding: var(--space-2) var(--space-3); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }
  .main-content { padding: var(--space-4) var(--space-3); }
}

/* --------------------------------------------------------------------------
   17. Print
   -------------------------------------------------------------------------- */

@media print {
  .site-header, .sidebar, .toc-aside, .prev-next, .site-footer, .copy-btn, .tab-buttons { display: none !important; }
  .layout { display: block; max-width: 100%; }
  .main-content { max-width: 100%; padding: 0; }
  a { color: var(--ink); text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: var(--fs-xs); color: var(--ink-light); }
  pre { white-space: pre-wrap; word-wrap: break-word; background-color: var(--bg-alt); color: var(--ink); border: 1px solid var(--border); }
}

/* --------------------------------------------------------------------------
   Componentes dos shortcodes

   Estas classes eram emitidas pelos templates sem nenhuma regra no CSS que o
   HTML de fato carrega. Os valores usam `var(--x, literal)` porque nem todos
   os sites definem as mesmas variáveis.
   -------------------------------------------------------------------------- */

.filename { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.note-body, .tip-body, .warning-body, .note-content, .corpo, .conceito-content {
  flex: 1 1 0;
  min-width: 0;
}
.note-body > *:last-child, .tip-body > *:last-child,
.warning-body > *:last-child, .note-content > *:last-child,
.corpo > *:last-child, .conceito-content > *:last-child { margin-bottom: 0; }

.note-icon, .tip-icon, .warning-icon {
  flex: 0 0 auto;
  font-size: var(--fs-lg, 1.125rem);
  line-height: 1.4;
}

.tab-content { background-color: var(--bg, #fff); }
