@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500&family=Roboto:wght@500&display=swap");

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

:root {
    --primary-text-color: #183b56;
    --secondary-text-color: #577592;
    --accent-color: #2294ed;
    --accent-color-dark: #1d69a3;
}

body {
    font-family: "Poppins", sans-serif;
    color: var(--primary-text-color);
}

p {
    font-family: "Roboto", sans-serif;
    color: var(--secondary-text-color);
    line-height: 1.4rem;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

.flex {
    display: flex;
    align-items: center;
}

.container {
    max-width: 1180px;
    margin-inline: auto;
    overflow: hidden;
}

nav {
    background-color: #f3faff;
    box-shadow: 0 0 4px #bbd0e2;
    position: fixed;
    top: 0;
    z-index: 99;
    left: 0;
    right: 0;
}

.main-nav {
    justify-content: space-between;
    padding-block: 8px;
}

.company-logo img {
    width: 120px;
}

.nav-links ul {
    gap: 16px;
}

.hover-link {
    cursor: pointer;
}

.hover-link:hover {
    color: var(--secondary-text-color);
}

.hover-link:active {
    color: red;
}

.nav-item.active {
    color: var(--accent-color);
}

.search-bar {
    height: 32px;
    gap: 8px;
}

.news-input {
    width: 200px;
    height: 100%;
    padding-inline: 12px;
    border-radius: 4px;
    border: 2px solid #bbd0e2;
    font-family: "Roboto", sans-serif;
}

.search-button {
    background-color: var(--accent-color);
    color: white;
    padding: 8px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Roboto", sans-serif;
}

.search-button:hover {
    background-color: var(--accent-color-dark);
}




@media only screen and (max-width: 768px) {
    .main-nav {
      flex-direction: column;
      align-items: center;
    }
  
    .nav-links ul {
      flex-direction: column;
      text-align: center;
    }
  
    .search-bar {
      flex-direction: column;
      align-items: center;
      margin-top: 10px;
    }
  
    .search-button {
      margin-top: 10px;
    }
  }
  
  @media only screen and (max-width: 480px) {
    .company-logo h2 {
      font-size: 24px;
    }
  
    .nav-links ul {
      padding-inline: 0;
    }
  
    .nav-item {
      margin-inline: 0;
      margin-block: 8px;
    }
  
    .news-input {
      width: 140px;
    }
  
    .search-button {
      padding: 6px 16px;
    }
  }
  /*------  */


  .hamburger-menu {
    display: none; /* Initially hide the hamburger menu on larger screens */
    background: none;
    border: none;
    cursor: pointer;
  }
  
  .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px auto;
    transition: all 0.3s ease;
  }
  
  /* Rotate bars to form an X when menu is active */
  .hamburger-menu.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 5px);
  }
  
  .hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .hamburger-menu.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -5px);
  }
  
  /* Show hamburger menu on smaller screens */
  @media only screen and (max-width: 768px) {
    .hamburger-menu {
      display: block;
    }
  
    .main-nav {
      display: none; /* Initially hide the main navigation on smaller screens */
      flex-direction: column;
      align-items: center;
      background-color: #f3faff;
      padding: 50px;
      position: absolute;
      top: 27px;
      left: 0;
      right: 0;
      box-shadow: 0 0 4px #bbd0e2;
    }
  
    .main-nav.active {
      display: flex;
    }
  
    .nav-links ul {
      flex-direction: column;
      text-align: center;
      margin-top: 10px;
    }
  
    .nav-item {
      margin-bottom: 10px;
    }
  }
  



/* --- */

main {
    padding-block: 20px;
    margin-top: 80px;
}

.cards-container {
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 20px;
    align-items: start;
}

.card {
    width: 360px;
    min-height: 400px;
    box-shadow: 0 0 4px #d4ecff;
    border-radius: 4px;
    cursor: pointer;
    background-color: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 1px 1px 8px #d4ecff;
    background-color: #f9fdff;
    transform: translateY(-2px);
}

.card-header img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 12px;
}

.news-source {
    margin-block: 12px;
}

