/**
 * Reset some basic elements
 */
 body, h1, h2, h3, h4, h5, h6,
 p, blockquote, pre, hr,
 dl, dd, ol, ul, figure {
   margin: 0;
   padding: 0;
 }
 
 html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  background-color: #ffffff;
  color: #222;
  line-height: 1.6;
}

main {
  flex: 1;
}
 
header {
  /*background: #f3eee9;*/
  color: #222;
  padding: 1.5em;
  text-align: center;
}

header img {
  max-width: 200px;
}

.menu {
  margin-top: 1em;
}

.menu a {
  margin: 0 10px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
}

.menu a:hover {
  text-decoration: underline;
}
 
 nav a {
   color: #fff;
   margin: 0 1rem;
   text-decoration: none;
   font-weight: 600;
 }

 section {
   padding: 1rem 1rem;
   max-width: 1200px;
   margin: auto;
 }

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

 #sobre {
  text-align: center;
  max-width: 600px;
 }

 #contato {
  text-align: center;
 }

 #sobre img {
  width: 150px;
 }

 footer {
   /*background: #f3eee9;*/
   color: #222;
   text-align: center;
   font-size: small;
   padding: 2rem;
   margin-top: 4rem;
 }

 .portfolio .grid {
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.5rem;
  padding: 1rem 0;
}

.portfolio .item {
  background: white;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.3s ease;
}

.portfolio .item .img-wrapper {
  width: 100%;
  overflow: hidden;
}

.portfolio .item img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
  display: block;
}

.portfolio .item:hover img {
  transform: scale(1.05);
  cursor: pointer
}

.portfolio .item .title {
  padding: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: #333;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

#missingpage {
  text-align: center;
}

#missingpage img{
  width: 150px;
}

.form-contato {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 5px;
  font-size: 0.9rem;
  color: #333;
}

.form-contato input,
.form-contato textarea {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  background: #f9f9f9;
  color: #222;
}

.form-contato input:focus,
.form-contato textarea:focus {
  outline: none;
  border-color: #0077ff;
  background: #fff;
}

.form-contato textarea {
  min-height: 150px;
  resize: vertical;
}

.btn-enviar {
  align-self: flex-start;
  padding: 12px 24px;
  background-color: #000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-enviar:hover {
  background-color: #333;
}

.backToTop {
  text-align: center;
}
/* Estilo base (desktop) */
.voltar-topo {
  display: inline-block;
  color: #000;
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
  margin: 4rem auto 2rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}

.voltar-topo:hover {
  opacity: 0.5;
}

.voltar-topo span {
  display: block;
}

.voltar-topo #arrow {
  transition: transform 0.3s ease;
}

.voltar-topo:hover #arrow {
  transform: translateY(-5px);
}

#work h1 {
  margin-bottom: 1em;
}

@media (max-width: 768px) {
  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: white; /* para garantir contraste */
    z-index: 1000;
    padding: 1em 0;
  }

  .menu {
    margin-top: 0px;
  }

  .topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1em;
  }

  #logo {
    display: block;
    align-items: center;
  }

  #logo img {
    display: block;
    height: 36px;
    width: auto;
    max-width: 100%;
  }

  /* Para que o conteúdo não fique "escondido" atrás da navbar fixa, dê um padding-top no body */
  body {
    padding-top: 3rem; /* ajuste conforme a altura da navbar */
  }

  .backToTop {
    display: none;
  }
}