/* ══════════════════════════════════════════════
   INDUSTRIAL LUXURY — Headless Blog Design System
   shadcn-inspired tokens & components
   ══════════════════════════════════════════════ */

:root {
  /* ── Color Tokens ── */
  --bg-base: #0a0a0a;
  --bg-surface: #141414;
  --bg-element: #1c1c1c;
  --bg-elevated: #242424;
  --accent: #ffcc00;
  --accent-hover: #ffd633;
  --accent-soft: rgba(255, 204, 0, 0.08);
  --accent-glow: rgba(255, 204, 0, 0.25);
  --text-primary: #f5f5f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #27272a;
  --border-hover: #3f3f46;
  --destructive: #ef4444;

  /* ── Typography ── */
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, 'Segoe UI', sans-serif;

  /* ── Spacing ── */
  --header-h: 64px;
  --container: 1200px;
  --gap: 24px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* ── Transitions ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.35s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

.hidden { display: none !important; }
.mobile-only { display: none; }

/* ══════════ HEADER ══════════ */
#site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,10,10,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gap); height: var(--header-h);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent); color: var(--bg-base);
  display: grid; place-items: center;
  font-family: var(--font-heading); font-weight: 700; font-size: 18px;
}
.logo-text {
  font-family: var(--font-heading); font-weight: 700;
  font-size: 0.95rem; letter-spacing: 1px;
}
#main-nav { display: flex; gap: 4px; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 500;
  color: var(--text-secondary); transition: all var(--duration) ease;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-element); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: grid; place-items: center; color: var(--text-secondary);
  transition: all 0.2s ease;
}
.icon-btn:hover { background: var(--bg-element); color: var(--text-primary); }

/* Search Bar */
.search-bar {
  border-top: 1px solid var(--border); padding: 12px var(--gap);
  background: var(--bg-surface);
  animation: slideDown 0.3s var(--ease-out);
}
.search-inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.search-inner input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 1rem; color: var(--text-primary);
}
.search-inner input::placeholder { color: var(--text-muted); }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ══════════ BREADCRUMB ══════════ */
.breadcrumb {
  max-width: var(--container); margin: 0 auto;
  padding: 20px var(--gap) 0;
  font-size: 0.75rem; color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; }

/* ══════════ PAGE HERO ══════════ */
.page-hero {
  max-width: var(--container); margin: 0 auto;
  padding: 32px var(--gap) 24px;
}
.page-title {
  font-family: var(--font-heading); font-size: 2rem;
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.page-title .accent { color: var(--accent); }
.page-subtitle {
  margin-top: 8px; font-size: 0.9375rem;
  color: var(--text-secondary); max-width: 520px;
}

/* ══════════ CATEGORY TABS ══════════ */
.category-tabs {
  max-width: var(--container); margin: 0 auto;
  padding: 0 var(--gap) 24px;
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 18px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); color: var(--text-secondary);
  transition: all var(--duration) ease; display: flex; align-items: center; gap: 6px;
}
.tab:hover { border-color: var(--border-hover); color: var(--text-primary); }
.tab.active {
  background: var(--accent); color: var(--bg-base);
  border-color: var(--accent); font-weight: 600;
}
.tab-count {
  font-size: 0.6875rem; padding: 1px 6px;
  border-radius: 999px; background: rgba(255,255,255,0.1);
}
.tab.active .tab-count { background: rgba(0,0,0,0.2); }

/* ══════════ CONTENT LAYOUT ══════════ */
.content-layout {
  max-width: var(--container); margin: 0 auto;
  padding: 0 var(--gap) 48px;
  display: grid; grid-template-columns: 1fr 320px; gap: 32px;
}
.posts-area { min-width: 0; }

/* ══════════ CARD (BASE) ══════════ */
.card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  position: relative; transition: all var(--duration) var(--ease-out);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 2px; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity var(--duration) ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-6px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px var(--accent), 0 0 40px var(--accent-glow);
}
.card:hover::before { opacity: 1; }

/* Card Image */
.card-img-wrap {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: 16/9; background: var(--bg-element);
  flex-shrink: 0;
}
.card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.card:hover .card-img-wrap img { transform: scale(1.04); }

/* Card Body */
.card-body { padding: 20px; flex: 1; }

