/* ==========================================================================
   TRENDINGTECHDAILY — DESIGN SYSTEMS DECODED STYLES
   Redesigned for the Figma Tech News Design System
   ========================================================================== */

.ds-page {
  background-color: var(--bg-page);
  color: var(--text-main);
}

/* ── 1. Hero Section ──────────────────────────────────────────────────────── */
.ds-hero {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding-block: var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.ds-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  height: 100%;
  background: radial-gradient(circle at 50% 20%, rgba(230, 57, 70, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.ds-poweredby {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.ds-poweredby strong {
  color: var(--accent-red);
}

.ds-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}

.ds-slash {
  color: var(--accent-red);
  margin-inline: 0.25rem;
}

.ds-sub {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}

/* Search Bar */
.ds-searchbar {
  max-width: 640px;
  margin-inline: auto;
  position: relative;
  margin-bottom: var(--space-lg);
}

.ds-searchbar i {
  position: absolute;
  inset-inline-start: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.ds-searchbar input {
  width: 100%;
  padding: 0.95rem 1.25rem;
  padding-inline-start: 3rem;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.05rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.ds-searchbar input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-subtle);
  background-color: var(--bg-surface);
}

.ds-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.ds-chip-big {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.ds-chip-big:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

/* ── 2. Trending Strip ────────────────────────────────────────────────────── */
.ds-trending {
  padding-block: var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-xl);
}

.ds-trending-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}

.ds-trending-item,
.ds-trending-card {
  flex: 0 0 280px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all var(--transition-fast);
  color: var(--text-main);
  text-decoration: none;
}

.ds-trending-item:hover,
.ds-trending-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  color: var(--text-main);
}

/* ── 3. Category Buckets & Statistics ─────────────────────────────────────── */
.ds-buckets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: var(--space-xl);
}

.ds-bucket {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem 1rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ds-bucket:hover {
  border-color: var(--accent-red);
  background-color: var(--bg-surface-elevated);
  transform: translateY(-2px);
  color: var(--text-main);
}

.ds-bucket-count {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent-red);
  margin-bottom: 0.5rem;
  display: block;
}

.ds-bucket h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.ds-bucket-cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ds-bucket:hover .ds-bucket-cta {
  color: var(--accent-red);
}

/* ── 4. Main Layout & Sidebar ─────────────────────────────────────────────── */
.ds-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: var(--space-3xl);
}

@media (min-width: 992px) {
  .ds-layout {
    grid-template-columns: 260px 1fr;
  }
}

.ds-sidebar {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.ds-sidebar h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.ds-sidebar h4:first-child {
  margin-top: 0;
}

.ds-sidebar label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.ds-sidebar label:hover {
  color: var(--text-main);
}

.ds-sidebar input[type="radio"],
.ds-sidebar input[type="checkbox"] {
  accent-color: var(--accent-red);
  cursor: pointer;
}

.ds-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.ds-chip {
  padding: 0.25rem 0.65rem;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ds-chip:hover,
.ds-chip.active {
  background-color: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

/* ── 5. Design Systems Grid & Cards ───────────────────────────────────────── */
.ds-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .ds-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .ds-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.ds-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.ds-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.ds-card-top,
.ds-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ds-card-icon,
.ds-logo-plate {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--accent-red);
  overflow: hidden;
  flex-shrink: 0;
}

.ds-card-icon img,
.ds-logo-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ds-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.ds-card-title a:hover {
  color: var(--accent-red);
}

.ds-card-org,
.ds-company {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.ds-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Palette Swatches Row */
.ds-swatches-row,
.ds-palette-strip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-block: 1rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.ds-swatch-dot,
.ds-sw {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.ds-card-footer,
.ds-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ── 6. Detail View Specifics ─────────────────────────────────────────────── */
.ds-detail-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: var(--space-xl);
}

.ds-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-block: 1.5rem;
}

.ds-swatch-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ds-swatch-color {
  height: 60px;
  width: 100%;
}

.ds-swatch-meta {
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-align: center;
}

.ds-verdict-banner {
  border-inline-start: 4px solid var(--accent-red);
  background: var(--bg-surface-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem;
  margin-block: 1.5rem;
}
