* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f9f9f9;
  color: #333;
  padding-top: 80px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* === Header === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: white;
  padding: 12px 20px;
  border-bottom: 1px solid #ddd;
  z-index: 1000;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 150px;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  margin-left: 25px;
}

.logo img {
  width: 60px;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 50px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  font-size: 18px;
  color: #111;
  font-weight: 500;
}

.main-nav a:hover {
  color: #070707;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-form input {
  padding: 6px 10px;
  font-size: 16px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.search-form button {
  padding: 6px 12px;
  margin-left: 6px;
  font-size: 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 20px;
}
/* === Cards Grid === */
.section-title {
  text-align: center;
  padding-top: 30px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 500;
  color: #444;
  border-bottom: 2px solid #444;
  display: inline-block;
  padding-bottom: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.add-aection {
  padding-top: 30px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.card-body {
  padding: 20px;
}

.card-body h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.card-body p {
  margin: 6px 0;
  font-size: 14px;
  color: #555;
}

.add-article-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}

.add-article-form input[type="text"] {
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
  max-width: 500px;
}

.add-article-form button {
  padding: 10px 20px;
  font-size: 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  align-self: start;
  transition: background-color 0.3s ease;
}

.add-article-form button:hover {
  background-color: #0270e6;
}

.delete-form button {
  margin-top: 10px;
  padding: 6px 12px;
  font-size: 14px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.delete-form button:hover {
  background-color: #c82333;
}
/* Hero section */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  background-color: #111;
  padding: 40px 20px;
  border-bottom: 1px solid #444;
}

.hero-left img {
  width: 280px;
  margin: 10px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

.hero-right {
  flex: 1;
  padding: 20px;
  text-align: center; /* Выравнивание по центру */
}
.hero-video {
  max-width: 100%;
  height: 500px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
  background-color: #000;
}

.hero-right blockquote {
  font-family: "Georgia", serif;
  font-style: italic;
  font-size: 24px;
  line-height: 1.5;
  color: #ccc;
  border-left: 4px solid #eee;
  padding-left: 20px;
  margin: 0;
}

.hero-books {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

.transition-white {
  background-color: #fff;
  padding: 100px 20px;
  text-align: center;
  border-top: 1px solid #ddd;
}

.category-links {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
  gap: 15px;
  font-size: 32px;
  color: #111;
  max-width: 80%;
}

.category-links a {
  text-decoration: none;
  color: #111;
  font-weight: 500;
}

.category-links span {
  margin: 0 60px;
  color: #999;
}

.carousel {
  width: 400px;
  height: 500px;
  margin: auto;
  overflow: hidden;
}

.carousel-item img {
  width: 400px;
  height: 500px;
  object-fit: cover;
  object-position: center;
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: transparent;
  filter: invert(40%);
}

.burger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 34px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 200;
}

.burger-menu span {
  width: 100%;
  height: 3px;
  background-color: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 20px;
  }

  .card {
    display: flex;
    flex-direction: column;
    height: 320px;
  }

  .card-body {
    flex: 1;
    padding: 15px;
  }

  .card-body h3 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    max-height: calc(1.2 * 16px * 2);
    font-size: 16px;
  }

  .card-body p.author,
  .card-body p.date {
    font-size: 12px;
    margin: 4px 0;
  }
  .burger-menu {
    flex-shrink: 0;
    margin-left: 0;
    display: flex;
    order: 3;
  }

  .header-inner {
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    align-items: center;
  }

  .header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .logo {
    margin-left: 0;
    flex-shrink: 0;
  }

  .main-nav {
    position: absolute;
    top: 60px;
    right: 0;
    background-color: #fff;
    width: 100%;
    max-width: 300px;
    padding: 20px 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 190;
    display: none;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .main-nav li {
    text-align: right;
    padding: 10px 20px;
    font-size: 18px;
  }

  .main-nav a {
    color: #333;
    text-decoration: none;
  }

  .main-nav.active {
    display: block;
  }

  .hero {
    flex-direction: column;
    padding: 20px 10px;
  }

  .hero-left,
  .hero-right {
    width: 100%;
    text-align: center;
  }

  .hero-right blockquote {
    font-size: 18px;
  }

  .carousel {
    width: 100%;
    height: auto;
  }

  .carousel-item img {
    width: 100%;
    height: auto;
  }

  .category-links {
    font-size: 24px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .add-article-form input[type="text"] {
    max-width: 100%;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .search-form {
    flex: 1;
  }
  .search-form input {
    flex: 1;
    font-size: 14px;
  }

  .search-form button {
    padding: 6px 8px;
    font-size: 14px;
  }

  .hero-video {
    height: 200px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-nav ul {
    gap: 80px;
  }

  .main-nav li {
    font-size: 20px;
  }

  .carousel {
    width: 300px;
    height: 400px;
  }

  .carousel-item img {
    width: 300px;
    height: 400px;
  }

  .section-title h2 {
    font-size: 28px;
  }

  .card-body h3 {
    font-size: 16px;
  }
}
