/* Modern Design CSS */
:root {
  --primary-color: #ff8800;
  --text-color: #1f2937;
  --bg-color: #faf9f5;
  --content-bg: #ffffff;
  --card-bg: #ffffff;
  --category-color: #60a5fa;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --heading-font: 'Poppins', sans-serif;
  --body-font: 'Inter', sans-serif;
  /* Градиент фона из Figma */
  --bg-gradient: linear-gradient(to left top, rgb(255, 237, 213) 0%, rgb(255, 251, 235) 50%, rgb(254, 252, 232) 100%);
}

html {
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(to left top, rgb(255, 237, 213) 0%, rgb(255, 251, 235) 50%, rgb(254, 252, 232) 100%);
  position: relative;
  overflow-x: hidden;
}

/* Emoji Tiles Background */
.emoji-tiles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.emoji-tile {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.18;
  user-select: none;
  line-height: 1;
  /* Цвет, соответствующий фону, но темнее - используем оттенки бежевого/кремового */
  color: rgb(190, 170, 140);
  /* Затемняем и делаем более приглушенным */
  filter: brightness(0.75) saturate(0.85);
  /* Плавное появление */
  animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.2;
  }
}


.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.content {
  word-wrap: break-word;
  background-color: #fffef9;
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  margin-top: 2rem;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 0;
}

header .main a {
  font-family: var(--heading-font);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-color);
  border: none;
}

header nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

header nav a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.125rem;
  border: none;
  transition: color 0.2s;
}

header nav a:hover {
  color: var(--primary-color);
  background: none;
}

/* Page Title */
.page-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 24px;
  margin: 0 0 2rem 0;
  color: #1a1a1a;
  color: oklch(0.21 0.034 264.665);
}

.page-title::before {
  display: none;
}

/* Articles List */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

/* Article Item */
.article-item {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.article-image-wrapper {
  flex-shrink: 0;
  width: 300px;
  height: 200px;
  border-radius: 0.5rem;
  overflow: hidden;
  display: block;
  border: none;
}

.article-image-wrapper img,
.article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0.5rem;
  border: none !important;
}

.article-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 769px) {
  .article-content {
    height: 200px;
    overflow: hidden;
  }
}

.article-category {
  display: flex;
  margin-bottom: 0;
}

.category-tag {
  display: inline-block;
  padding: 0;
  color: #d97706;
  color: oklch(0.666 0.179 58.318);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-transform: none;
  letter-spacing: normal;
  border: none;
  background: none;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  margin-bottom: 8px;
}

.category-tag:hover {
  background: none;
  color: #ea7a3c;
}

.article-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  margin: 0 0 12px 0;
  line-height: 24px;
  color: #1a1a1a;
  color: oklch(0.21 0.034 264.665);
}

.article-title::before {
  display: none;
}

.article-title a {
  color: #1a1a1a;
  color: oklch(0.21 0.034 264.665);
  text-decoration: none;
  border: none;
  transition: color 0.2s;
}

.article-title a:hover {
  color: var(--primary-color);
  background: none;
}

.article-description {
  color: #6b7280;
  color: oklch(0.446 0.03 256.802);
  font-size: 16px;
  line-height: 24px;
  margin: 0 0 16px 0;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  flex: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
}

.article-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  color: #8b8b8b;
  color: oklch(0.551 0.027 264.364);
}

.article-date svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }

  .content {
    padding: 1.25rem;
  }

  .article-item {
    flex-direction: column;
    gap: 1rem;
  }

  .article-image-wrapper {
    width: 100%;
    height: 200px;
  }

  .article-category {
    justify-content: flex-start;
  }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
}

h1::before, h2::before, h3::before, h4::before, h5::before, h6::before {
  display: none;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid var(--primary-color);
  transition: all 0.2s;
}

a:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-muted);
  margin-top: 2rem;
  padding: 2rem 0;
  background: none;
  border: none;
  box-shadow: none;
}

