:root {
  --main-font-size: 15px;

  --main-color: #c01f2f;

  --second-color: #a70011;

  --third-color: #c01f2f;

  --bg-second: #f4fbf7;

  --main-text-color: #333;

  --white: #ffffff;

  --light-gray: #f8f9fa;

  --border-color: #e8ecef;

  --shadow-sm: 0 2px 8px rgba(1, 112, 116, 0.06);

  --shadow-md: 0 4px 16px rgba(1, 112, 116, 0.08);

  --shadow-lg: 0 8px 32px rgba(1, 112, 116, 0.12);

  --shadow-xl: 0 12px 48px rgba(1, 112, 116, 0.15);

  --radius-sm: 5px;

  --radius-md: 5px;

  --radius-lg: 5px;

  --radius-xl: 5px;

  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-main {
  background: var(--white);

  padding: 0;

  min-height: 100vh;
}

.site-main .container {
  max-width: 100%;

  padding: 30px 0;

  margin: 0;
}

.content-wrapper {
  max-width: 780px;

  margin: 0 auto;

  padding: 20px 16px;

  position: relative;
}

.single-post {
  background: var(--white);

  position: relative;

  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;

    transform: translateY(20px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

.entry-header {
  margin-bottom: 32px;

  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.post-meta-top {
  display: flex;

  flex-wrap: wrap;

  gap: 16px;

  margin-bottom: 20px;

  padding-bottom: 16px;

  border-bottom: 1px solid var(--border-color);
}

.meta-item {
  display: flex;

  align-items: center;

  gap: 6px;

  font-size: 13px;

  color: #6b7280;

  transition: var(--transition-fast);
}

.meta-item:hover {
  color: var(--main-color);
}

.meta-icon {
  width: 16px;

  height: 16px;

  color: var(--second-color);

  flex-shrink: 0;
}

.meta-item a {
  color: inherit;

  text-decoration: none;

  transition: var(--transition-fast);
}

.meta-item a:hover {
  color: var(--main-color);
}

.entry-title {
  font-size: 21px;

  line-height: 1.5;

  color: var(--main-text-color);

  font-weight: 800;

  margin: 0 0 16px;

  position: relative;

  padding-right: 16px;
}

.entry-title::before {
  content: "";

  position: absolute;

  right: 0;

  top: 4px;

  width: 4px;

  height: calc(100% - 8px);

  background: linear-gradient(180deg, var(--main-color), var(--second-color));

  border-radius: 4px;
}

.entry-excerpt {
  font-size: 15px;

  line-height: 1.8;

  color: #6b7280;

  padding: 16px;

  background: linear-gradient(
    135deg,
    var(--bg-second) 0%,
    rgba(0, 200, 197, 0.05) 100%
  );

  border-radius: var(--radius-md);

  border-right: 3px solid var(--second-color);

  margin-top: 16px;
}

.post-thumbnail {
  margin: 32px 0;

  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.thumbnail-wrapper {
  position: relative;

  border-radius: var(--radius-lg);

  overflow: hidden;

  background: var(--light-gray);

  aspect-ratio: 16/9;
}

.thumbnail-wrapper img {
  width: 100%;

  height: 100%;

  object-fit: cover;

  display: block;

  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.thumbnail-wrapper:hover img {
  transform: scale(1.05);
}

.thumbnail-overlay {
  position: absolute;

  inset: 0;

  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(1, 112, 116, 0.1) 100%
  );

  opacity: 0;

  transition: var(--transition);

  pointer-events: none;
}

.thumbnail-wrapper:hover .thumbnail-overlay {
  opacity: 1;
}

.thumbnail-caption {
  margin-top: 12px;

  font-size: 13px;

  color: #6b7280;

  text-align: center;

  font-style: italic;
}

.entry-content {
  font-size: var(--main-font-size);

  line-height: 2;

  color: var(--main-text-color);

  margin: 40px 0;

  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.entry-content > * {
  margin-bottom: 24px;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-weight: 700;

  color: var(--main-text-color);

  margin-top: 48px;

  margin-bottom: 20px;

  line-height: 1.5;

  scroll-margin-top: 100px;
}

.entry-content h2 {
  font-size: 22px;

  padding-right: 20px;

  position: relative;
}

.entry-content h2::before {
  content: "";

  position: absolute;

  right: 0;

  top: 50%;

  transform: translateY(-50%);

  width: 6px;

  height: 24px;

  background: linear-gradient(180deg, var(--main-color), var(--second-color));

  border-radius: 3px;
}

.entry-content h3 {
  font-size: 19px;

  color: var(--main-color);
}

.entry-content h4 {
  font-size: 17px;

  color: var(--second-color);
}

.entry-content p {
  margin-bottom: 20px;
}

.entry-content a {
  color: var(--main-color);

  text-decoration: none;

  border-bottom: 1px solid var(--second-color);

  transition: var(--transition-fast);

  font-weight: 500;
}

.entry-content a:hover {
  color: var(--second-color);

  border-bottom-color: var(--main-color);
}

.entry-content ul,
.entry-content ol {
  padding-right: 24px;

  margin: 24px 0;
}

.entry-content li {
  margin-bottom: 12px;

  position: relative;

  padding-right: 8px;
}

.entry-content ul li::marker {
  color: var(--second-color);
}

.entry-content ol li::marker {
  color: var(--main-color);

  font-weight: 700;
}

.entry-content blockquote {
  margin: 32px 0;

  padding: 24px;

  background: linear-gradient(
    135deg,
    var(--bg-second) 0%,
    rgba(0, 200, 197, 0.05) 100%
  );

  border-right: 4px solid var(--second-color);

  border-radius: var(--radius-md);

  font-style: italic;

  color: #4b5563;

  position: relative;
}

.entry-content blockquote::before {
  content: '"';

  position: absolute;

  top: 16px;

  right: 16px;

  font-size: 48px;

  color: var(--second-color);

  opacity: 0.2;

  line-height: 1;
}

.entry-content img {
  max-width: 100%;

  height: auto;

  border-radius: var(--radius-md);

  margin: 32px 0;

  box-shadow: var(--shadow-md);
}

.entry-content figure {
  margin: 32px 0;
}

.entry-content figcaption {
  margin-top: 12px;

  font-size: 13px;

  color: #6b7280;

  text-align: center;

  font-style: italic;
}

.page-links {
  margin: 40px 0;

  padding: 24px;

  background: var(--light-gray);

  border-radius: var(--radius-md);

  display: flex;

  flex-wrap: wrap;

  gap: 12px;

  align-items: center;
}

.page-links-title {
  font-weight: 700;

  color: var(--main-color);

  margin-left: 12px;
}

.page-number {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  min-width: 40px;

  height: 40px;

  padding: 0 12px;

  background: var(--white);

  border: 2px solid var(--border-color);

  border-radius: var(--radius-sm);

  color: var(--main-text-color);

  font-weight: 600;

  transition: var(--transition-fast);
}

.page-links a .page-number:hover {
  background: var(--main-color);

  border-color: var(--main-color);

  color: var(--white);

  transform: translateY(-2px);
}

.page-links > span:not(.page-links-title) .page-number {
  background: var(--main-color);

  border-color: var(--main-color);

  color: var(--white);
}

.entry-footer {
  margin-top: 48px;

  padding-top: 32px;

  border-top: 2px solid var(--border-color);

  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.post-tags {
  display: flex;

  align-items: flex-start;

  gap: 12px;

  margin-bottom: 32px;

  flex-wrap: wrap;
}

.tags-icon {
  width: 18px;

  height: 18px;

  color: var(--second-color);

  flex-shrink: 0;

  margin-top: 6px;
}

.tags-list {
  display: flex;

  flex-wrap: wrap;

  gap: 8px;

  flex: 1;
}

.tag-item {
  display: inline-flex;

  align-items: center;

  padding: 6px 16px;

  background: var(--bg-second);

  color: var(--main-color);

  border-radius: 20px;

  font-size: 13px;

  font-weight: 500;

  text-decoration: none;

  transition: var(--transition-fast);

  border: 1px solid transparent;
}

.tag-item:hover {
  background: var(--main-color);

  color: var(--white);

  transform: translateY(-2px);

  box-shadow: var(--shadow-sm);
}

.post-share {
  display: flex;

  align-items: center;

  gap: 16px;

  padding: 20px;

  background: linear-gradient(
    135deg,
    var(--bg-second) 0%,
    rgba(255, 228, 0, 0.05) 100%
  );

  border-radius: var(--radius-md);

  flex-wrap: wrap;
}

.share-label {
  font-weight: 600;

  color: var(--main-color);

  font-size: 14px;
}

.share-buttons {
  display: flex;

  gap: 10px;

  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;

  align-items: center;

  justify-content: center;

  width: 44px;

  height: 44px;

  border-radius: 50%;

  background: var(--white);

  color: var(--main-color);

  border: 2px solid var(--border-color);

  transition: var(--transition-fast);

  cursor: pointer;

  text-decoration: none;
}

.share-btn:hover {
  transform: translateY(-4px) scale(1.05);

  box-shadow: var(--shadow-md);
}

.share-telegram:hover {
  background: #0088cc;

  border-color: #0088cc;

  color: var(--white);
}

.share-twitter:hover {
  background: #000000;

  border-color: #000000;

  color: var(--white);
}

.share-linkedin:hover {
  background: #0077b5;

  border-color: #0077b5;

  color: var(--white);
}

.share-copy:hover {
  background: var(--main-color);

  border-color: var(--main-color);

  color: var(--white);
}

.share-copy.copied {
  background: #10b981;

  border-color: #10b981;

  color: var(--white);
}

.post-navigation {
  display: grid;

  grid-template-columns: 1fr;

  gap: 16px;

  margin: 48px 0;

  animation: fadeInUp 0.6s ease-out 0.5s both;
}

.nav-item {
  display: flex;

  align-items: center;

  gap: 16px;

  padding: 20px;

  background: var(--white);

  border: 2px solid var(--border-color);

  border-radius: var(--radius-md);

  text-decoration: none;

  transition: var(--transition);

  position: relative;

  overflow: hidden;
}

.nav-item::before {
  content: "";

  position: absolute;

  inset: 0;

  background: linear-gradient(
    135deg,
    var(--bg-second) 0%,
    rgba(0, 200, 197, 0.05) 100%
  );

  opacity: 0;

  transition: var(--transition);
}

.nav-item:hover::before {
  opacity: 1;
}

.nav-item:hover {
  border-color: var(--second-color);

  transform: translateY(-4px);

  box-shadow: var(--shadow-md);
}

.nav-icon {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 40px;

  height: 40px;

  background: var(--bg-second);

  border-radius: 50%;

  color: var(--main-color);

  flex-shrink: 0;

  transition: var(--transition-fast);

  position: relative;

  z-index: 1;
}

.nav-item:hover .nav-icon {
  background: var(--main-color);

  color: var(--white);

  transform: scale(1.1);
}

.nav-content {
  flex: 1;

  position: relative;

  z-index: 1;
}

.nav-subtitle {
  display: block;

  font-size: 12px;

  color: #6b7280;

  margin-bottom: 4px;

  font-weight: 500;
}

.nav-title {
  display: block;

  font-size: 15px;

  color: var(--main-text-color);

  font-weight: 700;

  line-height: 1.5;
}

.nav-next {
  text-align: left;
}

.nav-previous {
  text-align: right;
}

.related-posts {
  margin: 64px 0;

  animation: fadeInUp 0.6s ease-out 0.6s both;
}

.section-header {
  margin-bottom: 32px;

  text-align: center;

  position: relative;
}

.section-title {
  display: inline-flex;

  align-items: center;

  gap: 12px;

  font-size: 22px;

  font-weight: 800;

  color: var(--main-text-color);

  margin: 0;

  position: relative;

  padding: 0 24px;
}

.title-icon {
  display: flex;

  align-items: center;

  justify-content: center;

  width: 48px;

  height: 48px;

  background: var(--second-color);

  border-radius: 50%;

  color: var(--white);
}

.title-decoration {
  height: 3px;

  width: 80px;

  background: linear-gradient(90deg, var(--main-color), var(--second-color));

  margin: 16px auto 0;

  border-radius: 3px;
}

.related-posts-grid {
  display: grid;

  grid-template-columns: 1fr;

  gap: 20px;
}

.related-post-item {
  background: var(--white);

  border: 2px solid var(--border-color);

  border-radius: var(--radius-md);

  overflow: hidden;

  transition: var(--transition);
}

.related-post-item:hover {
  border-color: var(--second-color);

  transform: translateY(-6px);

  box-shadow: var(--shadow-lg);
}

.related-post-link {
  display: block;

  text-decoration: none;

  color: inherit;
}

.related-post-thumbnail {
  position: relative;

  aspect-ratio: 16/9;

  overflow: hidden;

  background: var(--light-gray);
}

.related-post-thumbnail img {
  width: 100%;

  height: 100%;

  object-fit: cover;

  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-post-item:hover .related-post-thumbnail img {
  transform: scale(1.1);
}

.thumbnail-gradient {
  position: absolute;

  inset: 0;

  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(1, 112, 116, 0.7) 100%
  );

  opacity: 0;

  transition: var(--transition);
}

.related-post-item:hover .thumbnail-gradient {
  opacity: 1;
}

.read-more-badge {
  position: absolute;

  bottom: 16px;

  left: 16px;

  width: 40px;

  height: 40px;

  background: var(--white);

  border-radius: 50%;

  display: flex;

  align-items: center;

  justify-content: center;

  color: var(--main-color);

  opacity: 0;

  transform: translateX(-10px);

  transition: var(--transition);
}

.related-post-item:hover .read-more-badge {
  opacity: 1;

  transform: translateX(0);
}

.related-post-content {
  padding: 20px;
}

.related-post-title {
  font-size: 16px;

  font-weight: 700;

  color: var(--main-text-color);

  line-height: 1.6;

  margin: 0 0 12px;

  display: -webkit-box;

  -webkit-line-clamp: 2;

  -webkit-box-orient: vertical;

  overflow: hidden;
}

.related-post-meta {
  display: flex;

  align-items: center;

  gap: 6px;

  font-size: 13px;

  color: #6b7280;
}

.related-post-meta svg {
  width: 14px;

  height: 14px;

  color: var(--second-color);
}

.table-of-contents-wrapper {
  display: none;
}

.no-content {
  text-align: center;

  padding: 80px 20px;

  animation: fadeInUp 0.6s ease-out;
}

.no-content-icon {
  margin-bottom: 24px;

  color: var(--second-color);

  opacity: 0.3;
}

.no-content h2 {
  font-size: 24px;

  font-weight: 700;

  color: var(--main-text-color);

  margin: 0 0 12px;
}

.no-content p {
  font-size: 15px;

  color: #6b7280;

  margin: 0 0 32px;
}

.btn {
  display: inline-flex;

  align-items: center;

  gap: 8px;

  padding: 14px 28px;

  border-radius: var(--radius-sm);

  font-size: 15px;

  font-weight: 600;

  text-decoration: none;

  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--second-color);

  color: var(--white);

  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);

  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .content-wrapper {
    padding: 40px 32px;
  }

  .entry-title {
    font-size: 27px;
  }

  .entry-excerpt {
    font-size: 16px;

    padding: 20px;
  }

  .post-meta-top {
    gap: 24px;
  }

  .meta-item {
    font-size: 14px;
  }

  .entry-content {
    font-size: 16px;
  }

  .entry-content h2 {
    font-size: 23px;
  }

  .entry-content h3 {
    font-size: 21px;
  }

  .entry-content h4 {
    font-size: 19px;
  }

  .post-navigation {
    grid-template-columns: repeat(2, 1fr);

    gap: 20px;
  }

  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);

    gap: 24px;
  }

  .section-title {
    font-size: 26px;
  }
}

@media (min-width: 1024px) {
  .site-main .container {
    display: grid;

    grid-template-columns: 2.5fr 1fr;

    max-width: 1400px;

    margin: 0 auto;

    padding: 50px 3%;
  }

  .content-wrapper {
    padding: 60px 0;

    align-items: start;
  }

  .single-post,
  .post-navigation,
  .related-posts,
  .no-content {
    grid-column: 1;
  }

  .entry-title {
    font-size: 29px;
  }

  .thumbnail-wrapper {
    border-radius: var(--radius-xl);
  }

  .related-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .table-of-contents-wrapper {
    display: block;

    grid-column: 2;

    grid-row: 1 / -1;

    position: relative;
  }

  .toc-sticky {
    position: sticky;

    background: var(--white);

    border: 2px solid var(--border-color);

    max-height: calc(100vh - 140px);

    overflow-y: auto;

    transition: var(--transition);
  }

  .toc-sticky:hover {
    border-color: var(--second-color);

    box-shadow: var(--shadow-md);
  }

  .toc-header {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 20px;

    padding-bottom: 16px;

    border-bottom: 2px solid var(--border-color);
  }

  .toc-icon {
    width: 24px;

    height: 24px;

    color: var(--second-color);
  }

  .toc-title {
    font-size: 17px;

    font-weight: 700;

    color: var(--main-text-color);

    margin: 0;
  }

  .toc-content {
    margin-bottom: 20px;
  }

  .toc-list {
    list-style: none;

    padding: 0;

    margin: 0;
  }

  .toc-item {
    margin-bottom: 4px;
  }

  .toc-link {
    display: flex;

    align-items: center;

    gap: 8px;

    padding: 10px 12px;

    font-size: 14px;

    color: #6b7280;

    text-decoration: none;

    border-radius: var(--radius-sm);

    transition: var(--transition-fast);

    line-height: 1.5;
  }

  .toc-link:hover {
    background: var(--bg-second);

    color: var(--main-color);

    padding-right: 16px;
  }

  .toc-link.active {
    background: var(--second-color);

    color: var(--white);

    font-weight: 600;

    padding-right: 16px;
  }

  .toc-link-icon {
    width: 16px;

    height: 16px;

    flex-shrink: 0;

    transition: var(--transition-fast);
  }

  .toc-link.active .toc-link-icon {
    transform: rotate(90deg);
  }

  .toc-h3 {
    padding-right: 24px;
  }

  .toc-h3 .toc-link {
    font-size: 13px;
  }

  .toc-h4 {
    padding-right: 36px;
  }

  .toc-h4 .toc-link {
    font-size: 12px;
  }

  .toc-progress {
    height: 4px;

    background: var(--border-color);

    border-radius: 2px;

    overflow: hidden;

    margin-top: 20px;
  }

  .toc-progress-bar {
    height: 100%;

    background: linear-gradient(90deg, var(--main-color), var(--second-color));

    width: 0%;

    transition: width 0.1s ease-out;

    border-radius: 2px;
  }

  .toc-sticky::-webkit-scrollbar {
    width: 6px;
  }

  .toc-sticky::-webkit-scrollbar-track {
    background: var(--light-gray);

    border-radius: 3px;
  }

  .toc-sticky::-webkit-scrollbar-thumb {
    background: var(--second-color);

    border-radius: 3px;
  }

  .toc-sticky::-webkit-scrollbar-thumb:hover {
    background: var(--main-color);
  }
}

@media (max-width: 1023px) {
  .toc-sticky {
    background: var(--white);

    border: 2px solid var(--border-color);

    overflow: hidden;

    transition: var(--transition);
  }

  .toc-header {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 16px;

    background: var(--bg-second);

    cursor: pointer;

    user-select: none;

    position: relative;
  }

  .toc-header::after {
    content: "";

    position: absolute;

    left: 16px;

    top: 50%;

    transform: translateY(-50%) rotate(0deg);

    width: 20px;

    height: 20px;

    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2300c8c5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    background-size: contain;

    background-repeat: no-repeat;

    transition: var(--transition);
  }

  .toc-sticky.collapsed .toc-header::after {
    transform: translateY(-50%) rotate(-90deg);
  }

  .toc-icon {
    width: 20px;

    height: 20px;

    color: var(--second-color);
  }

  .toc-title {
    font-size: 15px;

    font-weight: 700;

    color: var(--main-text-color);

    margin: 0;

    flex: 1;
  }

  .toc-content {
    max-height: 400px;

    overflow-y: auto;

    padding: 16px;

    transition: var(--transition);
  }

  .toc-sticky.collapsed .toc-content {
    max-height: 0;

    padding: 0 16px;

    overflow: hidden;
  }

  .toc-list {
    list-style: none;

    padding: 0;

    margin: 0;
  }

  .toc-item {
    margin-bottom: 4px;
  }

  .toc-link {
    display: flex;

    align-items: center;

    gap: 8px;

    padding: 10px 12px;

    font-size: 14px;

    color: #6b7280;

    text-decoration: none;

    border-radius: var(--radius-sm);

    transition: var(--transition-fast);

    line-height: 1.5;
  }

  .toc-link:hover,
  .toc-link:active {
    background: var(--bg-second);

    color: var(--main-color);
  }

  .toc-link.active {
    background: var(--second-color);

    color: var(--white);

    font-weight: 600;
  }

  .toc-link-icon {
    width: 14px;

    height: 14px;

    flex-shrink: 0;

    transition: var(--transition-fast);
  }

  .toc-link.active .toc-link-icon {
    transform: rotate(90deg);
  }

  .toc-h3 {
    padding-right: 16px;
  }

  .toc-h3 .toc-link {
    font-size: 13px;
  }

  .toc-h4 {
    padding-right: 28px;
  }

  .toc-h4 .toc-link {
    font-size: 12px;
  }

  .toc-progress {
    height: 3px;

    background: var(--border-color);

    transition: var(--transition);
  }

  .toc-sticky.collapsed .toc-progress {
    height: 0;
  }

  .toc-progress-bar {
    height: 100%;

    background: linear-gradient(90deg, var(--main-color), var(--second-color));

    width: 0%;

    transition: width 0.1s ease-out;
  }
}

@media print {
  .post-share,
  .post-navigation,
  .related-posts,
  .table-of-contents-wrapper {
    display: none !important;
  }

  .entry-content {
    font-size: 12pt;

    line-height: 1.6;
  }

  .entry-content a {
    color: #000;

    text-decoration: underline;
  }

  .single-post {
    box-shadow: none;
  }
}

a:focus-visible,
button:focus-visible {
  outline: none;

  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;

    animation-iteration-count: 1 !important;

    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .entry-content {
    color: #000;
  }

  .meta-item,
  .nav-subtitle {
    color: #333;
  }

  .border-color {
    --border-color: #000;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }

  100% {
    background-position: 1000px 0;
  }
}

.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--light-gray) 0%,

    var(--border-color) 50%,

    var(--light-gray) 100%
  );

  background-size: 1000px 100%;

  animation: shimmer 2s infinite;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

::selection {
  background: var(--second-color);

  color: var(--white);
}

::-moz-selection {
  background: var(--second-color);

  color: var(--white);
}

::-webkit-scrollbar {
  width: 10px;

  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--second-color);

  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--main-color);
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.title-icon {
  animation: float 3s ease-in-out infinite;
}

.entry-title {
  background: linear-gradient(
    135deg,
    var(--main-text-color) 0%,
    var(--main-color) 100%
  );

  -webkit-background-clip: text;

  -webkit-text-fill-color: transparent;

  background-clip: text;
}

.entry-content img {
  transition: var(--transition);

  cursor: zoom-in;
}

.entry-content img:hover {
  transform: scale(1.02);

  box-shadow: var(--shadow-lg);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

.toc-link.active::before {
  content: "";

  position: absolute;

  right: 0;

  top: 50%;

  transform: translateY(-50%);

  width: 4px;

  height: 60%;

  background: var(--third-color);

  border-radius: 2px;

  animation: pulse 2s ease-in-out infinite;
}

.toc-link {
  position: relative;
}

.post-share {
  position: relative;

  overflow: hidden;
}

.post-share::before {
  content: "";

  position: absolute;

  top: -50%;

  right: -50%;

  width: 200%;

  height: 200%;

  background: radial-gradient(
    circle,
    rgba(0, 200, 197, 0.1) 0%,
    transparent 70%
  );

  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.related-post-item {
  position: relative;

  overflow: hidden;
}

.related-post-item::before {
  content: "";

  position: absolute;

  top: 0;

  right: 0;

  width: 0;

  height: 2px;

  background: linear-gradient(90deg, var(--main-color), var(--second-color));

  transition: width 0.4s ease;
}

.related-post-item:hover::before {
  width: 100%;
}

[data-tooltip] {
  position: relative;

  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);

  position: absolute;

  bottom: 100%;

  right: 50%;

  transform: translateX(50%) translateY(-8px);

  padding: 8px 12px;

  background: var(--main-text-color);

  color: var(--white);

  font-size: 12px;

  white-space: nowrap;

  border-radius: var(--radius-sm);

  opacity: 0;

  pointer-events: none;

  transition: var(--transition-fast);

  z-index: 1000;
}

[data-tooltip]:hover::after {
  opacity: 1;

  transform: translateX(50%) translateY(-4px);
}

.reading-progress-bar {
  position: fixed;

  top: 0;

  right: 0;

  width: 0%;

  height: 3px;

  background: linear-gradient(90deg, var(--main-color), var(--second-color));

  z-index: 9999;

  transition: width 0.1s ease-out;
}

.share-btn svg,
.nav-icon svg {
  transition: var(--transition-fast);
}

.share-btn:hover svg {
  transform: scale(1.2) rotate(5deg);
}

.nav-icon svg {
  transition: transform 0.3s ease;
}

.nav-item:hover .nav-previous .nav-icon svg {
  transform: translateX(-4px);
}

.nav-item:hover .nav-next .nav-icon svg {
  transform: translateX(4px);
}

@keyframes glow {
  0%,
  100% {
    box-shadow:
      0 0 5px var(--second-color),
      0 0 10px var(--second-color);
  }

  50% {
    box-shadow:
      0 0 10px var(--second-color),
      0 0 20px var(--second-color),
      0 0 30px var(--second-color);
  }
}

.btn-primary:hover {
  animation: glow 2s ease-in-out infinite;
}

.related-post-item:nth-child(1) {
  animation-delay: 0.1s;
}

.related-post-item:nth-child(2) {
  animation-delay: 0.2s;
}

.related-post-item:nth-child(3) {
  animation-delay: 0.3s;
}

@media (min-width: 1024px) {
  .thumbnail-wrapper {
    transform-style: preserve-3d;

    perspective: 1000px;
  }

  .thumbnail-wrapper:hover img {
    transform: scale(1.05) translateZ(20px);
  }
}

.entry-content hr {
  border: none;

  height: 2px;

  background: linear-gradient(
    90deg,
    transparent,
    var(--second-color),
    transparent
  );

  margin: 48px 0;

  position: relative;
}

.entry-content hr::after {
  content: "✦";

  position: absolute;

  top: 50%;

  right: 50%;

  transform: translate(50%, -50%);

  background: var(--white);

  color: var(--second-color);

  padding: 0 16px;

  font-size: 20px;
}

.entry-content pre {
  background: #1e293b;

  color: #e2e8f0;

  padding: 24px;

  border-radius: var(--radius-md);

  overflow-x: auto;

  margin: 32px 0;

  border: 2px solid var(--main-color);

  position: relative;
}

.entry-content pre::before {
  content: "";

  position: absolute;

  top: 0;

  right: 0;

  width: 100%;

  height: 4px;

  background: linear-gradient(90deg, var(--main-color), var(--second-color));
}

.entry-content code {
  font-size: 14px;

  line-height: 1.6;
}

.entry-content p code,
.entry-content li code {
  background: var(--bg-second);

  color: var(--main-color);

  padding: 2px 8px;

  border-radius: 4px;

  font-size: 0.9em;

  border: 1px solid var(--border-color);
}

.entry-content table {
  width: 100%;

  border-collapse: separate;

  border-spacing: 0;

  margin: 32px 0;

  border-radius: var(--radius-md);

  overflow: hidden;

  box-shadow: var(--shadow-md);
}

.entry-content table thead {
  background: var(--second-color);

  color: var(--white);
}

.entry-content table th {
  padding: 16px;

  text-align: right;

  font-weight: 700;

  font-size: 14px;
}

.entry-content table td {
  padding: 16px;

  border-bottom: 1px solid var(--border-color);

  font-size: 14px;
}

.entry-content table tbody tr {
  background: var(--white);

  transition: var(--transition-fast);
}

.entry-content table tbody tr:hover {
  background: var(--bg-second);
}

.entry-content table tbody tr:last-child td {
  border-bottom: none;
}

.entry-content iframe,
.entry-content video {
  max-width: 100%;

  border-radius: var(--radius-md);

  margin: 32px 0;

  box-shadow: var(--shadow-md);
}

.nav-item,
.related-post-item,
.share-btn,
.tag-item,
.toc-link {
  will-change: transform;
}

.post-thumbnail,
.related-post-thumbnail {
  contain: layout;
}

@media (min-width: 1024px) {
  .content-wrapper {
    max-width: 1400px;

    margin: 0 auto;

    padding: 0 24px;
  }

  .single-post {
    grid-column: 1;

    min-width: 0;
  }

  .table-of-contents-wrapper {
    grid-column: 2;

    position: sticky;

    top: 10px;

    max-height: calc(100vh - 120px);

    overflow-y: auto;

    margin: 0;

    animation: fadeInUp 0.6s ease-out 0.3s both;
  }

  .toc-sticky {
    background: var(--white);

    border: 1px solid var(--border-color);

    overflow: hidden;

    transition: var(--transition);
  }

  .toc-sticky:hover {
    box-shadow: var(--shadow-lg);

    border-color: var(--second-color);
  }

  .toc-header {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 20px;

    background: linear-gradient(135deg, var(--bg-second), var(--white));

    border-bottom: 2px solid var(--border-color);

    cursor: default;

    user-select: none;
  }

  .toc-header::after {
    display: none;
  }

  .toc-icon {
    width: 24px;

    height: 24px;

    color: var(--second-color);
  }

  .toc-title {
    font-size: 16px;

    font-weight: 700;

    color: var(--main-text-color);

    margin: 0;
  }

  .toc-content {
    padding: 20px;

    max-height: none !important;

    overflow-y: visible;
  }

  .toc-list {
    list-style: none;

    padding: 0;

    margin: 0;
  }

  .toc-item {
    margin-bottom: 4px;
  }

  .toc-link {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 12px 16px;

    font-size: 14px;

    color: #6b7280;

    text-decoration: none;

    border-radius: var(--radius-sm);

    transition: var(--transition-fast);

    line-height: 1.6;

    position: relative;
  }

  .toc-link:hover {
    background: var(--bg-second);

    color: var(--main-color);

    transform: translateX(-4px);
  }

  .toc-link.active {
    background: var(--second-color);

    color: var(--white);

    font-weight: 600;

    transform: translateX(-4px);
  }

  .toc-link.active::before {
    content: "";

    position: absolute;

    right: 0;

    top: 50%;

    transform: translateY(-50%);

    width: 4px;

    height: 70%;

    background: var(--third-color);

    border-radius: 2px 0 0 2px;
  }

  .toc-link-icon {
    width: 16px;

    height: 16px;

    flex-shrink: 0;

    transition: var(--transition-fast);
  }

  .toc-link.active .toc-link-icon {
    transform: rotate(90deg);
  }

  .toc-h3 {
    padding-right: 20px;
  }

  .toc-h3 .toc-link {
    font-size: 13px;

    padding: 10px 16px;
  }

  .toc-h4 {
    padding-right: 36px;
  }

  .toc-h4 .toc-link {
    font-size: 12px;

    padding: 8px 16px;
  }

  .toc-progress {
    height: 4px;

    background: var(--border-color);
  }

  .toc-progress-bar {
    height: 100%;

    background: linear-gradient(90deg, var(--main-color), var(--second-color));

    width: 0%;

    transition: width 0.1s ease-out;

    box-shadow: 0 0 10px rgba(0, 200, 197, 0.5);
  }

  .toc-content::-webkit-scrollbar {
    width: 6px;
  }

  .toc-content::-webkit-scrollbar-track {
    background: var(--light-gray);

    border-radius: 3px;
  }

  .toc-content::-webkit-scrollbar-thumb {
    background: var(--second-color);

    border-radius: 3px;
  }

  .toc-content::-webkit-scrollbar-thumb:hover {
    background: var(--main-color);
  }

  .table-of-contents-wrapper:empty {
    display: none;
  }
}

@media only screen and (max-width: 570px) {
  .entry-title {
    font-size: 19px;

    margin: 0;
  }
}
