/* ==========================================================================
   Parenting Library — page-specific styles only.
   Reuses tokens/classes from style.css (do not redefine brand tokens here).
   ========================================================================== */

/* Reveal-on-scroll (driven by main.js adding .is-visible) ------------------ */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.lib-hero {
  /* Pull the hero up behind the transparent header so its background is
     continuous — no seam between the header strip and the hero. */
  margin-top: -100px;
  padding: 172px 0 40px;
  background: linear-gradient(180deg, var(--blush) 0%, var(--warm-cream) 100%);
  text-align: center;
}
.lib-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  max-width: 16ch;
  margin: 0 auto 18px;
}
.lib-hero__sub {
  max-width: 620px;
  margin: 0 auto;
  color: var(--body);
  font-size: 1.12rem;
}

/* ==========================================================================
   Filter chips
   ========================================================================== */
.lib-articles { padding-top: 48px; }

.lib-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 56px;
}
.lib-chip {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: .95rem;
  color: var(--deep-plum);
  background: #fff;
  border: 1px solid rgba(92, 61, 78, 0.14);
  border-radius: 999px;
  padding: 9px 20px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.lib-chip:hover {
  border-color: var(--dusty-rose);
  color: var(--deep-rose);
}
.lib-chip.is-active {
  background: var(--dusty-rose);
  border-color: var(--dusty-rose);
  color: #fff;
}
.lib-chip:focus-visible {
  outline: 2px solid var(--deep-plum);
  outline-offset: 2px;
}

/* ==========================================================================
   Article grid + cards
   ========================================================================== */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
/* Horizontal card: inset image on the left, content on the right. */
.lib-card {
  display: flex;
  flex-direction: row;
  gap: 22px;
  background: var(--card-bg);
  border: 1px solid rgba(92, 61, 78, 0.12);
  border-radius: var(--radius);
  padding: 16px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.lib-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(201, 125, 138, 0.35);
}
/* Cards hidden by the category filter */
.lib-card[hidden] { display: none; }

.lib-card__media {
  display: block;
  flex: 0 0 42%;
  align-self: stretch;
  min-height: 210px;
  overflow: hidden;
  border-radius: calc(var(--radius) - 6px);
  background: linear-gradient(160deg, var(--dusty-rose), var(--deep-plum));
}
.lib-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.lib-card:hover .lib-card__media img { transform: scale(1.04); }

.lib-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 10px 12px 12px 0;
}
.lib-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.lib-card__date {
  font-size: .85rem;
  color: var(--muted);
}
.lib-card__tag {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dusty-rose);
  background: var(--warm-cream);
  border: 1px solid rgba(201, 125, 138, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
}
.lib-card__title {
  font-size: 1.45rem;
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}
.lib-card__title a { color: var(--deep-plum); }
.lib-card__title a:hover { color: var(--deep-rose); }
.lib-card__more {
  margin-top: auto;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: .95rem;
  color: var(--dusty-rose);
}
.lib-card__more:hover { color: var(--deep-rose); }
.lib-card__more span {
  transition: transform var(--transition);
  display: inline-block;
  margin-left: 2px;
}
.lib-card__more:hover span { transform: translateX(4px); }

/* Empty state (toggled by library.js) */
.lib-empty {
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 24px 0 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .lib-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .lib-grid { grid-template-columns: 1fr; }
  /* Stack the card vertically: image on top, content below */
  .lib-card { flex-direction: column; gap: 16px; }
  .lib-card__media {
    flex: none;
    width: 100%;
    aspect-ratio: 8 / 5;
    min-height: 0;
  }
  .lib-card__body { padding: 4px 8px 10px; }
  .lib-card__title { font-size: 1.3rem; }
  /* Chips scroll horizontally instead of wrapping on narrow screens */
  .lib-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
    scrollbar-width: none;
  }
  .lib-filters::-webkit-scrollbar { display: none; }
}

/* Fallback artwork for an article with no featured image set. Keeps the card
   grid even rather than collapsing the media box. */
.lib-card__media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blush);
}
.lib-card__media--empty img {
  width: 42%;
  height: auto;
  opacity: .5;
  object-fit: contain;
}

/* Single article body — inherits the brand type scale. */
.lib-single__content {
  max-width: 760px;
  margin: 0 auto;
}
.lib-single__content > * + * { margin-top: 1.1em; }
.lib-single__content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.lib-single__content blockquote {
  margin: 1.6em 0;
  padding: 1em 1.4em;
  border-left: 3px solid var(--accent);
  background: var(--card-bg);
  border-radius: var(--radius-sm);
}
