* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #555555;
  background: #ffffff;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Header ===== */

.inner-wrap {
  max-width: 980px;
  margin: 0 auto;
}

.topbar {
  background: #242627;
  color: #aaaaaa;
  line-height: 18px;
}

.topbar .inner-wrap {
  padding-top: 5px;
  padding-bottom: 5px;
}

.topbar span {
  color: #f7f7f7;
  font-size: 12px;
}

.main-header {
  background: #343638 url("header-bg-squares.png");
}

.main-header .inner-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 30px;
  padding-bottom: 10px;
}

.logo {
  margin-bottom: 30px;
}

.logo img {
  height: 140px;
  width: auto;
}

/* Nav */

.main-nav > ul {
  display: flex;
  list-style: none;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav > ul > li > a {
  display: block;
  color: #ffffff;
  font-size: 16px;
  font-weight: 300;
  padding: 15px 22px 15px 0;
}

.main-nav > ul > li > a:hover {
  color: #4fd3dc;
}

.main-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #2c2c2c;
  list-style: none;
  padding: 6px 0;
  z-index: 10;
}

.main-nav > ul > li:hover .sub-menu {
  display: block;
}

.main-nav .sub-menu a {
  display: block;
  color: #dddddd;
  font-size: 0.95rem;
  padding: 10px 18px;
  white-space: nowrap;
}

.main-nav .sub-menu a:hover {
  color: #4fd3dc;
  background: #3d3d3d;
}

/* Hero banner */

.hero-banner {
  background: #343638 url("header-bg-squares.png");
}

.hero-card {
  max-width: 980px;
  margin: 0 auto;
  background: #1b1c1d;
  color: #a4a6a8;
  position: relative;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.hero-banner h1 {
  color: #ffffff;
  font-weight: normal;
  font-size: 32px;
  padding: 20px 0;
  margin: 0;
}

/* ===== Content layout ===== */

.content-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 0 80px;
  display: flex;
  align-items: flex-start;
}

.main-content {
  flex: 1 1 610px;
  min-width: 0;
  padding-right: 35px;
  border-right: 1px solid #d0d8dd;
  box-shadow:
    10px 0 20px -20px #000,
    0 10px 20px -20px #000;
}

.sidebar {
  flex: 0 0 300px;
  max-width: 300px;
  padding-left: 29px;
}

/* Carousel */

.carousel {
  margin-bottom: 30px;
}

.carousel-nav {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 12px;
}

.carousel-btn {
  width: 30px;
  height: 30px;
  background: #1c1c1c;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.carousel-btn:hover {
  background: #4fd3dc;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.carousel-item {
  flex: 0 0 45%;
}

.carousel-item img,
.thumb-fallback {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 2px;
}

.thumb-fallback {
  display: block;
}

.thumb-fallback--car {
  background: linear-gradient(135deg, #5b7a99, #2c4457);
}

.carousel-item figcaption {
  margin-top: 12px;
  color: #333333;
  font-size: 1.05rem;
}

.carousel-item figcaption a:hover {
  color: #4fd3dc;
}

/* Article */

.article-text {
  padding: 30px;
}

.article-text h2 {
  color: #1c1c1c;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 30px 0 16px;
}

.article-text p {
  margin-bottom: 20px;
}

.article-text ul,
.article-text ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-text li {
  margin-bottom: 8px;
}

.article-text blockquote {
  margin: 0 0 20px;
  padding: 4px 20px;
  border-left: 3px solid #d0d4d8;
  color: #777777;
  font-style: italic;
}

.article-text blockquote p {
  margin-bottom: 0;
}

/* Related articles */

.related-posts {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #d0d4d8;
}

.related-posts h3 {
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1c1c1c;
  margin-bottom: 20px;
}

.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.related-card {
  flex: 1 1 calc(50% - 10px);
  min-width: 160px;
}

.related-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 2px;
  margin-bottom: 10px;
}

.related-card span {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c1c1c;
}

.related-card:hover span {
  color: #4fd3dc;
}

.sidebar .related-grid {
  flex-direction: column;
}

.sidebar .related-card {
  flex: 1 1 auto;
}

.sidebar .related-card img {
  height: 180px;
}

/* Sidebar */

.search-box {
  display: flex;
  border: 1px solid #d5d5d5;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 30px;
}

.search-box input {
  flex: 1;
  border: none;
  padding: 14px 16px;
  font-size: 1rem;
  outline: none;
}

.search-box button {
  border: none;
  background: #ffffff;
  width: 56px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-box svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #4fd3dc;
  stroke-width: 2;
}

.widget {
  margin-bottom: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid #d0d4d8;
}

.widget h3 {
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #1c1c1c;
  margin-bottom: 16px;
}

.widget p {
  margin-bottom: 14px;
}

/* Video widget */

.video-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.video-card {
  display: block;
}

.video-thumb {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 34px;
  background: #e02b1d;
  color: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.video-card:hover .play-btn {
  background: #ff3823;
}

.video-info {
  padding-top: 10px;
}

.video-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1c1c1c;
  margin-bottom: 4px;
}

.video-card:hover .video-title {
  color: #4fd3dc;
}

.video-channel {
  font-size: 0.85rem;
  color: #888888;
  margin-bottom: 0;
}

/* ===== Footer ===== */

.site-footer {
  background: #2c2c2c;
  color: #cfcfcf;
}

.footer-widgets {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 0;
}

.footer-widgets h3 {
  color: #ffffff;
  font-size: 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-widgets a {
  color: #4fd3dc;
}

.bottombar {
  background: #1c1c1c;
  text-align: center;
  padding: 16px 24px;
  font-size: 0.85rem;
}

/* ===== Responsive ===== */

@media (max-width: 780px) {
  .inner-wrap,
  .content-wrap,
  .footer-widgets {
    padding-left: 24px;
    padding-right: 24px;
  }

  .content-wrap {
    flex-direction: column;
  }

  .sidebar {
    flex-basis: auto;
    max-width: none;
    padding-left: 0;
  }

  .main-content {
    flex-basis: auto;
    padding-right: 0;
    border-right: none;
  }

  .main-header {
    justify-content: center;
    text-align: center;
  }

  .main-nav > ul {
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .carousel-item {
    flex: 0 0 92%;
  }
}

/* Search page */

.search-results {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 25px;
}

.search-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 25px;
  border-bottom: 1px solid #ddd;
}

.search-item h2 {
  order: 2;
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  text-align: center;
}

.search-item h2 a {
  color: #222;
  text-decoration: none;
}

.search-item h2 a:hover {
  color: #00bcd4;
}

.search-item > a {
  order: 1;
  display: block;
}

.search-item img {
  width: 100%;
  max-width: 300px;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
  margin: 0 auto;
}

/* Заголовок результатов */

.main-content > h1 {
  margin-bottom: 25px;
  font-size: 32px;
  line-height: 1.2;
}

/* контейнер */

.content-wrap {
  align-items: flex-start;
}

.main-content {
  padding-right: 30px;
}

/* sidebar */

.sidebar {
  margin-top: 0;
}

.search-content {
  padding: 30px;
}
