/* Wavelengths index (/articles) only. Hand-authored: the Tailwind standalone
   binary is not available on this host, so any new utility class would be a
   silent no-op. Colours come from the shared brand tokens so the manual dark
   toggle and the OS preference are both handled upstream. */

.wl-root {
  --wl-radius: 1rem;
  --wl-gap: 1.5rem;
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  background: var(--brand-bg);
  overflow-x: hidden;
}

.wl-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wl-root a:focus-visible,
.wl-root button:focus-visible,
.wl-root input:focus-visible,
.wl-root select:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* Hero. Content index, not a landing page: reading list starts near the fold.
   Product landings use tdh-hero__frame--product for viewport fill; articles
   keeps the shared tdh-hero chrome content-sized. Belt-and-braces override. */
.articles-page .tdh-hero .tdh-hero__frame {
  min-height: 0;
}
@media (min-width: 1024px) {
  .articles-page .wl-feedlinks {
    justify-content: flex-start;
  }
}

.wl-hero {
  position: relative;
  padding: 2.5rem 1rem 1.75rem;
}
@media (min-width: 640px) {
  .wl-hero {
    padding: 3rem 1.5rem 2rem;
  }
}
.wl-hero__inner {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}
.wl-hero__eyebrow:not(.tdh-chip) {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
}
.wl-hero__eyebrow.tdh-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.wl-hero__title {
  margin: 0;
  font-family: var(--font-heading, "Space Grotesk", system-ui, sans-serif);
  font-size: 1.875rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--brand-text);
}
@media (min-width: 640px) {
  .wl-hero__title {
    font-size: 2.375rem;
  }
}
.wl-hero__lead {
  max-width: 34rem;
  margin: 0.625rem auto 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--brand-text-muted);
}

/* Slim feed row: RSS/Atom demoted from a boxed sidebar card to two quiet
   inline text links, so they no longer compete with the article list for
   visual weight. */
.wl-feedlinks {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0.875rem 0 0;
  font-size: 0.8125rem;
  color: var(--brand-text-muted);
}
.wl-feedlinks__link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.wl-feedlinks__link:hover {
  color: var(--brand-text);
  border-bottom-color: currentColor;
}
.wl-feedlinks__sep {
  opacity: 0.5;
}

/* Layout */
.wl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  align-items: start;
  border-top: 1px solid var(--brand-border);
}
@media (min-width: 640px) {
  .wl-layout {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .wl-layout.wl-layout--with-side {
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: 3rem;
  }
}
.wl-main {
  min-width: 0;
}

/* Filters: a slim single-row bar, not a boxed form. Editorial pattern -
   text-forward controls above the list, no card, no equal-weight column. */
.wl-filters {
  margin-bottom: 1.75rem;
  padding-bottom: 1.125rem;
  border-bottom: 1px solid var(--brand-border);
}
.wl-filters__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 0.75rem;
}
.wl-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.wl-field--search {
  flex: 1 1 14rem;
  min-width: 10rem;
}
.wl-field:not(.wl-field--search) {
  flex: 0 1 auto;
}
.wl-field__label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--brand-text-muted);
}
.wl-field__input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
  color: var(--brand-text);
  background: transparent;
  border: 1px solid var(--brand-border);
  border-radius: 0.5rem;
}
.wl-field--search .wl-field__input {
  background: var(--brand-surface);
}
.wl-field__input::placeholder {
  color: var(--brand-text-muted);
}
select.wl-field__input {
  appearance: none;
  padding-right: 1.75rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 0.95rem center, right 0.65rem center;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
}
.wl-filters__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}
.wl-filters__actions .wl-btn {
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
}
@media (max-width: 480px) {
  .wl-filters__form {
    align-items: stretch;
  }
  .wl-field:not(.wl-field--search) {
    flex: 1 1 45%;
  }
  .wl-filters__actions {
    margin-left: 0;
    flex: 1 1 100%;
  }
}

