/*
 * Home page layout: section rhythm, alignment and density for the front page only.
 * Loaded by Index.cshtml after site.css; every rule is scoped to .nv-home so archive, category and
 * tag pages that share the same partials and card classes are unaffected.
 */
.nv-home { --nv-home-gap: clamp(32px, 5vw, 56px); overflow-x: clip; }

/* One vertical rhythm and one container boundary for every section. */
.nv-home > .nv-home-section,
.nv-home > .nv-home-lead { padding-block: 0; margin-block: var(--nv-home-gap) 0; border-top: 0; }
.nv-home > .nv-home-intro + .nv-home-lead { margin-top: 12px; }
.nv-home > .nv-home-section[hidden] { display: none; }
.nv-home .nv-home-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 20px; }

/* Hero: about 70/30, both columns top-aligned and of equal height on desktop. */
@media (min-width: 1000px) {
  .nv-home .nv-home-lead__grid { grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr); gap: 32px; align-items: stretch; }
}
.nv-home .nv-slider__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.nv-home .nv-slider__foreground { width: 100%; height: 100%; object-fit: cover; }
.nv-home .nv-most-viewed { background: transparent; box-shadow: none; border: 0; }
.nv-home .nv-most-viewed ol { margin: 0; padding: 0; list-style: none; }
.nv-home .nv-most-viewed li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--nv-border); }
.nv-home .nv-most-viewed li:first-child { border-top: 0; padding-top: 0; }
.nv-home .nv-most-viewed h3 { margin: 0 0 6px; font-size: var(--font-size-base); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Every section spans the container edge to edge and starts at its left edge, on all widths. */
.nv-home > .nv-container > *,
.nv-home .nv-home-heading,
.nv-home .nv-home-section-heading,
.nv-home .nv-home-lead__grid,
.nv-home .nv-home-grid,
.nv-home .nv-home-books__track,
.nv-home .nv-recommendations-block { width: 100%; max-width: none; margin-inline: 0; padding-inline: 0; text-align: left; box-sizing: border-box; }

/* Featured quote: compact, one at a time, full container width; long text is clamped and links to the full quote. */
.nv-home > .nv-home-quotes { margin-top: var(--nv-home-gap); }
.nv-home .nv-home-quotes .nv-qbanner { padding-block: 8px; background: transparent; box-shadow: none; border: 0; }
.nv-home .nv-home-quotes .nv-qbanner__text { margin: 0; max-width: none; font-size: clamp(1.05rem, 1.6vw, 1.35rem); line-height: 1.5; }
.nv-home .nv-home-quotes .nv-qbanner__text a { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.nv-home .nv-home-quotes .nv-qbanner__by,
.nv-home .nv-home-quotes .nv-qbanner__controls { justify-content: flex-start; }

/* Card grids: three columns on desktop, two on tablet, one on phones; equal heights. */
.nv-home .nv-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 28px 24px; align-items: stretch; }
@media (min-width: 1000px) { .nv-home .nv-home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 599px) { .nv-home .nv-home-grid { grid-template-columns: minmax(0, 1fr); } }
.nv-home .nv-home-grid > * { min-width: 0; height: 100%; }
.nv-home .nv-home-card { box-shadow: none; }
.nv-home .nv-home-card__media { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; }
.nv-home .nv-home-card__media img { width: 100%; height: 100%; object-fit: cover; }
.nv-home .nv-home-card h3 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nv-home .nv-home-card__body > p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nv-home .nv-home-meta { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Explore topics: compact chips that scroll sideways, at most six (four on tablet, three on phones). */
.nv-home .nv-home-section--popular .nv-category-tabs { gap: 8px; margin: 0 0 20px; padding: 0 0 4px; border-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.nv-home .nv-home-section--popular .nv-category-tabs::-webkit-scrollbar { display: none; }
.nv-home .nv-home-section--popular .nv-category-tabs button { flex: 0 0 auto; min-height: 36px; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.nv-home .nv-home-section--popular .nv-home-card__body > p,
.nv-home .nv-home-section--popular .nv-home-card__author { display: none; }
@media (max-width: 999px) { .nv-home .nv-home-section--popular .nv-home-grid > :nth-child(n + 5) { display: none; } }
@media (max-width: 599px) { .nv-home .nv-home-section--popular .nv-home-grid > :nth-child(n + 4) { display: none; } }

/* For you: a compact horizontal strip, never a tall repeated grid. */
.nv-home .nv-recommendations[data-placement='home'] .nv-recommendations-block { padding-top: 0 !important; border-top: 0 !important; }
.nv-home .nv-recommendations[data-placement='home'] .nv-home-grid { display: flex; gap: 20px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.nv-home .nv-recommendations[data-placement='home'] .nv-home-grid::-webkit-scrollbar { display: none; }
.nv-home .nv-recommendations[data-placement='home'] .nv-rec-item { flex: 0 0 80%; padding: 0; border-bottom: 0; scroll-snap-align: start; }
@media (min-width: 600px) { .nv-home .nv-recommendations[data-placement='home'] .nv-rec-item { flex-basis: calc(40% - 10px); } }
@media (min-width: 1000px) { .nv-home .nv-recommendations[data-placement='home'] .nv-rec-item { flex-basis: calc(25% - 15px); } }
.nv-home .nv-recommendations[data-placement='home'] .nv-home-card__body > p { display: none; }

/* Latest: an editorial list - small thumbnail, category, title, date. */
.nv-home .nv-home-section--latest .nv-latest-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 1000px) { .nv-home .nv-home-section--latest .nv-latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; } }
.nv-home .nv-home-card--latest { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; height: auto; padding: 16px 0; border: 0; border-bottom: 1px solid var(--nv-border); border-radius: 0; background: transparent; }
.nv-home .nv-home-card--latest .nv-home-card__media { aspect-ratio: 4 / 3; border-radius: 4px; }
.nv-home .nv-home-card--latest .nv-home-card__body { padding: 0; }
.nv-home .nv-home-card--latest h3 { margin: 4px 0; font-size: var(--font-size-base); line-height: 1.35; }
.nv-home .nv-home-card--latest .nv-home-card__body > p { margin: 0 0 6px; -webkit-line-clamp: 1; color: var(--nv-text-secondary); }
.nv-home .nv-home-card--latest .nv-latest-card__number,
.nv-home .nv-home-card--latest .nv-latest-card__rule,
.nv-home .nv-home-card--latest .nv-latest-card__footer { display: none; }
@media (max-width: 599px) { .nv-home .nv-home-card--latest { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; } }

/* Books: a compact portrait strip. */
.nv-home .nv-home-books__cover { aspect-ratio: 2 / 3; }

@media (prefers-reduced-motion: reduce) {
  .nv-home .nv-recommendations[data-placement='home'] .nv-home-grid { scroll-behavior: auto; }
}
