/**
 * Blog System - Main Stylesheet
 * Modern, responsive design with smooth interactions
 */

:root {
  --bg-primary: #FAFAFA;
  --bg-secondary: #FFFFFF;
  --color-cta: #D00000;
  --color-cta-hover: #A00000;
  --color-text: #1A1A1A;
  --color-text-secondary: #666666;
  --color-text-light: #999999;
  --color-border: #ECECEC;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--color-text);
  line-height: 1.6;
}

/* ==================== LAYOUT ==================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-article {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ==================== HEADER ==================== */

header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-cta);
  text-decoration: none;
  letter-spacing: -0.5px;
}

nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  margin-left: 30px;
  transition: var(--transition);
}

nav a:hover {
  color: var(--color-cta);
}

/* ==================== HERO SECTION ==================== */

.hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
  color: white;
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto;
}

/* ==================== BLOG LISTING ==================== */

.blog-section {
  padding: 60px 20px;
}

.section-title {
  font-size: 36px;
  margin-bottom: 50px;
  text-align: center;
  color: var(--color-text);
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.blog-filter-button {
  min-width: 0;
}

.blog-filter-button.active {
  background-color: var(--color-cta);
  color: white;
  border-color: var(--color-cta);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

/* ==================== ARTICLE CARD ==================== */

.article-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: visible;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--color-text);
}

.article-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.article-card-image {
  width: 100%;
  height: auto;
  min-height: 200px;
  object-fit: cover;
  transition: var(--transition);
}

.article-card:hover .article-card-image {
  transform: scale(1.05);
}

.article-card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}

.article-category {
  display: inline-block;
  background-color: rgba(208, 0, 0, 0.1);
  color: var(--color-cta);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.article-date {
  color: var(--color-text-light);
  font-size: 13px;
}

.article-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  line-height: 1.4;
  color: var(--color-text);
  transition: var(--transition);
}

.article-card:hover h3 {
  color: var(--color-cta);
}

.article-card p {
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 16px;
  flex-grow: 1;
}

.article-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.article-author {
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.read-more {
  color: var(--color-cta);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.read-more:hover {
  color: var(--color-cta-hover);
  transform: translateX(4px);
}

/* ==================== ARTICLE DETAIL PAGE ==================== */

.article-page {
  min-height: auto;
  height: auto;
  overflow: visible;
}

.article-page section,
.article-page section.container-article,
.section {
  height: auto;
  padding: 40px 0;
  overflow: visible;
}

.article-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 0;
  height: auto;
  overflow: visible;
  padding: 40px 0;
}

.article-header h1,
.article-header-title {
  font-size: 32px;
  margin-bottom: 20px;
  line-height: 1.3;
  color: var(--color-text);
}

.article-header-meta,
.article-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.article-info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-divider,
.article-info-separator {
  color: var(--color-border);
}

.article-page article.container-article,
.article-page .container-article,
.article-page .container {
  overflow: visible;
  height: auto;
}

#article-content {
  height: auto;
  overflow: visible;
  margin: 40px 0;
  padding: 20px 0;
}

.article-featured-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 0 auto 32px;
  box-shadow: var(--shadow-md);
  display: block;
}

/* ==================== BLOG CONTENT TYPOGRAPHY ==================== */

.blog-content {
  max-width: 850px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  line-height: 1.9;
  font-size: 16px;
  color: #222;
  height: auto;
  overflow: visible;
}

.article-body {
  padding: 0;
  margin: 0;
  height: auto;
  overflow: visible;
  width: 100%;
}

.blog-content * {
  height: auto;
  overflow: visible;
}

.blog-content h1 {
  font-size: 32px;
  margin-bottom: 24px;
  margin-top: 0;
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-text);
}

.blog-content h2 {
  font-size: 26px;
  margin-top: 32px;
  margin-bottom: 16px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-text);
}

.blog-content h3 {
  font-size: 20px;
  margin-top: 24px;
  margin-bottom: 12px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-text);
}

.blog-content h4 {
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 10px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-text);
}

.blog-content p {
  margin-bottom: 18px;
  line-height: 1.8;
  color: var(--color-text);
}

.blog-content ul,
.blog-content ol {
  padding-left: 28px;
  margin-bottom: 18px;
}

.blog-content li {
  margin-bottom: 12px;
  line-height: 1.8;
  color: var(--color-text);
}

.blog-content blockquote {
  border-left: 4px solid var(--color-cta);
  padding: 16px 20px;
  margin: 24px 0;
  background-color: rgba(208, 0, 0, 0.05);
  font-size: 16px;
  font-style: italic;
  line-height: 1.8;
}

.blog-content strong,
.blog-content b {
  font-weight: 700;
  color: var(--color-text);
}

.blog-content em,
.blog-content i {
  font-style: italic;
  color: var(--color-text);
}

.blog-content a {
  color: var(--color-cta);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
  font-weight: 500;
}

.blog-content a:hover {
  color: var(--color-cta-hover);
  border-bottom-color: var(--color-cta);
}

.blog-content a:visited {
  color: var(--color-cta);
  opacity: 0.8;
}

.blog-content img {
  max-width: 100%;
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 28px 0;
  box-shadow: var(--shadow-md);
  display: block;
}

.blog-content code {
  background-color: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  color: var(--color-cta);
}

