:root {
  --bg-color: #ffffff;
  --text-color: #111111;
  --hover-color: #0077aa;
  --accent-color: #999999;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --gallery-gap: 1em;
  --gallery-item-height: 220px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Karla', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

h1 {
  font-size: 2rem;
  font-weight: 400;
  padding-bottom: 20px;
  text-transform: uppercase;
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0;
  position: sticky;
  padding: 20px 7% 20px 7%;
  width: 100%;
  top: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 1000;
}

.logo {
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: 0.05rem;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

nav ul {
  display: flex;
  list-style-type: none;
}

nav ul li:not(:last-child) {
  margin-right: 2rem;
}

nav ul li a {
  color: #000;
  font-weight: 300;
  font-size: 1.25rem;
  text-decoration: none;
}

nav ul li a:hover {
  color: #888;
}

.livres,
.info {
  padding: 5%;
}

p {
  font-size: 1rem;
  font-family: 'Domine', serif;
}

.grid-container {
  opacity: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
  row-gap: 20px;
  margin-top: 40px;

  img {
    object-fit: contain;
  }
}

.grid-container a {
  display: flex;
  justify-content: center;
}

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 20dvh;
}

.loading-dots {
  width: 15px;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: d5 1s infinite linear alternate;
}
@keyframes d5 {
  0% {
    box-shadow:
      20px 0 #000,
      -20px 0 #0002;
    background: #000;
  }
  33% {
    box-shadow:
      20px 0 #000,
      -20px 0 #0002;
    background: #0002;
  }
  66% {
    box-shadow:
      20px 0 #0002,
      -20px 0 #000;
    background: #0002;
  }
  100% {
    box-shadow:
      20px 0 #0002,
      -20px 0 #000;
    background: #000;
  }
}

.grid-container.fade-in {
  opacity: 1;
  transition:
    opacity 500ms ease-in,
    visibility 0ms ease-in 0ms;
}

.grid-container.mobile-size {
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.grid-container.mobile-size img {
  max-width: 90%;
}

.grid-container.mobile-size img.grid-item-vertical {
  max-height: 300px;
}

.grid-container:not(:last-child) {
  margin-bottom: 20px;
}

.project-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 30px;
}

.project-card {
  position: relative;
  width: 320px;
  height: 320px;
  overflow: hidden;
  background: #f9f9f9;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.project-card:hover img {
  transform: scale(1.03);
}

.project-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  background-color: #f9f9f9;
  transition: opacity 0.5s ease;
  justify-content: center;
  align-items: center;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-title {
  color: #000;
  font-size: 1.5rem;
  text-transform: uppercase;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

main {
  flex: 1;
  padding: 20px 10% 20px 10%;
  margin: 0 auto;
  width: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

footer {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 20px 7% 20px 7%;
}

.footer-content p {
  color: var(--accent-color);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.logo a {
  cursor: pointer;
}

#home-project-list {
  flex: 1;
  margin: 0 auto;
  width: 100%;
  margin-top: 40px;

  ul {
    list-style-type: none;
  }

  a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    color: #000;
    font-family: 'Domine', serif;
  }

  :hover {
    color: #888;
  }
}

@media (max-width: 768px) {
  .drawer {
    width: 100%;
    right: -100%;
  }
  .project-grid {
    flex-direction: column;
    align-items: center;
  }
  .project-card {
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1/1;
    height: auto;
  }

  nav ul li:not(:last-child) {
    margin-right: 0.75rem;
  }

  nav ul li a {
    font-size: 1em;
  }

  .project-overlay {
    opacity: 1;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    background-color: transparent;
  }

  .project-title {
    font-size: 1rem;
    position: relative;
    top: unset;
    left: unset;
    transform: unset;
    -webkit-transform: unset;
    display: flex;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.6);
  }

  header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 1200px) {
  main {
    padding: 10px 7% 10px 7%;
  }

  #home-project-list {
    padding: 10px 0 10px 0;

    a {
      font-size: 1.5rem;
    }
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  #home-project-list {
    a {
      font-size: 1.75rem;
    }
  }
}

@media (min-width: 1200px) {
  #home-project-list {
    padding: 10px 20% 10px 20%;

    a {
      font-size: 2rem;
    }
  }
}
