/* =======================
   CSS GLOBAL (PADRÃO)
======================= */
:root {
  --bg: #0a0f1a;
  --surface: #1a2332;
  --surface-soft: #243040;
  --border: #2e3d4f;
  --text: #e1f0ff;
  --muted: #8fa8c7;
  --accent: #0066cc;
  --accent-soft: rgba(0, 102, 204, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system;
}

html, body {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* HEADER */
header {
  padding: 80px 20px;
  text-align: center;
  background: radial-gradient(circle at top, #1e3a52, transparent 70%),
    var(--bg);
  position: relative;
  overflow: hidden;
}

header span {
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

header h1 {
  font-size: 2.6rem;
  margin: 15px 0;
}

header p {
  max-width: 700px;
  margin: auto;
  color: var(--muted);
}

/* LAYOUT */
.container {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 30px;
}

/* ARTICLE */
article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.article-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.tags {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tags span {
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  border: 2px solid #0066cc;
}

article img {
  width: 100%;
  border-radius: 16px;
  margin: 30px 0;
}

blockquote {
  margin: 40px 0;
  padding: 25px;
  background: var(--surface-soft);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  color: var(--muted);
}

/* SIDEBAR */
aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  /* border-radius:20px; */
  padding: 25px;
  position: relative;
  overflow: hidden;
}

.card > * {
  position: relative;
  z-index: 10;
}

.card a {
  position: relative;
  z-index: 15;
  cursor: pointer;
}

/* SISTEMA DE CURTIDAS */
.like-section {
  margin: 20px 0 0 0;
  padding: 0;
  background: transparent;
  border: none;
  text-align: left;
}

.like-button {
  background: linear-gradient(135deg, var(--accent), rgba(0, 212, 170, 0.8));
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
  position: relative;
  z-index: 10;
}

.like-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.9), var(--accent));
}

.like-button:active {
  transform: translateY(0);
}

.like-button svg {
  transition: transform 0.3s ease;
}

.like-button:hover svg {
  transform: scale(1.1);
}

.like-count {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

.like-message {
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
}

/* COMMENTS */
.comments {
  margin-top: 10px;
}

.author {
  text-align: center;
}

.author img {
  width: 60px;
  /*  border-radius:50%; */
  margin-bottom: 15px;
}

.author p {
  color: var(--muted);
  font-size: 0.95rem;
}

.related-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  color: var(--text);
  position: relative;
  z-index: 10;
  cursor: pointer;
  transition: color 0.2s;
}

.related-link:hover {
  color: var(--accent);
}

/* COMMENTS */
.comments {
  margin-top: 70px;
}

.comment-form {
  margin-top: 25px;
}

/* 🔒 GARANTE FOCO DOS INPUTS */
.comment-form,
.comment-form * {
  position: relative;
  z-index: 5;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  background: #0f0f17;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.25);
}

.comment-form button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
}

/* ESTILOS PARA COMENTÁRIOS COM EDIÇÃO */
.comentario {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
}

.comment-content {
  margin-bottom: 10px;
}

.comment-content strong {
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.comment-content .comment-text {
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text);
}

.comment-content small {
  color: var(--muted);
  font-size: 0.85rem;
}

.edited {
  color: var(--accent) !important;
  font-style: italic;
}

.icone-editar {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background 0.2s;
}

.icone-editar:hover {
  background: var(--accent-soft);
}

.editor {
  display: none;
  margin-top: 10px;
}

.editor textarea {
  width: 100%;
  height: 100px;
  padding: 10px;
  background: #0f0f17;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  outline: none;
}

.editor textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.25);
}

.editor button {
  margin-top: 10px;
  margin-right: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.salvar {
  background: #28a745;
  color: white;
}

.salvar:hover {
  background: #218838;
}

.cancelar {
  background: #dc3545;
  color: white;
}

.cancelar:hover {
  background: #c82333;
}

/* ESTILOS PARA COMENTÁRIOS COM EDIÇÃO */
.comentario {
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  max-width: 500px;
  background: var(--surface-soft);
  z-index: 10;
}

.comentario * {
  position: relative;
  z-index: 12;
}

.icone-editar {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  color: var(--accent);
  font-size: 1.2rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  z-index: 20;
  pointer-events: auto;
}

.editor {
  display: none;
  margin-top: 10px;
  z-index: 15;
  position: relative;
}

.comentario textarea {
  width: 100%;
  height: 150px;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #aaa;
  resize: none;
  background: #0f0f17;
  color: var(--text);
  outline: none;
  transition: border 0.2s;
}

.comentario textarea:focus {
  border: 1px solid var(--accent);
}

.comentario button {
  margin-top: 8px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.salvar {
  background-color: #28a745;
  color: white;
}

.cancelar {
  background-color: #dc3545;
  color: white;
  margin-left: 5px;
}

/* EFEITO PREMIUM */
.card::before,
article::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: 20px;
  background: radial-gradient(
    500px circle at var(--x) var(--y),
    rgba(0, 212, 170, 0.95),
    transparent 60%
  );
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 1;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
}

.card.hovering::before,
article.hovering::before {
  opacity: 1;
}

.card::after,
article::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  border: 1.5px solid rgba(0, 212, 170, 0.9);
  opacity: 0;
  transition: 0.4s;
  z-index: 1;
}

