/*
Theme Name:   IT.pedia (SmartMag Child)
Template:     smart-mag
Version:      2.0
Description:  Modern IT community redesign — v2 with dropdown menu, fixed avatars, redesigned QA list, new footer.
*/

:root {
  --font-sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-elev: #F1F5F9;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --primary: #1E3A8A;
  --primary-hover: #1E40AF;
  --accent: #06B6D4;
  --accent-hover: #0891B2;
  --success: #10B981;
  --warn: #F59E0B;
  --danger: #EF4444;
  --header-bg: #0F172A;
  --header-text: #E2E8F0;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04);
  --shadow: 0 1px 3px rgba(15,23,42,.07), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg: 0 10px 25px -5px rgba(15,23,42,.1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --container: 1240px;
}
[data-theme="dark"] {
  --bg: #0B1220;
  --bg-soft: #131A2A;
  --bg-card: #1A2233;
  --bg-elev: #243047;
  --text: #F1F5F9;
  --text-muted: #94A3B8;
  --text-faint: #64748B;
  --border: #243047;
  --border-strong: #334155;
  --primary: #3B82F6;
  --primary-hover: #60A5FA;
}

/* Hide WP admin bar for non-admin users */
#wpadminbar { display: none !important; }
html[lang] { margin-top: 0 !important; }

html, body { overflow-x: hidden; max-width: 100vw; } html { scroll-behavior: smooth; }
body, body.theme-smart-mag {
  font-family: var(--font-sans) !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-sans);
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-weight: 700;
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }
code, pre, kbd { font-family: var(--font-mono) !important; font-size: 0.92em; }
:not(pre) > code {
  background: var(--bg-elev); color: var(--accent);
  padding: 2px 7px; border-radius: 4px; font-size: 0.88em;
}
pre {
  background: #0F172A !important; color: #E2E8F0 !important;
  border-radius: var(--radius); padding: 1rem 1.25rem; overflow-x: auto;
  border: 1px solid var(--border); margin: 1.25em 0;
}
pre code { background: transparent !important; color: inherit !important; padding: 0 !important; }

/* ============================
   CUSTOM HEADER (override SmartMag)
   ============================ */
body.theme-smart-mag #header,
body.theme-smart-mag .header-wrap,
body.theme-smart-mag .top-bar,
body.theme-smart-mag #smart-head,
body.theme-smart-mag #smart-head-mobile,
body.theme-smart-mag .smart-head,
body.theme-smart-mag .smart-head-row,
body.theme-smart-mag .smart-head-main { display: none !important; }

.itp-header {
  background: var(--header-bg);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 12px rgba(0,0,0,.3);
  border-bottom: 1px solid #1E293B;
}
.itp-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.itp-nav { flex: 1; }
.itp-header-right { flex-shrink: 0; }
.itp-logo {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: #FFFFFF !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
}
.itp-logo .accent {
  color: var(--accent);
  margin: 0 1px;
}
.itp-logo:hover { color: #FFFFFF !important; }
.itp-logo:hover .accent { color: var(--accent); }

.itp-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 32px;
}
.itp-nav-item {
  position: relative;
}
.itp-nav-item > a {
  color: var(--header-text) !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
  cursor: pointer;
}
.itp-nav-item > a:hover,
.itp-nav-item:hover > a {
  background: rgba(255,255,255,0.07);
  color: #FFFFFF !important;
}
.itp-nav-item .caret {
  font-size: 10px;
  opacity: 0.7;
  transition: transform .15s ease;
}
.itp-nav-item:hover .caret { transform: rotate(180deg); }

.itp-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .18s ease;
  z-index: 200;
}
[data-theme="dark"] .itp-dropdown {
  background: #131A2A;
  border-color: #243047;
}
.itp-nav-item:hover .itp-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.itp-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 6px;
  color: var(--text) !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all .12s ease;
}
.itp-dropdown a:hover {
  background: var(--bg-elev);
  color: var(--accent) !important;
}
.itp-dropdown a .icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.itp-dropdown a .desc {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 400;
  display: block;
  margin-top: 1px;
}