.wl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.125rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.wl-btn--primary {
  color: var(--brand-bg);
  background: var(--brand-text);
}
.wl-btn--primary:hover {
  background: var(--brand-text-muted);
}
.wl-btn--ghost {
  color: var(--brand-text);
  background: transparent;
  border-color: var(--brand-border);
}
.wl-btn--ghost:hover {
  border-color: var(--brand-text);
}

.wl-chips {
  margin-top: 0.875rem;
}
.wl-chips__label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
}
.wl-chips__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--brand-text);
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
}
/* Audit finding (320-768px, coarse pointers): the 32px pill was a real tap
   target (removes a filter), under the 44px minimum. Grown on touch only,
   so the desktop chip row keeps its denser, mouse-driven sizing. */
@media (pointer: coarse) {
  .wl-chip {
    min-height: 2.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}
.wl-chip:hover {
  border-color: var(--brand-text);
}
.wl-chip__x {
  font-size: 1rem;
  line-height: 1;
  color: var(--brand-text-muted);
}

/* Results */
.wl-results__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.wl-results__heading {
  margin: 0;
  font-family: var(--font-heading, "Space Grotesk", system-ui, sans-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--brand-text);
}
.wl-results__count {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--brand-text-muted);
}

/* View switch (list / 2-col / 3-col). Default with no override class present
   is 2-column on desktop (1-column on narrow viewports), so a blocked
   localStorage or a no-JS visitor still gets the documented default rather
   than an undefined in-between state. */
.wl-viewswitch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  border: 1px solid var(--brand-border);
  border-radius: 0.75rem;
  background: var(--brand-surface-elevated);
}
.wl-viewswitch__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.wl-viewswitch__btn:hover {
  color: var(--brand-text);
  border-color: var(--brand-border);
}
.wl-viewswitch__btn[aria-pressed="true"] {
  color: var(--brand-bg);
  background: var(--brand-text);
}
.wl-viewswitch__icon {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}

.wl-grid {
  display: grid;
  gap: var(--wl-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .wl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Overrides win on specificity (html + class beats the bare .wl-grid rules
   above), so source order does not matter and no !important is needed. */
html.articles-view-2col .wl-grid,
html.blog-view-2col .wl-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  html.articles-view-2col .wl-grid,
  html.blog-view-2col .wl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
html.articles-view-3col .wl-grid,
html.blog-view-3col .wl-grid {
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  html.articles-view-3col .wl-grid,
  html.blog-view-3col .wl-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  html.articles-view-3col .wl-grid,
  html.blog-view-3col .wl-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
html.articles-view-list .wl-grid,
html.blog-view-list .wl-grid {
  grid-template-columns: 1fr;
}

/* List mode: same card partial, restyled into a full-width row. */
html.articles-view-list .wl-card__link,
html.blog-view-list .wl-card__link {
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}
html.articles-view-list .wl-card__link:hover,
html.blog-view-list .wl-card__link:hover {
  transform: none;
}
html.articles-view-list .wl-card__media,
html.blog-view-list .wl-card__media {
  flex: 0 0 auto;
  width: 7rem;
  border-bottom: none;
  border-right: 1px solid var(--brand-border);
}
@media (min-width: 640px) {
  html.articles-view-list .wl-card__media,
  html.blog-view-list .wl-card__media {
    width: 11rem;
  }
}
html.articles-view-list .wl-card__img,
html.blog-view-list .wl-card__img {
  width: 100%;
  height: auto;
}
html.articles-view-list .wl-card__body,
html.blog-view-list .wl-card__body {
  padding: 0.875rem 1.25rem;
}
html.articles-view-list .wl-card__excerpt,
html.blog-view-list .wl-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wl-card {
  height: 100%;
}
.wl-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid var(--brand-border);
  border-radius: var(--wl-radius);
  background: var(--brand-surface-elevated);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.wl-card__link:hover {
  border-color: var(--brand-text);
  transform: translateY(-2px);
}
.wl-card__media {
  display: block;
  border-bottom: 1px solid var(--brand-border);
}
.wl-card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.wl-card__img--empty {
  background: var(--brand-surface);
}
.wl-card__body {
  display: flex;
  flex: 1 1 auto;
  /* Without this, a flex child's default min-width:auto can push a long,
     unbroken title (a URL-like string with no spaces) wider than the card
     and cause horizontal overflow, most visible in list view where the
     body sits beside a fixed-width thumbnail. */
  min-width: 0;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
}
.wl-card__chip {
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
}
.wl-card__title {
  margin: 0;
  font-family: var(--font-heading, "Space Grotesk", system-ui, sans-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--brand-text);
}
.wl-card__excerpt {
  flex: 1 1 auto;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--brand-text-muted);
}
.wl-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--brand-text-muted);
}