.card.full-border::after,
article.full-border::after {
  opacity: 1;
}

/* FOOTER */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 30px;
  padding: 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
}

.footer-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.developer-credit {
  color: var(--text) !important;
  font-weight: 500;
  font-size: 0.95rem !important;
}

.footer-social {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  transition: all 0.3s ease;
}

.footer-social a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.footer-social svg {
  width: 20px;
  height: 20px;
}

/* RESPONSIVIDADE COMPLETA */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
  }

  aside {
    order: -1;
    margin-bottom: 30px;
  }
}

@media (max-width: 768px) {
  /* Header responsivo */
  header {
    padding: 60px 15px;
  }

  header h1 {
    font-size: 2rem;
  }

  header p {
    font-size: 0.95rem;
  }

  /* Container mobile */
  .container {
    margin: 30px auto;
    padding: 0 15px;
    gap: 20px;
  }

  /* Article mobile */
  article {
    padding: 25px 20px;
    border-radius: 15px;
  }

  article img {
    margin: 20px 0;
    border-radius: 12px;
  }

  /* Cards mobile */
  .card {
    padding: 20px;
    border-radius: 15px;
  }

  /* Tags responsivas */
  .tags {
    gap: 8px;
  }

  .tags span {
    font-size: 0.7rem;
    padding: 5px 10px;
  }

  /* Botão de curtida mobile */
  .like-button {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  /* Comentários mobile */
  .comment-form input,
  .comment-form textarea {
    padding: 10px;
    font-size: 1rem;
  }

  .comment-form button {
    padding: 10px 20px;
    width: 100%;
  }

  /* Footer mobile */
  .footer-content {
    gap: 12px;
    padding: 0 15px;
  }

  .footer-social {
    gap: 12px;
  }

  .footer-social a {
    width: 36px;
    height: 36px;
  }

  .footer-social svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  /* Header extra small */
  header {
    padding: 40px 10px;
  }

  header h1 {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  /* Container extra small */
  .container {
    padding: 0 10px;
  }

  /* Article extra small */
  article {
    padding: 20px 15px;
  }

  .article-meta {
    font-size: 0.8rem;
  }

  /* Cards extra small */
  .card {
    padding: 15px;
  }

  .author img {
    width: 50px;
  }

  /* Links relacionados mobile */
  .related-link {
    padding: 8px 0;
    font-size: 0.9rem;
  }

  /* Botões mobile */
  .like-button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  /* Footer extra small */
  .footer-content p {
    font-size: 0.8rem;
  }

  .developer-credit {
    font-size: 0.85rem !important;
  }
}

/* ========================================
   RESPONSIVIDADE MELHORADA PARA MOBILE
   ======================================== */

@media (max-width: 768px) {
  /* Header mobile */
  header {
    padding: 2.5rem 1rem !important;
  }

  header h1 {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
  }

  header p {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    max-width: 100% !important;
  }

  /* Container com grid responsivo */
  .container {
    max-width: 100% !important;
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    margin: 0 !important;
    padding: 0 1rem !important;
  }

  /* Artigo responsivo */
  article {
    width: 100% !important;
    padding: 1.25rem !important;
    border-radius: 12px !important;
  }

  article h1 {
    font-size: 1.4rem !important;
  }

  article h2 {
    font-size: 1.2rem !important;
  }

  article h3 {
    font-size: 1rem !important;
  }

  article p,
  article li {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
  }

  /* Tags responsivas */
  .tags {
    gap: 0.5rem !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }

  .tags span {
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
    color: #ffffff !important;
  }

  /* Imagens responsivas */
  article img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
  }

  /* Sidebar responsiva */
  .sidebar {
    width: 100% !important;
  }

  .card {
    width: 100% !important;
    padding: 1rem !important;
  }

  .newsletter-card {
    width: 80% !important;
    margin: 1rem 0 !important;
    padding: 70px 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-evenly !important;
  }
}

@media (max-width: 480px) {
  /* Header extra small */
  header {
    padding: 1.5rem 0.75rem !important;
  }

  header h1 {
    font-size: 1.2rem !important;
  }

  header p {
    font-size: 0.8rem !important;
  }

  /* Container mobile extra small */
  .container {
    max-width: 100% !important;
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    margin: 0 !important;
    padding: 0 0.75rem !important;
  }

  /* Artigo muito compacto */
  article {
    width: 100% !important;
    padding: 0.75rem !important;
    border-radius: 8px !important;
  }

  article h1 {
    font-size: 1.1rem !important;
  }

  article h2 {
    font-size: 1rem !important;
  }

  article p {
    font-size: 0.8rem !important;
  }

  /* Sidebar ocupar 100% */
  .sidebar {
    width: 100% !important;
  }

  .card {
    width: 100% !important;
    padding: 0.75rem !important;
  }

  .newsletter-card {
    width: 100% !important;
    padding: 70px 0.75rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-evenly !important;
  }
}