.blog-content pre {
  background-color: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 24px 0;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.blog-content pre code {
  background-color: transparent;
  padding: 0;
  color: #d4d4d4;
}

/* ==================== ARTICLE FOOTER ==================== */

.article-footer-meta {
  max-width: 850px;
  margin: 20px auto 0;
  padding: 20px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.article-helpful-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-helpful-title {
  margin: 0;
  color: var(--color-text);
  font-weight: 600;
}

.helpful-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.helpful-btn {
  border: 1px solid var(--color-border);
  background-color: var(--bg-secondary);
  color: var(--color-text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.helpful-btn:hover {
  border-color: var(--color-cta);
  color: var(--color-cta);
}

/* ==================== DIVIDER ==================== */

.article-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 24px 0;
}

/* ==================== CTA ==================== */

.cta-wrapper {
  background-color: transparent;
  padding: 40px 0;
  overflow: visible;
}

#cta-container {
  overflow: visible;
  height: auto;
}

#cta-container .cta-section {
  background-color: rgba(208, 0, 0, 0.08);
  padding: 40px;
  border-radius: var(--radius);
  border-left: 4px solid var(--color-cta);
  margin: 0;
  overflow: visible;
  height: auto;
}

#cta-container .cta-section h3 {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--color-text);
  margin-top: 0;
}

#cta-container .cta-section p {
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  line-height: 1.8;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  font-size: 15px;
  text-align: center;
}

.btn-primary {
  background-color: var(--color-cta);
  color: white;
}

.btn-primary:hover {
  background-color: var(--color-cta-hover);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-cta);
  border: 2px solid var(--color-cta);
}

.btn-secondary:hover {
  background-color: rgba(255, 119, 28, 0.1);
}

/* ==================== RELATED ARTICLES ==================== */

.related-section,
.related-articles-section {
  margin: 0;
}

.related-title,
.related-articles-title {
  font-size: 28px;
  margin-bottom: 24px;
  color: var(--color-text);
}

.related-grid,
.related-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.related-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.related-card-image {
  width: 100%;
  height: auto;
  min-height: 180px;
  object-fit: cover;
}

.related-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.related-card h4 {
  font-size: 16px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.related-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  flex-grow: 1;
}

/* ==================== FOOTER ==================== */

footer {
  background-color: #1A1A1A;
  color: white;
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-column h4 {
  margin-bottom: 15px;
  font-size: 16px;
}

.footer-column p,
.footer-column a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: var(--transition);
}

.footer-column a:hover {
  color: var(--color-cta);
}

.footer-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

/* ==================== LOADING / ERROR ==================== */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  font-size: 18px;
  color: var(--color-text-light);
}

.loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-cta);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.error {
  background-color: #fef2f2;
  border-left: 4px solid #ef4444;
  padding: 20px;
  border-radius: 8px;
  color: #991b1b;
  margin: 20px 0;
}

.warning {
  background-color: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 20px;
  border-radius: 8px;
  color: #92400e;
  margin: 20px 0;
}

/* ==================== DEBUG LAYOUT ==================== */

body.layout-debug * {
  outline: 1px solid red;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
  footer {
    padding: 32px 20px 22px;
    margin-top: 36px;
  }
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
    margin-bottom: 20px;
  }
  .footer-column h4 {
    margin-bottom: 10px;
    font-size: 15px;
  }
  .footer-column p,
  .footer-column a {
    margin-bottom: 6px;
  }
  .footer-divider {
    padding-top: 16px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 16px;
  }

  .section-title {
    font-size: 28px;
  }

  .article-grid,
  .related-grid,
  .related-articles-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .article-page section,
  .section {
    padding: 30px 0;
  }

  .article-header {
    padding: 30px 0;
  }

  .article-header h1,
  .article-header-title {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .blog-content {
    padding: 16px;
  }

  .blog-content h1 {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .blog-content h2 {
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 12px;
  }

  .blog-content h3 {
    font-size: 18px;
    margin-top: 16px;
    margin-bottom: 10px;
  }

  .blog-content p {
    font-size: 15px;
    margin-bottom: 14px;
  }

  .blog-content ul,
  .blog-content ol {
    padding-left: 20px;
    margin-bottom: 14px;
  }

  .blog-content li {
    margin-bottom: 8px;
  }

  .article-featured-image {
    margin-bottom: 20px;
  }

  #cta-container .cta-section {
    padding: 24px;
  }

  .article-footer-meta {
    padding: 16px;
  }

  .article-card-content,
  .related-card-content {
    padding: 16px;
  }

  nav a {
    margin-left: 15px;
    font-size: 14px;
  }

  .header-content {
    flex-wrap: wrap;
    padding: 15px 20px;
  }

  .blog-section {
    padding: 40px 20px;
  }

  #article-content {
    margin: 20px 0;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .article-header h1,
  .article-header-title {
    font-size: 24px;
  }

  .article-header {
    padding: 20px 0;
  }

  .article-header-meta,
  .article-info {
    font-size: 12px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .blog-content {
    padding: 12px;
  }

  .blog-content h1 {
    font-size: 24px;
  }

  .blog-content h2 {
    font-size: 20px;
  }

  .blog-content h3 {
    font-size: 16px;
  }

  .blog-content p {
    font-size: 14px;
  }

  .blog-content ul,
  .blog-content ol {
    padding-left: 16px;
  }

  #cta-container .cta-section {
    padding: 16px;
  }

  .container-article {
    padding: 0 12px;
  }
}

/* ==================== PRINT STYLES ==================== */

@media print {
  header,
  footer,
  .cta-wrapper,
  .related-section,
  .related-articles-section {
    display: none;
  }

  .article-body {
    color: black;
  }

  a {
    text-decoration: underline;
  }
}

