:root {
  --bg: rgb(244, 241, 236);
  --text: rgb(152, 139, 114);
  --text-dark: rgb(94, 82, 62);
  --accent: #5c93aa;
  --line: rgba(152, 139, 114, 0.28);
  --max-wide: 1320px;
}

#quarto-content,
#quarto-document-content,
main,
.content,
.page-columns,
.page-layout-article {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

#quarto-content.page-columns #quarto-document-content {
  grid-column: screen-start / screen-end !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Charter", Georgia, serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

.quarto-title-block,
#title-block-header,
.quarto-title,
.quarto-title-meta,
#quarto-header,
.navbar {
  display: none !important;
}

.bibliografia-hero {
  width: 100%;
  text-align: center;
  padding: 4.5rem 1.25rem 1rem;
  background: var(--bg);
  box-sizing: border-box;
}

.back-link {
  position: fixed;
  z-index: 20;
  top: clamp(16px, 2.5vw, 32px);
  left: clamp(18px, 3vw, 44px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 190px;
  min-height: 44px;
  padding: 0 1.25rem;
  border: 1px solid rgb(128, 184, 219);
  border-radius: 999px;
  background: rgba(244, 241, 236, 0.9);
  box-shadow: 0 1px 4px rgba(92, 147, 170, 0.12);
  text-decoration: none;
  font-family: "Charter", Georgia, serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  color: rgb(92, 147, 170);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.back-link:hover,
.back-link:focus-visible {
  background: rgb(128, 184, 219);
  color: #f4f1ec;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(92, 147, 170, 0.18);
  outline: none;
}

.intro-gif {
  display: flex;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.intro-gif img {
  display: block;
  width: 110px;
}

.hero-intro {
  text-align: center;
}

.quote {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.bibliografia-page {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: clamp(1.8rem, 2.2vw, 2.8rem) 0 5rem !important;
  overflow-x: hidden;
}


.bibliografia-grid {
  width: min(1808px, 89vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.6rem, 1.7vw, 2.2rem) clamp(2.6rem, 3.4vw, 4.4rem);
  align-items: stretch;
  justify-content: center;
}

.book-card {
  min-width: 0;
  min-height: clamp(320px, 24.7vw, 506px);
  display: grid;
  grid-template-columns: clamp(190px, 36.5%, 285px) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(1.65rem, 2.35vw, 3rem);
  padding: clamp(2rem, 2.9vw, 3.7rem) clamp(2rem, 3.5vw, 4.5rem);
  border-radius: clamp(32px, 3vw, 60px);
  background: #e9e2d8;
}

figure.book-cover,
.book-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(225px, 16.8vw, 345px);
  margin: 0;
}

.book-cover img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: none;
}

.book-info {
  min-height: clamp(230px, 18.2vw, 373px);
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-top: 0;
  text-align: left;
}

.book-info h2 {
  margin: 0 0 clamp(1rem, 1.6vw, 2rem);
  font-size: clamp(1rem, 1.12vw, 1.45rem);
  transform: translateY(-1rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-dark);
}

.book-info p {
  text-align: left;
  text-align-last: auto;
  word-spacing: normal;
  margin: 0;
  font-size: clamp(0.85rem, 1.18vw, 1.5rem);
  line-height: 1.18;
  transform: translateY(-1rem);
  max-width: none;
  color: var(--text);
}

.book-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: min(250px, 68%);
  min-height: clamp(38px, 2.9vw, 60px);
  margin-top: auto;
  transform: translateY(0.55rem);
  border-radius: 999px;
  background: #84bdc2;
  color: #fff;
  font-size: clamp(0.92rem, 1.13vw, 1.45rem);
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.book-button:hover,
.book-button:focus-visible {
  background: transparent;
  color: #6fb2ba;
  border-color: #84bdc2;
  outline: none;
}

@media (max-width: 900px) {
  .bibliografia-page {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .bibliografia-grid {
    width: min(100%, 980px);
    grid-template-columns: 1fr;
  }

  .book-card {
    grid-template-columns: clamp(180px, 36%, 260px) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .bibliografia-hero {
    padding-top: 4rem;
  }

  .back-link {
    top: 12px;
    left: 12px;
    width: 165px;
    min-height: 40px;
    padding: 0 1rem;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
  }

  .bibliografia-page {
    width: 100%;
    padding: 1.4rem 0.5rem 4rem;
  }

  .bibliografia-grid {
    width: min(100%, 440px);
    gap: 1rem;
  }

  .book-card {
    grid-template-columns: 1fr;
    min-height: 0;
    row-gap: 1.15rem;
    padding: 1.6rem 1.35rem;
    border-radius: 26px;
  }

  .book-cover {
    height: 220px;
  }

  .book-info {
    min-height: 0;
  }

  .book-info h2,
  .book-info p {
    text-align: center;
  }

  .book-button {
    margin-top: 1.2rem;
    transform: none;
  }
}