/* Empty state - a considered pause in the reading list, not a wireframe
   placeholder. No dashed border (that reads as "unfinished"); a small mark,
   generous but not cavernous padding, and type that carries the section on
   its own. */
.wl-empty {
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.wl-empty__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 1.25rem;
  color: var(--brand-text-muted);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
}
.wl-empty__mark svg {
  width: 1.125rem;
  height: 1.125rem;
}
.wl-empty__title {
  margin: 0;
  font-family: var(--font-heading, "Space Grotesk", system-ui, sans-serif);
  font-size: 1.1875rem;
  font-weight: 600;
  color: var(--brand-text);
}
.wl-empty__text {
  max-width: 30rem;
  margin: 0.5rem auto 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--brand-text-muted);
}
.wl-empty__actions {
  margin: 1.5rem 0 0;
}

/* Pagination */
.wl-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border);
}
.wl-pagination__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-text);
  border: 1px solid var(--brand-border);
  border-radius: 0.625rem;
}
.wl-pagination__link:hover {
  border-color: var(--brand-text);
}
.wl-pagination__link--off {
  color: var(--brand-text-muted);
  opacity: 0.55;
}
.wl-pagination__status {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--brand-text-muted);
}

/* Sidebar. Typography and a hairline divider carry the structure here
   instead of stacking boxed cards - the sidebar is secondary navigation,
   it should read that way next to the article list. */
.wl-side {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  min-width: 0;
  padding-top: 0.25rem;
}
@media (min-width: 1024px) {
  .wl-side {
    position: sticky;
    top: calc(var(--page-nav-height, 4rem) + 1.5rem);
  }
}
.wl-panel {
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-border);
}
.wl-side > .wl-panel:first-of-type,
.wl-side > .wl-visually-hidden + .wl-panel {
  padding-top: 0;
  border-top: 0;
}
.wl-panel__title {
  margin: 0 0 0.625rem;
  font-family: var(--font-heading, "Space Grotesk", system-ui, sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand-text-muted);
}
.wl-panel__text {
  margin: 0 0 0.875rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--brand-text-muted);
}
.wl-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.wl-list__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--brand-text-muted);
  border-radius: 0.5rem;
}
.wl-list__link:hover {
  color: var(--brand-text);
  background: var(--brand-surface);
}
.wl-list__link[aria-current="page"] {
  font-weight: 600;
  color: var(--brand-bg);
  background: var(--brand-text);
}
.wl-list__count {
  flex: none;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.wl-popular {
  margin: 0;
  padding: 0 0 0 1.1rem;
  list-style: decimal;
  color: var(--brand-text-muted);
}
.wl-popular li + li {
  margin-top: 0.75rem;
}
.wl-popular__link {
  display: block;
  text-decoration: none;
}
.wl-popular__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--brand-text);
}
.wl-popular__link:hover .wl-popular__title {
  text-decoration: underline;
}
.wl-popular__meta {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--brand-text-muted);
}
.wl-feeds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Subscribe (bottom of page) */
.wl-subscribe {
  border-top: 1px solid var(--brand-border);
  padding: 2.5rem 1rem;
}
@media (min-width: 640px) {
  .wl-subscribe {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
.wl-subscribe__inner {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}
.wl-subscribe__title {
  margin: 0;
  font-family: var(--font-heading, "Space Grotesk", system-ui, sans-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--brand-text);
}
.wl-subscribe__text {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--brand-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .wl-root *,
  .wl-root *::before,
  .wl-root *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .wl-card__link:hover {
    transform: none;
  }
}
