/* ============== Base Style ============== */

body{
	background-color:rgb(255, 248, 232);
    margin: 0;
}

/* Total width equal to actual width */
*{
    box-sizing: border-box;
}

/* ============== Navigation Bar ============== */
/* From: https://www.w3schools.com/css/css_navbar.asp */
/* From: https://www.w3schools.com/css/css_dropdowns.asp */
/* From: https://www.w3schools.com/css/css_navbar_horizontal.asp */
/* From: https://stackoverflow.com/questions/77718681/header-with-a-logo-and-a-nav-bar-items-in-one-line */

.nav-bar {
    display: flex;
    /* Space items apart, logo left, menu right  */
    justify-content: space-between; 
    align-items: center;

    background: rgb(255, 206, 224);
    border-end-start-radius: 1.875rem;
    border-bottom-right-radius: 1.875rem;

    padding: 0.5rem 1rem;   
    margin-bottom: 3rem;  
}


/*(1) Logo including image and title*/
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    /* Keep logo text on single line  */
    min-width: max-content;
}

.nav-logo img {
    width: 4rem; 
    height: 4rem;
}

/*(2) Menu Icon including search bar, home, and contact*/
.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Search bar */
/* From: https://www.w3schools.com/howto/howto_css_searchbar.asp */
/* From: https://codepen.io/suhail369/pen/jOwEjQW */
/* From: https://www.sliderrevolution.com/resources/css-search-box/ */
.search-icon,
.nav-menu a{
    background: rgba(255, 255, 255, 0.7);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Search Icon */
.search-icon {
    font-size: 1.2rem;
    color: #333;
}

/* === Search box ===*/
/* Default Hidden  */
.search-box {
    width: 0;
    opacity: 0;

    /* Make the trasition smooth  */
    /* From: https://www.w3schools.com/css/css3_transitions.asp */
    transition: all 0.4s ease;
    display:flex;
    align-items: center;
    position: relative;
}

/* Display search box when focus */
.search-box:focus-within {
    width: 7rem;
    opacity: 1;
}

/* Search input */
.search-box input {
    width: 100%;
    padding: 0.5rem 0.5rem;
    border: 2px solid #ddd;
    border-radius: 25px;
    /* Space between CMC PET and search box */
    margin-left: 0.5rem;
}

/* Dropdown Menu */
.search-dropdown{
    position: absolute;
    top: 100%;
    left: 0; 
    width: 100%; 
    background: white; 
    border: 1px solid #ddd; 
    border-radius: 1rem; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);  
    margin-top: 0.1rem; 
    margin-left: 0.5rem;

    /* Overwrite the line-height */
    line-height: 1rem;

    /* Default hidden */
    display: none;
}

.search-dropdown a {
    padding: 0.75rem 1rem;
    display: block;
    color: #333;
    border-bottom: 1px solid #c0c0c0;

    /* Overwrite parent style */
    background: transparent;
    border-radius: 0rem; 
    width: 100%;
}

/* Display dropdown menu when focus */
.search-box:focus-within .search-dropdown {
    display: block; 
}

/* Hidden checkbox for toggle  */
#search-toggle {
    display: none;
}

/* Display search box when checked box is checked*/
/* From: https://www.w3schools.com/cssref/css_selectors.php */
/* From: https://www.w3schools.com/cssref/sel_checked.php */
#search-toggle:checked ~ .search-box {
    width: 7rem;
    opacity: 1;
}

/* Hide other icons in mobile layout */
#search-toggle:checked ~ .other-icons{
    display: none;
}


/* === Cover Part === */
.cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 0.5rem;
    text-align: center;
}

.cover img{
    width: 90vw;
    max-width: 23rem;
    height: auto;
}

/* === Pet Categories === */ 
.categories {
    background-color: rgb( 255, 206, 224);
    text-align: center;
    padding: 1rem 1rem 2rem 1rem;
    border-top-left-radius: 2.5rem;
    border-top-right-radius: 2.5rem;

    /* For the decoration */
    position: relative;
}

