/* ============================================================
   writing.css — writing list page specific styles
   ============================================================ */

.page-header { max-width: 1100px; margin: 0 auto; padding: 4rem 2.5rem 2.5rem; border-bottom: 1px solid var(--line); }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.5rem, 5vw, 3.75rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 0.75rem; }
.page-header h1 em { font-style: italic; color: var(--accent); }
.page-header p { font-size: 1rem; color: var(--ink2); line-height: 1.7; max-width: 520px; }

/* ── FILTER PILLS ── */
.filters-wrap { border-bottom: 1px solid var(--line); position: sticky; top: 62px; background: var(--bg); z-index: 40; transition: background 0.3s; }
.filters-inner { max-width: 1100px; margin: 0 auto; padding: 0 2.5rem; display: flex; align-items: center; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(to right, transparent 0, black 2rem, black calc(100% - 2rem), transparent 100%); mask-image: linear-gradient(to right, transparent 0, black 2rem, black calc(100% - 2rem), transparent 100%); }
.filters-inner::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1rem; border-radius: 100px; font-size: 12px; font-weight: 500; letter-spacing: 0.04em; color: var(--ink2); background: transparent; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: var(--transition); flex-shrink: 0; margin: 0.65rem 0; font-family: 'Jost', sans-serif; }
.pill:hover { background: var(--bg2); color: var(--ink); }
.pill.active { background: var(--ink); color: var(--bg); border-color: transparent; }
[data-theme="dark"] .pill.active { background: var(--accent); color: #0e0e0e; }
.pill-count { font-size: 10px; opacity: 0.6; font-weight: 400; }

/* ── CONTENT ── */
.content-wrap { max-width: 1100px; margin: 0 auto; padding: 3rem 2.5rem 5rem; overflow-x: clip; }
.results-count { font-size: 12px; color: var(--ink3); margin-bottom: 1.5rem; letter-spacing: 0.02em; }

/* ── FEATURED ── */
.feat-article { display: grid; grid-template-columns: 1fr 440px; gap: 3rem; align-items: center; padding-bottom: 3rem; border-bottom: 1px solid var(--line); margin-bottom: 3rem; cursor: pointer; }
/* When there's no cover image, collapse to single column */
.feat-article:not(:has(.feat-art-img-wrap)) { grid-template-columns: 1fr; max-width: 680px; }
.feat-article:hover .feat-art-title { color: var(--accent); }
.feat-article:hover .feat-art-img { transform: scale(1.02); }
.feat-art-eyebrow { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.feat-badge { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); padding: 0.25rem 0.65rem; border-radius: 100px; }
.feat-topic { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); }
.feat-art-title { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 400; line-height: 1.2; letter-spacing: -0.03em; color: var(--ink); margin-bottom: 1rem; transition: color 0.2s; }
.feat-art-exc { font-size: 0.95rem; color: var(--ink2); line-height: 1.8; margin-bottom: 1.5rem; }
.feat-art-meta { display: flex; align-items: center; gap: 1.25rem; }
.feat-art-date { font-size: 12px; color: var(--ink3); }
.feat-art-read { font-size: 12px; font-weight: 500; color: var(--accent); display: flex; align-items: center; gap: 0.3rem; transition: gap 0.15s; }
.feat-article:hover .feat-art-read { gap: 0.5rem; }
.feat-art-img-wrap { border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--sh2); }
.feat-art-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s cubic-bezier(0.4,0,0.2,1); }

/* ── ARTICLE LIST ── */
.articles-section-title { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink3); margin-bottom: 1.5rem; }
.article-list { display: flex; flex-direction: column; }
.article-row { display: grid; grid-template-columns: 100px 1fr auto; gap: 1.5rem; align-items: center; padding: 1.4rem 0; border-bottom: 1px solid var(--line); cursor: pointer; transition: var(--transition); text-decoration: none; color: inherit; }
/* Collapse image column when there's no cover */
.article-row:not(:has(.row-img)) { grid-template-columns: 1fr auto; }
.row-img-wrap--empty { display: none; }
.article-row:first-child { border-top: 1px solid var(--line); }
.article-row:hover { background: var(--bg2); padding-left: 0.75rem; padding-right: 0.75rem; border-radius: 10px; border-color: transparent; margin: 0 -0.75rem; }
.article-row:hover .row-title { color: var(--accent); }
.article-row:hover .row-arrow { transform: translateX(4px); color: var(--accent); opacity: 1; }
.row-img-wrap { width: 100px; height: 66px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: var(--bg3); }
.row-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.article-row:hover .row-img { transform: scale(1.06); }
.row-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.35rem; }
.row-topic { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.row-date { font-size: 11px; color: var(--ink3); }
.row-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 400; line-height: 1.3; letter-spacing: -0.02em; color: var(--ink); transition: color 0.2s; margin-bottom: 0.25rem; }
.row-exc { font-size: 12px; color: var(--ink3); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; flex-shrink: 0; }
.row-readtime { font-size: 11px; color: var(--ink3); white-space: nowrap; }
.row-arrow { font-size: 16px; color: var(--ink3); opacity: 0.4; transition: var(--transition); }
.empty-state { text-align: center; padding: 5rem 2rem; display: none; }
.empty-state.visible { display: block; }
.empty-icon { font-size: 2rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-text { font-size: 0.95rem; color: var(--ink3); }

@media (max-width: 900px) {
  .page-header { padding: 3rem 1.5rem 2rem; }
  .filters-inner { padding: 0 1.5rem; }
  .content-wrap { padding: 2.5rem 1.5rem 4rem; }
  .feat-article { grid-template-columns: 1fr; gap: 1.75rem; }
  .feat-art-img-wrap { aspect-ratio: 16/9; order: -1; }
}

@media (max-width: 600px) {
  .filters-wrap { top: 56px; }
  .page-header { padding: 2rem 1rem 1.5rem; }
  .filters-inner { padding: 0 1rem; }
  .content-wrap { padding: 2rem 1rem 3rem; }
  .feat-article { gap: 1.25rem; }
  .feat-art-title { font-size: 1.5rem; }
  .article-row { grid-template-columns: auto 1fr; gap: 1rem; }
  .row-img-wrap { width: 72px; height: 50px; }
  .row-right { display: none; }
  .row-img-wrap { width: 72px; height: 50px; }
  .row-exc { display: none; }
  .article-row:hover { background: var(--bg2); border-radius: 8px; padding-left: 0.5rem; padding-right: 0.5rem; margin: 0; border-color: transparent; }
  .row-tags { display: none; }
}

/* ── TAGS FILTER BAR ── */
.tags-wrap {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.tags-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.tags-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-right: 0.25rem;
  flex-shrink: 0;
}
.tag-pill {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink3);
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.tag-pill:hover { background: var(--bg3); color: var(--ink); border-color: var(--line2); }
.tag-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tag-pill--clear { background: transparent; color: var(--ink3); border-color: var(--line); }
.tag-pill--clear:hover { background: var(--bg2); }

/* ── TAGS ON ARTICLE ROWS ── */
.row-tags {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
  max-height: 2.4rem;    /* ~2 lines of tags */
  overflow: hidden;
}
.row-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink3);
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
  text-decoration: none;
  transition: var(--transition);
}
.row-tag:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

@media (max-width: 900px) { .tags-inner { padding: 0.5rem 1.5rem; } }
@media (max-width: 600px) { .tags-inner { padding: 0.5rem 1rem; } .tags-label { display: none; } }