/*
 * blog.css — Samuray Tecnologia
 * Estilos dedicados para: Newsletter, Botões de Compartilhamento, UX do Blog
 */

/* ============================================================
   NEWSLETTER — Captura de E-mail
   ============================================================ */

.newsletter-section {
  position: relative;
  padding: 5rem 0;
  overflow: hidden;
}

.newsletter-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.newsletter-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0);
}

.newsletter-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.newsletter-card:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 0 40px rgba(var(--primary-rgb), 0.06);
}

.newsletter-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--primary-rgb), 0.05));
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 1.6rem;
  color: var(--primary);
  transition: var(--transition);
}

.newsletter-card:hover .newsletter-icon {
  transform: rotate(-5deg) scale(1.1);
  background: rgba(var(--primary-rgb), 0.2);
}

.newsletter-badge {
  display: inline-block;
  background: rgba(var(--primary-rgb), 0.1);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 1.25rem;
}

.newsletter-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--white);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.newsletter-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  margin: 0 auto;
}

.newsletter-form .form-row {
  display: flex;
  gap: 1rem;
}

.newsletter-input-wrapper {
  position: relative;
  flex: 1;
}

.newsletter-input-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
  transition: color 0.3s;
}

.newsletter-input {
  width: 100%;
  padding: 0.95rem 1rem 0.95rem 2.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.newsletter-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.newsletter-input:focus {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.newsletter-input-wrapper:focus-within .input-icon {
  color: var(--primary);
}

.newsletter-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 2rem;
  background: var(--primary);
  color: var(--bg-dark);
  border: none;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.newsletter-submit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.3s;
}

.newsletter-submit-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.35);
}

.newsletter-submit-btn:hover::after {
  opacity: 1;
}

.newsletter-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.newsletter-submit-btn .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: var(--bg-dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.newsletter-submit-btn.loading .btn-text { display: none; }
.newsletter-submit-btn.loading .btn-spinner { display: block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Feedback Messages */
.newsletter-feedback {
  display: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  align-items: center;
  gap: 0.6rem;
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.newsletter-feedback.show {
  display: flex;
}

.newsletter-feedback.success {
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid rgba(46, 213, 115, 0.25);
  color: #2ed573;
}

.newsletter-feedback.error {
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.25);
  color: #ff4757;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.newsletter-privacy {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 1rem;
}

.newsletter-privacy i { margin-right: 0.3rem; }

/* Theme-Light adjustments */
body.theme-light .newsletter-card {
  box-shadow: 0 4px 30px rgba(0,0,0,0.06);
}
body.theme-light .newsletter-input {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.1);
  color: #0f172a;
}
body.theme-light .newsletter-input:focus {
  background: #fff;
}

/* Responsive */
@media (max-width: 600px) {
  .newsletter-card { padding: 2.5rem 1.5rem; }
  .newsletter-form .form-row { flex-direction: column; }
  .newsletter-submit-btn { width: 100%; }
}


/* ============================================================
   SHARE BUTTONS — Botões de Compartilhamento
   ============================================================ */

.share-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-bar-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.share-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px currentColor;
}

.share-btn:hover::before {
  opacity: 0.12;
}

.share-btn:active {
  transform: translateY(-1px);
}

.share-btn .share-icon {
  font-size: 0.95rem;
  transition: transform 0.3s;
}

.share-btn:hover .share-icon {
  transform: scale(1.2);
}

/* WhatsApp */
.share-btn-whatsapp {
  color: #25D366;
  border-color: rgba(37, 211, 102, 0.35);
  background: rgba(37, 211, 102, 0.06);
}

.share-btn-whatsapp::before {
  background: #25D366;
}

.share-btn-whatsapp:hover {
  color: #25D366;
  border-color: #25D366;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

/* Facebook */
.share-btn-facebook {
  color: #1877F2;
  border-color: rgba(24, 119, 242, 0.35);
  background: rgba(24, 119, 242, 0.06);
}

.share-btn-facebook::before {
  background: #1877F2;
}

.share-btn-facebook:hover {
  color: #1877F2;
  border-color: #1877F2;
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.3);
}

/* LinkedIn */
.share-btn-linkedin {
  color: #0A66C2;
  border-color: rgba(10, 102, 194, 0.35);
  background: rgba(10, 102, 194, 0.06);
}

.share-btn-linkedin::before {
  background: #0A66C2;
}