/* Category Badge */
.badge {
  display: inline-block; font-size: 0.6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 4px;
  border: 1px solid rgba(255,204,0,0.15);
  margin-bottom: 10px;
}

/* Card Title — FIX #1: proper H2/H3 hierarchy */
.card-title {
  font-family: var(--font-heading); font-weight: 600;
  line-height: 1.35; letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.card-title a {
  color: var(--text-primary); text-decoration: none;
  transition: color 0.3s ease;
}
.card:hover .card-title a { color: var(--accent); }

/* Meta */
.card-meta {
  font-size: 0.75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

/* Excerpt — FIX #1: proper clamp */
.card-excerpt {
  font-size: 0.875rem; line-height: 1.7; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 16px;
  letter-spacing: 0.01em; word-break: break-word;
}

/* Read More — FIX #3: CTA */
.read-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); transition: all 0.3s ease;
}
.read-more .arrow { transition: transform 0.3s ease; }
.card:hover .read-more .arrow { transform: translateX(4px); }
.read-more:hover { text-shadow: 0 0 8px var(--accent-glow); }

/* ══════════ FEATURED CARD ══════════ */
.card-featured { margin-bottom: var(--gap); }
.card-featured .card-img-wrap { aspect-ratio: 21/9; }
.card-featured .card-body { padding: 28px; }
.card-featured .card-title { font-size: 1.75rem; line-height: 1.25; margin-bottom: 12px; }
.card-featured .card-excerpt { -webkit-line-clamp: 3; font-size: 0.9375rem; }

/* ══════════ POST GRID (2 columns) ══════════ */
.posts-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--gap);
}
.posts-grid .card-title { font-size: 1.0625rem; }

/* ══════════ SERVICE BANNER ══════════ */
.service-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--bg-element), rgba(255,204,0,0.04));
  border: 1px solid var(--accent); border-radius: var(--radius-lg);
  padding: 36px; margin: var(--gap) 0; text-align: center;
}
.banner-accent {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 2px; background: var(--accent);
}
.banner-label {
  font-size: 0.625rem; font-weight: 700; letter-spacing: 3px;
  color: var(--accent); text-transform: uppercase;
}
.service-banner h3 {
  font-family: var(--font-heading); font-size: 1.375rem;
  margin: 8px 0; color: var(--text-primary);
}
.service-banner p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 16px; }

/* ══════════ BUTTONS ══════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-size: 0.8125rem; font-weight: 600;
  transition: all 0.3s ease;
}
.btn-accent {
  background: var(--accent); color: var(--bg-base);
  border: 1px solid var(--accent);
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-full { width: 100%; justify-content: center; }

/* ══════════ PAGINATION ══════════ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 32px;
}
.page-btn {
  min-width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  border: 1px solid var(--border); color: var(--text-secondary);
  background: var(--bg-element); transition: all 0.3s ease;
}
.page-btn:hover:not(.active):not(:disabled) {
  background: var(--accent); color: var(--bg-base);
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.page-btn.active {
  background: var(--accent); color: var(--bg-base);
  border-color: var(--accent); font-weight: 700;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ══════════ SIDEBAR ══════════ */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.widget-title {
  font-family: var(--font-heading); font-size: 0.8125rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--accent); margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 2px solid var(--accent);
}

/* Popular Posts */
.popular-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}
.popular-item:last-child { border-bottom: none; padding-bottom: 0; }
.popular-item:hover { padding-left: 4px; }
.popular-thumb {
  width: 72px; height: 48px; border-radius: 6px;
  overflow: hidden; flex-shrink: 0; background: var(--bg-element);
}
.popular-thumb img { width: 100%; height: 100%; object-fit: cover; }
.popular-info { flex: 1; min-width: 0; }
.popular-title {
  font-size: 0.8125rem; font-weight: 500; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: var(--text-primary);
  transition: color 0.2s;
}
.popular-item:hover .popular-title { color: var(--accent); }
.popular-date { font-size: 0.6875rem; color: var(--text-muted); margin-top: 4px; }

