/* Estils compartits del blog — Biblioteca Nina Sisena */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(135deg, #d4a574 0%, #c9956a 50%, #b8875a 100%);
  color: #1f1f1f;
  min-height: 100vh;
  line-height: 1.65;
}
h1, h2, h3 { font-family: 'Atma', sans-serif; font-weight: 600; line-height: 1.25; }
a { color: #8b4513; }

/* Capçalera */
.blog-header {
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 3px solid rgba(139, 69, 19, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: sticky; top: 0; z-index: 200;
}
.blog-header-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1200px; margin: 0 auto; padding: 0.9rem 1.2rem; flex-wrap: wrap;
}
.blog-brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; white-space: nowrap; }
.blog-brand img { height: 40px; width: 40px; object-fit: contain; }
.blog-header-title {
  font-family: 'Atma', sans-serif; font-weight: 700; font-size: 22px; color: #8b4513;
}

/* Cercador (igual que el web) */
.blog-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 440px; min-width: 180px; }
.blog-search-icon { position: absolute; left: 0.5rem; font-size: 15px; background: none; border: none; padding: 0.25rem 0.35rem; cursor: pointer; opacity: 0.7; line-height: 1; }
.blog-search-icon:hover { opacity: 1; }
.blog-search input {
  width: 100%; padding: 0.6rem 0.9rem 0.6rem 2.2rem;
  border: 2px solid rgba(139,69,19,0.25); border-radius: 8px;
  font-family: 'Nunito', sans-serif; font-size: 15px; color: #5a3410;
  background: #fff; outline: none; transition: border-color 0.2s;
}
.blog-search input::placeholder { color: #b0966f; }
.blog-search input:focus { border-color: #8b4513; }

/* Desplegable (igual que el web, sense JS) */
.blog-dropdown { position: relative; }
.blog-dropdown summary {
  list-style: none; cursor: pointer;
  background: #8b4513; color: #fff; border: none;
  width: 42px; height: 42px; border-radius: 8px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Atma', sans-serif; font-size: 24px; line-height: 1;
}
.blog-dropdown summary::-webkit-details-marker { display: none; }
.blog-dropdown summary:hover { background: #6b3410; }
.blog-dropdown[open] > .blog-dropdown-menu { display: block; }
.blog-dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 0.5rem);
  background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  min-width: 210px; overflow: hidden; border: 1px solid rgba(139,69,19,0.15); z-index: 210;
}
.blog-dropdown-menu a {
  display: block; padding: 0.85rem 1.1rem; text-decoration: none;
  font-family: 'Atma', sans-serif; font-weight: 600; font-size: 15px; color: #8b4513; transition: background .2s;
}
.blog-dropdown-menu a:hover { background: #f5f1ed; }
.blog-dropdown-menu a.current { background: #f0e4d8; }

/* Contenidor */
.blog-wrap { max-width: 820px; margin: 2rem auto; padding: 0 1.2rem 3.5rem; }
.breadcrumb { font-size: 13.5px; color: #6b4a2e; margin-bottom: 1rem; }
.breadcrumb a { color: #6b4a2e; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Targeta article */
.article-card {
  background: #fffdfb; border-radius: 18px; padding: 2.4rem 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}
@media (max-width: 600px) { .article-card { padding: 1.6rem 1.2rem; } }

.article-card h1 {
  font-size: 2rem; font-weight: 700; color: #7a3d0f; margin-bottom: 0.5rem;
}
.article-lead {
  font-size: 1.15rem; font-weight: 600; color: #a4632c; margin-bottom: 1.6rem;
}
.article-card h2 {
  font-size: 1.4rem; color: #7a3d0f; margin: 2rem 0 0.8rem;
}
.article-card h3 {
  font-size: 1.12rem; color: #8b4513; margin: 1.6rem 0 0.5rem;
}
.article-card p { margin: 0 0 1rem; font-size: 1.02rem; color: #3f342b; }
.article-card strong { color: #8b4513; font-weight: 700; }

/* Recuadres d'idea */
.info-box {
  background: #f3e7db; border-left: 5px solid #d4a574;
  padding: 1rem 1.2rem; border-radius: 0 8px 8px 0; margin: 1.4rem 0;
}
.info-box .label { font-family: 'Atma', sans-serif; font-weight: 600; color: #a05a1f; display: block; margin-bottom: 0.3rem; }
.info-box.box-green { background: #eef3e7; border-left-color: #a9c47f; }
.info-box.box-green .label { color: #5c7a2f; }

/* Reixa de llibres */
.books-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.2rem; margin: 1.4rem 0 0.5rem;
}
.book-card {
  display: block; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); border: 2px solid transparent;
  text-decoration: none; transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.book-card:hover { transform: translateY(-8px); box-shadow: 0 12px 24px rgba(139,69,19,0.25); border-color: #d4a574; }
.book-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #f5f1ed; }
.book-info { padding: 0.9rem; text-align: center; }
.book-title {
  font-family: 'Atma', sans-serif; font-size: 13px; font-weight: 700; color: #8b4513;
  margin-bottom: 0.35rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.book-author { font-size: 11px; color: #b8875a; font-weight: 500; }

/* Botons tornar (enrere / a la biblioteca) — grans i fàcils amb el polze */
.back-to-library {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.7rem;
  margin: 2.2rem auto 0.5rem; max-width: 560px;
}
.back-to-library a {
  flex: 1 1 auto; min-width: 150px; text-align: center;
  display: inline-block; background: #8b4513; color: #fff; text-decoration: none;
  font-family: 'Atma', sans-serif; font-weight: 600; font-size: 1.05rem;
  padding: 0.9rem 1.6rem; border-radius: 12px; transition: background .15s;
}
.back-to-library a:hover { background: #6b3410; }
.back-to-library .back-arrow { background: #e8d4c4; color: #8b4513; }
.back-to-library .back-arrow:hover { background: #8b4513; color: #fff; }

/* També et pot interessar */
.related { margin-top: 2.4rem; border-top: 2px solid #f0e4d8; padding-top: 1.4rem; }
.related h2 { font-size: 1.25rem; }
.related-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.8rem; }
.related-list a {
  display: block; background: #f7f0e8; border-radius: 10px; padding: 0.8rem 1rem;
  text-decoration: none; color: #6b3410; font-weight: 600; transition: background .15s;
}
.related-list a:hover { background: #efe3d4; }

/* Preguntes freqüents (acordió, sense JS) */
.faq { margin: 1.6rem 0 0.5rem; display: flex; flex-direction: column; gap: 0.7rem; }
.faq-item {
  background: #f7f0e8; border: 1px solid #ecdcc9; border-radius: 12px; overflow: hidden;
}
.faq-item summary {
  list-style: none; cursor: pointer; padding: 1rem 1.2rem;
  font-family: 'Atma', sans-serif; font-weight: 600; font-size: 1.08rem; color: #7a3d0f;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.5rem; color: #b8875a; line-height: 1; }
.faq-item[open] summary::after { content: '–'; }
.faq-item summary:hover { background: #efe3d4; }
.faq-item .faq-answer { padding: 0 1.2rem 1.1rem; }
.faq-item .faq-answer p { margin: 0.3rem 0 0; font-size: 1rem; color: #3f342b; }

/* Peu */
.blog-foot { text-align: center; color: rgba(255,255,255,0.85); font-size: 13px; margin-top: 2rem; }
.blog-foot a { color: #fff; }
.foot-ig-line { text-align: center; margin-top: 0.55rem; }
.foot-ig { display: inline-flex; align-items: center; gap: 0.4rem; color: rgba(255,255,255,0.8); text-decoration: none; font-size: 13px; font-weight: 600; transition: color .15s; }
.foot-ig:hover { color: #fff; }
.foot-ig svg { display: block; }
