/* TCB — The Conservative Bugler — Magazine-style news feed */

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #ffffff;
  --off-white: #f8f9fa;
  --light-gray: #e9ecef;
  --mid-gray: #6c757d;
  --dark-gray: #343a40;
  --navy: #1a2e4a;
  --navy-light: #2c3e5a;
  --blue: #3b82f6;
  --blue-dark: #1d4ed8;
  --red: #c0392b;
  --red-dark: #a93226;
  --gold: #d4a84b;

  --font-sans: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --radius: 8px;
  --radius-lg: 12px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--off-white);
  color: var(--dark-gray);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Top Bar ───────────────────────────────────────────────── */
.tcb-topbar {
  background: var(--navy);
  border-bottom: 3px solid var(--red);
  padding: 0 48px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.tcb-topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 32px;
}

.tcb-brand {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
  text-decoration: none;
}
.tcb-brand:hover { text-decoration: none; }
.tcb-brand-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tcb-brand-tagline {
  font-size: 0.65rem;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ─── Search ────────────────────────────────────────────────── */
.tcb-search {
  flex: 1;
  max-width: 480px;
  padding: 12px 0;
}
.tcb-search-form {
  display: flex;
  gap: 8px;
}
.tcb-search-input {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  background: rgba(255,255,255,.08);
  color: var(--white);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.tcb-search-input::placeholder { color: rgba(255,255,255,.45); }
.tcb-search-input:focus {
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.12);
}
.tcb-search-btn {
  padding: 8px 16px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-sans);
}
.tcb-search-btn:hover { background: var(--red-dark); }

/* ─── Category Bar ─────────────────────────────────────────── */
.tcb-catbar {
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
  padding: 0 48px;
  position: sticky;
  top: 68px;
  z-index: 99;
  box-shadow: var(--shadow-sm);
}
.tcb-catbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.tcb-catbar-inner::-webkit-scrollbar { display: none; }

.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
  white-space: nowrap;
  background: var(--off-white);
  color: var(--navy);
  text-decoration: none;
}
.cat-btn:hover {
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
  border-color: var(--navy);
}
.cat-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.cat-btn.editorial {
  border-color: var(--red);
  color: var(--red);
}
.cat-btn.editorial:hover,
.cat-btn.editorial.active {
  background: var(--red);
  color: var(--white);
}

/* ─── Main Layout ───────────────────────────────────────────── */
.tcb-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px 64px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
}

/* ─── Section Headers ──────────────────────────────────────── */
.tcb-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tcb-section-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tcb-section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: var(--red);
  border-radius: 2px;
}

/* ─── Article Cards ────────────────────────────────────────── */
.article-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.article-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--light-gray);
  overflow: hidden;
  min-height: 160px;
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.article-card:hover .card-image-wrap img { transform: scale(1.03); }

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}
.card-image-placeholder svg { opacity: 0.3; }

.source-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--navy);
  color: var(--white);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 0.88rem;
  color: var(--mid-gray);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: 14px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--light-gray);
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.card-author {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
}
.card-date {
  font-size: 0.75rem;
  color: var(--mid-gray);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--red);
  padding: 6px 14px;
  border: 1.5px solid var(--red);
  border-radius: 100px;
  transition: all 0.15s;
  white-space: nowrap;
}
.read-more:hover {
  background: var(--red);
  color: var(--white);
  text-decoration: none;
}

/* Fair Use tag on every card */
.fair-use-tag {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.85);
  font-size: 0.62rem;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

