/* ============================================
   SocialMention.net — Modern Design System
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand:        #0ea5e9;   /* sky-500  */
  --brand-dark:   #0284c7;   /* sky-600  */
  --brand-darker: #0369a1;   /* sky-700  */
  --brand-glow:   rgba(14, 165, 233, 0.25);

  --dark:         #0f172a;   /* slate-900 */
  --dark-2:       #1e293b;   /* slate-800 */
  --dark-3:       #334155;   /* slate-700 */

  --bg:           #f8fafc;   /* slate-50  */
  --surface:      #ffffff;
  --surface-2:    #f1f5f9;   /* slate-100 */
  --border:       #e2e8f0;   /* slate-200 */
  --border-2:     #cbd5e1;   /* slate-300 */

  --text:         #0f172a;   /* slate-900 */
  --text-2:       #334155;   /* slate-700 */
  --text-muted:   #64748b;   /* slate-500 */
  --text-subtle:  #94a3b8;   /* slate-400 */

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.06);
  --shadow:     0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.07), 0 10px 40px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 16px rgba(0,0,0,0.08), 0 24px 56px rgba(0,0,0,0.1);

  --transition: 0.18s ease;
}

/* ─────────────────────────────────────────── Base */

html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-dark);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

main {
  max-width: 100%;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────── Header */

header {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand), var(--brand-darker));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

.logo-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.logo-name em {
  font-style: normal;
  color: var(--brand);
}

/* Nav inside header */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  transition: color var(--transition), background var(--transition);
}

.header-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.header-nav a.active {
  color: var(--brand);
  background: rgba(14, 165, 233, 0.12);
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  z-index: 200;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─────────────────────────────────────────── Hero */

.hero {
  background: linear-gradient(160deg, var(--dark-2) 0%, var(--dark) 60%);
  padding: 80px 24px 96px;
  position: relative;
  overflow: hidden;
}

/* Decorative glow blobs */
.hero::before,
.hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(14,165,233,0.15) 0%, transparent 70%);
  top: -200px; left: -100px;
}
.hero::after {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(56,189,248,0.12) 0%, transparent 70%);
  bottom: -150px; right: -50px;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(14,165,233,0.15);
  border: 1px solid rgba(14,165,233,0.3);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--brand), #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 6px 6px 6px 20px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.1), var(--shadow-lg), 0 0 40px rgba(14,165,233,0.2);
  gap: 8px;
  margin-bottom: 28px;
}

.search-bar svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--text-subtle);
}

.search-bar select {
  border: none;
  border-left: 1px solid var(--border);
  outline: none;
  padding: 8px 12px;
  font-size: 0.875rem;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.search-bar button {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand-darker));
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-bar button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Category tabs under search */
.hero-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.hero-cat:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  text-decoration: none;
}

/* ─────────────────────────────────────────── Main page body */

.page-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  flex: 1;
}

/* Section headings */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand-darker);
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 500px;
}

/* ─────────────────────────────────────────── Category cards (homepage) */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cat-color-a, transparent), var(--cat-color-b, transparent));
  opacity: 0;
  transition: opacity var(--transition);
}

.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
  text-decoration: none;
}

.cat-card:hover::before {
  opacity: 0.04;
}

.cat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.cat-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cat-card-title svg {
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
  transition: transform var(--transition), color var(--transition);
  flex-shrink: 0;
}

.cat-card:hover .cat-card-title svg {
  transform: translate(2px, -2px);
  color: var(--brand-dark);
}

.cat-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Per-card color theming */
.cat-blogs     .cat-icon-wrap { background: #eff6ff; }
.cat-micro     .cat-icon-wrap { background: #f0f9ff; }
.cat-images    .cat-icon-wrap { background: #fdf4ff; }
.cat-videos    .cat-icon-wrap { background: #fff1f2; }
.cat-bookmarks .cat-icon-wrap { background: #fffbeb; }
.cat-comments  .cat-icon-wrap { background: #f0fdf4; }

/* ─────────────────────────────────────────── Homepage articles */

.home-articles {
  border-top: 1px solid var(--border);
  padding-top: 48px;
}

.home-articles .article-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.home-articles-more {
  margin-top: 28px;
  text-align: center;
}

.home-articles-more a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-dark);
  text-decoration: none;
}

.home-articles-more a:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────── Section page layout */

.section-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  flex: 1;
}

/* Section hero (inline, not full-bleed) */
.section-top {
  margin-bottom: 40px;
}

.section-top h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-top p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
  margin-bottom: 24px;
}

/* Section search bar (lighter, on white bg) */
.section-search {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-xl);
  padding: 5px 5px 5px 18px;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  max-width: 640px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.section-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.section-search svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.section-search input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.section-search input::placeholder { color: var(--text-subtle); }

.section-search button {
  padding: 9px 22px;
  background: var(--brand-darker);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-search button:hover { background: var(--brand-dark); }

/* Search hint */
.search-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  min-height: 24px;
  transition: color var(--transition);
}

.search-hint svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.query-badge {
  display: inline-block;
  padding: 1px 8px;
  background: rgba(14,165,233,0.12);
  border: 1px solid rgba(14,165,233,0.3);
  border-radius: 5px;
  font-weight: 700;
  color: var(--brand-darker);
  font-size: 0.875rem;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.search-hint.has-query {
  color: var(--brand-darker);
}

/* Shake animation when cards are clicked without a query */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.shake {
  animation: shake 0.35s ease;
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248,113,113,0.2) !important;
}

/* Platform cards grid */
.platforms-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.platform-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
  text-decoration: none;
}

.platform-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.platform-info {
  flex: 1;
  min-width: 0;
}

.platform-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.platform-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-arrow {
  color: var(--text-subtle);
  transition: transform var(--transition), color var(--transition);
  flex-shrink: 0;
}

.platform-card:hover .platform-arrow {
  transform: translate(2px, -2px);
  color: var(--brand-dark);
}

/* Related sections */
.related-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.related-pill:hover {
  background: #eff6ff;
  border-color: var(--brand);
  color: var(--brand-darker);
  text-decoration: none;
}

/* ─────────────────────────────────────────── Category page content */

.category-content {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-2);
  max-width: 720px;
  overflow-wrap: break-word;
}

