/* Compara3D — estilos base (sem dependências externas) */

:root {
  --paper: #fbfaf7;
  --paper-2: #f2efe8;
  --ink: #14161a;
  --ink-soft: #4b515c;
  --line: #e2ded4;
  --accent: #c13d16;
  --accent-soft: #fdeee8;
  --ok: #1f7a4d;
  --radius: 14px;
  --max: 68rem;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101216;
    --paper-2: #171a20;
    --ink: #eef0f3;
    --ink-soft: #a2a9b5;
    --line: #262a33;
    --accent: #ff6b3d;
    --accent-soft: #2a1a14;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 64px;
}
.brand {
  font-weight: 800; letter-spacing: -0.02em; font-size: 1.15rem;
  color: var(--ink); text-decoration: none;
}
.brand span { color: var(--accent); }
.nav { margin-left: auto; display: flex; gap: 1.25rem; align-items: center; }
.nav a { color: var(--ink-soft); font-size: 0.94rem; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ---------- hero ---------- */
.hero { padding: 4.5rem 0 3rem; border-bottom: 1px solid var(--line); }
.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 1.1rem;
  max-width: 22ch;
}
.hero p { font-size: 1.12rem; color: var(--ink-soft); max-width: 52ch; margin: 0; }

/* ---------- grids e cards ---------- */
.section { padding: 3.5rem 0; }
.section-head { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.75rem; }
.section-head h2 {
  font-family: var(--serif); font-size: 1.6rem; margin: 0; letter-spacing: -0.01em;
}
.section-head p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }

.card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; background: var(--paper-2);
  text-decoration: none; color: inherit;
  transition: transform .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card .tag {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: .1em;
  font-weight: 700; color: var(--accent); margin-bottom: .6rem;
}
.card h3 { margin: 0 0 .5rem; font-size: 1.18rem; line-height: 1.3; letter-spacing: -0.01em; }
.card p { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.95rem; }
.card .meta { margin-top: auto; font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- artigo ---------- */
.article { padding: 3rem 0 4rem; }
.article-header { max-width: 46rem; margin-bottom: 2.5rem; }
.article-header h1 {
  font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.12; letter-spacing: -0.02em; margin: .6rem 0 1rem;
}
.article-header .lead { font-size: 1.12rem; color: var(--ink-soft); margin: 0; }
.article-header .meta { font-size: .87rem; color: var(--ink-soft); margin-top: 1.25rem; }
.prose { max-width: 46rem; }
.prose h2 {
  font-family: var(--serif); font-size: 1.5rem; margin: 2.75rem 0 .9rem;
  letter-spacing: -0.01em;
}
.prose h3 { font-size: 1.12rem; margin: 1.9rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .4rem 0; }
.prose blockquote {
  margin: 1.75rem 0; padding: .9rem 1.25rem;
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
}
.prose blockquote p { margin: 0; }

.table-wrap { overflow-x: auto; margin: 1.75rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
th { background: var(--paper-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
tr:last-child td { border-bottom: 0; }
td strong { font-weight: 700; }

.callout {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.35rem; margin: 2rem 0; background: var(--paper-2);
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 2.5rem 0;
  color: var(--ink-soft); font-size: .88rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1rem; }
.site-footer a { color: var(--ink-soft); }

.disclosure {
  border-top: 1px solid var(--line); margin-top: 3.5rem; padding-top: 1.25rem;
  font-size: .85rem; color: var(--ink-soft);
}

/* ---------- imagens, foco, apoio ---------- */
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.hero-grid { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1.15fr 1fr; }
.hero-figure { margin: 0; }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.btn {
  display: inline-block; padding: .7rem 1.25rem; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:hover { opacity: .85; }

.card .thumb {
  width: calc(100% + 3rem); margin: -1.5rem -1.5rem 1.1rem;
  aspect-ratio: 16 / 9; object-fit: cover; object-position: center;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line);
  max-width: none;
}
.card .thumb[src*="bambu"] { object-position: center 25%; }
.card .thumb[src*="prusa-mini"] { object-position: center 55%; }
.card.muted { background: transparent; }

figure { margin: 2rem 0; }
figure img {
  width: 100%; max-width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 6px 18px rgb(0 0 0 / .08);
}
figcaption { font-size: .86rem; color: var(--ink-soft); margin-top: .6rem; }
figcaption a { color: inherit; }
figure.portrait { max-width: 22rem; margin-inline: auto; }

.photo-credits { padding: 2rem 0; font-size: .85rem; color: var(--ink-soft); }
.photo-credits p { margin: 0 0 .5rem; }
.photo-credits ul { margin: 0; padding-left: 1.2rem; }
.photo-credits a { color: inherit; }

.support-note {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; margin: 2rem 0; color: var(--ink-soft); font-size: .95rem;
}
.support-note p { margin: 0; }
.prose .meta-list { color: var(--ink-soft); font-size: .93rem; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header .wrap { flex-wrap: wrap; padding: .5rem 0; gap: .25rem 1rem; }
  .nav { flex-wrap: wrap; row-gap: .1rem; }
  .hero { padding: 3rem 0 2.25rem; }
  .nav { gap: .9rem; }
  .nav a { font-size: .88rem; }
}

/* ---------- imagens: tamanho contido e formato moderno ---------- */
picture { display: block; }

.hero-grid { grid-template-columns: 1.4fr .85fr; }

.hero-figure img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

figure img {
  max-height: 420px;
  object-fit: cover;
  object-position: center;
}

figure:not(.portrait) { max-width: 40rem; }

.card .thumb { max-height: none; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure img { max-height: 240px; }
  figure img { max-height: 320px; }

}

/* navegação compacta em telas estreitas */
@media (max-width: 420px) {
  .site-header .wrap { min-height: 0; padding: .7rem 0; gap: .5rem; }
  .brand { font-size: 1.05rem; }
  .nav { width: 100%; margin-left: 0; gap: .5rem .7rem; flex-wrap: nowrap; }
  .nav a { font-size: .76rem; letter-spacing: -.01em; }
}

/* tabela larga: rolagem horizontal sinalizada no celular */
.table-wrap { position: relative; -webkit-overflow-scrolling: touch; }
@media (max-width: 700px) {
  .table-wrap::after {
    content: "→ deslize para ver a tabela";
    position: sticky; right: 0; bottom: 0;
    display: block; padding: .45rem .75rem;
    font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
    color: var(--ink-soft); background: var(--paper-2);
    border-top: 1px solid var(--line);
  }
}