/* Newsletter Widget */
.widget-newsletter {
  border-color: var(--accent); text-align: center;
  background: linear-gradient(135deg, var(--bg-element), var(--bg-surface));
  position: sticky; top: calc(var(--header-h) + 20px);
}
.newsletter-icon { font-size: 2rem; margin-bottom: 8px; }
.widget-newsletter .widget-title { border-bottom: none; margin-bottom: 6px; }
.widget-newsletter p { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.newsletter-form input[type="email"] {
  width: 100%; padding: 10px 14px;
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 0.875rem; margin-bottom: 10px; outline: none;
  transition: border-color 0.2s;
}
.newsletter-form input:focus { border-color: var(--accent); }

/* Categories List */
.cat-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s ease;
}
.cat-item:last-child { border-bottom: none; }
.cat-item:hover { padding-left: 6px; color: var(--accent); }
.cat-item .cat-count {
  font-size: 0.75rem; padding: 2px 8px;
  background: var(--bg-element); border-radius: 999px;
  color: var(--text-muted);
}

/* ══════════ SKELETON LOADER ══════════ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-element) 25%, var(--bg-elevated) 50%, var(--bg-element) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.skeleton-img { aspect-ratio: 16/9; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.skeleton-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.skeleton-badge { width: 60px; height: 18px; }
.skeleton-title { width: 80%; height: 20px; }
.skeleton-text { width: 100%; height: 14px; }
.skeleton-featured .skeleton-img { aspect-ratio: 21/9; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ══════════ EMPTY STATE ══════════ */
.empty-state {
  text-align: center; padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state h3 { margin: 16px 0 8px; color: var(--text-primary); font-family: var(--font-heading); }
.empty-state p { font-size: 0.875rem; }

/* ══════════ FOOTER ══════════ */
#site-footer {
  border-top: 1px solid var(--border); background: var(--bg-surface);
}
.footer-inner {
  max-width: var(--container); margin: 0 auto;
  padding: 48px var(--gap) 32px;
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 32px;
}
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-brand .logo-icon { width: 32px; height: 32px; font-size: 15px; }
.footer-desc { font-size: 0.8125rem; color: var(--text-muted); max-width: 280px; }
.footer-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-nav a { font-size: 0.8125rem; color: var(--text-secondary); transition: color 0.2s; }
.footer-nav a:hover { color: var(--accent); }
.footer-social { display: flex; gap: 8px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); display: grid; place-items: center;
  font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
  transition: all 0.2s ease;
}
.footer-social a:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-soft);
}
.footer-bottom {
  max-width: var(--container); margin: 0 auto;
  padding: 16px var(--gap); border-top: 1px solid var(--border);
  text-align: center; font-size: 0.75rem; color: var(--text-muted);
}

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 1024px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .widget-newsletter { position: static; }
}
@media (max-width: 768px) {
  .mobile-only { display: block; }
  #main-nav { display: none; }
  .page-title { font-size: 1.5rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .card-featured .card-title { font-size: 1.25rem; }
  .card-featured .card-img-wrap { aspect-ratio: 16/9; }
  .card:hover { transform: translateY(-3px); }
  .footer-inner { flex-direction: column; }
}

/* ══════════ MOBILE MENU DRAWER ══════════ */
.mobile-menu {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200; pointer-events: none;
  visibility: hidden;
}
.mobile-menu.open {
  pointer-events: auto; visibility: visible;
}
.mobile-menu-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 0.3s ease;
}
.mobile-menu.open .mobile-menu-backdrop { opacity: 1; }

.mobile-menu-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 300px; max-width: 85vw;
  background: var(--bg-surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
  box-shadow: -8px 0 32px rgba(0,0,0,0.4);
}
.mobile-menu.open .mobile-menu-panel { transform: translateX(0); }

.mobile-menu-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.mobile-menu-header .logo-text { flex: 1; }

.mobile-nav {
  flex: 1; padding: 16px 0; overflow-y: auto;
}
.mobile-nav-link {
  display: block; padding: 14px 24px;
  font-size: 0.9375rem; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}
.mobile-nav-link:hover, .mobile-nav-link.active {
  color: var(--accent); background: var(--accent-soft);
  padding-left: 30px;
}

.mobile-menu-footer {
  padding: 20px 24px; border-top: 1px solid var(--border);
}
.mobile-menu-footer .footer-social { margin-bottom: 12px; }
.mobile-menu-footer .footer-desc {
  font-size: 0.75rem; color: var(--text-muted);
}

