/* ncircular /wire ("The Wire") — editorial redesign (2026-09-07).
   Loaded AFTER ../theme/stylesheet/site.css, which supplies the shared
   design tokens (:root vars), base typography, and the .masthead/.nav-links
   component — so this file only needs the things unique to this page: the
   secondary "wire toolbar", the source-grouped/jumble card grids, and dark
   mode (the main site has no dark mode, so all of that lives here).

   Card grids use flexbox + flex-grow rather than CSS grid specifically so a
   trailing partial row (3 cards, 2 cards…) always stretches to fill the
   full width instead of leaving an empty gap where a 4th/3rd card would
   have been. */

/* -- wire toolbar (page-specific controls, below the shared masthead) -------- */

.wire-toolbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.wire-toolbar__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: .6rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: .85rem;
  color: var(--ink-soft);
}

.nav-info { flex: 1; }
.nav-updated { font-size: .85em; }

.sorter a {
  background: var(--accent);
  color: #fff;
  padding: .4rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .85em;
}
.sorter a:hover { background: var(--accent-light); color: #fff; }

.theme-toggle {
  background: var(--ink);
  color: #fff;
  border: none;
  padding: .35rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-width: 38px;
  justify-content: center;
}
.theme-toggle:hover { background: var(--accent); }
.theme-toggle:focus, .toggle-btn:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* -- page shell --------------------------------------------------------------- */

#wrapper, #jumblewrapper, .jumble-container {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.5rem;
}

.page-intro, .jumble-intro {
  text-align: center;
  margin-bottom: 1.5rem;
}
.page-intro p, .jumble-intro p { color: var(--ink-soft); font-size: 1.05rem; margin: 0; }

.news-summary { text-align: center; margin: 2rem 0; color: var(--ink-soft); }

/* -- source sections ----------------------------------------------------------- */

.feeds-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.feed-section {
  flex: 1 1 320px;
  background: var(--paper-raised);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.section-header h2 { margin: 0; flex: 1; min-width: 160px; }
.section-header h2 a:hover { color: var(--accent); }

.feed-info { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }

.article-count {
  color: var(--ink-soft);
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.toggle-btn {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: .35rem .8rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: .8em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
.toggle-icon { transition: transform .2s ease; font-size: .8em; }
.toggle-btn[aria-expanded="true"] .toggle-icon { transform: rotate(180deg); }

/* entries within a section, as a card row that never leaves a trailing gap */
.feed-content {
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  max-height: 900px;
  overflow: hidden;
}
.feed-content.expanded { max-height: none; }

.news-entry {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 10px;
  transition: background-color .15s ease, transform .15s ease;
}
.news-entry:hover { background: #f2ece1; transform: translateY(-1px); }

.news-entry a { display: flex; flex-direction: column; flex: 1; padding: .9rem 1rem; color: inherit; }

.news-entry h3 {
  font-size: .98em;
  line-height: 1.3;
  margin-bottom: .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-entry:hover h3 { color: var(--accent); }

.news-entry time { margin-top: auto; padding-top: .5rem; color: var(--ink-soft); font-size: .78em; text-transform: uppercase; letter-spacing: .03em; }

/* -- jumble (mixed) page: one flat card wall ----------------------------------- */

.jumble-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.jumble-entry {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.jumble-entry:hover { transform: translateY(-2px); }

.jumble-entry a { display: flex; flex-direction: column; flex: 1; padding: 1.2rem 1.3rem; color: inherit; }

.jumble-entry h3 {
  margin-bottom: .6rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.jumble-entry:hover h3 { color: var(--accent); }

.entry-meta { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: .8rem; }

.source {
  display: inline-block;
  font-size: .72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.entry-meta time { color: var(--ink-soft); font-size: .78em; }

/* -- footer --------------------------------------------------------------------- */

#footer {
  text-align: center;
  color: var(--ink-soft);
  padding: 2rem 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: .85em;
}
#footer p { margin-bottom: .4rem; }

/* -- responsive ------------------------------------------------------------------- */

@media (max-width: 640px) {
  .wire-toolbar__inner { padding: .6rem 1rem; }
  #wrapper, #jumblewrapper, .jumble-container { padding: 1rem; }
  .feeds-grid, .jumble-grid { gap: 1rem; }
  .feed-section, .jumble-entry { flex-basis: 100%; }
  .news-entry { flex-basis: 100%; }
  .section-header { padding: .8rem 1rem; }
  .feed-content { max-height: 340px; }
  .hidden-mobile { display: none; }
  .feed-content.expanded .hidden-mobile { display: block; }
}

/* -- dark mode (this page only — the main site has no dark mode) ----------------- */

body.dark-mode {
  background-color: #16151a;
  color: #e8e4dd;
}
body.dark-mode .masthead { background: #1f1e24; border-color: #33323a; }
body.dark-mode .masthead__title, body.dark-mode .masthead__subtitle { color: #e8e4dd; }
body.dark-mode .nav-links a { color: #e8e4dd; }
body.dark-mode .wire-toolbar { background: #1f1e24; border-color: #33323a; }
body.dark-mode .nav-info, body.dark-mode .nav-updated { color: #9b978f; }
body.dark-mode .feed-section, body.dark-mode .jumble-entry { background: #232228; box-shadow: none; border: 1px solid #33323a; }
body.dark-mode .section-header { border-color: #33323a; }
body.dark-mode .section-header h2 a { color: #e8e4dd; }
body.dark-mode .news-entry { background: #2a2930; }
body.dark-mode .news-entry:hover { background: #33323a; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode .news-entry h3, body.dark-mode .jumble-entry h3 { color: #e8e4dd; }
body.dark-mode .toggle-btn { background: #2a2930; border-color: #33323a; color: #e8e4dd; }
body.dark-mode .article-count, body.dark-mode .page-intro p, body.dark-mode .jumble-intro p,
body.dark-mode .news-summary, body.dark-mode #footer { color: #9b978f; }

/* -- print ------------------------------------------------------------------------- */

@media print {
  .masthead, .wire-toolbar, #footer, .toggle-btn, .sorter, .theme-toggle { display: none; }
  .feed-section, .jumble-entry { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .feed-content { max-height: none !important; }
  .hidden-mobile { display: block !important; }
  a { color: #000 !important; text-decoration: underline; }
}
