@import url('https://fonts.googleapis.com/css2?family=Dosis&family=PT+Mono&family=Slabo+27px&display=swap');

/*CSS Variables*/
:root {
    --brown: #261617;
    --forest: #002500;
    --light-grey: #DCE0D9;
    --dark-grey: #13171C;
    --green: #52E620;
    --brand-font: "PT mono", monospace;
    --heading-font: "Slabo 27px", serif;
    --body-font: "Dosis", sans-serif;
}

/*General styles*/
.login-state {
    text-align: center;
    padding: 10px;
    font-family: var(--brand-font);
    color: var(--light-grey);
    background-color: rgba(0, 37, 0, 0.4);
}

body {
    font-family: var(--body-font);
    background-color: var(--light-grey);
    color: var(--dark-grey);
    min-height: 100vh;
}

main {
   margin-top: 66px;
   margin-bottom: 69px;
   font-size: large;
}

h1 {
    font-family: var(--brand-font);
}

h2, h3 {
    font-family: var(--heading-font);
}

.pagination {
    max-width: fit-content;
    margin-bottom: 50px;
}

.alert {
    margin-bottom: 0;
    border-radius: 0;
}

/*Helper classes*/
.link {
    text-decoration: none;
    color: inherit;
    font-weight: bold;
}

.plain {
    text-decoration: none;
    color: inherit;
}

.hidden {
    display: none;
}

.small {
    font-size: 14px;
}

.red {
    color: red;
}

.green {
    color: var(--green);
}

.green-hover:hover {
    color: var(--green);
}

.bold-hover:hover {
    font-weight: bold;
}

/*Navigation Menu*/
.navbar {
    background-color: var(--brown);
    color: var(--light-grey);
    font-family: var(--brand-font);
}

.navbar-brand {
    font-family: var(--brand-font);
    color: var(--light-grey);
}

.navbar-brand:hover {
    color: var(--green);
}

#logo {
    max-height: 40px;
}

.nav-link {
    color: var(--light-grey);
}

.nav-link:hover {
    color: var(--green);
}

.active {
    border-bottom: 1px solid var(--green);
}

.user-auth-desktop{
    display: none;
}

.user-auth-footer {
    display: flex;
    list-style: none;
    text-decoration: none;
}

.auth-item {
    margin: 4px 8px;
}

#admin-link {
    color: var(--green);
}

#admin-link:hover {
    color: var(--light-grey);
}

/*Homepage*/
.home {
    background: url(../images/home-banner.webp) no-repeat center center / cover;
    display: flex;
    flex-direction: column;
}

.diggit-wordmark {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}

.diggit-wordmark > img {
    max-height: 60px;
}

.diggit-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.diggit-name {
    color: var(--brown);
    margin: 0;
}

.diggit-tagline {
    font-size: 16px;
    color: var(--dark-grey);
}

#home-backdrop {
    min-width: 100%;
    flex-grow: 1;
    background-color: rgba(220, 224, 217, 0.5);
}

#home-banner {
    background-color: rgba(220, 224, 217, 0.7);
}

.banner-overlay {
    margin: 10px 0;
    padding-top: 10px;
}

.highlight-card {
    max-width: 90%;
    background-color: rgba(220, 224, 217, 0.9);
    text-decoration: none;
    color: var(--forest);
    border: 1px solid var(--brown);
    border-radius: 5px;
    margin: auto;
}

/*Forum Page*/
#forum-backdrop .card {
    background-color: rgba(0, 37, 0, 0.7);
    color: var(--light-grey)
}

#forum-backdrop .card-footer {
    color: var(--light-grey);
}

.page-title {
    text-align: center;
    padding-top: 10px;
}

#post-form, #comment-form {
    border: 1px solid var(--brown);
    border-radius: 5px;
    max-width: 95%;
    background-color: var(--light-grey);
}

textarea {
    min-width: 90%;
    max-width: 100%;
    resize: vertical;
}

textarea:focus-visible {
        outline: var(--brown) auto 1px;
}

#categories {
    column-count: 2;
}

#post-delete, #comment-delete {
    border: 1px solid var(--brown);
    border-radius: 5px;
    max-width: 95%;
    background-color: var(--light-grey);
}

/*Blog Cards*/
.card {
    color: var(--dark-grey);
    background-color: #f2f4f1;
    border-radius: 5px;
    border-color: var(--brown);
}

.card-title {
    font-family: var(--heading-font);
    padding: 1rem 1rem 0;
}

.post-image, .post-image-feature {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

.post-image img, .post-image-feature img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-text {
    font-family: var(--body-font);
    font-size: 1.1rem;
}

.card-footer, #details {
    color: rgba(0, 37, 0, 0.7);
    font-family: var(--body-font);
    font-size: 0.9rem;
}

.card hr {
    margin: 0.5rem 0;
    color: var(--brown);
}

.date {
    display: inline-block; 
}

.category-labels span {
    color: var(--dark-grey);
    border: 1px solid var(--brown);
    border-radius: 5px;
}

/*Single post view*/
.single-post {
    max-width: 90%;
    margin: 10px auto 40px;
    font-family: inherit;
    padding-bottom: 10px;
}

