@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500&family=Roboto:wght@500&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Anta&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

/* *******************Root************************ */
:root {
    --primary-text-color: #183b56;
    --secondary-text-color: #577592;
    --accent-color: #2294ed;
    --accent-color-dark: #1d69a3;
}

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

body {
    font-family: "Poppins", sans-serif;
    color: var(--primary-text-color);
}

p {
    font-family: "Roboto", sans-serif;
    color: #577592;
    line-height: 1.4rem;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
}

.flex {
    display: flex;
    align-items: center;
}

.container {
    max-width: 1200px;
    margin-inline: auto;
    overflow: hidden;
}


/* **********************Navbar*********************** */
nav {
    box-shadow: 0 0 10px grey;
    padding: 15px 0px;
}

.main-nav {
    justify-content: space-between;
}

.logo{
    font-family: "Anta", sans-serif;
    color: black;
    font-weight: 600;
    font-size: 25px;
}

.logo span{
    color: royalblue;
}

.nav-links ul {
    gap: 20px;
}

.hover-link {
    cursor: pointer;
}

.hover-link:hover {
    color: royalblue;
    text-decoration: underline;
    transition: all ease-in-out 0.3s;
}

.hover-link:active {
    color: royalblue;
}

.nav-item.active {
    color: royalblue;
}


/* ************************MainContainer******************** */
main h2{
    text-align: center;
    margin: 20px 0px;
    padding: 20px 10px;
}

.search-bar {
    height: 32px;
    justify-content: center;
    margin: 30px 0px;
    gap: 10px;
}

.news-input {
    width: 60%;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    border: none;
    font-family: "Roboto", sans-serif;
    box-shadow: 0px 0px 5px grey;
}

.search-button {
    background-color: royalblue;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-family: "Roboto", sans-serif;
}

.search-button:hover {
    background-color: var(--accent-color-dark);
    transition: all ease-in-out 0.3s;
}

.cards-container {
    justify-content: space-around;
    flex-wrap: wrap;
    row-gap: 20px;
    align-items: start;
    padding: 20px 0px;
}

.card {
    width: 360px;
    min-height: 400px;
    box-shadow: 0 0 5px lightskyblue;
    border-radius: 5px;
    cursor: pointer;
    background-color: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0px 0px 10px grey;
    background-color: #f9fdff;
    transform: scale(1.02);
}

.card-header img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 12px;
}

.news-source {
    margin-block: 12px;
}


/***********************Footer***********************/
footer{
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: baseline;
    padding: 20px 0px;
    box-shadow: 0px 0px 5px grey;
}

footer h3, h4{
    font-family: "Noto Sans", sans-serif;
    color: royalblue;
}

footer p{
    color: rgba(0, 0, 0, 0.9);
    font-family: "Noto Sans", sans-serif;
    margin: 5px 0px;
    padding: 0;
}

footer ul li a{
    color: rgba(0, 0, 0, 0.9);
    font-family: "Noto Sans", sans-serif;
}

footer ul li{
    margin: 5px 0px;
}

footer ul li a:hover{
    text-decoration: underline;
}

/* *********************Responsive******************** */
@media screen and (max-width: 750px){
    footer{
        flex-wrap: wrap;
    }
    footer ul{
        margin: 0px 10px;
    }
}

@media screen and (max-width: 500px){
    .main-nav{
        flex-direction: column;
    }
    .main-nav ul{
        flex-direction: row;
    }
    nav .logo{
        margin-bottom: 10px;
    }
    .container a div{
        width: 100%;
        margin: 30px 0px;
    }
    footer{
        flex-direction: column;
        align-items: center;
    }
    footer ul{
        margin: 0;
        padding: 0;
    }
    footer div, ul{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin: 10px 0px;
    }
}