/* ============== Base Style ============== */
body{
	background-color:rgba(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: 2.8rem; 
    height: 2.8rem;
}

/*(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 */
/* From: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:focus-within */
.search-box:focus-within .search-dropdown {
    display: block; 
}

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

/* Display search box when checked box is checked*/
#search-toggle:checked ~ .search-box {
    width: 7rem;
    opacity: 1;
}

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


/* ============== Main ============== */
/* Top: Yellow Background color */
/* Adjust Main Margin */
.main-section{
    margin: 0 1.5rem;
	padding-bottom: 2rem;
	/* curved corners */
    border-bottom-left-radius: 2.5rem;
    border-bottom-right-radius: 2.5rem;
}

/* ============== Pet Cover ============== */
.pet-image,
.pet-name,
.pet-details,
.pet-intro {
    padding-left: 1.8rem;
    padding-right: 1.8rem;
    margin-left: auto;      
    margin-right: auto;
}

.logo{
    /* Tutorial: https://www.w3schools.com/cssref/css3_pr_justify-content.php */
    display: flex;
    justify-content: center;
}

/* == Image == */
.pet-image {
    margin-top:1.5rem;
    justify-content: center;
    margin:0 auto;
}

.animal-photo {
    width: 100%;
    border-radius: 1rem;
    display: block;
    margin:0;
}

/* ============== Pet information ============== */ 

/* (1) Title */
.pet-name{
    display: flex;
    align-items:center;
    gap:1rem;
    font-size: 2.4rem;
}

/* Tutorial: https://www.w3schools.com/Css/tryit.asp?filename=trycss_display */
.hidden{
    display: none;
}

/* (2) Icon */
.icon img{
    width: 4.5rem;
    height: auto;
}

/* (3) Detail */
.info-row {
    display: flex;
    /* Stack vertically */
    flex-direction: column;     
    gap: 0.75rem;
    padding: 0.4rem 0;
}

.pet-info {
    display: flex;
    justify-content: space-between;
    /* Baseline alignment */
    /* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/align-items*/
    align-items: baseline;
    border-bottom: 2px solid RGB(255, 206, 224);
    padding-bottom: 0.7rem;
}

/* (4) Introduction */
.pet-intro {
    margin-top: 3rem;
    margin-bottom: 2.5rem;
}

.pet-intro h2 {
    margin-bottom: 1rem;
}

.pet-intro p {
    line-height: 1.7rem;
}

/* ============== Pet Preference Guide ============== */
.guide {
    background-color: RGBA(255, 206, 224, 0.7);              
    border-radius: 2rem;                    
    padding: 2rem 1.5rem;                   
    margin:2rem 1.8rem 2rem 1.8rem;
    text-align: center;
}

.guide-row img {
    width: 4rem;
    height: 4rem;
}

/* ============== View More Pets ============== */
.more{
    text-align: center;  
    border-top-left-radius: 2rem;
    border-top-right-radius: 2rem;
    padding-bottom: 2rem;
    padding-top: 1rem;
    background-color: RGB(214,240,229);
}

/* ============== 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;
}

footer a {
    text-decoration: none;
}

/* == 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;
    /* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/align-items */
    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;
}

/* 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 */
    content: "";
    display: block;
    height: 3px;
    background-color: #DF4488;
    margin: 0 2rem;
}