/* Decoration bows  */
/* From: https://www.w3schools.com/css/css_pseudo_elements.asp  */
/* From: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/::before */
/* From: https://www.w3schools.com/cssref/pr_gen_content.php */
/* From: https://developer.mozilla.org/zh-CN/docs/Web/CSS/Reference/Properties/content */
/* Pseudo-Elements to style a specific part of an element  */
.categories::before {
    /* Create an empty pseudo element content*/
    content: "";
    position: absolute;
    top: 2rem;  
    left: 2rem; 
    width: 5rem; 
    height: 5rem;
    background-image: url('../icons/bows.png');  
    /* Show whole image */
    background-size: contain;
    /* Only display once  */
    background-repeat: no-repeat;
} 

.categories::after {
    content: "";
    position: absolute;
    top: 2rem; 
    right: 2rem; 
    width: 5rem; 
    height: 5rem;
    background-image: url('../icons/bows.png');
    background-size: contain;
    background-repeat: no-repeat;
    
    /* Flip the image horizontally  */
    transform: scaleX(-1);  
}

/* ===== Category button ===== */
.categories-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;                   
}

.categories-buttons li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    margin: auto;
}

.categories-buttons button {
    width: 25vw;
    height: 25vw;
    max-width: 15rem;
    max-height: 15rem;
    border-radius: 50%;
    border: 5px solid rgb(255, 248, 232);
    background-color: rgb(255, 248, 232);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.categories-buttons button img {
    width: 2.5rem;
    height: 2.5rem;
}

/* ===== Pet Categories: Cats / Dogs / Rodents ===== */
.cream-bg{
    background-color: rgb(255, 248, 232);
    border-top-left-radius: 2.5rem;
    border-top-right-radius: 2.5rem;
    padding: 1rem;
    margin-top: 2rem;   
}

.categories-cats,
.categories-dogs,
.categories-rodents {
    text-align: center;
    padding-bottom: 2.5rem;
}

/* === Pet preference guide === */
.guide {               
    padding: 2rem;                 
    text-align: center;
}

.guide li{
    margin-bottom: 3rem;
}

.guide img{
    width: 5rem; 
    height: 5rem;
    margin-bottom: -2rem ;
}

/* === Footer === */ 
/* From: https://www.w3schools.com/tags/tag_footer.asp */
/* From: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/footer */
footer{
    background-color: RGB(156, 216, 191);
    text-align: center;
    /* Space above CMC PET & bottom */
    padding-top: 2rem;
    padding-bottom: 3rem;
}

footer h2{
    margin: 2rem 2rem 1.5rem 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #DF4488;
}

/* Footer About */
.foot-about,
.info,
.subscribe,
.author {
    margin-bottom: 4rem;
}

footer li {
    margin: 0.3rem 0;
}

/* == Subcribe == */
.subscribe p {
    margin-bottom: 1rem;
}

/* From: https://www.w3schools.com/howto/howto_css_newsletter.asp */
/* From: https://www.w3schools.com/howto/howto_css_contact_form.asp */
.subscribe form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin: 0 2rem 2rem 2rem;
}

.subscribe input {
    border: none;
    border-bottom: 2px solid #FF5FA5;
    background: transparent;
    padding: 0.5rem;
    width: 15rem;
}

.subscribe button {
    background: transparent;
    border: none;
    color: #FF5FA5;
    cursor: pointer;
}

/* == Author Section == */
.author ul {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.author li {
    border: 2px solid #FF5FA5;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    line-height: 3rem;
    text-align: center;
    font-size: 0.9rem;
}

footer::after {
    content: "";
    display: block;
    height: 3px;
    background-color: #DF4488;
    margin: 0 2rem;
}


/* ========== Responsive Design ========== */

/* ===== 480px/42rem ===== */

@media(width> 30rem){

    /* === Search bar === */
    #search-toggle:checked ~ .other-icons{
        display:flex;
    }

    /* === Categories === */
    .categories span{
        font-size: 1.2rem;
    }

    .site-tagline {
        font-size: 1.2rem;
    }

    .categories-buttons button img {
        width: 4rem;
        height: 4rem;
    }

}

