/* Mathisa Blog V2 - CSS compartilhado */
:root {
  --brand-red: #e62b1e;
  --brand-red-dark: #b81e13;
  --ink: #1a1a1a;
  --ink-soft: #2c2c2c;
  --muted: #6b6b6b;
  --line: #e8e6e3;
  --paper: #fafaf7;
  --cream: #f5f2ec;
  --surface: #ffffff;
  --shadow: 0 18px 40px rgba(18, 18, 18, 0.08);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --radius: 8px;
  --radius-lg: 12px;
  --font-ui: "Geist", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid rgba(230, 43, 30, 0.45); outline-offset: 3px; }

.skip-link {
  position: fixed;
  left: var(--space-4);
  top: -80px;
  z-index: 3000;
  padding: var(--space-3) var(--space-4);
  background: var(--brand-red);
  color: #fff;
  border-radius: var(--radius);
  transition: top .2s ease;
}
.skip-link:focus { top: var(--space-4); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.blog-container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #202020;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: #fff;
  text-decoration: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.16);
}
.brand-text strong,
.brand-text span { display: block; }
.brand-text strong { font-size: 1.12rem; line-height: 1; }
.brand-text span { color: rgba(255,255,255,.72); font-size: .76rem; }
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
}
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.nav-links {
  display: none;
  position: absolute;
  inset: 76px 16px auto 16px;
  padding: var(--space-4);
  background: #202020;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  list-style: none;
  box-shadow: var(--shadow);
}
.nav-links.is-open { display: grid; gap: var(--space-2); }
.nav-links a {
  display: block;
  padding: var(--space-3);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
}
.nav-links a:hover { background: rgba(230,43,30,.2); }

/* Breadcrumb */
.breadcrumb-band {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.breadcrumb-list {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin: 0;
  padding: var(--space-3) 0;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--muted);
  font-size: .92rem;
}
.breadcrumb-list a { text-decoration: none; color: var(--muted); }
.breadcrumb-list li + li::before { content: "›"; margin-right: var(--space-2); color: #a3a3a3; }

/* Hero */
.blog-hero,
.post-hero {
  margin: var(--space-8) 0;
  padding: clamp(28px, 6vw, 64px);
  border-radius: var(--radius);
  color: #fff;
  background:
    radial-gradient(circle at 78% 20%, rgba(230,43,30,.32), transparent 28%),
    linear-gradient(135deg, #151515, #2a2020 62%, #101010);
  overflow: hidden;
  position: relative;
}
.blog-hero::after,
.post-hero::after {
  content: "";
  position: absolute;
  right: clamp(18px, 8vw, 92px);
  bottom: -90px;
  width: 160px;
  height: 320px;
  border: 12px solid rgba(255,255,255,.16);
  border-radius: 34px;
  transform: rotate(10deg);
}
.hero-content { position: relative; z-index: 1; max-width: 820px; }
.post-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--space-8);
  align-items: center;
}
.post-hero-visual {
  display: none;
  min-height: 300px;
}
.post-hero-visual img {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 24px 52px rgba(0,0,0,.28);
}
.phone-visual {
  position: relative;
  width: min(220px, 100%);
  height: 360px;
  margin-left: auto;
  border: 14px solid rgba(255,255,255,.18);
  border-radius: 38px;
  background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(230,43,30,.24));
  box-shadow: 0 24px 52px rgba(0,0,0,.28);
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  text-align: center;
  color: #fff;
}
.phone-camera {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 52px;
  height: 7px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(255,255,255,.25);
}
.phone-screen {
  position: absolute;
  inset: 44px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.14);
}
.phone-visual strong {
  position: relative;
  font-family: var(--font-display);
  font-size: 2rem;
}
.phone-visual small {
  position: relative;
  color: rgba(255,255,255,.72);
  font-weight: 800;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: rgba(255,255,255,.78);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.blog-hero h1,
.post-hero h1 {
  margin: var(--space-4) 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 8vw, 5rem);
  line-height: .98;
  font-weight: 900;
}
.hero-lead {
  max-width: 720px;
  color: rgba(255,255,255,.78);
  font-size: clamp(1rem, 2vw, 1.18rem);
}
.hero-stats {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin: var(--space-6) 0;
}
.hero-stat {
  padding: var(--space-4);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
}
.hero-stat strong { display: block; color: #fff; font-size: 1.3rem; }
.hero-stat span { color: rgba(255,255,255,.7); }
.hero-search {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: 1fr;
  max-width: 680px;
  margin-top: var(--space-6);
}
.hero-search input,
.search-panel input {
  min-height: 52px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 var(--space-4);
  font: inherit;
}
.hero-search button,
.button,
.post-action {
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 var(--space-5);
  background: var(--brand-red);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.hero-search button:hover,
.button:hover,
.post-action:hover { background: var(--brand-red-dark); color: #fff; text-decoration: none; }

/* Filters */
.filter-bar {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: 0 0 var(--space-4);
  margin-bottom: var(--space-5);
}
.filter-chip {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.filter-chip.is-active,
.filter-chip:hover { background: var(--ink); color: #fff; }

/* Cards */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 2px 0 rgba(0,0,0,.02);
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #222;
}
.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-2);
  color: #fff;
  background: linear-gradient(135deg, #202020, #4b1612);
}
.post-card-fallback span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--brand-red);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
}
.post-card-fallback small { color: rgba(255,255,255,.72); font-weight: 800; }
.category-badge {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-red);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
}
.post-card-body { padding: var(--space-5); display: grid; gap: var(--space-3); flex: 1; }
.post-card h2,
.post-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  line-height: 1.08;
}
.post-card h2 a,
.post-card h3 a { text-decoration: none; }
.post-card p {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  color: var(--muted);
  font-size: .86rem;
}
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
}
.read-link {
  color: var(--brand-red-dark);
  font-weight: 900;
  text-decoration: none;
}
.share-wrap { position: relative; }
.share-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.share-popover {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 50;
  min-width: 180px;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.share-wrap.is-open .share-popover { display: grid; gap: var(--space-1); }
.share-popover a,
.share-popover button {
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 9px 10px;
  border-radius: 6px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.share-popover a:hover,
.share-popover button:hover { background: var(--cream); }

/* Layout principal */
.content-layout {
  display: grid;
  gap: var(--space-8);
}
.article-shell {
  display: grid;
  gap: var(--space-8);
}
.article-content {
  max-width: 780px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.article-content h2 {
  margin-top: var(--space-10);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  line-height: 1.08;
}
.article-content h2::after {
  content: "";
  display: block;
  width: 58px;
  height: 4px;
  margin-top: var(--space-3);
  border-radius: 999px;
  background: var(--brand-red);
}
.article-content a { color: var(--brand-red-dark); font-weight: 800; text-underline-offset: 3px; }
.article-content img { border-radius: var(--radius); }
.toc,
.info-box,
.specs-box,
.faq-section,
.post-tags,
.post-share,
.related-section,
.post-nav {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-5);
}
.toc h2,
.faq-section h2,
.related-section h2 { margin-top: 0; font-size: 1.35rem; }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc a { color: var(--ink); text-decoration: none; font-weight: 800; }
.info-box { border-left: 5px solid var(--brand-red); box-shadow: 0 10px 28px rgba(0,0,0,.05); }
.specs-box {
  border-left: 5px solid var(--brand-red);
}
.specs-box h2 {
  margin-top: 0;
  font-size: 1.35rem;
}
.specs-grid {
  display: grid;
  gap: var(--space-3);
}
.spec-item {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--cream);
}
.spec-item .key {
  color: var(--muted);
}
.spec-item .val {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
}
.compat-chips,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.compat-chips a,
.tag-list a {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: .9rem;
}
.faq-item {
  border-top: 1px solid var(--line);
  padding: var(--space-4) 0;
}
.faq-item:first-of-type { border-top: 0; }
.faq-item summary { cursor: pointer; font-weight: 900; }
.post-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.post-action.secondary { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }

/* Sidebar */
.blog-sidebar { display: grid; gap: var(--space-5); align-content: start; }
.sidebar-widget {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--space-5);
}
.sidebar-widget h2,
.sidebar-widget h3 {
  margin: 0 0 var(--space-4);
  font-size: 1.18rem;
  font-family: var(--font-display);
}
.sidebar-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.sidebar-list a {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.sidebar-list li:last-child a { border-bottom: 0; }
.count-pill {
  min-width: 28px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-red);
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
}
.popular-item a { display: grid; grid-template-columns: 34px 1fr; align-items: start; }
.rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 900;
}

