@import url('https://fonts.googleapis.com/css2?family=Lobster+Two:wght@700&family=Poppins:wght@500&display=swap');

body {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-gap: 32px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    background-color: #FAFAFA;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
    padding: 0;
    line-height: round(168%);
    color: #2E2E2E;
}

p {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

header {
    display: grid;
    grid-template-columns: inherit;
    grid-gap: inherit;
    grid-column: 2 / span 10;
    padding: 32px 0 16px;
    align-items: center;
}

header h1 {
    grid-column: 1 / span 3;
    width: fit-content;
    font-family: 'Lobster Two';
    font-weight: 700;
    font-size: 25px;
}

header h1 > span {
    font-size: 20px;
}

header form {
    grid-column: 4 / span 6;
    display: grid;
    grid-template-columns: inherit;
    grid-gap: inherit;
    justify-items: center;
    border-radius: 32px;
}

header form input {
    grid-column: 1 / span 11;
    width: 100%;
    background: #F0f0f0;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 32px;
    border: none;
    font-weight: 500;
    overflow: hidden;
}

header form input::placeholder {
    font-weight: 500 !important;
}

header form input:focus {
    outline: 2px solid #939393;
}

header form button {
    grid-column: 12 / span 2;
    background: #2E2E2E;
    color: #FAFAFA;
    padding: 12px 16px;
    border-radius: 32px;
    border: none;
    font-weight: 500;
    cursor: pointer;
}

h2 {
    font-family: 'Lobster Two';
    font-weight: 700;
    font-size: 30px;
}

.filter-buttons {
    grid-column: 2 / span 10;
    display: flex;
    column-gap: 16px;
    align-items: center;
    font-weight: 500;
    font-size: 16px;
}

.filter-buttons h3,
.filter-buttons a,
.filter-buttons a:visited {
    font-size: 16px;
    color: #2E2E2E;
    text-decoration: none;
}

.filter-buttons a:not(.selected) {
    color: #939393;
}

.fantastic-beasts {
    grid-column: 2 / span 10;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 32px;
    margin-bottom: 32px;
}

.beast-card {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
}

.beast-name-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.beast-classification {
    padding: 8px 16px;
    border-radius: 32px;
    color: #FAFAFA;
}

.classification-x,
.classification-xx {
    background-color: #4FB477;
}

.classification-xxx,
.classification-xxxx {
    background-color: #FCA311;
}

.classification-xxxxx {
    background-color: #FE4A49;
}

.beast-description {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #2E2E2E;
}

.beast-card a,
.beast-card a:visited {
    text-decoration: none;
    margin-top: 8px;
    color: #2E2E2E;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
        grid-gap: 16px;
        padding: 0 16px;
    }

    header {
        grid-column: 1;
        grid-template-columns: 1fr;
        grid-gap: 16px;
        padding: 16px 0;
    }

    header h1 {
        grid-column: 1;
        text-align: left;
        font-size: 22px;
    }

    header form {
        grid-column: 1;
        grid-template-columns: 1fr auto;
        grid-gap: 8px;
        width: 100%;
        max-width: 100%;
    }

    header form input {
        grid-column: 1;
        font-size: 14px;
        padding: 10px 14px;
        width: 100%;
        box-sizing: border-box;
    }

    header form button {
        grid-column: 2;
        padding: 10px 14px;
        font-size: 14px;
    }

    .filter-buttons {
        grid-column: 1;
        flex-wrap: wrap;
        row-gap: 8px;
        justify-content: flex-start;
    }

    .fantastic-beasts {
        grid-column: 1;
        grid-template-columns: 1fr;
        grid-gap: 24px;
        margin-bottom: 24px;
        margin-top: 24px;
    }

    .beast-card {
        row-gap: 12px;
    }

    .beast-name-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .beast-classification {
        align-self: center;
        font-size: 12px;
        padding: 6px 12px;
    }

    .beast-card a {
        font-size: 14px;
    }

    h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0 12px;
        grid-gap: 12px;
    }

    header {
        grid-gap: 12px;
        padding: 12px 0;
    }

    header h1 {
        font-size: 20px;
    }

    header h1 > span {
        font-size: 18px;
    }

    .filter-buttons {
        column-gap: 12px;
        row-gap: 6px;
        font-size: 14px;
        justify-content: flex-start;
    }

    .filter-buttons h3,
    .filter-buttons a {
        font-size: 14px;
    }

    .fantastic-beasts {
        grid-gap: 32px;
        margin-bottom: 32px;
        margin-top: 32px;
    }

    .beast-card {
        row-gap: 12px;
    }

    .beast-classification {
        font-size: 11px;
        padding: 4px 10px;
    }

    .beast-card a {
        font-size: 13px;
    }

    h2 {
        font-size: 20px;
    }

    .beast-description {
        -webkit-line-clamp: 3;
        line-clamp: 3;
        font-size: 14px;
    }
}