@import url('https://fonts.googleapis.com/css2?family=Bitcount+Prop+Single+Ink:wght@100..900&family=Bodoni+Moda:ital,opsz,wght@0,6..96,400..900;1,6..96,400..900&family=Oswald:wght@200..700&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap');

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

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    color: var(--primary-text-color);
}

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

p {
    font-family: "Roboto", sans-serif;
    color: var(--secondary-text-color);
    line-height: 1.4rem;
}

h3 {
    font-family: "Roboto", sans-serif;
    font-weight: 500;
}

h6 {
    font-family: "Roboto", sans-serif;
    font-weight: 600;
}

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 {
    height: 60px;
    width: 60px;
    object-fit: cover;
}

.mobile-menu-logo img {
    display: none;
}

.nav-menu-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

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

.hover-link {
    cursor: pointer;
}

.hover-link:hover {
    color: var(--secondary-text-color);
}

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

.nav-items.active {
    color: var(--accent-color);
}

.search-bar {
    gap: 10px;
}

.news-input {
    height: 100%;
    width: 200px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 2px solid #bbd0e2;
    font-family: "Roboto", sans-serif;
}

.news-input:focus {
    outline: none;
    border: 2px solid #2294ed;
}

.search-button {
    background-color: var(--accent-color);
    color: white;
    font-family: "Roboto", sans-serif;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    padding: 8px 24px;
    cursor: pointer;
}

.search-button:hover {
    background-color: var(--accent-color-dark);
}

.hamburger {
    display: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--primary-text-color);
    z-index: 200; 
}

main {
    margin-top: 100px;
    padding-block: 20px;
}

.card-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 .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;
    font-size: 12px;
}

/* Media Queries */
@media screen and (max-width: 1180px) {
    .container {
        padding-inline: 20px;
    }
}

@media screen and (max-width: 992px) {
    .card-container {
        justify-content: center;
        gap: 20px;
    }
    
    .card {
        width: calc(50% - 20px); 
    }
}

@media screen and (max-width: 768px) {
    
    .hamburger {
        display: block;
    }

    .nav-menu-container {
        position: fixed;
        top: 0;
        left: -100%;
        width: 75%;
        height: 100vh;
        background-color: #f3faff;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
        flex-direction: column;
        align-items: flex-start;
        padding: 30px 20px;
        transition: left 0.35s ease-in-out;
        z-index: 100;
    }

    .nav-menu-container.active {
        left: 0;
    }

    .mobile-menu-logo img {
        display: block;
        width: 50px;
        margin-bottom: 20px;
    }

    .nav-links ul {
        flex-direction: column;
        width: 100%;
        gap: 18px;
        align-items: flex-start;
    }

    .nav-links ul li {
        font-size: 1rem;
        font-weight: 500;
    }

    .search-bar {
        flex-direction: column;
        width: 100%;
        margin-top: 25px;
        align-items: flex-start;
        gap: 12px;
    }

    .news-input {
        width: 100%;
        font-size: 0.95rem;
    }

    .search-button {
        width: 100%;
        font-size: 0.95rem;
        font-weight: 500;
    }

    .card {
        width: 100%;
        max-width: 450px;
    }

    .card-content {
        padding: 14px;
    }

    /* typography */
    body {
        font-size: 15px;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    h1 {
        font-size: 1.6rem;
        font-weight: 600;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.4rem;
        font-weight: 600;
        line-height: 1.3;
    }

    h3 {
        font-size: 1.15rem;
        font-weight: 600;
        line-height: 1.4;
        margin-bottom: 8px;
    }

    h6 {
        font-size: 0.85rem;
        font-weight: 600;
        letter-spacing: 0.5px;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.5rem;
        font-weight: 400;
    }

    .news-source {
        font-size: 0.75rem;
        font-weight: 500;
        opacity: 0.8;
    }
}