/* blog.html CSS */

main a { 
    text-decoration: underline;
    color: #9C8B7E;
}

main a:hover {
    color: #555;
}

h1 {
    text-align: center;
}

.category-links {
    list-style-type: none;
    padding: 0px;
    margin: 0px;
    text-align: center;
}

.category-links li {
    display: inline-block; /* makes list items appear inline */
    margin: 0 10px;
}

.category-links a {
    color: white;
    background-color: #555;
    padding: 6px 10px;
}

.category-links a:hover {
    color: white;
    background-color: #9C8B7E;
}

/* search bar in blog.html */
.search {
    margin: 0 auto;
    width: 60%;
}

#search-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
}

#search-input::placeholder {
    color: #555;
}

#search-results div {
    margin: 6px 0;
}

mark {
  background: #9C8B7E;
  padding: 0 2px;
}

.posts {
    display: grid;
    margin: auto;
    width: 60%;
}

.posts h2 {
    margin-bottom: 0px; /* removes default margin-bottom of h2 element */
}

.posts p:first-of-type {
    margin-top: 10px; /* lowers margin-top of first p (title, not date) from 16 to 10px for closer spacing */
}

.tags {
    display: inline-block;
    text-decoration: underline;
    margin: 0;
}

.tags a {
    color: white;
    background-color: #555;
    padding: 6px 10px;
}

.tags a:hover {
    color: white;
    background-color: #9C8B7E;
}

@media screen and (max-width: 768px) { /* mobile devices & tablets - screen width <= 768px */
    .search {
        width: 90%;
    }
    
    .posts {
        width: 90%;
    }
}

@media screen and (max-width: 480px) { /* mobile phones only - no tablets */
    .category-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px; /* consistent spacing between items */
        padding: 0;
        margin: 0 auto;
    }

    .category-links li {
        display: inline-flex;
        margin: 0; /* use gap instead */
    }

    .category-links a {
        color: white;
        background-color: #555;
        padding: 6px 10px;
        text-decoration: none;
    }

    .category-links a:hover {
        background-color: #9C8B7E;
    }
}