#post-title{
    font-family: var(--heading-font);
}

.single-post h3 {
    font-size: 1.2rem;
}

#comment-form, #comment-delete {
    background-color: #f2f4f1;
    
}

#counter {
    color: #353D47;
}

.comment-body p,
.reply-body p {
    margin-bottom: 0;
}

.comment-likes {
    display: inline;
}

.likes {
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
}

#post-content {
    font-family: var(--body-font);
}

.each-reply {
    margin-left: 2rem;
}

.table *, .table-bordered *{
    background-color: var(--light-grey) !important; 
}

.table {
    border-collapse: collapse;
    border: 1px solid var(--brown);
}

blockquote {
    margin-left: 20px;
    border-left: 4px solid var(--forest);
    opacity: 80%;
    padding-left: 5px;
}

blockquote > span {
    font-size: 1rem !important;
}

/*Contact Page*/
.contact {
    background: url(../images/contact.webp) no-repeat center center / cover;
}

.contact-overlay {
    background-color: rgba(220, 224, 217, 0.8);
    flex-grow: 1;
    min-width: 100%;
}

#contact-form {
    max-width: 320px;
}

#contact-form input {
    width: 292px;
}

/*404 page*/
.lost {
    background: url(../images/lost-error.webp) no-repeat center center / cover ;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#error-overlay {
    background-color: rgba(220, 224, 217, 0.5);
    flex-grow: 1;
    padding-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.error-card {
    max-width: 95%;
}

/*Signup Form*/
#signup-backdrop {
    background: url(../images/signup.webp) no-repeat center center / cover ;
    width: 100%;
    flex-grow: 1;
    display: flex;
}

.overlay {
    background-color: rgba(220, 224, 217, 0.5);
    width: 100%;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#form-card {
    max-width: 600px;
    margin: auto;
    border-radius: 5px;
}

.form-field > input {
    min-width: 90%;
}

#terms {
    max-height: 200px;
    overflow-y: auto;
    background-color: rgba(255, 255, 255, 0.9);
    border: 0.5px solid var(--brown);
    padding: 5px;
    margin: 3px 10px;
    border-radius: 5px;
}

#terms h2 {
    font-size: 18px;
}

#terms h3 {
    font-size: 16px;
}

#terms p, #terms li {
    font-size: 14px;
}

.form-check-input:checked, .form-check-input:checked:focus {
    background-color: var(--forest);
    border-color: var(--forest);
}

.form-check-input {
    border-color: var(--forest);
}

.form-check-input:focus {
    border-color: var(--forest);
    outline: 0;
    box-shadow: none;
    background-color: rgba(0, 37, 0, 0.2);
}

/*Copied from Dev Tools to alter the toggleswitch appearance*/
.form-switch .form-check-input:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:focus {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/*Login Form*/
.login {
    background: url(../images/login.webp) no-repeat center center / cover ;;
}

.body-container {
    background-color: rgba(220, 224, 217, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.form-card {
    max-width: 95%;
}

/*Logout Form*/
.logout {
    background: url(../images/login.webp) no-repeat center center / cover;
}

/*Footer*/
footer {
    min-height: 40px;
    background-color: var(--brown);
    color: var(--light-grey);
    font-family: var(--brand-font);
}

footer ul {
    margin-bottom: 0;
}

footer > p {
    text-align: end;
}

/*Small screens 576px an up*/
@media screen and (min-width: 576px) {
    main {
        padding: 0;
    }

    .login-state { 
        text-align: end;
    }

    .page-title {
        text-align: start;
    }

    .post-image-feature {
        max-height: 350px;
    }

    .highlight-card {
        max-width: 350px;
    }

}

/*Medium screens and up*/
@media screen and (min-width: 768px) {
    main {
        margin-bottom: 40px;
    }

    .card, .page-title {
        max-width: 700px;
        margin: 0 auto 0;
    }

    .user-auth-desktop {
        display: flex;
    }

    .user-auth-footer {
        display: none;
    }

    #highlight-row {
        height: 175px;
    }

    .highlight-card {
        height: 100%;
    }

    #highlight-row {
        margin-top: 10%;
    }

    #comment-form, #comment-delete {
        max-width: 500px;
        padding: 20px;
    }

    #contact-form {
        min-width: 500px;
    }

    #contact-form textarea {
        width: 100%;
    }

    footer > p {
        margin-top: 5px;
    }
}

/*Large screens and up*/
@media screen and (min-width: 992px) {
    .highlight-card {
        min-height: 142.23px;
    }

    .home-banner {
        width: 100%;
    }

    .banner-overlay, #highlight-row {
        max-width: 70%;
        margin-left: auto;
        margin-right: auto;
    }

    #contact-text {
        max-width: 70%;
        margin-left: auto;
        margin-right: auto;
    }

}

/*Laptops 1024px and up */
@media screen and (min-width: 1024px) {
    .highlight-card {
        min-height: fit-content;
    }
    
}

/*XL screens and up*/
@media screen and (min-width: 1200px) {
    #terms {
        max-height: 260px;
    }

    .post-image-feature {
        max-width: 80%;
        max-height: 550px;
        margin: auto;
    }

}
