/* SellPipe Blog — polish CSS (mobile-first, tokens via theme.json) */

/* ---------- Reset leve ---------- */
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ---------- Topbar ---------- */
.sp-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid #e5e7eb;
}
.sp-topbar-inner { min-height: 76px; padding: 16px 0; gap: 16px; }
.sp-brand-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: #111827; font-weight: 700; font-size: 18px;
}
.sp-brand-mark {
  width: 32px; height: 32px; background: #007F2D; color: #fff;
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: -0.02em; flex: 0 0 32px;
}
.sp-brand-name em { font-style: normal; font-weight: 500; color: #4b5563; margin-left: 4px; }

/* nav block override */
.sp-nav { font-size: 14px; }
.sp-nav .wp-block-navigation__container { gap: 24px; }
.sp-nav .wp-block-navigation-item__content {
  font-weight: 600; color: #374151; padding: 8px 4px; transition: color .15s;
}
.sp-nav .wp-block-navigation-item__content:hover { color: #004c1b; }

.sp-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: #007F2D; color: #fff !important;
  padding: 10px 18px; border-radius: 8px;
  font-weight: 600; font-size: 14px; text-decoration: none;
  transition: background .15s, transform .1s;
}
.sp-cta:hover { background: #006524; transform: translateY(-1px); }
.sp-cta--green { box-shadow: 0 4px 14px rgba(0,127,45,0.25); }

@media (max-width: 768px) {
  .sp-nav { display: none; } /* TODO: substituir por overlay menu nativo do bloco */
  .sp-cta { padding: 8px 14px; font-size: 13px; }
}

/* ---------- Hero pattern ---------- */
.sp-eyebrow-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #ecfdf5; color: #004c1b;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid #d1fae5;
}
.sp-pulse {
  width: 6px; height: 6px; background: #007F2D; border-radius: 50%;
  animation: sp-pulse 2s infinite;
}
@keyframes sp-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .4 } }