.share-btn-linkedin:hover {
  color: #0A66C2;
  border-color: #0A66C2;
  box-shadow: 0 6px 20px rgba(10, 102, 194, 0.3);
}

/* Share bar wrapper — used in articles */
.article-share-wrapper {
  padding: 2rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-share-wrapper .share-cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.article-share-wrapper .share-cta span {
  color: var(--primary);
}

/* Share bar — inline / compact (top of article) */
.article-share-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

body.theme-light .article-share-wrapper {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.07);
}

@media (max-width: 600px) {
  .article-share-wrapper { flex-direction: column; align-items: flex-start; }
  .share-btn span.share-label { display: none; }
  .share-btn { padding: 0.55rem 0.85rem; }
}


/* ============================================================
   ARTICLE ENHANCEMENTS — Melhorias de UX
   ============================================================ */

/* Estimated reading time */
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.article-meta-item i { color: var(--primary); }

/* Progress bar for reading */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), rgba(var(--primary-rgb), 0.5));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
}

/* Copy link button */
.share-copy-link {
  background: none;
  border: 1.5px solid var(--glass-border);
  color: var(--text-muted);
  border-radius: 50px;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  font-family: var(--font-main);
}

.share-copy-link:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.share-copy-link.copied {
  border-color: #2ed573;
  color: #2ed573;
}

/* Smooth appear animation for sections */
.fade-in-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   BREADCRUMB VISUAL — Navegação hierárquica
   ============================================================ */

.article-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.article-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.article-breadcrumb a:hover {
  color: var(--primary);
}

.article-breadcrumb .breadcrumb-separator {
  color: var(--text-muted);
  opacity: 0.4;
  font-size: 0.65rem;
  user-select: none;
}

.article-breadcrumb .breadcrumb-current {
  color: var(--primary);
  font-weight: 700;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ============================================================
   AUTHOR — Exibição do autor
   ============================================================ */

.article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.article-author i {
  color: var(--primary);
  font-size: 0.9rem;
}

.article-author .author-name {
  font-weight: 700;
  color: var(--text-main);
}


/* ============================================================
   TAGS — Sistema de hashtags
   ============================================================ */

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
}

.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.9rem;
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.article-tag:hover {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: rgba(var(--primary-rgb), 0.35);
  transform: translateY(-2px);
}

.article-tag .tag-hash {
  opacity: 0.6;
  font-weight: 800;
}


/* ============================================================
   RELATED ARTICLES — Artigos relacionados
   ============================================================ */

.related-articles {
  margin-top: 9rem;
}

.related-articles-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.related-articles-title::before {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background: var(--primary);
}

.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}

.related-article-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.related-article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.related-article-card .related-img {
  height: 80px;
  background-size: cover;
  background-position: center;
  background-color: rgba(var(--primary-rgb), 0.05);
}

.related-article-card .related-body {
  padding: 0.65rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.related-article-card .related-date {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.3rem;
}

.related-article-card .related-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em; /* Garante alinhamento vertical com exatamente 2 linhas */
}

.related-article-card .related-summary {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 4.2em; /* Garante alinhamento vertical com exatamente 3 linhas */
}

.related-article-card .related-link {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.6rem;
}


/* ============================================================
   THEME-LIGHT — Ajustes para tema claro
   ============================================================ */

body.theme-light .article-breadcrumb a { color: #64748b; }
body.theme-light .article-breadcrumb a:hover { color: var(--primary-dark); }
body.theme-light .article-breadcrumb .breadcrumb-current { color: var(--primary-dark); }
body.theme-light .article-author .author-name { color: #0f172a; }
body.theme-light .article-tag {
  background: rgba(var(--primary-rgb), 0.06);
  border-color: rgba(var(--primary-rgb), 0.15);
}
body.theme-light .related-articles-title { color: #0f172a; }
body.theme-light .related-article-card {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.07);
}
body.theme-light .related-article-card:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}
body.theme-light .related-article-card .related-title { color: #0f172a; }


/* ============================================================
   RESPONSIVE — Ajustes para mobile
   ============================================================ */

@media (max-width: 600px) {
  .article-breadcrumb {
    font-size: 0.72rem;
    gap: 0.3rem;
  }
  .article-breadcrumb .breadcrumb-current {
    max-width: 160px;
  }
  .related-articles-grid {
    grid-template-columns: 1fr;
  }
  .article-tags {
    gap: 0.4rem;
  }
  .article-tag {
    font-size: 0.7rem;
    padding: 0.3rem 0.7rem;
  }
}

