/* ═══════════════════════════════════════════════════════════
   PV Forum Archive — Premium Light Design (Matching WP Theme)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f3f5;
  --bg-header: rgba(255, 255, 255, 0.95);
  --bg-post: #ffffff;
  --bg-post-alt: #f8f9fa;
  --text: #212529;
  --text-muted: #495057;
  --text-dim: #868e96;
  --accent: #007bff;
  --accent-glow: rgba(0, 123, 255, 0.15);
  --accent-hover: #0056b3;
  --gold: #f59f00;
  --border: #e9ecef;
  --border-light: #f1f3f5;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.05);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base reset inside our archive container to not break WP styles */
.pv-forum-archive {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 30px;
  padding-bottom: 60px;
}

.pv-forum-archive a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
.pv-forum-archive a:hover { color: var(--accent-hover); }

/* ─── Archive Header / Search ────────────────────────────── */
.archive-topbar {
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.archive-title-link {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.archive-title-link svg { color: var(--accent); }

.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid #ced4da;
  border-radius: 999px;
  padding: 10px 20px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.075);
}
.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.1);
  max-height: 420px;
  overflow-y: auto;
  z-index: 2000;
}
.search-dropdown.active { display: block; }

.search-result {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  color: var(--text) !important;
}
.search-result:hover { background: var(--bg-card-hover); }
.search-result:last-child { border-bottom: none; }
.search-result-title { font-weight: 600; font-size: 0.95rem; }
.search-result-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.search-result-snippet { font-size: 0.85rem; color: var(--text-dim); margin-top: 4px; }
.search-no-results { padding: 20px 16px; text-align: center; color: var(--text-dim); }

/* ─── Breadcrumbs ────────────────────────────────────────── */
.breadcrumbs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.bc-sep { margin: 0 8px; color: #adb5bd; }
.bc-current { color: var(--text); font-weight: 500; }

/* ─── Main Content Area ──────────────────────────────────── */
.archive-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Banners & CTAs ─────────────────────────────────────── */
.archive-banner {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 16px 20px;
  margin-bottom: 30px;
  border-radius: 4px;
  color: #856404;
  font-size: 0.95rem;
}
.archive-banner strong { font-weight: 600; }
.archive-banner a { font-weight: 600; color: #856404; text-decoration: underline; }

.cta-banner {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}
.cta-banner h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 4px; color: white; }
.cta-banner p { font-size: 0.95rem; opacity: 0.9; margin: 0; }
.cta-button {
  background: white;
  color: var(--accent) !important;
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.cta-button:hover { transform: translateY(-2px); color: var(--accent-hover) !important; }

/* ─── Hero ───────────────────────────────────────────────── */
.forum-hero {
  text-align: center;
  padding: 40px 24px 50px;
}
.forum-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── Forum Cards (Index) ────────────────────────────────── */
.forum-list {
  display: grid;
  gap: 16px;
}

.forum-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text) !important;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.forum-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.forum-card-icon { font-size: 2rem; flex-shrink: 0; width: 50px; text-align: center; }

.forum-card-body { flex: 1; min-width: 0; }
.forum-card-body h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; color: var(--accent); }
.forum-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.4; }

.forum-card-stats {
  display: flex;
  gap: 24px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  padding-left: 24px;
}
.stat {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat strong {
  display: block;
  font-size: 1.2rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
}

/* ─── Forum Page Header ──────────────────────────────────── */
.forum-page-header {
  padding: 20px 0 30px;
}
.forum-page-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.topic-count {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ─── Topic List ─────────────────────────────────────────── */
.topic-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topic-list-header {
  display: grid;
  grid-template-columns: 1fr 150px 80px 80px 140px;
  padding: 16px 24px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: #f8f9fa;
  border-bottom: 2px solid var(--border);
}

.topic-row {
  display: grid;
  grid-template-columns: 1fr 150px 80px 80px 140px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  color: var(--text) !important;
  transition: background var(--transition);
  align-items: center;
}
.topic-row:last-child { border-bottom: none; }
.topic-row:hover { background: var(--bg-card-hover); }

.td-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
  padding-right: 16px;
  line-height: 1.4;
}
.td-author { font-size: 0.9rem; color: var(--text-muted); }
.td-stats { font-size: 0.9rem; color: var(--text-muted); text-align: center; font-weight: 500; }
.td-date { font-size: 0.85rem; color: var(--text-dim); text-align: right; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 40px 0;
}
.page-link, .page-current {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
}
.page-link {
  color: var(--text-muted) !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.page-link:hover { background: var(--bg-card-hover); color: var(--accent) !important; border-color: #adb5bd; }
.page-current {
  background: var(--accent);
  color: white !important;
  border: 1px solid var(--accent);
  font-weight: 600;
}
.page-dots { color: var(--text-dim); padding: 0 4px; }

/* ─── Layout with Sidebar ────────────────────────────────── */
.archive-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.sidebar-widget h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}
.widget-list { list-style: none; padding: 0; margin: 0; }
.widget-list li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.widget-list li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.widget-list a {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text) !important;
  line-height: 1.4;
}
.widget-list a:hover { color: var(--accent) !important; }
.widget-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ─── Topic Page ─────────────────────────────────────────── */
.topic-header {
  padding: 10px 0 30px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 30px;
}
.topic-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}
.topic-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  align-items: center;
}
.topic-meta span { display: flex; align-items: center; gap: 6px; }

.posts { display: grid; gap: 24px; }

.post {
  display: grid;
  grid-template-columns: 200px 1fr;
  background: var(--bg-post);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-sidebar {
  padding: 24px;
  background: #f8f9fa;
  border-right: 1px solid var(--border);
  text-align: center;
}
.post-author {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 6px;
  word-wrap: break-word;
}
.post-date {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.post-body { padding: 32px; }
.post-subject {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--text);
}
.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #343a40;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.post-content blockquote {
  border-left: 4px solid var(--accent);
  background: #f8f9fa;
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}
.post-content blockquote cite {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 8px;
  font-style: normal;
}
.post-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(0, 123, 255, 0.3);
  text-underline-offset: 3px;
  font-weight: 500;
}
.post-content a:hover { text-decoration-color: var(--accent); }

/* Auto-links styling */
.post-content a.auto-link {
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
}
.post-content a.auto-link:hover {
  border-bottom-style: solid;
}

/* ─── Ads ────────────────────────────────────────────────── */
.ad-container {
  margin: 30px 0;
  text-align: center;
  background: #f8f9fa;
  padding: 10px;
  border: 1px dashed #dee2e6;
  border-radius: var(--radius-sm);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 8px;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 992px) {
  .archive-layout { grid-template-columns: 1fr; }
  .topic-list-header { display: none; }
  .topic-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .td-title { padding-right: 0; }
}

@media (max-width: 768px) {
  .archive-topbar { flex-direction: column; align-items: stretch; }
  .header-search { max-width: 100%; }
  
  .forum-card { flex-direction: column; align-items: flex-start; gap: 16px; }
  .forum-card-stats { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; width: 100%; justify-content: flex-start; }

  .post { grid-template-columns: 1fr; }
  .post-sidebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    text-align: left;
  }
  .post-author { margin-bottom: 0; }
  .post-body { padding: 20px; }
  
  .cta-banner { flex-direction: column; text-align: center; gap: 16px; }
}
