/*
Theme Name: Fitonear
Theme URI: https://fitonear.com
Author: Fitonear
Author URI: https://fitonear.com
Description: Custom authority-site theme for Fitonear — reviews, comparisons, and free tools across AI, Productivity, Home Office, Software, Education, and Career. Includes review scoring, pros/cons blocks, comparison tables, and Amazon affiliate product boxes.
Version: 1.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: fitonear
*/

:root {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --primary: #2563EB;
  --accent: #06B6D4;
  --success: #22C55E;
  --danger: #E05252;
  --border: #E2E8F0;
  --radius: 14px;
  --amazon: #FF9900;
}
[data-theme="dark"] {
  --bg: #0B1220;
  --card: #131C2E;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --primary: #3B82F6;
  --accent: #22D3EE;
  --success: #4ADE80;
  --danger: #F87171;
  --border: #22314A;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.fon-wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }

h1, h2, h3, .fon-display { font-family: 'Manrope', sans-serif; font-weight: 800; letter-spacing: -0.01em; }
.fon-mono { font-family: 'JetBrains Mono', monospace; }

/* ---------- Header / Nav ---------- */
.fon-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 50;
}
.fon-logo { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.fon-logo-mark { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--primary), var(--accent)); flex-shrink: 0; }
.fon-menu { display: flex; gap: 22px; font-size: 13.5px; font-weight: 500; color: var(--muted); list-style: none; margin: 0; padding: 0; }
.fon-menu li { position: relative; }
.fon-menu a:hover { color: var(--primary); }
.fon-menu-wrap { display: flex; align-items: center; gap: 22px; }
@media (max-width: 780px) { .fon-menu { display: none; } }
.fon-nav-actions { display: flex; align-items: center; gap: 10px; }
.fon-icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--card); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: 15px;
}
.fon-btn-primary {
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  padding: 12px 20px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-block;
}
.fon-btn-secondary {
  background: none; color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 20px; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-block;
}

/* Reading progress bar (single posts only) */
.fon-progress-track { height: 3px; background: var(--border); position: sticky; top: 66px; z-index: 49; }
.fon-progress-fill { height: 100%; width: 0%; background: var(--primary); transition: width 0.1s linear; }

/* ---------- Breadcrumb ---------- */
.fon-breadcrumb { padding: 16px 0 0 0; font-size: 12px; color: var(--muted); }
.fon-breadcrumb a:hover { color: var(--primary); }

/* ---------- Cards, grids (shared) ---------- */
.fon-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.fon-section { padding: 40px 0 0 0; }
.fon-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.fon-section-title { font-size: 20px; margin: 0; }
.fon-section-link { font-size: 12.5px; font-weight: 600; color: var(--primary); }

.fon-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fon-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.fon-grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 780px) { .fon-grid-3, .fon-grid-4, .fon-grid-6 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .fon-grid-3, .fon-grid-4, .fon-grid-6 { grid-template-columns: 1fr; } }

.fon-post-card { overflow: hidden; }
.fon-post-card-img { height: 100px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: rgba(37,99,235,0.08); }
.fon-post-card-body { padding: 14px; }
.fon-post-card-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); margin-bottom: 6px; }
.fon-post-card-title { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 13.5px; line-height: 1.4; margin: 0 0 8px 0; }
.fon-post-card-excerpt { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 12px 0; }
.fon-post-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }
.fon-score { color: var(--success); font-weight: 700; }

/* ---------- Score dial ---------- */
.fon-dial { position: relative; flex-shrink: 0; }
.fon-dial-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-weight: 700; }

