/*
Theme Name: Roof Blog
Theme URI: https://iroof.com.br/blog/
Author: Roof
Description: Tema do blog da Roof, seguindo o visual da landing page (index.html).
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: roof-blog
*/

/* Tokens — mesmos da landing page (index.html) */
:root {
  --blue: #2118ff;
  --blue-2: #4a44ff;
  --navy: #0d1233;
  --text: #161a34;
  --muted: #666d86;
  --soft: #f6f8ff;
  --line: #e7ebf5;
  --green: #9aff58;
  --green-2: #5dd84f;
  --white: #fff;
  --dark-1: #040515;
  --dark-2: #0a0b2d;
  --dark-3: #030414;
  --footer: #071022;
  --shadow: 0 28px 70px rgba(17, 24, 80, .10);
  --shadow-soft: 0 14px 34px rgba(17, 24, 80, .07);
  --max: 1180px;
  --read: 760px;
  --nav-h: 78px;
  --font: "Outfit", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--soft);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; font-weight: 600; }
img { display: block; max-width: 100%; height: auto; }

.container { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.container-read { width: min(var(--read), calc(100% - 32px)); margin: 0 auto; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto; z-index: 2000; top: 12px; left: 12px;
  padding: 10px 16px; background: #fff; color: var(--blue); border-radius: 10px;
}

/* ---------- Header (igual ao nav-on-dark da landing) ---------- */
.nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(4, 5, 21, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.nav-inner {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo { display: block; width: 86px; flex: none; }
.logo img { width: 100%; height: auto; }
.menu {
  display: flex; flex: 1 1 auto; justify-content: center; gap: 24px;
  font-size: 14px; font-weight: 850; white-space: nowrap;
}
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.menu a { color: rgba(255, 255, 255, .78); font-weight: 850; transition: color .25s ease; }
.menu a:hover, .menu .current-menu-item > a, .menu a[aria-current="page"] { color: #fff; }
.nav-buttons { display: flex; align-items: center; gap: 10px; flex: none; }

/* ---------- Botões ---------- */
.btn {
  min-height: 50px; padding: 0 22px; border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font); font-size: 15px; font-weight: 950; line-height: 1.12;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .22s ease, box-shadow .22s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-green { background: var(--green); color: #071022; box-shadow: 0 16px 40px rgba(154, 255, 88, .24); }
.btn-green:hover { box-shadow: 0 26px 62px rgba(154, 255, 88, .30); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 16px 40px rgba(33, 24, 255, .22); }
.btn-outline { background: #fff; color: var(--blue); border-color: rgba(33, 24, 255, .14); }
.btn-dark-outline { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .22); }
.arrow { transition: transform .22s ease; }
.btn:hover .arrow, .card-link:hover .arrow { transform: translateX(3px); }

/* ---------- Eyebrow / spark ---------- */
.eyebrow {
  width: max-content; max-width: 100%;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 999px;
  background: #fff; border: 1px solid rgba(33, 24, 255, .10);
  color: var(--blue); font-size: 13px; font-weight: 950;
  box-shadow: 0 12px 36px rgba(33, 24, 255, .06);
}
.eyebrow.dark {
  color: #fff; border-color: rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08); box-shadow: none; backdrop-filter: blur(12px);
}
.spark { width: 14px; height: 14px; position: relative; display: inline-block; flex: none; }
.spark::before, .spark::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  background: var(--green); border-radius: 999px;
}
.spark::before { width: 14px; height: 3px; }
.spark::after { width: 3px; height: 14px; }

/* ---------- Hero escuro com grade (igual ao hero da landing) ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  padding: 88px 0 96px;
  background:
    radial-gradient(circle at 75% 24%, rgba(33, 24, 255, .44), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(154, 255, 88, .12), transparent 18%),
    linear-gradient(135deg, var(--dark-1) 0%, var(--dark-2) 48%, var(--dark-3) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 62px 62px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 65%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 65%, transparent 100%);
}
.hero .container, .hero .container-read { position: relative; z-index: 2; }
.h1 {
  margin: 22px 0 18px; max-width: 900px;
  font-size: clamp(40px, 5.2vw, 72px); line-height: .98; letter-spacing: -.06em;
  font-weight: 700; color: #fff; overflow-wrap: break-word;
}
.h1 .accent, .h2 .accent { color: var(--green); }
.h2 {
  margin: 18px 0 16px;
  font-size: clamp(32px, 4vw, 54px); line-height: 1.02; letter-spacing: -.055em;
  color: var(--navy); overflow-wrap: break-word;
}
.lead {
  margin: 0; max-width: 700px;
  font-size: clamp(16px, 1.08vw, 18px); line-height: 1.58; color: var(--muted);
}
.hero .lead { color: rgba(255, 255, 255, .72); }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px;
  color: rgba(255, 255, 255, .82); font-weight: 850; font-size: 14px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.check {
  width: 22px; height: 22px; border-radius: 999px; display: inline-grid; place-items: center;
  background: rgba(154, 255, 88, .14); color: var(--green); font-style: normal; font-size: 12px;
}

/* Busca no hero */
.search-form { display: flex; gap: 10px; margin-top: 30px; max-width: 560px; }
.search-form input[type="search"] {
  flex: 1 1 auto; min-width: 0; min-height: 50px; padding: 0 18px;
  border-radius: 14px; border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08); color: #fff;
  font-family: var(--font); font-size: 15px; font-weight: 600;
}
.search-form input[type="search"]::placeholder { color: rgba(255, 255, 255, .55); }
.search-form input[type="search"]:focus { outline: 2px solid var(--green); outline-offset: 2px; }

/* Filtro de categorias */
.cats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cats a {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 850;
  color: rgba(255, 255, 255, .78); border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .05);
}
.cats a:hover, .cats a.is-active { color: #071022; background: var(--green); border-color: var(--green); }

/* ---------- Seções e grade de posts ---------- */
.section { padding: 84px 0; position: relative; }
.section-soft { background: linear-gradient(180deg, #ffffff 0%, var(--soft) 100%); }

.posts-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card {
  display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 28px;
  overflow: hidden; box-shadow: var(--shadow-soft);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--dark-2); position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(circle at 75% 24%, rgba(33, 24, 255, .55), transparent 45%),
    radial-gradient(circle at 15% 90%, rgba(154, 255, 88, .16), transparent 35%),
    linear-gradient(135deg, var(--dark-1), var(--dark-2));
}
.thumb-placeholder img { width: 84px; height: auto; opacity: .9; object-fit: contain; }
.card-body { display: flex; flex-direction: column; gap: 12px; padding: 24px 24px 26px; flex: 1 1 auto; }
.pill {
  width: max-content; padding: 6px 12px; border-radius: 999px;
  background: rgba(33, 24, 255, .07); color: var(--blue); font-size: 12px; font-weight: 950;
}
.card-title {
  margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: -.03em; color: var(--navy);
}
.card-title a { font-weight: 800; }
.card-title a:hover { color: var(--blue); }
.card-excerpt { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.card-footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted); font-weight: 700;
}
.card-link { color: var(--blue); font-weight: 950; display: inline-flex; gap: 6px; }

/* Destaque (primeiro post na home do blog) */
.card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
.card-featured .card-thumb { aspect-ratio: auto; min-height: 340px; }
.card-featured .card-body { padding: 40px; justify-content: center; }
.card-featured .card-title { font-size: clamp(26px, 2.6vw, 36px); }

/* ---------- Home do blog: conteúdo à esquerda, banner + formulário à direita ---------- */
.blog-layout {
  display: grid; gap: 40px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.blog-layout .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blog-layout .card-featured .card-thumb { min-height: 280px; }
.blog-layout .card-featured .card-body { padding: 32px; }

.blog-sidebar { display: grid; gap: 24px; }

.sidebar-banner {
  display: block; overflow: hidden; border-radius: 28px;
  box-shadow: var(--shadow-soft); transition: transform .25s ease, box-shadow .25s ease;
}
.sidebar-banner:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.sidebar-banner img { width: 100%; height: auto; }
.sidebar-banner-padrao {
  display: flex; flex-direction: column; gap: 16px; padding: 32px 26px; color: #fff;
  background:
    radial-gradient(circle at 80% 15%, rgba(33, 24, 255, .55), transparent 45%),
    radial-gradient(circle at 10% 95%, rgba(154, 255, 88, .16), transparent 35%),
    linear-gradient(135deg, var(--dark-1), var(--dark-2));
}
.sidebar-banner-padrao strong { font-size: 28px; line-height: 1.05; letter-spacing: -.04em; font-weight: 800; }
.sidebar-banner-padrao .accent { color: var(--green); }
.sidebar-banner-texto { color: rgba(255, 255, 255, .72); font-size: 15px; line-height: 1.5; font-weight: 500; }
.sidebar-banner-padrao .btn { align-self: flex-start; }

.sidebar-form {
  background: #fff; border: 1px solid var(--line); border-radius: 28px;
  padding: 28px 24px; box-shadow: var(--shadow-soft); scroll-margin-top: calc(var(--nav-h) + 20px);
}
.sidebar-form h2 { margin: 0 0 8px; font-size: 24px; line-height: 1.1; letter-spacing: -.035em; color: var(--navy); }
.sidebar-form p { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sidebar-form form { display: flex; flex-direction: column; }
.sidebar-form label { font-size: 13px; font-weight: 800; color: var(--navy); margin: 12px 0 6px; }
.sidebar-form input, .sidebar-form textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--soft); color: var(--text);
  font-family: var(--font); font-size: 15px; font-weight: 500;
}
.sidebar-form textarea { resize: vertical; min-height: 90px; }
.sidebar-form input:focus, .sidebar-form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; background: #fff; }
.sidebar-form .btn { margin-top: 20px; width: 100%; }
.form-robo { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-aviso { padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.form-aviso.sucesso { background: #eafbef; color: #17803b; border: 1px solid #d2f4dd; }
.form-aviso.erro { background: #fff0f0; color: #c63838; border: 1px solid #ffd7d7; }

/* Paginação */
.pagination { margin-top: 48px; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
  min-width: 46px; height: 46px; padding: 0 14px; border-radius: 14px;
  display: inline-grid; place-items: center;
  background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 850;
}
.pagination .page-numbers.current, .pagination a.page-numbers:hover {
  background: var(--blue); border-color: var(--blue); color: #fff;
}

.empty-state {
  text-align: center; padding: 60px 24px; background: #fff;
  border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-soft);
}
.empty-state h2 { margin: 0 0 10px; color: var(--navy); letter-spacing: -.03em; }
.empty-state p { margin: 0 0 22px; color: var(--muted); }

/* ---------- Artigo ---------- */
.article-hero { padding: 72px 0 150px; }
.article-hero .h1 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; }
.breadcrumb { font-size: 13px; font-weight: 800; color: rgba(255, 255, 255, .6); margin-bottom: 18px; }
.breadcrumb a { color: rgba(255, 255, 255, .78); }
.breadcrumb a:hover { color: var(--green); }

.article-wrap { margin-top: -110px; position: relative; z-index: 3; padding-bottom: 40px; }
.article-card {
  background: #fff; border: 1px solid var(--line); border-radius: 32px;
  box-shadow: var(--shadow); overflow: hidden;
}
.article-cover img { width: 100%; max-height: 520px; object-fit: cover; }
.article-content { padding: 48px clamp(22px, 5vw, 64px) 56px; }

.entry-content { font-size: 18px; line-height: 1.75; color: #2a2f4b; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content p { margin: 0; }
.entry-content p + p { margin-top: 1.1em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
  color: var(--navy); letter-spacing: -.035em; line-height: 1.15; margin: 1.8em 0 .6em;
}
.entry-content h2 { font-size: clamp(26px, 2.4vw, 34px); }
.entry-content h3 { font-size: clamp(21px, 1.9vw, 26px); }
.entry-content h4 { font-size: 20px; }
.entry-content a { color: var(--blue); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(33, 24, 255, .3); text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-color: var(--blue); }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: .45em; }
.entry-content li::marker { color: var(--blue); font-weight: 800; }
.entry-content img { border-radius: 20px; margin: 1.6em auto; }
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption { text-align: center; font-size: 14px; color: var(--muted); margin-top: -.8em; }
.entry-content blockquote {
  margin: 1.6em 0; padding: 22px 26px; border-radius: 20px;
  background: var(--soft); border-left: 4px solid var(--green); color: var(--navy); font-weight: 600;
}
.entry-content blockquote p { margin: 0; }
.entry-content hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 16px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--soft); color: var(--navy); }
.entry-content .wp-block-button__link, .entry-content .wp-element-button {
  display: inline-flex; min-height: 50px; padding: 0 22px; align-items: center; border-radius: 14px;
  background: var(--blue); color: #fff; font-weight: 950; text-decoration: none;
}
.entry-content .alignwide { width: min(1000px, calc(100vw - 48px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }

/* Artigo com barra lateral: texto à esquerda, banner + formulário à direita */
.article-hero .h1, .article-hero .hero-meta { max-width: 820px; }
.article-layout {
  display: grid; gap: 40px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 340px;
}
.article-layout .article-card { min-width: 0; }
.article-layout .entry-content .alignwide { width: auto; margin-left: 0; transform: none; }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.article-tags a { padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 800; }
.article-tags a:hover { color: var(--blue); }

.share {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 14px; font-weight: 900; color: var(--navy);
}
.share a {
  padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line);
  color: var(--blue); font-size: 13px; font-weight: 900; background: #fff;
}
.share a:hover { border-color: var(--blue); }

/* ---------- CTA final (igual à seção .final da landing) ---------- */
.final {
  color: #fff; padding: 78px 0;
  background:
    radial-gradient(circle at 70% 22%, rgba(154, 255, 88, .14), transparent 25%),
    linear-gradient(135deg, #040515, #111332);
}
.cta-card {
  text-align: center; position: relative; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13); border-radius: 46px;
  background: rgba(255, 255, 255, .06); backdrop-filter: blur(14px);
  padding: 72px 42px; box-shadow: 0 34px 90px rgba(0, 0, 0, .20);
}
.cta-card .h2 { color: #fff; max-width: 880px; margin-left: auto; margin-right: auto; }
.cta-card .lead { color: rgba(255, 255, 255, .72); margin: 0 auto; }
.cta-card .actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

/* Relacionados */
.related .h2 { font-size: clamp(28px, 3vw, 40px); margin-top: 0; }
.related-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }

/* ---------- Footer (igual ao da landing) ---------- */
.footer { background: var(--footer); color: #fff; padding: 46px 0 34px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 36px; }
.footer .logo { width: 96px; }
.footer p { margin: 18px 0 0; max-width: 250px; color: rgba(255, 255, 255, .62); line-height: 1.46; font-weight: 650; }
.footer h4 { margin: 0 0 16px; color: var(--green); font-size: 14px; font-weight: 950; }
.footer a { display: block; margin: 10px 0; color: rgba(255, 255, 255, .76); font-weight: 820; font-size: 14px; }
.footer a:hover { color: #fff; }
.copyright {
  margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .10);
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  color: rgba(255, 255, 255, .58); font-size: 13px; font-weight: 700;
}

/* ---------- Página simples / 404 ---------- */
.page-hero { padding: 72px 0 80px; }

/* ---------- Responsivo (mesmos cortes da landing) ---------- */
@media (max-width: 1080px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-layout, .article-layout { grid-template-columns: 1fr; }
  .blog-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .card-featured { grid-template-columns: 1fr; }
  .card-featured .card-thumb { min-height: 0; aspect-ratio: 16 / 9; }
  .card-featured .card-body { padding: 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .menu { display: none; }
}
@media (max-width: 640px) {
  :root { --nav-h: 72px; }
  .container { width: calc(100% - 32px); }
  .nav-buttons .btn-outline { display: none; }
  .nav-buttons .btn-green { min-height: 44px; padding: 0 14px; font-size: 13px; }
  .logo { width: 72px; }
  .hero { padding: 64px 0 72px; }
  .h1 { font-size: 40px; }
  .article-hero { padding: 56px 0 130px; }
  .article-hero .h1 { font-size: 34px; }
  .posts-grid, .blog-layout .posts-grid { grid-template-columns: 1fr; gap: 20px; }
  .blog-sidebar { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .search-form { flex-direction: column; }
  .search-form .btn { width: 100%; }
  .entry-content { font-size: 17px; }
  .article-content { padding: 32px 20px 40px; }
  .article-card { border-radius: 24px; }
  .cta-card { padding: 52px 22px; border-radius: 32px; }
  .cta-card .actions .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}
