/* СБРОС И ОСНОВНЫЕ СТИЛИ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* чтобы шапка не перекрывала заголовки */
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: #f9fafc;
  color: #1e293b;
  line-height: 1.5;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ШАПКА */
.header {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: #3b82f6;
}

nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 32px;
}

nav a {
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: #3b82f6;
}

.btn {
  display: inline-block;
  background-color: #3b82f6;
  color: white !important;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.2s,
    transform 0.1s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  color: #3b82f6 !important;
  border: 2px solid #3b82f6;
}

.btn-outline:hover {
  background-color: #3b82f6;
  color: white !important;
}

/* ГЛАВНЫЙ ЭКРАН */
.hero {
  padding: 100px 0 80px;
  background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  margin-bottom: 24px;
}

.hero h1 span {
  color: #3b82f6;
  border-bottom: 4px solid #3b82f6;
  display: inline-block;
  padding-bottom: 8px;
}

.hero p {
  font-size: 18px;
  color: #475569;
  max-width: 500px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-image img {
  max-width: 100%;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ПРЕИМУЩЕСТВА */
.features {
  padding: 80px 0;
  background-color: #ffffff;
}

.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 60px;
}

.section-title span {
  color: #3b82f6;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.feature-card {
  background-color: #f8fafc;
  border-radius: 24px;
  padding: 32px 24px;
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.feature-card p {
  color: #475569;
}

/* КАК ЭТО РАБОТАЕТ */
.how-it-works {
  padding: 80px 0;
  background-color: #f1f5f9;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 50px;
}

.step {
  text-align: center;
  padding: 0 20px;
}

.step-number {
  display: inline-block;
  width: 60px;
  height: 60px;
  background-color: #3b82f6;
  color: white;
  font-size: 28px;
  font-weight: bold;
  border-radius: 50%;
  line-height: 60px;
  margin-bottom: 20px;
}

.step h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

/* БЛОГ (ПРЕВЬЮ СТАТЕЙ) */
.blog-preview {
  padding: 80px 0;
  background-color: #ffffff;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.article-card {
  background-color: #f8fafc;
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #e2e8f0;
  transition: 0.2s;
}

.article-card:hover {
  border-color: #3b82f6;
}

.article-card h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.article-card p {
  color: #475569;
  margin-bottom: 20px;
}

.article-link {
  color: #3b82f6;
  font-weight: 600;
  text-decoration: none;
}

.article-link:hover {
  text-decoration: underline;
}

/* ПРИЗЫВ К ДЕЙСТВИЮ */
.cta {
  padding: 80px 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  text-align: center;
}

.cta h2 {
  font-size: 40px;
  margin-bottom: 20px;
}

.cta p {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 40px;
  opacity: 0.9;
}

.cta .btn {
  background-color: white;
  color: #0f172a !important;
  font-size: 18px;
  padding: 16px 48px;
}

.cta .btn:hover {
  background-color: #f1f5f9;
}

/* ФУТЕР */
.footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 40px 0;
  text-align: center;
}

.footer a {
  color: #cbd5e1;
  text-decoration: none;
}

.footer a:hover {
  color: white;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 20px 0;
  flex-wrap: wrap;
}

/* Улучшенные стили для статей */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.post-header {
  margin-bottom: 40px;
  text-align: center;
}

.post-header h1 {
  font-size: 42px;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #0f172a;
}

.post-meta {
  color: #64748b;
  font-size: 16px;
  margin-bottom: 20px;
}

.post-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.tag {
  background-color: #e2e8f0;
  color: #334155;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
}

.post-content {
  font-size: 18px;
  line-height: 1.8;
  color: #334155;
}

.post-content h2 {
  font-size: 30px;
  margin: 40px 0 20px;
  color: #0f172a;
}

.post-content h3 {
  font-size: 24px;
  margin: 30px 0 15px;
}

.post-content p {
  margin-bottom: 24px;
}

.post-content ul,
.post-content ol {
  margin: 20px 0 20px 30px;
}

.post-content li {
  margin-bottom: 8px;
}

.post-content blockquote {
  border-left: 4px solid #3b82f6;
  background-color: #f1f5f9;
  padding: 16px 24px;
  margin: 24px 0;
  font-style: italic;
  border-radius: 0 12px 12px 0;
}

.post-content code {
  background-color: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 16px;
}

.post-content pre {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 20px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 24px 0;
}

.post-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.post-cta {
  margin-top: 60px;
  padding: 40px;
  background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
  border-radius: 24px;
  text-align: center;
  border: 1px solid #cbd5e1;
}

.post-cta h3 {
  font-size: 28px;
  margin-bottom: 16px;
  color: #0f172a;
}

.post-cta p {
  margin-bottom: 24px;
  font-size: 18px;
  color: #334155;
}

/* Стили для страницы списка статей */
.blog-page {
  padding: 40px 20px;
}

.blog-page h1 {
  font-size: 48px;
  margin-bottom: 40px;
  text-align: center;
  color: #0f172a;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.article-card {
  background-color: #ffffff;
  border-radius: 20px;
  padding: 30px;
  border: 1px solid #e2e8f0;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.article-card h2 {
  font-size: 24px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-card h2 a {
  color: #0f172a;
  text-decoration: none;
}

.article-card h2 a:hover {
  color: #3b82f6;
  text-decoration: underline;
}

.article-card .post-meta {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 12px;
}

.article-card .post-description {
  color: #475569;
  margin-bottom: 20px;
  flex-grow: 1;
}

.article-card .post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.article-card .tag {
  background-color: #e2e8f0;
  color: #334155;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 12px;
}

.article-card .read-more {
  color: #3b82f6;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: auto;
}

.article-card .read-more:hover {
  text-decoration: underline;
}

.no-posts {
  text-align: center;
  font-size: 20px;
  color: #64748b;
  padding: 60px 0;
}

/* Стили для кнопок, которые выглядят как ссылки, но это button */
button.btn {
  font-family: inherit;
  border: none;
  cursor: pointer;
}

button.btn-outline {
  background-color: transparent;
  color: #3b82f6;
  border: 2px solid #3b82f6;
}

button.btn-outline:hover {
  background-color: #3b82f6;
  color: white;
}

/* Добавить в конец стилей HowItWorks.astro */
@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}
/* Адаптация карточек статей для планшетов и мобильных */
@media (max-width: 768px) {
  .article-card {
    padding: 20px; /* уменьшаем отступы */
  }

  .article-card h2,
  .article-card h3 {
    font-size: 22px; /* чуть меньше заголовки */
  }

  .article-card .post-meta {
    font-size: 13px; /* мета-информация мельче */
  }

  .article-card .post-description {
    font-size: 15px; /* текст описания */
  }
}

@media (max-width: 480px) {
  .article-card {
    padding: 16px; /* ещё меньше отступов на узких экранах */
  }

  .article-card h2,
  .article-card h3 {
    font-size: 20px;
  }

  .article-card .post-meta {
    font-size: 12px;
  }

  .article-card .post-description {
    font-size: 14px;
  }

  .article-card .tag {
    font-size: 11px; /* мелкие теги */
    padding: 3px 8px;
  }
}

@media (max-width: 375px) {
  .article-card {
    width: 100%;
    max-width: 300px;
    padding: 16px;
    /* max-width: 360px; */
  }
}