.itp-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.itp-header-search {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0 12px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--header-text);
  font-size: 13px;
  transition: all .15s ease;
  margin: 0;
  box-sizing: border-box;
}
.itp-header-search:hover { background: rgba(255,255,255,0.1); }
.itp-header-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--header-text);
  font-family: inherit;
  font-size: 13px;
  width: 160px;
  height: 100%;
  padding: 0;
  margin: 0;
}
.itp-header-search input::placeholder { color: rgba(226,232,240,0.5); }

.itp-btn-ask {
  background: var(--accent);
  color: #FFFFFF !important;
  padding: 0 16px;
  height: 38px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
.itp-btn-ask:hover {
  background: var(--accent-hover);
  color: #FFFFFF !important;
  transform: translateY(-1px);
}

.itp-theme-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--header-text);
  transition: all .15s ease;
  padding: 0;
  flex-shrink: 0;
  box-sizing: border-box;
}
.itp-theme-toggle:hover {
  background: rgba(255,255,255,0.12);
  color: var(--accent);
}
.itp-theme-toggle svg { width: 18px; height: 18px; }
.itp-theme-toggle .icon-light { display: none; }
.itp-theme-toggle .icon-dark { display: block; }
[data-theme="dark"] .itp-theme-toggle .icon-light { display: block; }
[data-theme="dark"] .itp-theme-toggle .icon-dark { display: none; }

.itp-mobile-toggle { display: none; }

@media (max-width: 1024px) {
  .itp-nav, .itp-header-search { display: none; }
  .itp-mobile-toggle {
    display: inline-flex;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    color: var(--header-text);
    cursor: pointer;
  }
}

/* ============================
   HERO
   ============================ */
