/* ============ AI For Everyone - Main Stylesheet ============ */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --accent: #06b6d4;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 4px 14px rgba(15, 23, 42, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: -.5px; }
.logo span { color: var(--primary); }
.logo:hover { text-decoration: none; }
.main-nav { display: flex; align-items: center; gap: 18px; flex: 1; }
.main-nav > a, .nav-drop > a { color: var(--text); font-weight: 500; font-size: 15px; }
.main-nav > a:hover, .nav-drop > a:hover { color: var(--primary); text-decoration: none; }
.nav-drop { position: relative; }
.drop-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 220px; padding: 8px 0; z-index: 200;
  max-height: 320px; overflow-y: auto;
}
.drop-menu.open { display: block; }
.drop-menu a { display: block; padding: 8px 16px; color: var(--text); font-size: 14px; }
.drop-menu a:hover { background: var(--bg); color: var(--primary); text-decoration: none; }
.search-form { display: flex; }
.search-form input {
  border: 1px solid var(--border); border-right: 0; border-radius: 8px 0 0 8px;
  padding: 8px 12px; font-size: 14px; width: 200px; outline: none; font-family: inherit;
}
.search-form input:focus { border-color: var(--primary); }
.search-form button {
  background: var(--primary); color: #fff; border: 0; border-radius: 0 8px 8px 0;
  padding: 8px 16px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.search-form button:hover { background: var(--primary-dark); }

/* ---------- Layout ---------- */
.site-main { padding: 28px 0 48px; }
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 130%);
  border-radius: 16px; color: #fff; padding: 48px 40px; margin-bottom: 32px;
}
.hero h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.2; margin-bottom: 12px; letter-spacing: -.5px; }
.hero p { font-size: 17px; opacity: .92; max-width: 640px; margin-bottom: 20px; }
.hero .btn { background: #fff; color: var(--primary); font-weight: 700; }
.hero .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 10px 22px; border-radius: 10px; font-weight: 600;
  font-size: 15px; transition: all .15s ease; border: 0; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; text-decoration: none; }

