/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

html {
  scroll-padding-top: 80px; /* Отступ для фиксированной навигации */
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}

/* Header styles */
.blog-header {
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
}

.navbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: #666;
}

.nav-links .rss-link {
  color: #ffa500;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-links .rss-link:hover {
  color: #ff8c00;
}

.nav-links .rss-link i {
  font-size: 1.1em;
}

.hero {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #222;
}

.meta-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  color: #666;
  font-size: 0.9rem;
}

.meta-info span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Main content styles */
.blog-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

article {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.intro {
  font-size: 1.2rem;
  color: #444;
  margin-bottom: 2rem;
}

.content-section {
  margin-bottom: 2rem;
}

.content-section h2 {
  color: #222;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

/* Sidebar styles */
.sidebar {
  position: sticky;
  top: 100px;
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: #888 #f1f1f1;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.widget {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
}

.widget h3 {
  color: #222;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.widget ul {
  list-style: none;
}

.widget ul li {
  margin-bottom: 0.5rem;
}

.widget ul li a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.widget ul li a:hover {
  color: #333;
}

/* Social share styles */
.social-share {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8f8f8;
  border-radius: 8px;
}

.share-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

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

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

.share-btn.pinterest {
  background-color: #e60023;
}

.share-btn.linkedin {
  background-color: #0077b5;
}

.share-btn i {
  font-size: 18px;
}

/* Author bio styles */
.author-bio {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #f8f8f8;
  border-radius: 8px;
  border-left: 4px solid #333;
}

.author-info {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.author-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.author-info h3 {
  color: #222;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.author-info p {
  color: #444;
  line-height: 1.6;
}

/* Footer styles */
.blog-footer {
  background: #222;
  color: #fff;
  padding: 3rem 0 1rem;
  margin-top: 3rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #fff;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.footer-section a:hover {
  opacity: 1;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  font-size: 1.5rem;
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Newsletter form styles */
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.newsletter-form button {
  padding: 0.5rem 1rem;
  background: #ffa500;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.newsletter-form button:hover {
  background: #ff8c00;
}

.newsletter-form button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#newsletterSuccess {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  background: #e8f5e9;
  border-radius: 4px;
  color: #2e7d32;
}

#newsletterSuccess i {
  margin-right: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .hero {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  .blog-content {
    grid-template-columns: 1fr;
    padding: 0 1rem;
    gap: 1rem;
  }

  article {
    padding: 1rem;
  }

  .content-section h2 {
    font-size: 1.5rem;
  }

  .sidebar {
    position: static;
    height: auto;
    margin-top: 1rem;
    padding-right: 0;
  }

  .widget {
    padding: 1rem;
  }

  .social-share {
    padding: 1rem;
  }

  .share-buttons {
    justify-content: center;
  }

  .author-bio {
    padding: 1rem;
  }

  .author-info {
    flex-direction: column;
    text-align: center;
  }

  .author-image {
    margin: 0 auto;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 0 1rem;
  }

  .footer-section {
    margin-bottom: 2rem;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form button {
    width: 100%;
  }

  .article-image {
    height: 250px;
  }

  .logo img {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .meta-info {
    flex-direction: column;
    gap: 0.5rem;
  }

  .content-section h2 {
    font-size: 1.3rem;
  }

  .article-image {
    height: 200px;
  }

  .modal-content {
    margin: 5% auto;
    padding: 1rem;
  }

  .rss-options {
    gap: 1rem;
  }

  .rss-option {
    padding: 1rem;
  }

  .rss-url {
    flex-direction: column;
  }

  .rss-btn {
    width: 100%;
  }
}

/* Добавим поддержку устройств с высоким DPI */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .article-image {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Добавим кнопку переключения темы */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: background-color 0.3s ease;
}

.theme-toggle:hover {
  background: #444;
}

.theme-toggle i {
  font-size: 1.5rem;
}

/* Стили для тёмной темы */
body.dark-theme {
  background-color: #1a1a1a;
  color: #fff;
}

body.dark-theme .blog-header,
body.dark-theme article,
body.dark-theme .widget,
body.dark-theme .modal-content {
  background-color: #2d2d2d;
}

body.dark-theme .hero h1,
body.dark-theme .content-section h2,
body.dark-theme .widget h3,
body.dark-theme .author-info h3 {
  color: #fff;
}

body.dark-theme .nav-links a,
body.dark-theme .widget ul li a {
  color: #fff;
}

body.dark-theme .nav-links a:hover,
body.dark-theme .widget ul li a:hover {
  color: #ffa500;
}

body.dark-theme .meta-info,
body.dark-theme .intro,
body.dark-theme .author-info p {
  color: #ccc;
}

body.dark-theme .theme-toggle {
  background: #fff;
  color: #333;
}

body.dark-theme .theme-toggle:hover {
  background: #f0f0f0;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  position: relative;
  background-color: #fff;
  margin: 5% auto;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close-modal {
  position: absolute;
  right: 1.5rem;
  top: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #333;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: #333;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #555;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #333;
}

.submit-btn {
  background-color: #333;
  color: #fff;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.submit-btn:hover {
  background-color: #444;
}

.submit-btn:disabled {
  background-color: #999;
  cursor: not-allowed;
}

.success-message {
  display: none;
  text-align: center;
  padding: 2rem;
}

.success-message i {
  font-size: 3rem;
  color: #4caf50;
  margin-bottom: 1rem;
}

.success-message p {
  color: #333;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .modal-content {
    margin: 10% auto;
    width: 95%;
    padding: 1.5rem;
  }
}

.rss-options {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.rss-option {
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.rss-option h3 {
  color: #333;
  margin-bottom: 0.5rem;
}

.rss-option p {
  color: #666;
  margin-bottom: 1rem;
}

.rss-url {
  display: flex;
  gap: 0.5rem;
}

.rss-url input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.rss-btn {
  padding: 0.5rem 1rem;
  background: #ffa500;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.rss-btn:hover {
  background: #ff8c00;
}

.article-image {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
