/* The redesigned home page, a prototype at /home-v2/ (templates/home_v2.html): an archive's front door
   in the 2009 colours. Blue #069 for links and titles, red #C00 on hover, greys #F7F7F7 / #CCC / #666,
   dotted separators; the section colours as tags, top borders and bars (--c), with the text-safe
   shade (--ct) wherever white text sits on them. The theme's fonts are kept. Everything is scoped to
   this page: .hv-* classes,. */

.hv-home { padding-block: 24px 40px; }
.hv-sr { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hv-date { color: #999999; font-size: 0.8em; white-space: nowrap; }
.hv-tag { display: inline-block; padding: 1px 10px; background: var(--ct, #888888); color: #FFFFFF; font-weight: 700;
  font-size: 0.85em; text-decoration: none; box-shadow: 2px 2px 0 #ABABAB; }
.hv-tag:hover { background: #006699; color: #FFFFFF; }
.hv-tag--sm { padding: 0 6px; font-size: 0.8em; box-shadow: none; }

/* ---- blocks ------------------------------------------------------------------------------------- */
.hv-block { margin-block-start: 36px; }
.hv-block__title { margin: 0 0 14px; color: #333333; font-size: 1.3em; font-weight: 700; }
.hv-block__foot { margin: 10px 0 0; font-size: 0.9em; text-align: end; }

/* ---- 1. the archive at a glance ------------------------------------------------------------------ */
.hv-intro { padding: 22px 24px; background: #F7F7F7; border-block-start: 3px solid #006699; text-align: center; }
.hv-intro__title { margin: 0; color: #006699; font-size: 2em; font-weight: 700; }
.hv-intro__lede { margin: 6px 0 16px; color: #555555; }   /* then the numbers (search is in the header) */
.hv-search { display: flex; gap: 6px; max-inline-size: 36rem; margin: 0 auto 16px; }
.hv-search__input { flex: 1; min-inline-size: 0; font-size: 1.05em; }
.hv-search__go { display: inline-flex; align-items: center; gap: 6px; background: #006699; border-color: #006699; }
.hv-search__go:hover { background: #CC0000; border-color: #CC0000; }
.hv-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; margin: 0; padding: 0; list-style: none; color: #666666; }
.hv-stats b { color: #333333; font-size: 1.35em; }
.hv-stats a { color: inherit; text-decoration: none; }
.hv-stats a:hover { color: #CC0000; }

/* ---- 2. the timeline ---------------------------------------------------------------------------- */
.hv-tl { display: flex; gap: 10px; align-items: flex-end; overflow-x: auto; padding-block-end: 4px; }
.hv-tl__year { flex: 1 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-inline-size: 7.5rem; }
.hv-tl__bars { display: flex; align-items: flex-end; gap: 2px; block-size: 110px; border-block-end: 1px solid #CCCCCC; }
.hv-tl__bar { flex: 1; min-inline-size: 6px; block-size: max(var(--h), 2px); display: flex; flex-direction: column-reverse; }
.hv-tl__bar span { display: block; background: var(--c); min-block-size: 1px; }
.hv-tl__bar:hover { outline: 2px solid #CC0000; outline-offset: 1px; }
.hv-tl__label { text-align: center; color: #333333; font-weight: 700; text-decoration: none; }
.hv-tl__label span { color: #999999; font-weight: 400; font-size: 0.85em; }
.hv-tl__label:hover { color: #CC0000; }
.hv-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; padding: 0; list-style: none; color: #666666; font-size: 0.8em; }
.hv-legend li::before { content: ""; display: inline-block; inline-size: 10px; block-size: 10px; margin-inline-end: 5px; background: var(--c); vertical-align: middle; }

/* ---- 3. the sections as shelves ----------------------------------------------------------------- */
.hv-shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.hv-shelf { display: flex; flex-direction: column; padding: 12px 14px 12px; border: 1px solid #CCCCCC; border-block-start: 4px solid var(--c); background: #FFFFFF; }
.hv-shelf__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-block-end: 10px; }
.hv-shelf__meta { color: #999999; font-size: 0.8em; }
.hv-feature { display: block; color: inherit; text-decoration: none; }
.hv-feature__img { float: left; inline-size: 120px; block-size: 90px; object-fit: cover; margin: 3px 12px 6px 0; }
.hv-feature__title { display: block; color: #006699; font-weight: 700; font-size: 1.1em; line-height: 1.35; }
.hv-feature:hover .hv-feature__title { color: #CC0000; text-decoration: underline; }
.hv-feature__summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  margin-block-start: 4px; color: #555555; font-size: 0.9em; line-height: 1.6; }
.hv-feature::after { content: ""; display: block; clear: both; }
.hv-heads { margin: 10px 0 0; padding: 0; list-style: none; }
.hv-heads li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0;
  background: url(/2009/dot.gif) repeat-x left top; font-size: 0.9em; line-height: 1.45; }
.hv-heads a { color: #006699; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }
.hv-heads a:hover { color: #CC0000; text-decoration: underline; }
.hv-more { margin-block-start: auto; padding-block-start: 10px; align-self: flex-end; color: #666666; font-size: 0.85em; text-decoration: none; }
.hv-more:hover { color: #CC0000; }

/* ---- 4. on this day: one random article per year, as a ribbon with arrows (js/home.js) --------- */
.hv-otd[hidden] { display: none; }
.hv-otd .t9-otd__day { color: #999999; font-weight: 400; font-size: 0.8em; }
.hv-ribbon-wrap { position: relative; }
.hv-ribbon { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(14rem, calc((100% - 36px) / 4)); gap: 12px;
  overflow-x: auto; scroll-snap-type: inline mandatory; scroll-padding-inline: 4px; scrollbar-width: none;
  margin: 0; padding: 2px 4px 8px; list-style: none; }
.hv-ribbon::-webkit-scrollbar { display: none; }
.hv-ribbon:focus-visible { outline: 2px solid #006699; outline-offset: 2px; }
.hv-ribbon li { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px;
  background: #F7F7F7; border-block-start: 3px solid #006699; }
.hv-ribbon__year { color: #999999; font-size: 1.5em; font-weight: 700; line-height: 1; }
.hv-ribbon a { color: #006699; font-weight: 700; text-decoration: none; line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.hv-ribbon a:hover { color: #CC0000; text-decoration: underline; }
.hv-ribbon__date { margin-block-start: auto; color: #999999; font-size: 0.8em; }
/* arrows over the ends, with a fade so the cut-off card reads as "more this way" */
.hv-ribbon__nav { position: absolute; inset-block-start: 50%; translate: 0 -50%; z-index: 2; display: grid; place-items: center;
  inline-size: 2.4rem; block-size: 2.4rem; border: 1px solid #CCCCCC; border-radius: 50%; background: #FFFFFF; color: #006699;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); cursor: pointer; }
.hv-ribbon__nav[hidden] { display: none; }
.hv-ribbon__nav:hover:not(:disabled) { color: #FFFFFF; background: #006699; border-color: #006699; }
.hv-ribbon__nav:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.hv-ribbon__nav--back { inset-inline-start: -14px; }
.hv-ribbon__nav--next { inset-inline-end: -14px; }
/* the arrows are drawn in the template, pointing outward from their ends (the site is right to left) */
.hv-ribbon__icon { display: block; }
.hv-linkbutton { padding: 0; border: 0; background: none; color: #006699; font: inherit; cursor: pointer; }
.hv-linkbutton:hover { color: #CC0000; text-decoration: underline; }

/* ---- each section's five most commented, one box per section ----------------------------------- */
.hv-best { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; }
.hv-best__box { padding: 12px 14px 6px; border: 1px solid #CCCCCC; border-block-start: 3px solid var(--ct); }
.hv-best__head { margin: 0 0 6px; font-size: 1em; }
.hv-best__list { margin: 0; padding: 0; list-style: none; }
.hv-best__list li { display: flex; gap: 10px; padding: 8px 0; background: url(/2009/dot.gif) repeat-x left top; }
.hv-best__list li:first-child { background: none; }
.hv-best__rank { flex: none; display: grid; place-items: center; inline-size: 1.6rem; block-size: 1.6rem; border-radius: 50%;
  background: var(--ct); color: #FFFFFF; font-size: 0.8em; font-weight: 700; }
.hv-best__body { display: flex; flex-direction: column; gap: 3px; min-inline-size: 0; }
.hv-best__title { color: #006699; font-weight: 700; text-decoration: none; line-height: 1.4; font-size: 0.95em; }
.hv-best__title:hover { color: #CC0000; text-decoration: underline; }
.hv-best__meta { color: #999999; font-size: 0.78em; }


/* ---- 6. the writers ------------------------------------------------------------------------------- */
.hv-writers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; margin: 0; padding: 0; list-style: none; }
.hv-writers a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  color: inherit; text-decoration: none; }
.hv-writer__initial { grid-row: 1 / 3; display: grid; place-items: center; inline-size: 2.6rem; block-size: 2.6rem; border-radius: 50%;
  background: var(--ct); color: #FFFFFF; font-weight: 700; font-size: 1.1em; }
.hv-writer__name { color: #006699; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-writers a:hover .hv-writer__name { color: #CC0000; text-decoration: underline; }
.hv-writer__meta { color: #999999; font-size: 0.8em; }

/* ---- narrow screens ---------------------------------------------------------------------------- */
@media (max-width: 52rem) {
  .hv-home { padding-block-start: 12px; }
  .hv-intro { padding: 16px; }
  .hv-intro__title { font-size: 1.5em; }
  .hv-search__go span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .hv-shelves, .hv-best { grid-template-columns: minmax(0, 1fr); }
  .hv-writers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hv-tl__year { min-inline-size: 9rem; }
  .hv-ribbon { grid-auto-columns: 78%; }
  .hv-ribbon__nav--back { inset-inline-start: -6px; }
  .hv-ribbon__nav--next { inset-inline-end: -6px; }
}

/* every writer: a clear toggle (and a link to the authors page), then a filterable list (js/home.js) */
.hv-writers-more { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-block-start: 18px; }
.hv-allwriters { flex: 1 1 auto; }                     /* the toggle first; the panel takes the row when open */
.hv-allwriters__toggle { list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px;
  border: 1px solid #006699; background: #006699; color: #FFFFFF; font-weight: 700; cursor: pointer; user-select: none; }
.hv-allwriters__toggle::-webkit-details-marker { display: none; }
.hv-allwriters__toggle:hover { background: #CC0000; border-color: #CC0000; }
.hv-allwriters__toggle:focus-visible { outline: 2px solid #006699; outline-offset: 2px; }
.hv-allwriters__close { display: none; }
.hv-allwriters[open] .hv-allwriters__open { display: none; }
.hv-allwriters[open] .hv-allwriters__close { display: inline; }
.hv-allwriters__chevron { transition: transform 0.15s ease; }
.hv-allwriters[open] .hv-allwriters__chevron { transform: rotate(180deg); }
.hv-allwriters__panel { margin-block-start: 12px; padding: 14px; border: 1px solid #CCCCCC; background: #F7F7F7; }
.hv-allwriters__filter { inline-size: 100%; max-inline-size: 22rem; margin-block-end: 12px; }
/* row by row, so the most-articles-first order reads across, then down */
.hv-allwriters__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 24px;
  margin: 0; padding: 0; list-style: none; font-size: 0.9em; max-block-size: 28rem; overflow-y: auto; }
.hv-allwriters__list li { padding: 3px 0; }
.hv-allwriters__list li[hidden] { display: none; }
.hv-allwriters__list a { color: #006699; text-decoration: none; }
.hv-allwriters__list a:hover { color: #CC0000; text-decoration: underline; }
.hv-allwriters__none { margin: 0; color: #999999; }
.hv-button-outline { display: inline-flex; align-items: center; padding: 8px 16px; border: 1px solid #006699; color: #006699;
  font-weight: 700; text-decoration: none; background: #FFFFFF; }
.hv-button-outline:hover { border-color: #CC0000; color: #CC0000; }

/* ---- the intro and the timeline in one row (templates/index.html, .hv-top) ------------------------ */
.hv-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: stretch; }
.hv-top > .hv-block { margin-block-start: 0; }
.hv-top .hv-intro { display: flex; flex-direction: column; justify-content: center; text-align: start; padding: 20px 22px; }
.hv-top .hv-intro__title { font-size: 1.7em; }
.hv-top .hv-intro__lede { margin-block-end: 18px; }
.hv-top .hv-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; justify-content: stretch; }
.hv-top .hv-stats li { display: flex; flex-direction: column; padding: 8px 10px; background: #FFFFFF; border: 1px solid #E5E5E5; line-height: 1.3; }
.hv-top .hv-stats b { font-size: 1.5em; color: #006699; }
.hv-top .hv-stats a { display: flex; flex-direction: column; }
.hv-top .hv-timeline { display: flex; flex-direction: column; }
.hv-top .hv-tl { flex: 1; gap: 6px; }
.hv-top .hv-tl__year { min-inline-size: 0; flex: 1 1 0; }
.hv-top .hv-tl__bars { block-size: 140px; gap: 1px; }
.hv-top .hv-tl__bar { min-inline-size: 2px; }
.hv-top .hv-tl__label { font-size: 0.9em; }
.hv-top .hv-legend { font-size: 0.75em; gap: 3px 10px; }
@media (max-width: 52rem) {
  .hv-top { grid-template-columns: minmax(0, 1fr); }
  .hv-top .hv-tl__year { min-inline-size: 9rem; flex: 1 0 auto; }
}
