html, body, h1, h2{
    margin:0;
    padding:0;
}
html{
    font-size:16px;
}
body {
  font-family: system-ui, sans-serif;
}
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
}
input, button {
    border: none;
    background-color: white;
}

/* search bar, search results */
.search-bar{
    display: flex;
    flex-direction: row;
    align-items: center;
    border: #A2A2A2 2px solid;
    padding-right: 5px;
}

.search-bar input{
    line-height: 25px;
    padding: 0 10px;
    width:250px;
}

/* header */
header {
    display: flex;
    justify-content: space-between;
    padding:25px;
    background-color: white;
    position:sticky;
    top:0;
    z-index: 100;
    box-shadow: 0 1px 5px #0003;
}

header img {
    width: 100%;
}

#icon-wrapper{
    width: 100px;
}
.nav-category p {
    margin: 0;
}

.head-right, .nav, .nav-category {
    display: flex;
}
.nav{
    gap: 30px;
    margin-right: 30px;
    font-size:1.2rem;
}

/* menu */
#menu-icon, #menu{
    display:none;
}

#menu {
  opacity: 0;
}

/* hero */
.hero{
    position: relative;      
    display: block; 
    width:100%;
    height:50vh;
}

.hero-image-tag {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    position: absolute;
    z-index: 1; 
}

.overlay {
    z-index: 2; 
    position: absolute;       
    top: 50%;                 
    left: 50%;                
    transform: translate(-50%, -50%); 
    background-color: rgba(0,0,0,0.5); 
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 90%;          
}


/* main */
main{
    background-color: #F0F0F0;
    padding: 30px 0;
}

section.new, section.categories{
    width: 80%;
    margin: 15px auto;
    background-color: white;
    padding: 40px;
}

section.new h2, section.categories h2{
    margin-bottom:30px;
}


.new-image-container, .category-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
}
.new-image-container img{
    width:100%; 
    height:100%;
    object-fit:cover;
}

.category{
    width:100%;
    height:170px;
    background-color: #A6A6A6;
    object-fit: cover;
}

.category-block {
  position:relative;
}

.category-title {
    position:absolute;
    font-size: 1.5rem;
    background-color: rgba(0,0,0,0.5);
    color: white;
    padding: 10px;
    height:70px;
    line-height:70px;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    width:max-content;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}


@media (max-width: 767px) { 
    .head-right{
        display:none; /* Hides desktop navigation */
    }
    header {
        align-items: center;
    }
    #menu-icon{
        display:block; /* Shows mobile menu icon */
        font-size: 25px;
    }

    header + .search-results.active{
        display: none !important;
    }
    .search-results{
        top: 54px;   
    }
}

@media (max-width: 480px) { 
    h1{
        font-size:1.6rem;
    }
    h2{
        font-size: 1.5rem;
    }
    
    header {
        align-items: center;
    }
    .overlay {
        width: 80%;
    }
   
}

@media (min-width: 481px) and (max-width: 767px) { 
    h1{
        font-size:1.7rem;
    }
    h2{
        font-size: 1.6rem;
    }
    .overlay {
        width: 80%;
    }
}

@media (min-width: 768px) and (max-width: 1023px) { 
    h1{
        font-size:1.8rem;
    }
    h2{
        font-size: 1.7rem;
    }
    .overlay {
        width: 60%;
    }
}

@media (min-width: 1024px) and (max-width: 1279px) { 
    h1{
        font-size:1.8rem;
    }
    h2{
        font-size: 1.7rem;
    }
    .overlay {
        width: 45%;
    }
}