/* Goodwire — warm morning-paper redesign (2026-07-03) */

:root {
  --paper: #faf6ee;
  --card: #ffffff;
  --ink: #2b2418;
  --muted: #7d7263;
  --line: #eae2d3;
  --accent: #e8890c;
  --accent-soft: #fdf0dc;
  --link: #b05e00;
  --shadow: 0 1px 2px rgba(60, 45, 20, .05), 0 10px 30px rgba(60, 45, 20, .07);
  --radius: 16px;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
[data-theme="dark"] {
  --paper: #201a12;
  --card: #2a2317;
  --ink: #f0e8d8;
  --muted: #a89a83;
  --line: #3a3222;
  --accent: #f4a821;
  --accent-soft: #3a2f1a;
  --link: #f4b95a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  transition: background .25s, color .25s;
}
a { color: var(--link); }
button { font-family: inherit; }

/* nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem 1.3rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.brand-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
.nav-right { display: flex; align-items: center; gap: .7rem; }
.searchbox {
  display: flex; align-items: center; gap: .45rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .42rem .9rem; min-width: 150px;
}
.searchbox svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.searchbox input {
  border: none; outline: none; background: none; color: var(--ink);
  font-size: .92rem; width: 160px;
}
.searchbox input::placeholder { color: var(--muted); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .15s;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

/* masthead */
.masthead { text-align: center; padding: 3.2rem 1.3rem 2.2rem; }
.masthead-date {
  font-size: .82rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .8rem;
}
.masthead h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.12; letter-spacing: -.015em;
  max-width: 21ch; margin: 0 auto .8rem;
}
.masthead h1 em { font-style: italic; color: var(--accent); }
.masthead-sub { color: var(--muted); max-width: 46ch; margin: 0 auto; font-size: 1.02rem; }

/* controls */
.controls { max-width: 1080px; margin: 0 auto; padding: 0 1.3rem; }
.tabs { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tab {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 600; color: var(--muted);
  padding: .55rem .1rem; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.pills { display: flex; gap: .45rem; flex-wrap: wrap; }
.pill {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: .86rem; font-weight: 600; padding: .34rem .85rem; border-radius: 999px;
  cursor: pointer; transition: all .15s;
}
.pill:hover { border-color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
#sort-select {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: .88rem; font-weight: 600; padding: .4rem .7rem; border-radius: 10px; cursor: pointer;
}

/* feed */
.main { max-width: 1080px; margin: 0 auto; padding: 0 1.3rem 3rem; }
.feed { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; align-items: start; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-2px); }
.card-img { width: 100%; aspect-ratio: 16/8.5; object-fit: cover; background: var(--accent-soft); }
.card-body { padding: 1.15rem 1.25rem 1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-meta { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--muted); }
.cat-chip {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft);
  padding: .18rem .6rem; border-radius: 999px;
}
.card-title {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.3; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.card-desc {
  color: var(--muted); font-size: .93rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot {
  margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.card-src { font-size: .82rem; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; align-items: center; gap: .3rem; flex: none; }
.act-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--line); background: none; color: var(--muted);
  font-size: .84rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.act-btn:hover { border-color: var(--accent); color: var(--accent); }
.act-btn.voted { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.act-btn svg { width: 15px; height: 15px; }

/* featured card spans both columns */
.card.featured { grid-column: 1 / -1; flex-direction: row; min-height: 300px; }
.card.featured .card-img { width: 52%; aspect-ratio: auto; }
.card.featured .card-body { padding: 1.8rem 1.9rem 1.4rem; }
.card.featured .card-title { font-size: 1.85rem; line-height: 1.2; }
.card.featured .card-desc { -webkit-line-clamp: 4; font-size: 1rem; }

/* community attribution */
.picked-by { font-size: .82rem; color: var(--accent); font-weight: 600; }

.feed-status { text-align: center; color: var(--muted); padding: 2.5rem 0; font-size: .95rem; }
.feed-status[hidden] { display: none; }
.load-more {
  display: block; margin: 2rem auto 0;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  font-size: .95rem; font-weight: 700; padding: .75rem 1.9rem; cursor: pointer;
  transition: filter .15s;
}
.load-more:hover { filter: brightness(1.07); }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 1.8rem 1.3rem; }
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: .88rem;
}

@media (max-width: 760px) {
  .searchbox input { width: 100px; }
  .feed { grid-template-columns: 1fr; }
  .card.featured { flex-direction: column; }
  .card.featured .card-img { width: 100%; aspect-ratio: 16/9; }
  .card.featured .card-title { font-size: 1.45rem; }
  .masthead { padding-top: 2.2rem; }
}
