@import url("https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@500&display=swap");

@import url("https://fonts.googleapis.com/css2?family=Yeseva+One&display=swap");

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Roboto Slab", serif;
  /* background-color: #757573; */
  background-color: #b3b3b1;
}

/* *! Title Section ///////////////// */

.title-section {
  height: 30vh;
  background-size: cover;
  background-image: url(/newspaper-background.jpg);
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.title {
  font-family: "Yeseva One", cursive;
  font-size: 4rem;
}

.title-tag {
  font-size: 2rem;
}

/* *!Nav Section////////////////////////////////////// */

.nav-section {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 1rem;
}

.tabs-container {
  margin-top: 2rem;
  width: 95vw;
}

.tab-btn {
  /* width: 8rem;
  height: 4rem; */
  background: #f3f3f0;
  font-family: "Roboto Slab", serif;
  border-radius: 0 0 1rem 0;
  font-size: 1rem;
  padding: 1.5rem 3.5rem;
  margin-bottom: 0.6rem;
  border: none;
}
.tab-btn:not(:last-child) {
  margin-right: 0.3rem;
}

.tab-btn.active {
  background: #f6916b;
  color: white;
}

.tab-btn:hover {
  background: #f6916b;
  border: none;
  color: white;
  transform: scale(1.1);
}

.back-to-top-container {
  position: fixed;
  right: 15px;
  bottom: 30px;
}

#back-to-top-link {
  text-decoration: none;
  color: white;
}
.back-to-top {
  padding: 0.8rem;
  background: #f6916b;
  border-radius: 50%;
  cursor: pointer;
}

/* !! Search bar///// */

.searchbox-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.searchBox {
  background: #f6916b;
  border-radius: 40px;
  padding: 10px;
  width: 20rem;
}

.searchBox:hover {
  transform: scale(1.02);
}

.searchBox:hover > .searchButton {
  background: #f3f3f0;

  color: #2f3640;
}

.searchInput {
  border: none;
  background: none;
  outline: none;
  margin-left: 1rem;
  color: white;
  font-size: 1rem;
  width: 16rem;
}

@media screen and (max-width: 620px) {
  .searchBox:hover > .searchInput {
    width: 150px;
    padding: 0 6px;
  }
}

/* *!Main container//////////////// */

.main {
}

.main-container {
  padding: 1rem;
}

.trend-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 2rem;
  border-bottom: 2px solid #000;
  margin-bottom: 2rem;
}

.trending {
  font-size: 2.5rem;
  padding-right: 0.3rem;
  margin-bottom: 1rem;
}

.link,
.link:hover,
.link:focus,
.link:active {
  text-decoration: none;
  color: inherit;
}
.newscontainer {
}

.news-box {
  height: 13rem;
  display: flex;
  margin-bottom: 2rem;
  background: #f3f3f0;
  border-radius: 0 0 3.5rem 0;
}

.poster {
  width: 20rem;
  height: 13rem;
  min-width: 20rem;
  /* border-radius: 0.5rem 0 0 0.5rem; */
}

.news-info {
  margin-left: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 0.5rem;
}

.news-title {
  color: #272726;
}

.date {
  color: #f6916b;
}

.overview {
  font-weight: 550;
  color: #334b4a;
}

/* !! Tool tip////////////////////////////// */

.news-title {
  position: relative;
}

.news-title::before,
.news-title::after {
  --scale: 0;
  --arrow-size: 20px;
  --tooltip-color: green;

  position: absolute;
  top: -1rem;
  left: 50%;
  transform: translateX(-50%) translateY(var(--translate-y, 0))
    scale(var(--scale));
  transition: 150ms transform;
  transform-origin: bottom center;
}

.news-title::before {
  --translate-y: calc(-100% - var(--arrow-size));

  content: attr(data-tooltip);
  color: white;
  padding: 0.5rem;
  border-radius: 0.3rem;
  text-align: center;
  width: max-content;
  max-width: 100%;

  background: #f6916b;
}

.news-title:hover::before,
.news-title:hover::after {
  --scale: 1;
}

.news-title::after {
  --translate-y: calc(-1 * var(--arrow-size));

  content: "";
  border: var(--arrow-size) solid transparent;
  border-top-color: #f6916b;
  transform-origin: top center;
}

/* !! loader////////////////////////////// */

.loader-container {
  height: 50vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader {
  border: 16px solid #f3f3f3;
  border-top: 16px solid #333;
  border-radius: 50%;
  width: 120px;
  height: 120px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* !! MEDIA QUERY////////////////////////////// */

/* Extra big screen devices (1200px and above) */
@media only screen and (min-width: 1200px) {
}

/* Big screen devices (889px and above) */
@media only screen and (max-width: 889px) {
  .tab-btn {
    /* padding: 0.5rem 1rem; */
    padding: 1.2rem 3rem;
  }

  .searchBox {
    height: 40px;
    padding: 10px;
    width: 15rem;
  }

  .news-box {
    height: 12rem;
  }

  .poster {
    width: 15rem;
    height: 11rem;
    min-width: 15rem;
    /* border-radius: 0.5rem 0 0 0.5rem; */
  }

  .news-info {
    margin-left: 1rem;
    padding: 0.3rem;
  }
}

/* Medium screen devices (768px and above) */
@media only screen and (max-width: 768px) {
  .title {
    font-size: 3rem;
  }

  .title-tag {
    font-size: 1.4rem;
  }
  .tab-btn {
    /* padding: 0.5rem 1rem; */
    padding: 1rem 2.2rem;
  }

  .trending {
    font-size: 1.5rem;
    padding-right: 0.3rem;
    margin-bottom: 1rem;
  }

  .news-title {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* number of lines to show */
    -webkit-box-orient: vertical;
  }

  .overview {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: clip;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* number of lines to show */
    -webkit-box-orient: vertical;
  }
}

/* Small screen devices (600px and above) */
@media only screen and (max-width: 600px) {
  .main-container {
    padding-top: 0;
    /* margin-top: -1rem; */
  }
  .tabs-container {
    margin-top: 0.5rem;
  }
  .poster {
    width: 8rem;
    height: 6rem;
    min-width: 8rem;
  }

  .tab-btn {
    /* padding: 0.5rem 1rem; */
    padding: 0.8rem 1.7rem;
  }
  .overview {
    /* margin-top: 1rem; */
    margin-left: -8.5rem;
  }
}

/* For extremely small screen devices (595px and below) */

@media only screen and (max-width: 400px) {
  .news-title {
    font-size: 0.9rem;
  }
  .tab-btn {
    /* padding: 0.5rem 1rem; */
    padding: 0.5rem 1rem;
  }
  .overview {
    font-size: 0.77rem;
  }

  .news-box {
    border-radius: 0 0 0.5rem 0;
  }

  .news-info {
    margin-left: 0.5rem;
    padding: 0.2rem;
  }

  .back-to-top {
    padding: 0.5rem;
    font-size: 1.2rem;
  }
}

@media only screen and (max-width: 330px) {
  .news-title {
    font-size: 0.7rem;
  }

  .overview {
    font-size: 0.6rem;
    padding-left: 0.3rem;
  }

  .news-box {
    border-radius: 0 0 0.2rem 0;
  }

  .news-info {
    margin-left: 0.3rem;
    padding: 0.1rem;
  }
}

footer {
  height: 10vh;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -5vh;
}
footer span {
  color: #ffffff;
  font-size: 1.2rem;
  /* font-weight: 500; */
  margin-left: 0.2rem;
  letter-spacing: 0.1rem;
}