.sp-hero-h1 strong, .sp-hero-h1 b { font-weight: 800; color: #007F2D; }

.sp-btn-primary .wp-block-button__link:hover {
  filter: brightness(0.92); transform: translateY(-1px);
}

/* ---------- Cards de posts (grid) ---------- */
.sp-posts-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.sp-card {
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.sp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.06);
  border-color: #d1fae5;
}
.sp-card .wp-block-post-featured-image {
  overflow: hidden;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
.sp-card .wp-block-post-featured-image img {
  transition: transform .35s ease;
}
.sp-card:hover .wp-block-post-featured-image img { transform: scale(1.03); }
.sp-card .wp-block-post-title a { text-decoration: none; color: #111827; }
.sp-card .wp-block-post-title a:hover { color: #006524; }
.sp-card-body { flex: 1; }

@media (max-width: 960px) {
  .sp-posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 640px) {
  .sp-posts-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- Section header com link "Ver todos" ---------- */
.sp-section-head { gap: 16px; }
.sp-link-arrow {
  color: #006524; font-weight: 600; font-size: 14px;
  text-decoration: none;
  border-bottom: 1px dashed #9ca3af;
  padding-bottom: 1px; transition: color .15s, border-color .15s;
}
.sp-link-arrow:hover { color: #004c1b; border-color: #007F2D; }

/* ---------- Single post ---------- */
.sp-post-meta-top { font-size: 13px; gap: 10px; }
.sp-post-meta-top .wp-block-post-terms a { text-decoration: none; }
.sp-post-meta-top .wp-block-post-terms a:hover { text-decoration: underline; }

.sp-main--single .wp-block-post-content {
  font-size: 19px; line-height: 1.7; color: #1f2937;
}
.sp-main--single .wp-block-post-content > * + * { margin-top: 1.4em; }
.sp-main--single .wp-block-post-content h2 {
  font-size: clamp(24px, 3vw, 30px); font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.2;
  margin-top: 2em; margin-bottom: 0.4em;
}
.sp-main--single .wp-block-post-content h3 {
  font-size: clamp(20px, 2.5vw, 24px); font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.25;
  margin-top: 1.6em; margin-bottom: 0.4em;
}
.sp-main--single .wp-block-post-content img {
  border-radius: 12px;
}
.sp-main--single .wp-block-post-content a {
  color: #006524; text-decoration: underline; text-decoration-color: #d1fae5;
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.sp-main--single .wp-block-post-content a:hover { text-decoration-color: #007F2D; }
.sp-main--single .wp-block-post-content blockquote,
.sp-main--single .wp-block-quote {
  border-left: 4px solid #007F2D; padding: 4px 0 4px 20px;
  font-style: italic; color: #374151; background: #f9fafb;
  margin: 1.8em 0;
}

/* ---------- Newsletter pattern (MailPoet override + horizontal layout) ---------- */
.sp-newsletter-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0;
}
.sp-newsletter-text .sp-eyebrow {
  color: #004c1b; font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  margin: 0 0 12px;
}
.sp-newsletter-title {
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  margin: 0 0 12px; color: #111827;
}
.sp-newsletter-sub {
  font-size: 16px; line-height: 1.55; color: #374151;
  margin: 0; max-width: 480px;
}
.sp-newsletter-form { width: 100%; min-width: 0; }
.sp-newsletter-form form.mailpoet_form,
.sp-newsletter-form .mailpoet_form {
  margin: 0; padding: 0; background: transparent; width: 100%;
}
.sp-newsletter-form .mailpoet_paragraph,
.sp-newsletter-form .mailpoet_text_label,
.sp-newsletter-form .mailpoet_text,
.sp-newsletter-form p.mailpoet_paragraph,
.sp-newsletter-form .mailpoet_submit {
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  margin: 0 0 12px !important;
  box-sizing: border-box !important;
}
.sp-newsletter-form .mailpoet_paragraph:last-child,
.sp-newsletter-form .mailpoet_submit:last-child { margin-bottom: 0 !important; }
.sp-newsletter-form input[type="email"],
.sp-newsletter-form input[type="text"],
.sp-newsletter-form .mailpoet_text {
  width: 100% !important;
  display: block !important;
  padding: 14px 16px !important;
  border: 1.5px solid #d1d5db !important;
  border-radius: 10px !important;
  font-size: 15px !important;
  background: #fff !important;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box !important;
  margin: 0 !important;
}
.sp-newsletter-form input[type="email"]:focus,
.sp-newsletter-form input[type="text"]:focus {
  border-color: #007F2D; outline: none;
  box-shadow: 0 0 0 4px rgba(0,127,45,0.12);
}
.sp-newsletter-form input[type="submit"],
.sp-newsletter-form button[type="submit"] {
  background: #007F2D !important; color: #fff !important;
  padding: 14px 22px !important; border-radius: 10px !important; border: none !important;
  font-weight: 700 !important; font-size: 15px !important;
  cursor: pointer; transition: background .15s, transform .1s;
  box-shadow: 0 4px 14px rgba(0,127,45,0.25);
  width: 100%; box-sizing: border-box;
}
.sp-newsletter-form input[type="submit"]:hover,
.sp-newsletter-form button[type="submit"]:hover {
  background: #006524 !important; transform: translateY(-1px);
}
.sp-newsletter-fallback {
  display: inline-block; background: #007F2D; color: #fff;
  padding: 14px 22px; border-radius: 10px; font-weight: 700;
  text-decoration: none; box-shadow: 0 4px 14px rgba(0,127,45,0.25);
}
@media (max-width: 768px) {
  .sp-newsletter-card { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- Pagination ---------- */
.sp-pagination .wp-block-query-pagination-numbers a,
.sp-pagination .page-numbers {
  padding: 8px 12px; border-radius: 8px;
  text-decoration: none; color: #374151;
  border: 1px solid #e5e7eb; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.sp-pagination .page-numbers.current { background: #007F2D; color: #fff; border-color: #007F2D; }
.sp-pagination .page-numbers:hover { background: #ecfdf5; border-color: #d1fae5; }

/* ---------- Footer ---------- */
.sp-footer { padding-bottom: calc(var(--wp--preset--spacing--2xl, 48px) + env(safe-area-inset-bottom, 0px)) !important; }
.sp-footer .sp-brand-link--footer { color: #fff; text-decoration: none; }
.sp-footer .sp-brand-link--footer .sp-brand-name { color: #fff; }
.sp-footer-list { list-style: none; padding: 0; margin: 12px 0 0; }
.sp-footer-list li { padding: 6px 0; }
.sp-footer-list a {
  color: #d1d5db; text-decoration: none; font-size: 14px;
  transition: color .15s;
}
.sp-footer-list a:hover { color: #fff; }
.sp-link-cta { color: #007F2D !important; font-weight: 700; }
.sp-footer-mini { font-size: 12px; color: #6b7280; margin-top: 24px; line-height: 1.5; }
.sp-footer-cols { gap: 48px !important; margin-bottom: 32px; }
.sp-footer h4 { margin-bottom: 4px !important; }
@media (max-width: 920px) {
  .sp-footer-cols { gap: 32px !important; }
}
@media (max-width: 720px) {
  .sp-footer-cols { gap: 24px !important; }
}

/* ---------- Padding interno dos patterns full-width (cada seção respira sozinha) ---------- */
.sp-hero {
  margin: 0 !important;
  padding-top: 96px !important;
  padding-bottom: 96px !important;
}
.sp-cta-banner {
  margin: 0 !important;
  padding-top: 96px !important;
  padding-bottom: 96px !important;
}
.sp-newsletter-wrap {
  margin: 0 !important;
  padding-top: 80px !important;
  padding-bottom: 80px !important;
}
.sp-section { padding-block: 80px; }
.sp-section--latest { padding-top: 96px !important; padding-bottom: 96px !important; }

/* Spacing interno hero — agora centralizado */
.sp-hero-inner {
  max-width: 880px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 28px;
}
.sp-hero-inner .sp-eyebrow-pill { margin: 0; }
.sp-hero-inner .sp-hero-h1 {
  margin: 0;
  font-size: clamp(30px, 6vw, 60px);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.03em;
  color: #111827; max-width: 920px;
}
.sp-hero-inner .sp-hero-h1-accent { color: #007F2D; }
.sp-hero-inner .sp-hero-sub {
  margin: 0;
  font-size: 19px; line-height: 1.5; color: #374151; max-width: 720px;
}
.sp-hero-inner .sp-hero-sub strong { color: #111827; font-weight: 700; }
.sp-hero-inner .sp-hero-cta-row {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
  margin-top: 8px;
}
.sp-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 24px; border-radius: 10px;
  font-weight: 700; font-size: 16px; text-decoration: none;
  transition: background .15s, transform .1s, border-color .15s;
  font-family: inherit; cursor: pointer; border: none;
  line-height: 1;
}
.sp-btn--primary {
  background: #007F2D; color: #fff;
  box-shadow: 0 4px 14px rgba(0, 127, 45, 0.35);
}
.sp-btn--primary:hover { background: #006524; transform: translateY(-1px); color: #fff; }
.sp-btn--secondary {
  background: #fff; color: #111827;
  border: 1.5px solid #d1d5db;
  padding: 14.5px 22px;
}
.sp-btn--secondary:hover { border-color: #6b7280; transform: translateY(-1px); color: #111827; }

@media (max-width: 540px) {
  .sp-hero-inner { gap: 22px; }
  .sp-hero-inner .sp-hero-cta-row { width: 100%; flex-direction: column; align-items: stretch; }
  .sp-hero-inner .sp-btn { justify-content: center; width: 100%; }
}

/* Listing/section head — eyebrow precisa de margin-bottom suficiente */
.sp-listing-header { margin-bottom: 56px !important; }
.sp-listing-header .sp-eyebrow { margin-bottom: 12px !important; }
.sp-section-head { margin-bottom: 48px !important; }
.sp-section-head .sp-eyebrow { margin-bottom: 8px !important; }

/* Pagination com ar acima */
.sp-pagination { margin-top: 64px !important; }

/* Mobile fine-tune dos paddings de seção */
@media (max-width: 720px) {
  .sp-hero { padding-top: 64px !important; padding-bottom: 64px !important; }
  .sp-cta-banner { padding-top: 64px !important; padding-bottom: 64px !important; }
  .sp-newsletter-wrap { padding-top: 56px !important; padding-bottom: 56px !important; }
  .sp-section, .sp-section--latest { padding-block: 56px !important; }
  .sp-listing-header { margin-bottom: 40px !important; }
}

/* ---------- Categorias page ---------- */
.sp-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.sp-cat-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%);
  border: 1px solid #d1fae5;
  border-radius: 16px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.sp-cat-card:hover {
  transform: translateY(-2px);
  border-color: #007F2D;
  box-shadow: 0 12px 32px rgba(0,127,45,0.10);
}
.sp-cat-card .sp-cat-name {
  font-size: 19px; font-weight: 800; letter-spacing: -0.01em;
  color: #111827;
}
.sp-cat-card .sp-cat-desc {
  font-size: 14px; line-height: 1.5; color: #4b5563;
}
.sp-cat-card .sp-cat-count {
  margin-top: auto; font-size: 12px; color: #006524;
  font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
@media (max-width: 900px) { .sp-cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .sp-cat-grid { grid-template-columns: 1fr; } }

/* ---------- 404 + utilitários ---------- */
.sp-sep { height: 1px; border: 0; }
.sp-main--404 { min-height: 50vh; display: flex; flex-direction: column; justify-content: center; }

/* ---------- Mobile fine-tuning ---------- */
@media (max-width: 540px) {
  .sp-hero-h1 { font-size: 32px !important; }
  .sp-newsletter { padding: 28px 20px !important; }
  .sp-cta-banner { padding-top: 48px !important; padding-bottom: 48px !important; }
}