/* Pagination and empty */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin: var(--space-10) 0;
}
.pagination a,
.pagination span {
  min-width: 42px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.pagination .is-active { background: var(--brand-red); color: #fff; border-color: var(--brand-red); }
.empty-state {
  padding: var(--space-12);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* Ads and utilities */
.blog-ad {
  margin: var(--space-8) 0;
  padding: var(--space-4);
  border: 1px dashed #d8d8d8;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.blog-ad span {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  width: 0;
  height: 3px;
  background: var(--brand-red);
}
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: .2s ease;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); }
.highlight { background: #fff1a8; padding: 0 2px; border-radius: 3px; }

/* Footer */
.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-12) 0;
  background: #202020;
  color: #fff;
}
.footer-grid {
  display: grid;
  gap: var(--space-8);
}
.site-footer a { color: rgba(255,255,255,.82); text-decoration: none; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.footer-bottom { margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.7); }

@media (min-width: 480px) {
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-search { grid-template-columns: 1fr auto; }
  .specs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-card.is-featured { grid-column: span 2; }
  .post-card.is-featured h2 { font-size: 2.4rem; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex;
    position: static;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .posts-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .post-card.is-featured { grid-column: span 2; }
  .content-layout { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .blog-sidebar { position: sticky; top: 96px; }
  .post-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); }
  .post-hero-visual { display: block; }
}

html[data-theme="light"] {
  --ink: #1a1a1a;
  --ink-soft: #2c2c2c;
  --muted: #6b6b6b;
  --line: #e8e6e3;
  --paper: #fafaf7;
  --cream: #f5f2ec;
  --surface: #ffffff;
}

html[data-theme="dark"] {
  --ink: #f4f4f4;
  --ink-soft: #dddddd;
  --muted: #a8a8a8;
  --line: #333333;
  --paper: #121212;
  --cream: #202020;
  --surface: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --ink: #f4f4f4;
    --ink-soft: #dddddd;
    --muted: #a8a8a8;
    --line: #333333;
    --paper: #121212;
    --cream: #202020;
    --surface: #1a1a1a;
  }
  .highlight { color: #1a1a1a; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media print {
  .site-header, .breadcrumb-band, .blog-sidebar, .blog-ad, .post-share, .post-nav, .related-section, .site-footer, .back-to-top { display: none !important; }
  body { background: #fff; color: #000; }
  .blog-container { width: 100%; }
  a { color: #000; text-decoration: underline; }
}