/* ---------- Section headings ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 18px; }
.section-head h2 { font-size: 24px; letter-spacing: -.3px; }
.section-head a { font-size: 14px; font-weight: 600; }

/* ---------- Post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(15,23,42,.12); }
.post-card .thumb { aspect-ratio: 16/9; width: 100%; object-fit: cover; }
.card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { font-size: 13px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-block; background: #eef2ff; color: var(--primary); font-size: 12px;
  font-weight: 600; padding: 3px 10px; border-radius: 999px;
}
.badge-featured { background: #fef3c7; color: #b45309; }
.post-card h3 { font-size: 17px; line-height: 1.4; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--primary); text-decoration: none; }
.card-excerpt { font-size: 14px; color: var(--muted); flex: 1; }
.card-foot { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }

/* Featured strip */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.featured-card { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.featured-card img { aspect-ratio: 16/8; width: 100%; object-fit: cover; }
.featured-card .fc-body {
  position: absolute; inset: auto 0 0 0; padding: 40px 20px 18px;
  background: linear-gradient(transparent, rgba(2,6,23,.92) 60%); color: #fff;
}
.featured-card h3 a { color: #fff; font-size: 18px; }
.featured-card h3 a:hover { text-decoration: underline; }
.featured-card .card-meta { color: #cbd5e1; }

/* Category chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 6px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 16px; font-size: 14px; font-weight: 500; color: var(--text);
}
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.chip span { color: var(--muted); font-size: 12px; }

/* ---------- Article ---------- */
.article-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow); }
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.article-title { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.25; letter-spacing: -.5px; margin-bottom: 14px; }
.article-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.article-image { border-radius: var(--radius); margin: 0 0 24px; width: 100%; }
.article-content { font-size: 17px; }
.article-content p { margin: 0 0 18px; }
.article-content h2 { font-size: 24px; margin: 34px 0 14px; letter-spacing: -.3px; }
.article-content h3 { font-size: 19px; margin: 26px 0 10px; }
.article-content ul, .article-content ol { margin: 0 0 18px 26px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
  border-left: 4px solid var(--primary); background: #eef2ff; padding: 14px 20px;
  border-radius: 0 10px 10px 0; margin: 0 0 18px; color: #3730a3; font-style: italic;
}
.article-content pre {
  background: #0f172a; color: #e2e8f0; padding: 18px; border-radius: 10px;
  overflow-x: auto; font-size: 14px; margin: 0 0 18px; line-height: 1.6;
}
.article-content code { background: #eef2ff; padding: 2px 6px; border-radius: 5px; font-size: .9em; color: #3730a3; }
.article-content pre code { background: transparent; color: inherit; padding: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.article-content th { background: var(--bg); }
.article-content img { border-radius: 10px; margin: 0 0 18px; }
.share-row { display: flex; gap: 10px; align-items: center; margin: 30px 0 0; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.share-row span { font-weight: 600; font-size: 14px; }
.share-btn { font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); color: var(--text); }
.share-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.post-nav a { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: 14px; font-weight: 600; }
.post-nav a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.post-nav .next { text-align: right; }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 84px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.widget h3 { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); display: inline-block; }
.widget-posts { list-style: none; }
.widget-posts li + li { margin-top: 12px; }
.widget-posts a { display: flex; gap: 12px; align-items: center; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.45; }
.widget-posts img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.widget-posts a:hover { color: var(--primary); text-decoration: none; }
.widget-cats { list-style: none; }
.widget-cats li + li { border-top: 1px dashed var(--border); }
.widget-cats a { display: flex; justify-content: space-between; padding: 9px 2px; color: var(--text); font-size: 14px; font-weight: 500; }
.widget-cats a:hover { color: var(--primary); text-decoration: none; }
.widget-cats span { background: var(--bg); border-radius: 999px; padding: 1px 9px; font-size: 12px; color: var(--muted); }
.widget-list { list-style: none; }
.widget-list li + li { margin-top: 10px; }
.widget-list a { color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.5; }
.widget-list a:hover { color: var(--primary); }
.widget-cta { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border: 0; }
.widget-cta h3 { color: #fff; border-color: rgba(255,255,255,.5); }
.widget-cta p { font-size: 14px; opacity: .92; margin-bottom: 14px; }
.widget-cta .btn { background: #fff; color: var(--primary); width: 100%; text-align: center; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 36px; flex-wrap: wrap; }
.page-link { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; }
a.page-link:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-link.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Ads ---------- */
.ad-slot { margin: 18px 0; text-align: center; min-height: 0; }
.ad-slot ins { margin: 0 auto; }

/* ---------- Static pages / forms ---------- */
.page-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); max-width: 900px; margin: 0 auto; }
.page-wrap h1 { font-size: 30px; margin-bottom: 8px; letter-spacing: -.4px; }
.page-wrap h2 { font-size: 21px; margin: 28px 0 10px; }
.page-wrap p, .page-wrap li { color: #334155; font-size: 15.5px; }
.page-wrap ul { margin: 0 0 18px 24px; }
.page-wrap .updated { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.form-grid { display: grid; gap: 16px; margin-top: 20px; }
.form-field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 15px; outline: none; background: #fff; color: var(--text);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.form-field textarea { min-height: 140px; resize: vertical; }
.alert { padding: 13px 16px; border-radius: 10px; font-size: 14.5px; margin-bottom: 18px; }
.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }

/* ---------- Footer ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding: 44px 20px 32px; }
.footer-grid h4 { color: #fff; font-size: 16px; margin-bottom: 14px; }
.footer-grid p { font-size: 14px; line-height: 1.7; }
.footer-grid a { display: block; color: #94a3b8; font-size: 14px; padding: 4px 0; }
.footer-grid a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 18px 0; font-size: 13px; color: #64748b; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h2 { margin-bottom: 10px; color: var(--text); }
.tag-count { color: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
  .header-inner { gap: 12px; }
  .search-form input { width: 130px; }
  .article-wrap, .page-wrap { padding: 22px; }
  .post-nav { grid-template-columns: 1fr; }
  .hero { padding: 32px 22px; }
}
