/*
Theme Name: 10Tools Directory
Theme URI: https://10tools.online/
Author: 10Tools
Author URI: https://10tools.online/
Description: A fast, lightweight, custom-built WordPress theme for the 10Tools AI Tools Directory. No page builder, no jQuery — vanilla CSS/JS, mobile-first responsive, card-based tool listings, pricing badges, built-in ad hooks and JSON-LD schema for SEO.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tentools
Tags: directory, tools, ai, responsive, fast, seo, custom-post-type, cards, adsense-ready
*/

/* ============================================================
   10Tools Directory — Design System
   Mobile-first. CSS custom properties drive theming; the
   primary color is overridable from the Customizer.
   ============================================================ */
:root {
  --primary: #5b5bd6;
  --primary-dark: #4545b8;
  --primary-soft: #eef0ff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --header-bg: #0b1226;
  --header-bg-2: #141d38;
  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1200px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-stack);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-weight: 600; font-size: 1rem;
  border: 0; cursor: pointer; text-decoration: none; transition: background 0.2s, transform 0.15s;
}
.btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  background: linear-gradient(180deg, var(--header-bg), var(--header-bg-2));
  color: #e2e8f0; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.header-inner { display: flex; align-items: center; gap: 16px; padding: 14px 20px; max-width: var(--max-width); margin: 0 auto; }
