* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f8fafc;
  color: #1f2937;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.site-header {
  background: #0f172a;
  color: #fff;
  padding: 12px 0;
}

.public-header {
  background: #ffffff;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.theme-toggle {
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.nav a {
  margin-left: 12px;
  font-size: 0.95rem;
}

main.container {
  padding: 24px 0 48px;
}

.site-footer {
  padding: 20px 0;
  background: #f1f5f9;
  color: #64748b;
}

body.public-page.dark-mode {
  background: #0f172a;
  color: #e5e7eb;
}

body.public-page.dark-mode .site-header.public-header {
  background: #111827;
  color: #e5e7eb;
  border-bottom-color: #1f2937;
}

body.public-page.dark-mode .site-footer {
  background: #111827;
  color: #9ca3af;
}

body.public-page.dark-mode .page-view,
body.public-page.dark-mode .page-form,
body.public-page.dark-mode .page-list,
body.public-page.dark-mode .dashboard,
body.public-page.dark-mode .auth-card,
body.public-page.dark-mode .card,
body.public-page.dark-mode .related-card,
body.public-page.dark-mode .featured-card,
body.public-page.dark-mode .affiliate-box,
body.public-page.dark-mode .content-box,
body.public-page.dark-mode .toc,
body.public-page.dark-mode .community-cta,
body.public-page.dark-mode .ad-slot {
  background: #111827;
  color: #e5e7eb;
  border-color: #1f2937;
}

body.public-page.dark-mode .meta,
body.public-page.dark-mode .tags,
body.public-page.dark-mode .related-category,
body.public-page.dark-mode .site-footer a {
  color: #9ca3af;
}

body.public-page.dark-mode a {
  color: #60a5fa;
}

.footer-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid #cbd5f5;
  background: #fff;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.btn.danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.btn.small {
  padding: 6px 10px;
  font-size: 0.85rem;
}

.auth-card,
.page-form,
.dashboard,
.page-list,
.page-view {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.page-view {
  max-width: 920px;
  margin: 0 auto;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.95rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  gap: 12px;
}

.counter {
  font-size: 0.8rem;
  color: #64748b;
}

.help-text {
  font-size: 0.8rem;
  color: #64748b;
}

.alert {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 8px;
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 20px;
}

.table {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.table-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr repeat(4, 0.6fr);
  gap: 8px;
  padding: 10px 8px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.9rem;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.table-head {
  background: #e2e8f0;
  font-weight: 600;
}

.analytics-grids {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.stat-card {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px;
}

.simple-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.simple-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: #e2e8f0;
}

.badge.publicado {
  background: #dcfce7;
  color: #166534;
}

.badge.rascunho {
  background: #fef9c3;
  color: #854d0e;
}

.cards {
  display: grid;
  gap: 16px;
}

.card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.slug-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #64748b;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.85rem;
}

.tags {
  font-size: 0.85rem;
  color: #0f172a;
}

.page-view .content {
  margin-top: 16px;
  line-height: 1.7;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.page-view .content p {
  margin: 0 0 16px;
}

.page-view .content h2,
.page-view .content h3 {
  margin: 24px 0 12px;
}

.page-view .content ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.page-view .content li {
  margin: 6px 0;
}

.page-body {
  display: grid;
  gap: 24px;
}

.sidebar {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  display: none;
}

.page-view .content h2,
.page-view .content h3 {
  margin-top: 24px;
}

.page-view .content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: #64748b;
}

.page-header {
  margin-top: 12px;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 12px;
}

.excerpt {
  font-size: 1rem;
  color: #0f172a;
  margin-top: 8px;
}

.cover-wrap {
  margin: 16px 0 8px;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e2e8f0;
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.content-box {
  background: #f1f5f9;
  border-radius: 12px;
  padding: 12px;
  margin: 16px 0;
}

.content-box.highlight {
  border-left: 4px solid #2563eb;
}

.toc {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
  margin: 16px 0;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
}

.toc li {
  margin-bottom: 6px;
}

.share-buttons {
  display: flex;
  gap: 8px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}

.ad-slot {
  margin: 20px 0;
  background: #f1f5f9;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  min-height: 90px;
}

.affiliate-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin: 20px 0;
  background: #fff;
}

.affiliate-box img {
  max-width: 120px;
  border-radius: 12px;
  margin-right: 16px;
}

.affiliate-body {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.community-cta {
  margin: 24px 0;
  border-radius: 12px;
  padding: 16px;
  background: #eff6ff;
}

.community-cta.compact {
  padding: 12px;
  background: #f8fafc;
}

.cta-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tip,
.warning,
.steps {
  border-radius: 12px;
  padding: 12px;
  margin: 16px 0;
}

.tip {
  background: #ecfeff;
  border-left: 4px solid #06b6d4;
}

.warning {
  background: #fef9c3;
  border-left: 4px solid #f59e0b;
}

.steps {
  background: #f1f5f9;
  border-left: 4px solid #64748b;
}

.list-content .list-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
}

.after-content {
  margin-top: 32px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
}

.related-section {
  margin-top: 32px;
}

.featured-next h2 {
  margin-bottom: 12px;
}

.featured-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.featured-card a {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.featured-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.related-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.related-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-body {
  padding: 12px;
}

.related-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.related-card h3 {
  margin: 6px 0 8px;
  font-size: 1rem;
}

.related-card p {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
}

.related-grid .ad-slot,
.related-grid .affiliate-box {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-grids {
    grid-template-columns: repeat(2, 1fr);
  }

  .featured-card a {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cover-wrap {
    aspect-ratio: 16 / 9;
  }

  .footer-row {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-body {
    grid-template-columns: minmax(0, 720px) minmax(0, 280px);
    align-items: start;
  }

  .sidebar {
    display: block;
  }
}
