/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: #fefefe;
  color: #222;
  line-height: 1.5;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
header {
  margin-bottom: 20px;
  border-bottom: 2px solid #ccc;
  padding-bottom: 10px;
}

header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
  text-align: center;
}

/* Navegação principal */
nav.quick-nav {
  max-width: 1200px;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  margin-right: 6px;
}

nav.quick-nav .nav-links {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

nav.quick-nav a {
  color: #2c3e50;
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 4px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

nav.quick-nav a:hover,
nav.quick-nav a.active {
  background-color: #2c3e50;
  color: #fff;
}

/* dropdown menu */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  user-select: none;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: none;  /* Escondido por padrão */
  min-width: 180px;
  z-index: 10;
  padding: 5px 0;
  border-radius: 4px;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: block;  /* Aparece no hover ou foco */
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu li a {
  display: block;
  padding: 6px 15px;
  color: #2c3e50;
  text-decoration: none;
}

.dropdown-menu li a:hover {
  background-color: #2c3e50;
  color: #fff;
}


/* Barra de pesquisa no topo */
.search-bar {
  max-width: 300px;
  width: 100%;
}

.search-bar input[type="search"] {
  width: 100%;
  padding: 6px 10px;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

/* Content com duas colunas */
.content {
  display: flex;
  gap: 20px;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

/* Main (livros) */
main {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
}

/* Cada livro */
.book {
  display: flex;
  gap: 20px;
  background: #fffaf4;
  border: 1px solid #e0ddd8;
  border-left: 4px solid #c4b5fd;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease;
}

.book:hover {
  transform: translateY(-4px);
}

.book img {
  width: 100px;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.book .info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4em;
  margin: 0 0 6px;
  color: #3c2c4a;
}

.book small {
  font-size: 0.9em;
  color: #7a7a7a;
  margin-bottom: 6px;
}

.book .meta {
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 8px;
}

/* Tags - sempre visíveis */
.tags {
  margin-bottom: 8px;
}

.tag, 
.tag-filter {
  display: inline-block;
  background-color: #2c3e50;
  color: white;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid #3f51b5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.tag:hover,
.tag-filter:hover {
  background-color: #1b2735;
  color: #fff;
}

/* Tag ativa (filtro aplicado) */
.tag-filter.active {
  background-color: #1b2735;
  color: white;
  pointer-events: none;
  cursor: default;
  box-shadow: 0 0 8px #1b2735aa;
}

/* Link PDF */
.book a:not(.tag-filter) {
  font-size: 0.9rem;
  color: #2c3e50;
  text-decoration: none;
  align-self: flex-start;
  margin-top: auto;
  font-weight: 600;
}

.book a:not(.tag-filter):hover {
  text-decoration: underline;
}

/* Footer */
footer {
  margin-top: 40px;
  text-align: center;
  color: #777;
  font-size: 0.9rem;
  font-style: italic;
  flex-shrink: 0;
  padding: 1rem;
}

/* Responsividade */
@media (max-width: 900px) {
  .content {
    flex-direction: column;
    align-items: center;
  }

  main {
    display: block;
    width: 100%;
  }

  .book {
    flex-direction: row;
    width: 100%;
  }

  aside {
    width: 100%;
    margin-top: 25px;
    max-width: 600px;
  }

  nav.quick-nav {
    flex-direction: column;
    align-items: center;
  }

  nav.quick-nav .nav-links {
    justify-content: center;
  }

  .search-bar {
    max-width: 100%;
    margin-top: 10px;
  }
}
