@font-face {
  font-family: Palatino;
  src: url(./assets/font/Palatino.ttc) format("truetype");
}

@import url('https://fonts.googleapis.com/css2?family=Spectral:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

:root {
  --bg-color: #362208;
  --primary-color: #af8355;
  --bright-yellow: #FFE69D;
  --modal-bg-color: #362208d0;
}

body{
  background-color: var(--bg-color);
}

h1{
  font-family: 'Spectral', serif;
  color: var(--bright-yellow);
  text-align: center;
  margin-block: 2rem;
  font-size: 2.4rem;
  cursor: default;
}

.sidebar-container{
  position: fixed;
  /* top: 0; */
  bottom: 0;
  width: 100%;
  height: 7rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  /* border: red solid 1px; */
  background-color: var(--bg-color);
  padding-inline: 3rem ;
}

.search-logo{
  width: 3rem;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.gallery-logo {
  width: 3rem;
  height: auto;
  cursor: pointer;
  z-index: 4;
  justify-content: center;
  align-self: center;
  display: flex;
  a{
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.gallery-logo svg{
  align-self: center;
  width: 2rem;
  height: auto;
}

.search-container {
  position: fixed;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  z-index: 5;
  /* border: red solid 1px; */
  /* background-color: var(--bg-color); */
  /* backdrop-filter: blur(10px); */
  /* -webkit-backdrop-filter: blur(10px); */
  display: none;
}

.search-wrapper {
  width: 50%;
  height: 4rem;
  padding: 1rem 2rem;         
  background-color: #1a1104;  
  border: 1.5px solid #af8355;  
  box-shadow: 0 0 1rem #2b16009b;
  border-radius: 10rem;        
  color: #af8355;            
  font-family: 'Spectral', serif;
  font-size: 1.5rem;
  outline: none; 
  display: flex;
  align-items: center;
  justify-content: space-between; 
  svg {
    cursor: pointer;
  }           
}

.search-container-active {
  display: flex;
  opacity: 1;
}



#fav-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding-inline: 2rem;
  padding-block: 2rem;
  margin-block-end: 10rem;
  color: var(--bright-yellow);

  img {
    width: 100%;
    height: auto;
  }
}

#fav-content > p{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  font-family: 'Spectral', serif;
  text-align: center;
}

.image-wrapper img{
  cursor: pointer;
}

.hidden {
  display: none;
}

#modal {
  padding: 20px;
  /* border: 1px solid #ff0000; */
  z-index: 10;
  width: 100svw;
  height: 100svh;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw; /* 或者 100% */
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  &::backdrop {
    background-color: var(--modal-bg-color);
    backdrop-filter: blur(100px);
    -webkit-backdrop-filter: blur(100px);
  }
}

#modal[open] {
  display: flex;
  justify-content: center;
  align-items: center;
}


.modal-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 80%;
  font-family: 'Spectral', serif;
  color: var(--bright-yellow);
  img{
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
  }
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 6rem;
  width: 20%;
  font-size: 1.2rem;
  button{
    cursor: pointer;
  }
}

#modal-caption {
  width: 20%;
  font-size: 1.2rem;
  text-align: center;
}

#close-modal {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
}

.fav-btn {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
  p{
    text-align: center;
  }
}

.saved {
  fill: var(--bright-yellow);
}


@media screen and (width <= 1000px) {
  #fav-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (width <= 600px) {
  #fav-content {
    grid-template-columns: repeat(1, 1fr);
    padding-inline: 1rem;
  }

  .sidebar-container{
    padding-inline: 1rem ;
  }

  .logo svg{
    align-self: center;
    width: 3rem;
    height: auto;
  }

  .search-logo{
    width: 3rem;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .search-logo svg{
    width: 1.2rem;
    height: auto;
  }

  h1{
    font-size: 1.6rem;
  }

  .gallery-logo svg{
    align-self: center;
    width: 1.4rem;
    height: auto;
  }

  .search-wrapper {
    width: 90%;
    height: 3.5rem;
    padding: 1rem 2rem;         
    background-color: #1a1104;  
    border: 1px solid #af8355;  
    border-radius: 10rem;        
    color: #af8355;            
    font-family: 'Spectral', serif;
    font-size: 1.2rem;
    outline: none; 
    display: flex;
    align-items: center;
    justify-content: space-between; 
    svg {
      cursor: pointer;
      width: 1.2rem;
    }           
  }

  .modal-content{
    flex-direction: column-reverse;
    justify-content: space-between;
    align-items: center;
    height: 75%;
    width: 90%;
     img{
      max-width: 100%;
      max-height: 80vh;
    }
  }
  .modal-buttons{
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 70%;
    gap: 4rem;
  }

  #modal-caption {
    width: 70%;
  } 

  #fav-content > p{
    font-size: 1.2rem;
  }
}