.itp-hero {
  background: radial-gradient(ellipse at top, #1E3A8A 0%, #0F172A 70%);
  color: #F1F5F9;
  padding: 80px 24px 90px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.itp-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(6,182,212,0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(99,102,241,0.1) 0%, transparent 40%);
  pointer-events: none;
}
.itp-hero-inner { max-width: 800px; margin: 0 auto; position: relative; }
.itp-hero h1 {
  color: #FFFFFF;
  font-size: clamp(2rem, 5vw, 3.75rem);
  margin: 0 0 18px;
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1.05;
}
.itp-hero h1 .accent { color: var(--accent); }
.itp-hero p.lead {
  color: #94A3B8;
  font-size: clamp(1rem, 2vw, 1.2rem);
  margin: 0 0 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.itp-search-form {
  display: flex;
  gap: 0;
  max-width: 640px;
  margin: 0 auto 32px;
  background: #FFFFFF;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25), 0 0 0 4px rgba(6,182,212,0);
  transition: box-shadow .2s ease;
}
.itp-search-form:focus-within {
  box-shadow: 0 10px 30px rgba(0,0,0,0.25), 0 0 0 4px rgba(6,182,212,0.25);
}
.itp-search-form input[type="text"],
.itp-search-form input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  font-size: 16px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #0F172A;
  outline: none;
  font-family: inherit;
  min-width: 0;
}
.itp-search-form input::placeholder { color: #94A3B8; }
.itp-search-form button {
  padding: 12px 28px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
  flex-shrink: 0;
}
.itp-search-form button:hover { background: var(--accent-hover); }
@media (max-width: 540px) {
  .itp-search-form { flex-direction: column; padding: 8px; }
  .itp-search-form input { padding: 14px 16px; }
  .itp-search-form button { padding: 14px; width: 100%; border-radius: 8px; }
}

.itp-hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 0.95rem;
  color: #94A3B8;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.itp-hero-stats strong { color: #FFFFFF; font-weight: 600; margin-right: 4px; }
.itp-hero-stats .sep { color: #475569; }

.itp-trending-tags {
  display: flex; justify-content: center; gap: 8px;
  flex-wrap: wrap; font-size: 0.85rem;
}
.itp-trending-tags .label { color: #64748B; align-self: center; margin-right: 4px; }
.itp-trending-tags a {
  color: #CBD5E1; background: rgba(255,255,255,0.06);
  padding: 6px 14px; border-radius: 999px;
  font-weight: 500; border: 1px solid rgba(255,255,255,0.08);
  transition: all .15s ease;
}
.itp-trending-tags a:hover {
  background: var(--accent); color: #FFFFFF; border-color: var(--accent);
}

/* ============================
   SECTIONS
   ============================ */
.itp-container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.itp-section { margin: 60px auto; }
.itp-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.itp-section-head h2 {
  margin: 0; font-size: 1.65rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 10px;
}
.itp-section-head h2 .ico { font-size: 1.4rem; }
.itp-section-head a.see-all {
  font-size: 0.9rem; color: var(--text-muted); font-weight: 500;
  transition: color .15s; padding: 6px 12px; border-radius: 8px;
}
.itp-section-head a.see-all:hover { color: var(--accent); background: var(--bg-elev); }

/* ============================
   AVATAR (FIX banana issue)
   ============================ */
.itp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06B6D4 0%, #1E3A8A 100%);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0;
  border: 2px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.itp-avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.itp-avatar.sm { width: 24px; height: 24px; font-size: 10px; }

/* ============================
   Q&A CARDS (front page)
   ============================ */
.itp-qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}
.itp-qa-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
}
.itp-qa-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.itp-qa-card .meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; color: var(--text-muted); margin-bottom: 12px;
}
.itp-qa-card .meta strong { color: var(--text); font-weight: 600; }
.itp-qa-card h3 {
  font-size: 1.08rem; margin: 0 0 10px; line-height: 1.4;
  font-weight: 600;
}
.itp-qa-card h3 a { color: var(--text); }
.itp-qa-card h3 a:hover { color: var(--accent); }
.itp-qa-card .excerpt {
  font-size: 0.9rem; color: var(--text-muted);
  margin: 0 0 14px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.itp-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.itp-tag {
  background: var(--bg-elev); color: var(--primary);
  font-size: 0.76rem; padding: 3px 10px; border-radius: 4px;
  font-weight: 500; text-decoration: none; transition: all .15s;
}
[data-theme="dark"] .itp-tag { color: var(--accent); }
.itp-tag:hover { background: var(--accent); color: #FFFFFF !important; }
.itp-qa-card .stats {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border);
  display: flex; gap: 18px; font-size: 0.82rem; color: var(--text-muted);
}
.itp-qa-card .stats .item.answered { color: var(--success); font-weight: 600; }

/* Article cards */
.itp-article-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}
.itp-article-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all .2s ease;
}
.itp-article-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent);
}
.itp-article-card .img-wrap {
  aspect-ratio: 16/9; background: linear-gradient(135deg, #1E3A8A 0%, #06B6D4 100%);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  color: #FFFFFF; font-size: 56px; font-weight: 800;
}
.itp-article-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.itp-article-card:hover .img-wrap img { transform: scale(1.04); }
.itp-article-card .content { padding: 18px; }
.itp-article-card .cat {
  display: inline-block; background: var(--accent); color: #FFFFFF;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 3px 10px; border-radius: 4px; margin-bottom: 10px;
  text-decoration: none;
}
.itp-article-card h3 {
  font-size: 1.1rem; margin: 0 0 8px; line-height: 1.4; font-weight: 600;
}
.itp-article-card h3 a { color: var(--text); }
.itp-article-card h3 a:hover { color: var(--accent); }
.itp-article-card .excerpt {
  font-size: 0.9rem; color: var(--text-muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============================
   ANSPRESS LIST OVERRIDES (повна перебудова)
   ============================ */
.ap-questions, .ap-question-list, .anspress-questions { background: transparent !important; padding: 0 !important; }
.anspress-questions-archive { padding: 30px 0 !important; }

/* Search bar AnsPress — вписуємо в наш стиль */
.ap-search-form, .anspress-search-form {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 4px !important;
  box-shadow: var(--shadow);
  display: flex !important; align-items: center !important; gap: 4px;
}
.ap-search-form input[type="text"],
.ap-search-form input[type="search"] {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: var(--text) !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  width: 100%;
}
.ap-search-form button, .anspress-search-form button {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: none !important;
  padding: 10px 20px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: inherit !important;
}

/* Filter bar */
.ap-filter-list, .anspress-filter, .ap-list-filter {
  background: var(--bg-soft) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 14px 18px !important;
  margin: 16px 0 !important;
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
}
.ap-filter-list a, .anspress-filter a {
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  font-size: 14px;
  padding: 4px 0;
}
.ap-filter-list a.active, .ap-filter-list a:hover { color: var(--accent) !important; }

/* Question items */
.ap-questions-item, .ap-list-item, .ap-question-list-item, article.question {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 22px !important;
  margin-bottom: 14px !important;
  transition: all .2s ease;
  display: flex !important;
  gap: 18px;
  align-items: flex-start;
}
.ap-questions-item:hover, .ap-list-item:hover {
  border-color: var(--accent) !important;
  box-shadow: var(--shadow);
}

/* Vote/answer counter blocks (зліва) */
.ap-questions-item .ap-question-counts,
.ap-list-counts {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  min-width: 80px;
}
.ap-list-counts > div, .ap-question-counts > div {
  background: var(--bg-elev) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 8px 10px !important;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.ap-list-counts strong, .ap-question-counts strong {
  display: block;
  font-size: 18px;
  color: var(--text);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 2px;
}
.ap-list-counts .ap-best, .ap-question-counts .ap-best {
  background: rgba(16,185,129,0.1) !important;
  border-color: var(--success) !important;
  color: var(--success) !important;
}

/* Hide default avatars (banana issue) */
.ap-questions-item img.avatar,
.ap-list-item img.avatar,
.ap-author img.avatar {
  display: none !important;
}

/* Question titles */
.ap-questions-hentry .ap-questions-title,
.ap-list-item h2,
.ap-list-item h3,
.ap-questions-item .question-title {
  font-size: 1.12rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  margin: 0 0 8px !important;
  color: var(--text) !important;
}
.ap-questions-hentry .ap-questions-title a { color: var(--text) !important; }
.ap-questions-hentry .ap-questions-title a:hover { color: var(--accent) !important; }

/* Question excerpt + meta */
.ap-questions-snippet, .ap-question-snippet {
  font-size: 0.92rem; color: var(--text-muted); line-height: 1.55;
  margin-bottom: 8px;
}
.ap-question-meta, .ap-meta { font-size: 0.82rem; color: var(--text-muted); }
.ap-question-meta a, .ap-meta a { color: var(--text-muted); }
.ap-question-meta a:hover, .ap-meta a:hover { color: var(--accent); }

/* Single question + answer */
.ap-question-content, .ap-answer-content { font-size: 1.05rem; line-height: 1.75; }
.ap-question-content h2, .ap-question-content h3,
.ap-answer-content h2, .ap-answer-content h3 { margin-top: 1.8em; margin-bottom: 0.6em; }

/* Forms */
.ap-form-fields, .ap-question-form, .ap-answer-form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.ap-form-fields input, .ap-form-fields textarea, .ap-form-fields select {
  background: var(--bg) !important; color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 11px 14px !important; font-family: inherit;
}
.ap-form-fields input:focus, .ap-form-fields textarea:focus {
  border-color: var(--accent) !important; outline: 2px solid rgba(6,182,212,.2) !important;
}
.ap-btn, .ap-button, button.ap-btn-primary {
  background: var(--primary) !important; color: #FFFFFF !important;
  border: none !important; border-radius: var(--radius-sm) !important;
  padding: 10px 22px !important; font-weight: 600 !important;
  cursor: pointer; transition: background .15s; font-family: inherit;
}
.ap-btn:hover { background: var(--accent) !important; }

/* Hide AnsPress credits */
.anspress-credit, p.anspress-credits, .ap-credit { display: none !important; }

/* ============================
   FOOTER (4 columns, dark)
   ============================ */
body.theme-smart-mag footer.main-footer,
body.theme-smart-mag .main-footer,
body.theme-smart-mag .lower-footer,
body.theme-smart-mag #footer,
body.theme-smart-mag .footer-main,
body.theme-smart-mag .smart-footer,
body.theme-smart-mag .footer-wrap { display: none !important; }
body.theme-smart-mag footer.itp-footer { display: block !important; }

.itp-footer {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 60px 24px 30px;
  margin-top: 80px;
  border-top: 1px solid #1E293B;
}
.itp-footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
.itp-footer-col h4 {
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
}
.itp-footer-col ul { list-style: none; padding: 0; margin: 0; }
.itp-footer-col li { margin-bottom: 10px; }
.itp-footer-col a {
  color: #94A3B8 !important;
  font-size: 14px;
  text-decoration: none;
  transition: color .12s ease;
}
.itp-footer-col a:hover { color: var(--accent) !important; }

.itp-footer-brand .itp-logo { font-size: 22px; margin-bottom: 14px; display: inline-flex; }
.itp-footer-brand p {
  color: #94A3B8;
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 0 18px;
}
.itp-social {
  display: flex; gap: 8px;
}
.itp-social a {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  color: #94A3B8 !important;
  font-size: 14px;
  transition: all .15s ease;
}
.itp-social a:hover { background: var(--accent); color: #FFFFFF !important; }

.itp-footer-bottom {
  max-width: var(--container);
  margin: 36px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  color: #64748B; font-size: 13px;
}
.itp-footer-bottom a { color: #94A3B8; text-decoration: none; }

/* ============================
   STICKY ASK FAB (mobile only)
   ============================ */
.itp-fab-ask {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--accent); color: #FFFFFF !important;
  padding: 14px 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 24px rgba(6,182,212,.4);
  z-index: 90;
  display: none;
  align-items: center; gap: 8px;
  transition: all .2s ease;
  text-decoration: none;
}
.itp-fab-ask:hover { background: var(--accent-hover); transform: translateY(-2px); }
.itp-fab-ask::before { content: "+"; font-size: 18px; font-weight: 700; }
@media (max-width: 1024px) {
  .itp-fab-ask { display: inline-flex; }
}

/* Single article/question better content */
.single .entry-content, .single .post-content {
  font-size: 1.075rem; line-height: 1.75;
}
.single .entry-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 8px 20px;
  background: var(--bg-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .itp-hero { padding: 50px 16px 70px; }
  .itp-search-form { flex-direction: column; gap: 8px; }
  .itp-search-form button { padding: 14px; }
  .itp-hero-stats { gap: 14px; font-size: 0.85rem; }
  .itp-section { margin: 40px auto; }
  .itp-footer-inner { grid-template-columns: 1fr 1fr; gap: 30px; }
  .itp-footer-brand { grid-column: 1 / -1; }
  .itp-footer-bottom { flex-direction: column; text-align: center; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Hide AnsPress residual credit footer/link */
a[href*="anspress.net"] { display: none !important; }
.ap-cradit, p.ap-credit, .anspress-credits { display: none !important; }

/* Better tabs styling on single question */
.ap-tab-nav, ul.ap-tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border) !important;
  margin: 20px 0 !important; padding: 0 !important; list-style: none !important;
}
.ap-tab-nav li, ul.ap-tabs li { list-style: none; margin: 0; }
.ap-tab-nav a, ul.ap-tabs a {
  display: inline-block; padding: 10px 18px; color: var(--text-muted) !important;
  font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent;
  margin-bottom: -2px; text-decoration: none;
}
.ap-tab-nav a.active, ul.ap-tabs a.active,
.ap-tab-nav li.active a, ul.ap-tabs li.active a {
  color: var(--accent) !important; border-bottom-color: var(--accent);
}

/* Comment area styling */
.ap-comments, .ap-comment-list {
  margin: 16px 0; padding: 16px; background: var(--bg-soft);
  border-radius: var(--radius); border: 1px solid var(--border);
}
.ap-comment {
  padding: 12px 0; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-muted);
}
.ap-comment:last-child { border-bottom: none; }

/* Better single question page header with stats */
.ap-single-question .ap-title, .ap-question-title h1 {
  font-size: 1.75rem; line-height: 1.3; margin-bottom: 16px;
}
.ap-question-meta-list {
  display: flex; gap: 14px; flex-wrap: wrap; align-items: center;
  font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}

/* ============================
   MOBILE FIXES (hero overflow, qa search, members)
   ============================ */
@media (max-width: 768px) {
  .itp-hero h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem) !important;
    line-height: 1.15;
    word-break: keep-all;
    overflow-wrap: break-word;
    padding: 0 8px;
  }
  .itp-hero p.lead {
    font-size: 0.95rem;
    padding: 0 8px;
  }
  .itp-hero { padding: 40px 12px 60px; }
  .itp-search-form {
    flex-direction: column;
    gap: 8px;
    padding: 0 8px;
  }
  .itp-search-form input,
  .itp-search-form button { width: 100%; box-sizing: border-box; }
  .itp-trending-tags { padding: 0 12px; }
  .itp-trending-tags .label { display: block; width: 100%; text-align: center; margin-bottom: 6px; }
  .itp-container { padding: 0 12px; }
  .itp-section-head h2 { font-size: 1.25rem; }

  /* AnsPress search/ask layout on mobile */
  .ap-search-form, .anspress-search-form {
    flex-direction: column !important;
    gap: 6px;
    padding: 8px !important;
  }
  .ap-search-form input,
  .ap-search-form button { width: 100%; box-sizing: border-box; }
  .ap-questions-item, .ap-list-item {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .ap-list-counts { flex-direction: row !important; min-width: 0 !important; }
  .ap-list-counts > div { flex: 1; }
  body { font-size: 16px; }
}

/* ============================
   FOOTER SOCIAL — SVG icons (replace emoji)
   ============================ */
.itp-social a {
  position: relative;
  font-size: 0;
}
.itp-social a svg { width: 18px; height: 18px; fill: currentColor; }

/* ============================
   BUDDYPRESS MEMBERS REDESIGN
   ============================ */
#buddypress {
  max-width: var(--container);
  margin: 30px auto;
  padding: 0 24px;
}
#buddypress .item-list-tabs {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  display: inline-flex !important;
}
#buddypress .item-list-tabs ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  gap: 4px;
}
#buddypress .item-list-tabs li {
  list-style: none !important;
  margin: 0 !important;
}
#buddypress .item-list-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px !important;
  background: transparent !important;
  color: var(--text) !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  text-decoration: none !important;
}
#buddypress .item-list-tabs li.selected a,
#buddypress .item-list-tabs a.active {
  background: var(--bg-card) !important;
  color: var(--accent) !important;
  box-shadow: var(--shadow-sm);
}
#buddypress .item-list-tabs span.count,
#buddypress .item-list-tabs li a span {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  font-size: 11px !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  margin-left: 4px !important;
  font-weight: 700 !important;
}

