/* ═══════════════════════════════════════════════
   OLAVU — Library Page Styles
   ═══════════════════════════════════════════════ */

.library-section {
  background: var(--warm-white);
  padding: 3rem 2rem 5rem;
}

/* ─── Filter bar ─── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2.5rem;
  padding: 1rem 1.2rem;
  background: white;
  border: 1px solid var(--sand);
  border-radius: var(--radius);
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--sand);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
}
.filter-btn:hover {
  background: var(--sand);
  color: var(--terracotta);
  border-color: var(--sand);
}
.filter-btn.active {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

/* ─── Library grid ─── */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
  align-items: start;
}

/* ─── Library card ─── */
.library-card {
  background: white;
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.library-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.library-card[style*="display: none"] {
  display: none !important;
}

.library-card-inner {
  padding: 1.6rem;
}

.library-cat-tag {
  margin-bottom: 0.8rem;
}

.library-card h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--deep-slate);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.library-preview {
  font-size: 0.9rem;
  color: var(--slate);
  line-height: 1.65;
  margin-bottom: 1.1rem;
}

/* ─── Expand button ─── */
.library-expand-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--warm-white);
  border: none;
  border-top: 1px solid var(--sand);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--terracotta);
  font-family: var(--font-sans);
  transition: var(--transition);
  margin: 0 -1.6rem -1.6rem;
  width: calc(100% + 3.2rem);
}
.library-expand-btn:hover {
  background: var(--sand);
}
.library-expand-btn span {
  transition: transform 0.3s ease;
  font-size: 0.78rem;
}
.library-expand-btn[aria-expanded="true"] span {
  transform: rotate(180deg);
}

/* ─── Library body (expanded content) ─── */
.library-body {
  display: none;
  padding: 1.4rem 1.6rem 1.6rem;
  border-top: 1px solid var(--sand);
  animation: slideDown 0.2s ease;
}
.library-body.open { display: block; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.library-body h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--deep-slate);
  margin: 1.2rem 0 0.4rem;
}
.library-body h4:first-child { margin-top: 0; }

.library-body p {
  font-size: 0.9rem;
  color: var(--slate);
  line-height: 1.72;
  margin-bottom: 0.75rem;
}

.library-body ul, .library-body ol {
  padding-left: 1.3rem;
  margin-bottom: 0.75rem;
}
.library-body li {
  font-size: 0.9rem;
  color: var(--slate);
  line-height: 1.65;
  margin-bottom: 0.3rem;
}

.library-body em { font-style: italic; }
.library-body strong { font-weight: 600; color: var(--deep-slate); }

/* ─── Library note (callout box) ─── */
.library-note {
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  background: rgba(122,158,138,0.09);
  border-left: 3px solid var(--sage);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.87rem;
  color: var(--deep-slate);
  line-height: 1.65;
  font-style: italic;
}

/* ─── Responsive ─── */
@media (max-width: 680px) {
  .library-grid { grid-template-columns: 1fr; }
  .filter-bar { gap: 0.3rem; padding: 0.8rem 1rem; }
  .filter-btn { font-size: 0.78rem; padding: 0.3rem 0.8rem; }
}