.category-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.category-content p {
  margin-bottom: 1rem;
}

.category-content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.category-content li {
  margin-bottom: 0.4rem;
}

.category-content a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.category-content a:hover {
  color: var(--brand-darker);
}

.category-content code {
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ─────────────────────────────────────────── All-results view (homepage) */

.results-view {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  flex: 1;
  overflow-x: hidden;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.results-meta {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.results-meta strong {
  color: var(--text);
  font-weight: 700;
}

.results-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.results-back-btn:hover {
  border-color: var(--brand);
  color: var(--brand-darker);
  text-decoration: none;
}

.results-back-btn svg {
  width: 15px;
  height: 15px;
}

.results-group {
  margin-bottom: 40px;
}

.results-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.results-group-title a {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-dark);
  margin-left: auto;
}

.results-group-title a:hover {
  text-decoration: underline;
}

/* ─────────────────────────────────────────── Ad containers */

.ad-container {
  max-width: 728px;
  margin: 32px auto;
  padding: 0 24px;
  text-align: center;
}

.section-page .ad-container {
  padding: 0;
  margin: 40px 0;
  max-width: 720px;
}

.page-body .ad-container {
  padding: 0;
  margin: 40px auto;
}

.ad-infeed {
  grid-column: 1 / -1;
  min-height: 100px;
}

.ad-multiplex {
  max-width: 728px;
  margin: 32px auto;
  min-height: 200px;
}

/* ─────────────────────────────────────────── Footer */

footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand .logo-name {
  font-size: 1.05rem;
  color: #fff;
}

.footer-brand p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 12px;
  max-width: 300px;
  line-height: 1.65;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 14px;
}

footer ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

footer ul li a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color var(--transition);
}

footer ul li a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

/* ─────────────────────────────────────────── Responsive */

@media (max-width: 900px) {
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .nav-toggle {
    display: flex;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 8px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 150;
  }

  .header-nav.open {
    display: flex;
  }

  .header-nav a {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
  }

  .header-nav a:hover {
    background: rgba(255,255,255,0.06);
  }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }

  .hero { padding: 52px 16px 64px; }

  .search-bar {
    flex-wrap: wrap;
    border-radius: var(--radius-lg);
    padding: 12px 12px 8px;
    gap: 6px;
  }

  .search-bar svg { display: none; }

  .search-bar input {
    width: 100%;
    order: -1;
  }

  .search-bar select { border-left: none; padding-left: 0; }

  .search-bar button { flex: 1; }

  .cat-grid {
    grid-template-columns: 1fr;
  }

  .page-body { padding: 36px 16px; }

  .section-page { padding: 32px 16px 48px; }

  .section-search {
    flex-wrap: wrap;
    border-radius: var(--radius-lg);
    padding: 10px 10px 8px;
  }

  .section-search svg { display: none; }
  .section-search input { width: 100%; order: -1; }
  .section-search button { flex: 1; }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────── Blog listing page */

.blog-listing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  flex: 1;
}

.blog-listing-header {
  margin-bottom: 40px;
}

.blog-listing-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.blog-listing-header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 20px;
}

.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
  text-decoration: none;
}

.article-card time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.article-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.article-read-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin-top: auto;
}

.article-card:hover .article-read-more {
  text-decoration: underline;
}

.blog-empty {
  color: var(--text-muted);
  font-size: 1rem;
  text-align: center;
  padding: 60px 0;
}

/* ─────────────────────────────────────────── Single article page */

.article-page {
  max-width: 740px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  flex: 1;
  overflow-x: hidden;
}

.article-header {
  background: linear-gradient(160deg, var(--dark-2) 0%, var(--dark) 60%);
  padding: 32px 32px 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.article-header::before {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(14,165,233,0.18) 0%, transparent 70%);
  top: -120px;
  right: -80px;
  border-radius: 50%;
  pointer-events: none;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  margin-bottom: 20px;
  padding: 5px 12px;
  background: rgba(14,165,233,0.12);
  border: 1px solid rgba(14,165,233,0.25);
  border-radius: 20px;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
  z-index: 1;
}

.article-back:hover {
  background: rgba(14,165,233,0.2);
  border-color: rgba(14,165,233,0.4);
  text-decoration: none;
}

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  position: relative;
  z-index: 1;
}

.article-meta-sep {
  color: rgba(255,255,255,0.3);
}

/* Article body prose */
.article-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-2);
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.3px;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body a:hover {
  color: var(--brand-darker);
}

.article-body blockquote {
  border-left: 3px solid var(--brand);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-style: italic;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body th, .article-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-body th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text);
}

.article-body code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  word-break: break-all;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.ad-mid-article {
  margin: 2rem 0;
  padding: 0;
}

.article-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.article-footer .article-back {
  background: var(--surface-2);
  border-color: var(--border-2);
  color: var(--brand-dark);
}

.article-footer .article-back:hover {
  background: var(--surface);
  border-color: var(--brand);
}

/* ─────────────────────────────────────────── Responsive (blog) */

@media (max-width: 640px) {
  .blog-listing { padding: 32px 16px 48px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-page { padding: 32px 16px 48px; }
  .article-header { padding: 24px 20px 22px; }
}
