/* === V2 — TCI-inspired black/white editorial === */
/* Loads after app.css on v2 pages only. */

/* White background everywhere on v2 */
body { background: #fff; }
nav.topbar { background: #fff; border-bottom: 1px dotted #000; }
nav.topbar a { color: #000; }
main { background: #fff; }
.site-footer { background: #fff; border-top: 1px dotted #000; }

/* ---- Outer containers ---- */
.v2-discovery,
.v2-bento {
  max-width: 100%;
  margin: 0;
  padding: 20px 20px 64px;
}

.v2-item-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ---- Header ---- */
.v2-feed-header,
.v2-bento-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px dotted #000;
}

.v2-site-title { font-size: 1.3rem; margin-bottom: 4px; }
.v2-site-title a { color: #000; text-decoration: none; }
.v2-site-tagline { color: #666; font-size: 0.82rem; }

.v2-bento-name { font-size: 1.3rem; margin-bottom: 5px; }
.v2-bento-bio { color: #555; font-size: 0.85rem; line-height: 1.5; }

/* ---- Tag filter nav ---- */
.v2-tag-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.v2-tag-filter {
  font-size: 0.78rem;
  padding: 4px 12px;
  border: 1px solid #000;
  border-radius: 0;
  color: #000;
  text-decoration: none;
  background: #fff;
}

.v2-tag-filter:hover,
.v2-tag-filter.active {
  background: #000;
  color: #fff;
  border-color: #000;
  text-decoration: none;
}

/* ---- Card grid: auto-fill 270px columns, partial last row stays at fixed width ---- */
.v2-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 270px);
  gap: 10px;
}

.v2-item-card {
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 270px;
  border: 1px dotted #000;
  position: relative;
  cursor: pointer;
}

.v2-item-card:hover {
  background: #f2f2f2;
  border: 1px solid #000;
}
.v2-item-card:hover .v2-item-title a { text-decoration: none; }

/* Thumbnail — fills top of card when og_image is present */
.v2-item-thumb {
  width: calc(100% + 28px);
  height: 130px;
  margin: -14px -14px 12px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.v2-item-card.pinned { background: #fafafa; }
.v2-item-card.pinned:hover { background: #f2f2f2; border: 1px solid #000; }

.v2-item-title {
  font-size: 1rem;
  font-weight: normal;
  line-height: 1.42;
  margin: 0;
  flex: 1;
}

.v2-item-title a { color: #000; text-decoration: none; }

/* ::after covers the full card, making it entirely clickable */
.v2-item-title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* No tags in grid — title + date only, like TCI */
.v2-item-tags { display: none; }

.v2-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: #aaa;
  margin-top: 16px;
  margin-bottom: 0;
}

.v2-pin {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #000;
  font-weight: bold;
}

.v2-meta-sep { color: #ccc; }
.v2-bento-link { color: #aaa; text-decoration: none; }
.v2-bento-link:hover { color: #000; }
.v2-item-date { color: #aaa; }
.v2-item-excerpt { display: none; }

.v2-empty {
  grid-column: 1 / -1;
  background: #fff;
  color: #999;
  padding: 32px 20px;
  font-size: 0.88rem;
}

.v2-pagination { margin-top: 20px; }

.v2-btn {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #000;
  color: #000;
  text-decoration: none;
  font-size: 0.82rem;
  background: #fff;
  border-radius: 0;
}

.v2-btn:hover { background: #000; color: #fff; text-decoration: none; }

/* ---- Item page ---- */
.v2-item-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.v2-item-page-title {
  font-size: 1.75rem;
  line-height: 1.2;
  margin-bottom: 16px;
  font-weight: normal;
}

.v2-item-page-title a { color: #000; text-decoration: none; }
.v2-item-page-title a:hover { text-decoration: underline; }

.v2-item-og-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
  margin-bottom: 32px;
  border: 1px dotted #000;
}

/* Meta row: date · tags · source — sits between title and body */
.v2-item-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #999;
  border-top: 2px solid #000;
  border-bottom: 1px solid #ddd;
  padding: 8px 0;
  margin-bottom: 32px;
}

.v2-item-meta-row a { color: #004de5; }
.v2-item-meta-row .v2-tag { display: inline; color: #999; font-size: 0.78rem; }
.v2-item-meta-row .v2-tag::before { content: "#"; }

.v2-item-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #000;
}

.v2-item-body h2 {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 2em 0 0.5em;
  color: #000;
}

.v2-item-body h3 {
  font-size: 1rem;
  font-weight: bold;
  margin: 1.5em 0 0.4em;
  color: #000;
}

.v2-item-body p { margin: 0 0 0.9em; }
.v2-item-body ul, .v2-item-body ol { margin: 0 0 0.9em 1.4em; }
.v2-item-body li { margin-bottom: 0.35em; line-height: 1.6; }
.v2-item-body a { color: #004de5; }
.v2-item-body a:hover { text-decoration: none; }
.v2-item-body strong { font-weight: bold; }

.v2-item-body blockquote {
  border-left: 2px solid #000;
  padding-left: 1em;
  color: #555;
  margin: 1em 0;
  font-style: italic;
}

.v2-item-body pre, .v2-item-body code {
  font-family: var(--courier);
  background: #f0f0f0;
  padding: 2px 5px;
  font-size: 0.88em;
}

.v2-item-body pre { padding: 14px; overflow-x: auto; margin: 1em 0; }
.v2-item-body pre code { background: none; padding: 0; }

/* Legacy source/back — replaced by bottom nav */
.v2-item-source { display: none; }
.v2-back { display: none; }

/* ---- Bottom navigation: Previous | Random | Next (TCI-style) ---- */
.v2-item-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: #000;
  border: 1px solid #000;
  margin-top: 56px;
  font-size: 0.85rem;
}

.v2-nav-btn {
  background: #fff;
  padding: 18px 20px;
  text-decoration: none;
  color: #000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 80px;
}

.v2-nav-btn:hover {
  background: #000;
  color: #fff;
  text-decoration: none;
}

.v2-nav-btn:hover .v2-nav-label { color: #aaa; }

.v2-nav-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
}

.v2-nav-title {
  font-size: 0.88rem;
  line-height: 1.35;
}

.v2-nav-center {
  text-align: center;
  justify-content: center;
  align-items: center;
}

.v2-nav-right {
  text-align: right;
  align-items: flex-end;
}

.v2-nav-disabled {
  background: #f8f8f8;
  color: #ccc;
  cursor: default;
  padding: 18px 20px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2-nav-disabled .v2-nav-label { color: #ddd; }

/* Mobile — single column cards */
@media (max-width: 640px) {
  .v2-discovery, .v2-bento { padding: 14px 12px 40px; }
  .v2-item-page { padding: 20px 14px 60px; }
  .v2-item-list { grid-template-columns: 1fr; }
  .v2-item-card { height: auto; min-height: 200px; }
  .v2-item-page-title { font-size: 1.35rem; }
  .v2-item-nav { grid-template-columns: 1fr; }
  .v2-bento-name { font-size: 1.1rem; }
}