.site-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.site-brand:hover { color: #fff; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.05rem;
}
.site-brand img { max-height: 38px; width: auto; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a { color: #cbd5e1; padding: 10px 14px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; text-decoration: none; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.icon-btn {
  background: rgba(255,255,255,0.08); border: 0; color: #e2e8f0; cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.icon-btn svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }
.header-search { display: none; padding: 0 20px 14px; max-width: var(--max-width); margin: 0 auto; }
.header-search.open { display: block; }
.header-search form { display: flex; gap: 8px; }
.header-search input[type="search"] {
  flex: 1; padding: 11px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); color: #fff; font-size: 1rem;
}
.header-search input[type="search"]::placeholder { color: #94a3b8; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 50% -10%, #2b2f6b 0%, var(--header-bg) 60%);
  color: #e2e8f0; text-align: center; padding: 72px 20px 64px;
}
.hero h1 { color: #fff; font-size: clamp(2rem, 6vw, 3.4rem); margin-bottom: 0.35em; letter-spacing: -0.03em; }
.hero h1 .accent {
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(1rem, 2.5vw, 1.2rem); color: #b6c2d9; max-width: 640px; margin: 0 auto 28px; }
.hero-search { max-width: 640px; margin: 0 auto; display: flex; gap: 0; background: #fff; border-radius: 999px; padding: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.35); }
.hero-search input[type="search"] {
  flex: 1; border: 0; outline: none; padding: 12px 20px; font-size: 1.05rem; background: transparent; color: var(--ink); min-width: 0;
}
.hero-search .btn { border-radius: 999px; white-space: nowrap; }
.hero-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero-tags a {
  color: #cbd5e1; font-size: 0.85rem; padding: 6px 14px; border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px; text-decoration: none;
}
.hero-tags a:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* ---------- Sections ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head .more { font-weight: 600; white-space: nowrap; }

/* ---------- Category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; list-style: none; margin: 0; padding: 0; }
.cat-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s;
}
.cat-card:hover { box-shadow: var(--card-shadow); transform: translateY(-2px); border-color: #c7d2fe; text-decoration: none; }
.cat-icon {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; font-weight: 700;
}
.cat-card h3 { margin: 0 0 2px; font-size: 1rem; color: var(--ink); }
.cat-card .count { font-size: 0.82rem; color: var(--muted); margin: 0; }

/* ---------- Tool cards ---------- */
.tools-grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
.tool-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative;
  transition: box-shadow 0.2s, transform 0.15s;
}
.tool-card:hover { box-shadow: var(--card-shadow); transform: translateY(-2px); }
.tool-card-top { display: flex; align-items: center; gap: 14px; }
.tool-avatar {
  width: 52px; height: 52px; border-radius: 13px; flex: 0 0 52px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.4rem;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
}
.tool-card h3 { margin: 0; font-size: 1.1rem; }
.tool-card h3 a { color: var(--ink); text-decoration: none; }
.tool-card h3 a:hover { color: var(--primary); }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole-card click */
.tool-desc { font-size: 0.93rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tool-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; padding-top: 6px; position: relative; z-index: 1; }
.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}
.badge-free { background: #dcfce7; color: #15803d; }
.badge-freemium { background: #dbeafe; color: #1d4ed8; }
.badge-paid { background: #fef3c7; color: #b45309; }
.badge-free-trial { background: #ede9fe; color: #6d28d9; }
.badge-featured { background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; }
.stars { color: #f59e0b; font-size: 0.9rem; letter-spacing: 1px; }
.visit-link { margin-left: auto; font-weight: 600; font-size: 0.9rem; }

/* ---------- Page header (archive / single) ---------- */
.page-hero { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 40px 0 32px; }
.page-hero h1 { margin-bottom: 0.3em; }
.page-hero .lede { color: var(--muted); max-width: 720px; margin: 0; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { font-size: 0.85rem; color: var(--muted); margin: 0 0 18px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 8px; color: #cbd5e1; }

/* ---------- Filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.filters input[type="search"], .filters select {
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; background: #fff; color: var(--ink); min-width: 0;
}
.filters input[type="search"] { flex: 1 1 200px; }
.filters select { flex: 1 1 150px; }
.results-count { font-size: 0.9rem; color: var(--muted); margin: 0 0 16px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0 0; flex-wrap: wrap; }
.pagination .page-numbers {
  min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px; color: var(--ink-soft); font-weight: 600; text-decoration: none; padding: 0 12px;
}
.pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Single tool layout ---------- */
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 32px; padding: 32px 0 56px; }
.tool-main { min-width: 0; }
.tool-sidebar { min-width: 0; }
.quick-facts {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 24px; position: sticky; top: 90px;
}
.quick-facts h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 14px; }
.fact-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 0.93rem; }
.fact-row:last-child { border-bottom: 0; }
.fact-row dt { color: var(--muted); font-weight: 500; }
.fact-row dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.fact-cta { margin-top: 16px; }
.fact-cta .btn { width: 100%; }
.fact-note { font-size: 0.78rem; color: var(--muted); text-align: center; margin: 8px 0 0; }
.tool-content h2 { margin-top: 1.8em; padding-bottom: 0.4em; border-bottom: 2px solid var(--primary-soft); }
.feature-list { list-style: none; padding: 0; }
.feature-list li { padding: 8px 0 8px 32px; position: relative; border-bottom: 1px solid var(--bg-alt); }
.feature-list li::before { content: "✓"; position: absolute; left: 4px; color: var(--primary); font-weight: 800; }
.pricing-table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.95rem; }
.pricing-table th, .pricing-table td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.pricing-table th { background: var(--bg-alt); color: var(--ink); }
.pros-cons { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 1em 0; }
.pros, .cons { border-radius: var(--radius-sm); padding: 18px; }
.pros { background: #f0fdf4; border: 1px solid #bbf7d0; }
.cons { background: #fef2f2; border: 1px solid #fecaca; }
.pros h3, .cons h3 { margin-top: 0; font-size: 1rem; }
.pros ul, .cons ul { margin: 0; padding-left: 1.2em; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.faq-item summary { padding: 14px 18px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; float: right; color: var(--primary); font-weight: 800; }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-answer { padding: 0 18px 16px; color: var(--ink-soft); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; text-align: center; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 12px; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--primary); display: block; }
.stat .label { color: var(--muted); font-size: 0.9rem; }

/* ---------- Newsletter ---------- */
.newsletter { background: linear-gradient(135deg, var(--primary), #7c3aed); color: #fff; border-radius: 20px; padding: 44px 28px; text-align: center; }
.newsletter h2 { color: #fff; }
.newsletter p { color: #e0e7ff; max-width: 520px; margin: 0 auto 20px; }
.newsletter form { display: flex; gap: 8px; max-width: 460px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.newsletter input[type="email"] { flex: 1 1 240px; padding: 12px 18px; border-radius: 999px; border: 0; font-size: 1rem; }
.newsletter .btn { background: var(--ink); border-radius: 999px; }
.newsletter .btn:hover { background: #000; }

/* ---------- Inline search form (search + 404 pages) ---------- */
.tool-search-inline { display: flex; gap: 8px; max-width: 560px; margin: 20px 0; }
.tool-search-inline input[type="search"] {
  flex: 1; padding: 11px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1rem; min-width: 0;
}

/* ---------- Ad slots ---------- */
.ad-slot { margin: 28px auto; text-align: center; max-width: 100%; overflow: hidden; }
.ad-slot .ad-label { display: block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #b0b8c8; margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--header-bg); color: #94a3b8; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; padding: 52px 0 36px; }
.footer-col h3 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #94a3b8; font-size: 0.93rem; }
.footer-col a:hover { color: #fff; }
.footer-brand { color: #cbd5e1; font-size: 0.93rem; max-width: 320px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding: 20px 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }

/* ---------- Content pages ---------- */
.page-content, .post-content { padding: 40px 0 60px; max-width: 800px; }
.post-card { border-bottom: 1px solid var(--border); padding: 24px 0; }
.post-card h2 { margin-bottom: 0.3em; }
.post-card h2 a { color: var(--ink); }
.post-meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; }
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 .big { font-size: 5rem; font-weight: 800; color: var(--primary-soft); line-height: 1; }

/* ---------- Tablet ---------- */
@media (min-width: 640px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .pros-cons { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .tools-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .tools-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .tool-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
@media (max-width: 899px) {
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--header-bg-2); padding: 10px 20px 18px; box-shadow: 0 12px 24px rgba(0,0,0,0.3); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { display: block; padding: 12px 8px; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
}