/* ─── Featured / Hero Article ──────────────────────────────── */
.featured-card {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  margin-bottom: 32px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.featured-card:hover { box-shadow: var(--shadow-lg); text-decoration: none; }

.featured-image-wrap {
  position: relative;
  aspect-ratio: 16/10;
  background: var(--navy);
  overflow: hidden;
}
.featured-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.featured-body {
  padding: 28px 28px 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 14px;
}

.featured-excerpt {
  font-size: 0.9rem;
  color: var(--mid-gray);
  line-height: 1.65;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Editorial Cards ───────────────────────────────────────── */
.editorial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
  border-left: 4px solid var(--red);
  transition: box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.editorial-card:hover { box-shadow: var(--shadow-md); text-decoration: none; }

.editorial-body {
  padding: 16px 18px 18px;
}

.editorial-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.editorial-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 8px;
}
.editorial-byline {
  font-size: 0.78rem;
  color: var(--mid-gray);
}
.editorial-excerpt {
  font-size: 0.85rem;
  color: var(--mid-gray);
  line-height: 1.6;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.tcb-sidebar {
  position: sticky;
  top: 136px;
}

.sidebar-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 24px;
}
.sidebar-section-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  background: var(--red);
  border-radius: 2px;
}

/* Source list */
.source-list { list-style: none; }
.source-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.source-list li:last-child { border-bottom: none; }
.source-name { color: var(--navy); font-weight: 600; }
.source-count { font-size: 0.75rem; color: var(--mid-gray); }

/* Fair use sidebar box */
.fair-use-box {
  background: #f0f4f8;
  border: 1px solid #c8d8e8;
  border-radius: var(--radius);
  padding: 16px;
}
.fair-use-box h4 {
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--navy);
}
.fair-use-box p {
  font-size: 0.78rem;
  color: var(--mid-gray);
  line-height: 1.55;
  margin-bottom: 8px;
}
.fair-use-box a { font-size: 0.78rem; }

/* ─── Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 40px 0 24px;
  grid-column: 1 / -1;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s;
}
.pagination a {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--light-gray);
  text-decoration: none;
}
.pagination a:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.pagination .current {
  background: var(--red);
  color: var(--white);
  border: 1px solid var(--red);
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--mid-gray);
}
.empty-state svg { opacity: 0.3; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--navy); }
.empty-state p { font-size: 0.9rem; }

/* ─── Footer ────────────────────────────────────────────────── */
.tcb-footer {
  background: var(--navy);
  color: rgba(255,255,255,.65);
  padding: 40px 48px 32px;
  margin-top: 40px;
}
.tcb-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
}
.footer-brand-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.footer-tagline {
  font-size: 0.78rem;
  margin-bottom: 16px;
}
.footer-fair-use {
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(255,255,255,.45);
}
.footer-col-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 14px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a {
  color: rgba(255,255,255,.65);
  font-size: 0.85rem;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--white); text-decoration: none; }
.footer-bottom {
  max-width: 1400px;
  margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: var(--white); }

/* ─── Loading skeleton ──────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--light-gray) 25%, #e2e8f0 50%, var(--light-gray) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .tcb-main { grid-template-columns: 1fr; }
  .tcb-sidebar { position: static; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-image-wrap { aspect-ratio: 16/7; }
}

@media (max-width: 768px) {
  .tcb-topbar { padding: 0 20px; }
  .tcb-topbar-inner { flex-wrap: wrap; gap: 0; }
  .tcb-search { max-width: 100%; order: 3; padding: 8px 0 12px; }
  .tcb-catbar { padding: 0 20px; top: auto; position: sticky; }
  .tcb-main { padding: 20px 20px 48px; }
  .tcb-footer { padding: 32px 20px 24px; }
  .tcb-footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .article-card { margin-bottom: 16px; }
  .card-title { font-size: 1rem; }
}

@media (max-width: 480px) {
  .tcb-brand-name { font-size: 1.1rem; }
  .cat-btn { padding: 5px 12px; font-size: 0.78rem; }
  .featured-title { font-size: 1.15rem; }
}

/* ─── High contrast mode toggle ─────────────────────────────── */
@media (prefers-contrast: high) {
  .article-card { border: 2px solid var(--navy); }
  .cat-btn { border-width: 2px; }
}