/* ---------- Category grid ---------- */
.fon-cat-card { padding: 18px; transition: border-color 0.15s ease, transform 0.15s ease; cursor: pointer; display: block; }
.fon-cat-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.fon-cat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 12px; }
.fon-cat-name { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 14.5px; margin: 0 0 3px 0; }
.fon-cat-count { font-size: 12px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* ---------- Newsletter band ---------- */
.fon-newsletter {
  margin: 44px 0 0 0; background: var(--text); color: var(--bg);
  border-radius: 18px; padding: 32px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
[data-theme="dark"] .fon-newsletter { background: var(--card); border: 1px solid var(--border); }
.fon-newsletter-title { font-size: 19px; margin: 0 0 6px 0; }
.fon-newsletter-sub { font-size: 13px; opacity: 0.75; margin: 0; }
.fon-newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.fon-newsletter-input { border: none; border-radius: 9px; padding: 11px 14px; font-size: 13px; width: 220px; }
.fon-newsletter-btn { background: var(--primary); color: #fff; border: none; border-radius: 9px; padding: 11px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }

/* ---------- Single post ---------- */
.fon-post-header { padding: 12px 0 22px 0; border-bottom: 1px solid var(--border); }
.fon-post-tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary); background: rgba(37,99,235,0.1); padding: 4px 10px; border-radius: 6px; margin-bottom: 12px; }
.fon-post-title { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.2; margin: 0 0 14px 0; }
.fon-byline { display: flex; align-items: center; gap: 10px; }
.fon-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(6,182,212,0.15); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.fon-byline-text { font-size: 12.5px; }
.fon-byline-name { font-weight: 700; }
.fon-byline-meta { color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; }

.fon-verdict { margin: 22px 0 0 0; padding: 20px; display: flex; gap: 18px; align-items: center; }
@media (max-width: 640px) { .fon-verdict { flex-direction: column; align-items: flex-start; } }
.fon-verdict-body { flex: 1; }
.fon-verdict-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.fon-verdict-text { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.fon-verdict-cta { background: var(--text); color: var(--bg); border: none; border-radius: 10px; padding: 12px 20px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-block; }

.fon-toc { margin: 22px 0 0 0; padding: 16px 18px; }
.fon-toc-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 10px; }
.fon-toc-list { display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.fon-toc-list a { color: var(--primary); }

.fon-post-body { padding: 26px 0 0 0; font-size: 15px; line-height: 1.75; }
.fon-post-body p { margin: 0 0 18px 0; }
.fon-post-body h2 { font-size: 20px; margin: 30px 0 14px 0; }
.fon-post-body h3 { font-size: 17px; margin: 24px 0 12px 0; }
.fon-post-body ul, .fon-post-body ol { margin: 0 0 18px 0; padding-left: 22px; }
.fon-post-body img { border-radius: var(--radius); margin: 20px 0; }

.fon-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 22px 0; }
@media (max-width: 640px) { .fon-proscons { grid-template-columns: 1fr; } }
.fon-pc-card { border-radius: var(--radius); padding: 16px 18px; border: 1px solid var(--border); }
.fon-pc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.fon-pc-pros .fon-pc-title { color: var(--success); }
.fon-pc-cons .fon-pc-title { color: var(--danger); }
.fon-pc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }

.fon-product { padding: 18px; margin: 22px 0; display: flex; gap: 16px; align-items: center; }
@media (max-width: 640px) { .fon-product { flex-direction: column; align-items: flex-start; } }
.fon-product-img { width: 76px; height: 76px; border-radius: 10px; background: rgba(37,99,235,0.08); display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; overflow: hidden; }
.fon-product-body { flex: 1; }
.fon-product-name { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.fon-product-stars { color: var(--accent); font-size: 12px; margin-bottom: 6px; }
.fon-product-price { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--muted); }
.fon-product-btn { background: var(--amazon); color: #17130A; border: none; border-radius: 9px; padding: 11px 18px; font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-block; }

.fon-disclosure { font-size: 11.5px; color: var(--muted); padding: 12px 16px; margin: 22px 0; line-height: 1.6; }

.fon-authorbox { margin: 30px 0 0 0; padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.fon-authorbox-avatar { width: 46px; height: 46px; border-radius: 50%; background: rgba(6,182,212,0.15); color: var(--accent); display: flex; align-items: center; justify-content: center; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.fon-authorbox-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.fon-authorbox-bio { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ---------- Comparison table ---------- */
.fon-table-wrap { margin: 22px 0; overflow-x: auto; }
.fon-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fon-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--border); }
.fon-table td { padding: 12px; border-bottom: 1px solid var(--border); }
.fon-table tr:last-child td { border-bottom: none; }

/* ---------- Category archive header ---------- */
.fon-archive-header { padding: 14px 0 24px 0; border-bottom: 1px solid var(--border); }
.fon-archive-header-top { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
.fon-archive-icon { width: 52px; height: 52px; border-radius: 14px; background: rgba(37,99,235,0.1); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.fon-archive-title { font-size: clamp(24px, 3vw, 30px); margin: 0 0 4px 0; }
.fon-archive-count { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.fon-archive-desc { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 62ch; margin: 0; }

.fon-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 30px 0 0 0; }
.fon-pagination a, .fon-pagination span { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: 12.5px; font-family: 'JetBrains Mono', monospace; display: flex; align-items: center; justify-content: center; padding: 0 8px; }
.fon-pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* ---------- Footer ---------- */
.fon-footer { margin-top: 60px; border-top: 1px solid var(--border); padding: 40px 0; }
.fon-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
@media (max-width: 780px) { .fon-footer-grid { grid-template-columns: 1fr 1fr; } }
.fon-footer-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 12px; }
.fon-footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.fon-footer-links a:hover { color: var(--primary); }
.fon-footer-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- 404 ---------- */
.fon-404 { text-align: center; padding: 60px 0; }
.fon-404 h1 { font-size: 40px; margin-bottom: 8px; }
.fon-searchform { display: flex; gap: 8px; max-width: 400px; margin: 20px auto; }
.fon-searchform input[type="search"] { flex: 1; border: 1px solid var(--border); border-radius: 9px; padding: 11px 14px; font-size: 14px; background: var(--card); color: var(--text); }
.fon-searchform button { background: var(--primary); color: #fff; border: none; border-radius: 9px; padding: 11px 16px; font-size: 14px; cursor: pointer; }

/* ---------- Comments ---------- */
.fon-comments { padding: 40px 0 0 0; }