footer a {
  border: none;
}


/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  padding: 2rem 0;
  margin: 2rem 0 0 0;
  border-top: 1px solid var(--border-color);
}

.page-item {
  display: inline-block;
}

.page-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: none;
  transition: all 0.2s;
}

.page-link:hover {
  background-color: var(--primary-color);
  color: white;
}

.page-prev {
  margin-right: auto;
}

.page-next {
  margin-left: auto;
}

/* List page styles */
.posts {
  list-style: none;
  padding: 0;
  margin: 0;
}

.posts li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.posts li:last-child {
  border-bottom: none;
}

.posts a {
  color: var(--text-color);
  font-weight: 500;
  border: none;
}

.posts a:hover {
  color: var(--primary-color);
  background: none;
}

.posts .meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: 0.5rem;
}

/* Single Article Page */
.article-post {
  max-width: none;
  margin: 0;
}

.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.article-header .article-title {
  font-size: 2rem;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}


.article-tags-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.article-tags-header .category-tag {
  margin: 0;
  padding: 0;
  color: #ea7a3c;
  font-size: 0.875rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  border: none;
  background: none;
  text-decoration: none;
}

.article-tags-header .category-tag:hover {
  background: none;
  color: #ea7a3c;
}

.article-body {
  line-height: 1.8;
  font-size: 1.0625rem;
  color: #374151;
}

.article-body p {
  margin-bottom: 1.5rem;
  color: #374151;
  font-weight: 400;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 2rem 0;
  border: none;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-body h1 {
  font-size: 1.75rem;
}

.article-body h2 {
  font-size: 1.5rem;
}

.article-body h3 {
  font-size: 1.25rem;
}

.article-body h4 {
  font-size: 1.125rem;
}

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

.article-body h6 {
  font-size: 0.875rem;
}

.article-body code {
  background-color: #f3f4f6;
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em;
}

.article-body pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

.article-body blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-body ul,
.article-body ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body a {
  color: var(--primary-color);
  text-decoration: underline;
  border: none;
}

.article-body a:hover {
  background-color: var(--primary-color);
  color: white;
  padding: 0.1em 0.2em;
  margin: 0 -0.2em;
  border-radius: 0.2em;
}

.tldr {
  background-color: #eff6ff;
  border-left: 4px solid var(--primary-color);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border-radius: 0.25rem;
}

.draft-label {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Linkcard */
.linkcard {
  display: block;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 2rem 0;
  text-decoration: none !important;
  background-color: var(--card-bg) !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  color: inherit !important;
  padding: 0 !important;
  line-height: normal !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.linkcard-content {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.linkcard-image {
  flex-shrink: 0;
  width: 200px;
  height: auto;
  overflow: hidden;
  background-color: #f3f4f6;
}

.linkcard-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  border-radius: 0;
}

.linkcard-text {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.linkcard-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
  line-height: 1.4;
}

.linkcard-title::before {
  display: none;
}

.linkcard-description {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.linkcard-site {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  color: var(--primary-color);
  font-weight: 500;
  margin-top: auto;
}

a.linkcard:hover {
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15) !important;
  border-color: var(--primary-color) !important;
  background-color: var(--card-bg) !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 2rem 0 !important;
  border-radius: 0.5rem !important;
}

.linkcard a,
.linkcard-content a,
.linkcard-text a {
  border: none !important;
  text-decoration: none;
  background-color: transparent !important;
  color: inherit;
  padding: 0 !important;
  margin: 0 !important;
}

a.linkcard:hover .linkcard a,
a.linkcard:hover .linkcard-content a,
a.linkcard:hover .linkcard-text a {
  background-color: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
}

@media (max-width: 768px) {
  .linkcard-content {
    flex-direction: column;
  }

  .linkcard-image {
    width: 100%;
    height: 200px;
  }

  .linkcard-text {
    padding: 1.25rem;
  }
}