#buddypress #members-dir-search,
#buddypress div.dir-search {
  margin-bottom: 16px;
}
#buddypress div.dir-search input[type="search"],
#buddypress div.dir-search input[type="text"] {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 14px !important;
  font-family: inherit;
  width: 100%;
  max-width: 360px;
}
#buddypress button[type="submit"] {
  background: var(--accent) !important;
  color: #FFFFFF !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 18px !important;
  font-weight: 600 !important;
  cursor: pointer;
  font-family: inherit;
}
#buddypress li.vcard,
#buddypress ul.item-list li,
#buddypress ul#members-list li {
  list-style: none !important;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  display: flex !important;
  gap: 14px;
  align-items: center;
  transition: all .2s ease;
}
#buddypress ul.item-list li:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
#buddypress ul#members-list li img.avatar {
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
}
/* If no avatar — replace with gradient */
#buddypress li.vcard .item-avatar img.avatar[src*="mystery"],
#buddypress li.vcard .item-avatar img.avatar[src*="gravatar"][src*="mp"],
#buddypress li.vcard .item-avatar img.avatar[src*="gravatar"][src*="mm"] {
  visibility: hidden;
  position: relative;
}
#buddypress li.vcard .item-avatar {
  position: relative;
  flex-shrink: 0;
}
#buddypress h2.item-title,
#buddypress h2.list-title,
#buddypress li.vcard h2 {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  margin: 0 0 4px !important;
}
#buddypress h2.item-title a { color: var(--text) !important; }
#buddypress h2.item-title a:hover { color: var(--accent) !important; }
#buddypress p.activity,
#buddypress span.activity {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  margin: 0 !important;
}
#buddypress .pag-count, #buddypress div.pagination {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 16px 0;
}
#buddypress .item-options {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg-soft); padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 16px; flex-wrap: wrap;
}
#buddypress .item-options a {
  color: var(--text-muted); font-size: 14px; font-weight: 500;
}
#buddypress .item-options a.selected { color: var(--accent); }
#buddypress select {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 10px !important;
  font-family: inherit;
}

/* Hide SmartMag-injected social share buttons on articles */
.s-share, .s-shares, .post-share, .share-buttons, .smart-share,
.entry-share, .single-share, .mvp-share-buttons,
.s-shares-block, .post-shares,
.smart-shares { display: none !important; }