/* ===== 672px/42rem ===== */
@media (width > 42rem){

    /* === Nav menu icons === */
    .nav-menu{
        gap: 1rem;
    }

    /* === Search bar === */
    .search-box:focus-within {
        width: 12rem;
    }

    #search-toggle:checked ~ .search-box {
        width: 12rem;
    }

    /* === Categories === */
    .site-tagline {
        font-size: 1.4rem;
    }

    .categories span{
        font-size: 1.8rem;
    }

    .categories-buttons button{
        gap: 1rem;
    }
    .categories-buttons button img {
        width: 5rem;
        height: 5rem;
    }

    /* === Guide === */
    .guide{
        padding: 0 3.8rem;
    }
    
    /* === Footer === */
    footer {
        display: grid;
        grid-template-columns: 2fr 1fr;
        column-gap: 4rem;
        row-gap: 1rem;
        text-align: left;          
        padding: 2rem 3.8rem;      
    }

    .foot-about,
    .info,
    .subscribe,
    .author {
        margin-bottom: 3rem;
    }
  
    /* Align the list */
    footer li {
        text-align: left;
    }

    /* (1) H2 */
    footer h2 {
        grid-column: 1 / -1;
        border-bottom: 3px solid #DF4488;
        padding-bottom: 1rem;
        font-size: 1.5rem;
        margin-left: 0;
        text-align: left;
    }

    /* (2) Left Top: About */
    .foot-about{ 
        grid-column: 1 / 2;
    }

    /* (3) Left Bottom: Subcribe */
    .subscribe form {
        margin-left: 0;
        margin-top: 2rem;
        justify-content:flex-start;
    }

    .subscribe p {
        font-size: 0.9rem;
        margin-left: 0rem;
    }

    /* (4) Right bottom: Insta link */
    .author {
        grid-column: 2 / 3;
        margin-bottom: 0;
        justify-self:left;       
    }

    /* (4) Right bottom: Insta link */
    .author ul {
        /* https://www.w3schools.com/cssref/css3_pr_justify-content.php */
        /* Align the flex items at the end of the container */
        justify-content: flex-end; 
        gap: 1rem;
    }

    /* (5) Decoration Underline */
    /* tutorial: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/::after */
    footer::after {
    /* :: after: a "virtual" last child of the selected element */
    /* no visible content is added */
        margin-left: 0;
        grid-column: 1 / -1;
        height: 3px;
        background-color: #DF4488;
    }
}

/* ====== 992px/62rem ===== */
@media (width > 62rem){
    
    /* === Nav menu icons === */
    .nav-menu{
        gap: 1.5rem;
    }

    /* === Search bar === */
    /* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:focus-within */
    /*  targets the element that directly has focus */
    .search-box:focus-within {
        width: 20rem;
    }

    #search-toggle:checked ~ .search-box {
        width: 20rem;
    }

    /* === Categories === */
    .site-tagline {
        font-size: 1.6rem;
    }

     .categories span{
        font-size: 2rem;
    }

    .categories-buttons button img {
        width: 7rem;
        height: 7rem;
    }

    /* === Categories-Pets === */

    /* Center the slides */
    .categories-dogs ul,
    .categories-cats ul,
    .categories-rodents ul {
        justify-content: center; 
        gap: 2rem;
    }

    /* === Pet Guide === */
    /* Guide to 3rows */
    .guide ul {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
    }

    .guide li {
        flex: 1;  
        max-width: 25rem; 
    }

    /* === Footer === */
    footer h2 {
        text-align: left;
    }
    
    .foot-about h3 {
        font-size: 1.2rem;
    }

    .foot-about{ 
        font-size: 1.1rem;
    }

    /* Right top: info */
    .info h3 {
        font-size: 2rem;
    }

    .info {
        font-size: 1.1rem;
    }
}