/*--------------------------------------------- CSS Reset --------------------------------------------------------*/

/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* 2. Remove default margin */
* {
    margin: 0;
}

body {
    /* 3. Add accessible line-height */
    line-height: 1.5;
    /* 4. Improve text rendering */
    -webkit-font-smoothing: antialiased;
}

/* 5. Improve media defaults */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input,
button,
textarea,
select {
    font: inherit;
    padding: 0;
}

/* 7. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

/* 8. Improve line wrapping */
p {
    text-wrap: pretty;
}

/*
    9. Create a root stacking context
  */
#root,
#__next {
    isolation: isolate;
}

/*--------------------------------------------- Variables / Utilities ----------------------------------------------------------*/
:root {
    /* Colors */
    --primary-bg-clr: #212838;
    --secondary-bg-clr: #121628;
    --primary-txt-clr: #9fa4af;
    --secondary-txt-clr: #6e7589;
    --tertiary-txt-clr: #373e4f;

    /* Fonts */
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden {
    display: none;
}

/*--------------------------------------------- Typography ---------------------------------------------------------*/
body {
    font-family: "Nunito Sans";
}

/*--------------------------------------------------- Header Section ---------------------------------------------------------------*/
.search {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: url("./header.jpg");
    background-size: cover;
    padding-top: 3rem;
    height: 35vh;
}

.search__wrapper {
    width: 80%;
    max-width: 400px;
}

.search__input-wrapper {
    display: flex;
    align-items: center;
    background: var(--primary-bg-clr);
    padding: 0 0.75rem;
    border-radius: 7px;
}

.search__input-icon svg {
    width: 25px;
    height: 25px;
}

.search__input-icon svg path {
    fill: var(--secondary-txt-clr);
}

.search__input-wrapper form {
    width: 100%;
}

.search__input-wrapper input {
    background: var(--primary-bg-clr);
    font-size: 1.125rem;
    width: 100%;
    border: none;
    padding: 0.75rem;
    color: var(--primary-txt-clr);
    outline: none;
}

.search__title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--secondary-bg-clr);
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 7px;
}

.search__title-wrapper h2 {
    font-size: 1.25rem;
    color: var(--primary-txt-clr);
}

.search__title-wrapper p {
    color: var(--secondary-txt-clr);
}

.search__title-wrapper svg {
    width: 50px;
    height: 50px;
    background: black;
    border-radius: 7px;
}

/*--------------------------------------------------- Results Section --------------------------------------------------------------*/
main {
    background: var(--primary-bg-clr);
}

.results {
    background: var(--primary-bg-clr);
    height: 65vh;
    max-width: 1440px;
    margin: 0 auto;
}

.results__profile-img-wrapper {
    padding: 1rem;
    display: inline-flex;
}

.results__profile-img-wrapper img {
    /* height: 100%; */
    height: auto;
    width: 100%;
    max-width: 200px;
    background: black;
    border-radius: 13px;
}

.results__profile-info {
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.results__profile-info a {
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
}

.results__profile-info a:hover .results__profile-username,
.results__profile-info a:hover .results__profile-name {
    color: white;
}

.results__profile-name {
    color: var(--primary-txt-clr);
}

.results__profile-username {
    color: var(--secondary-txt-clr);
    font-weight: 500;
}

.results__profile-stat-wrapper {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1rem;
    margin-bottom: 2rem;
}

.results__profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--secondary-bg-clr);
    font-size: 1rem;
    border-radius: 8px;
    padding: 0.5rem 0.5rem;
    width: 100%;
}

.results__profile-stat-label {
    color: var(--secondary-txt-clr);
}

.results__profile-stat-value {
    font-size: 0.75rem;
    color: var(--primary-txt-clr);
    font-weight: bold;
}

/*--------------------------------------------------- Product Cards -------------------------------------------------------------*/
.results__repositories {
    display: grid;
    gap: 1rem;
    padding: 0 1rem 2rem 1rem;
}

.results__repository-card {
    background: #121628;
    background: linear-gradient(95deg, #111729 3%, #1d1b48 99.61%);
    border-radius: 7px;
    padding: 0.75rem 1rem;
    max-width: 500px;
}

.results__repository-card a {
    display: inline-flex;
    text-decoration: none;
    cursor: pointer;
}

.results__repository-card a:hover .results__repository-name {
    color: white;
}

.results__repository-name {
    color: var(--primary-txt-clr);
    margin-bottom: 7px;
}

.results__repository-description {
    color: var(--secondary-txt-clr);
    margin-bottom: 15px;
}

.results__repository-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results__repository-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--secondary-txt-clr);
    padding: 0.25rem;
}

.results__repository-stat svg {
    width: 18px;
    height: 18px;
}

.results__repository-stat svg path {
    stroke: var(--secondary-txt-clr);
    stroke-width: 2.5px;
}

.results__view-all-container {
    text-align: center;
    padding: 0 0 4rem 0;
}

.results__view-all-container.hidden {
    display: none;
}

.results__view-all-container a {
    color: var(--primary-txt-clr);
    text-decoration: none;
    cursor: pointer;
}

.results__view-all-container a:hover {
    text-decoration: underline;
}

/*--------------------------------------------------- Media Queries -------------------------------------------------------------*/
/* 768 */
@media (width >= 768px) {
    /* Search Section */
    .search__wrapper {
        max-width: 450px;
    }

    /* Results Section */
    .results {
        padding: 0 6rem;
    }

    .results__profile-stats {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "top-left top-right"
            "bottom bottom";
        grid-row-gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .results__profile-img-wrapper {
        grid-area: top-left;
        padding: 0;
    }

    .results__profile-img-wrapper img {
        height: 120px;
        width: 120px;
        border: 6px solid var(--primary-bg-clr);
        margin-top: -40px;
    }

    .results__profile-info {
        grid-area: bottom;
        margin-bottom: 0;
        padding: 0;
    }

    .results__profile-stat-wrapper {
        grid-area: top-right;
        align-items: center;
        justify-content: start;
        gap: 1.25rem;
        margin-bottom: 0;
        padding: 0 0 0 2rem;
    }

    .results__profile-stat {
        flex-direction: row;
        width: auto;
        padding: 0.5rem 1rem;
    }

    .results__profile-stat-label {
        font-size: 0.875rem;
        border-right: 1px solid var(--secondary-txt-clr);
        padding-right: 0.5rem;
    }

    .results__profile-stat-value {
        font-size: 0.875rem;
        padding-left: 0.5rem;
    }

    .results__repositories {
        grid-template-columns: repeat(auto-fit, 450px);
    }

    /* .results__repository-card {
        max-width: 400px;
    } */
}

/* @media (width >= 1200px) {
    .search__wrapper {
        max-width: 40%;
    }
} */
