/* ========================================
   ARTICLE PAGE STYLES
   Blog Desnegativa - Vanilla HTML/CSS/JS
======================================== */

/* Article Container */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 100px 20px 64px;
  min-height: 60vh;
}

/* Back Link */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 24px;
  transition: all 0.2s;
}

.article-back:hover {
  color: var(--primary-dark);
  gap: 12px;
}

.article-back i {
  font-size: 0.75rem;
}

/* Cover Image */
.article-cover {
  width: 100%;
  height: 400px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article Header */
.article-header {
  margin-bottom: 32px;
}

.article-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 20px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 0.875rem;
  color: var(--text-light);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* Article Content - Typography */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text);
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  color: var(--text);
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.article-body h1 { font-size: 1.875rem; }
.article-body h2 { font-size: 1.5rem; }
.article-body h3 { font-size: 1.25rem; }
.article-body h4 { font-size: 1.125rem; }

.article-body p {
  margin-bottom: 16px;
}

.article-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.article-body ul,
.article-body ol {
  margin: 16px 0;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body li::marker {
  color: var(--primary);
}

.article-body blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-light);
  background: var(--gray-100);
  border-radius: 0 8px 8px 0;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 24px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.article-body pre,
.article-body code {
  background: var(--dark);
  border-radius: 8px;
  font-family: 'Courier New', Consolas, monospace;
  color: var(--white);
}

.article-body code {
  padding: 3px 8px;
  font-size: 0.875em;
}

.article-body pre {
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
}

.article-body pre code {
  padding: 0;
  background: none;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9375rem;
}

.article-body th,
.article-body td {
  border: 1px solid var(--gray-300);
  padding: 12px 16px;
  text-align: left;
}

.article-body th {
  background: var(--gray-100);
  font-weight: 600;
}

.article-body strong {
  font-weight: 600;
  color: var(--text);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 32px 0;
}

/* Tags Section */
.article-tags {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.article-tags h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-tags h3 i {
  color: var(--primary);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  background: linear-gradient(135deg, rgba(23, 225, 168, 0.1) 0%, rgba(23, 225, 168, 0.05) 100%);
  color: var(--primary-dark);
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(23, 225, 168, 0.2);
  transition: all 0.2s;
}

.tag:hover {
  background: var(--primary);
  color: var(--dark);
  border-color: var(--primary);
}

/* Share Section */
.article-share {
  margin-top: 32px;
  padding: 24px;
  background: var(--gray-100);
  border-radius: 12px;
}

.article-share h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--white);
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.share-btn i {
  font-size: 1rem;
}

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

.share-btn.whatsapp:hover {
  background: #20ba5a;
  transform: translateY(-2px);
}

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

.share-btn.facebook:hover {
  background: #166fe5;
  transform: translateY(-2px);
}

.share-btn.twitter {
  background: #1DA1F2;
}

.share-btn.twitter:hover {
  background: #0d95e8;
  transform: translateY(-2px);
}

.share-btn.copy {
  background: var(--gray-600);
}

.share-btn.copy:hover {
  background: var(--gray-700);
  transform: translateY(-2px);
}

/* Related Section */
.related-section {
  background: var(--white);
  padding: 64px 0;
}

.related-section .section-title {
  text-align: center;
  margin-bottom: 40px;
}

.related-section .section-title h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.related-section .section-title p {
  color: var(--text-light);
  font-size: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.related-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-200);
  transition: all 0.3s;
}

.related-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.related-card .card-image {
  height: 140px;
  background: var(--gray-200);
  overflow: hidden;
}

.related-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.related-card:hover .card-image img {
  transform: scale(1.05);
}

.related-card .card-image.card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 2rem;
}

.related-card .card-content {
  padding: 16px;
}

.related-card .card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  line-height: 1.4;
}

.related-card .card-date {
  font-size: 0.8125rem;
  color: var(--text-light);
}

/* Error State */
.article-error {
  text-align: center;
  padding: 80px 20px;
}

.article-error i {
  font-size: 4rem;
  color: var(--gray-400);
  margin-bottom: 24px;
}

.article-error h1 {
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 12px;
}

.article-error p {
  color: var(--text-light);
  margin-bottom: 32px;
  font-size: 1.0625rem;
}

.article-error .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: var(--dark);
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.article-error .back-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Loading State */
.article .loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.article .loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.article .loading p {
  color: var(--text-light);
  font-size: 1rem;
}

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

/* ========================================
   RESPONSIVE DESIGN
======================================== */

@media (max-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .article-container {
    padding: 90px 16px 48px;
  }

  .article-cover {
    height: 250px;
    margin-bottom: 24px;
    border-radius: 12px;
  }

  .article-title {
    font-size: 1.625rem;
  }

  .article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-body h1 { font-size: 1.5rem; }
  .article-body h2 { font-size: 1.25rem; }
  .article-body h3 { font-size: 1.125rem; }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
    width: 100%;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .related-card {
    display: flex;
    flex-direction: row;
  }

  .related-card .card-image {
    width: 120px;
    height: 100px;
    flex-shrink: 0;
  }

  .related-card .card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .article-error {
    padding: 60px 16px;
  }

  .article-error i {
    font-size: 3rem;
  }

  .article-error h1 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .article-container {
    padding: 85px 12px 40px;
  }

  .article-cover {
    height: 200px;
    border-radius: 10px;
  }

  .article-title {
    font-size: 1.375rem;
  }

  .article-share {
    padding: 16px;
  }

  .tags-list {
    gap: 8px;
  }

  .tag {
    padding: 6px 12px;
    font-size: 0.8125rem;
  }
}
