/*
Theme Name: FixGuide
Theme URI: https://homefixguide.info
Author: Brand Visibility
Author URI: https://brandvisibility.net
Description: A clean, fast, AdSense-optimized blog theme for how-to and fix-it content sites. Works across homefixguide.info, bodyfixguide.com, and techfixhub. Swap accent color and logo per site.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: fixguide
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, one-column, two-columns, right-sidebar
*/

/* ============================================================
   DESIGN TOKENS — change these per site
   Site 1 (homefixguide):  --accent: #E8622A; --accent-dark: #C44D1A;
   Site 2 (bodyfixguide):  --accent: #2A9E6E; --accent-dark: #1E7A52;
   Site 3 (techfixhub):    --accent: #2A6FE8; --accent-dark: #1A52C4;
============================================================ */
:root {
  --accent:        #E8622A;
  --accent-dark:   #C44D1A;
  --accent-light:  #FDF0EA;
  --text-primary:  #1A1A1A;
  --text-secondary:#555;
  --text-muted:    #888;
  --bg:            #fff;
  --bg-secondary:  #F7F7F5;
  --border:        #E8E8E4;
  --radius:        6px;
  --radius-lg:     10px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07);
  --shadow-md:     0 4px 16px rgba(0,0,0,.09);
  --font-head:     'DM Serif Display', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --max-width:     1140px;
  --content-width: 720px;
  --sidebar-width: 300px;
  --header-height: 64px;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1rem;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-dark); }
ul, ol { padding-left: 1.5rem; }

/* ============================================================
   TYPOGRAPHY
============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  color: var(--text-primary);
  line-height: 1.25;
  font-weight: 400;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

/* ============================================================
   LAYOUT HELPERS
============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}
.site-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 48px;
  align-items: start;
  padding: 48px 0;
}
@media (max-width: 900px) {
  .site-layout { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { order: 2; }
}

/* ============================================================
   HEADER
============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 20px; height: 20px; fill: #fff; }
.logo-text {
  font-family: var(--font-head);
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 400;
}
.logo-text span { color: var(--accent); }

/* NAV */
.main-nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
  padding: 0;
}
.main-nav a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: .01em;
  transition: color .2s;
}
.main-nav a:hover,
.main-nav .current-menu-item a { color: var(--accent); }
.nav-search {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  transition: color .2s;
}
.nav-search:hover { color: var(--accent); }
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all .3s;
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 16px; }
}

/* ============================================================
   HERO / FEATURED POST
============================================================ */
.hero-section {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image { order: -1; }
}
.hero-category {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero-excerpt {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 24px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hero-meta .sep::before { content: '·'; }
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  transition: background .2s, transform .15s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; transform: translateY(-1px); }
.hero-image img {
  border-radius: var(--radius-lg);
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* ============================================================
   CATEGORY STRIP
============================================================ */
.category-strip {
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }
.category-strip-inner {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.cat-tab {
  display: inline-block;
  padding: 12px 16px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  text-decoration: none;
}
.cat-tab:hover,
.cat-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   POST CARDS
============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}
.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.post-card-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.post-card:hover .post-card-thumb img { transform: scale(1.04); }
.post-card-cat {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
}
.post-card-body { padding: 20px; }
.post-card-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.3;
}
.post-card-title a { color: var(--text-primary); }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt {
  font-size: .875rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--text-muted);
}
.read-time { display: flex; align-items: center; gap: 4px; }

/* ============================================================
   SINGLE POST
============================================================ */
.post-header { margin-bottom: 32px; }
.post-breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-breadcrumb a { color: var(--text-muted); }
.post-breadcrumb a:hover { color: var(--accent); }
.post-category-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 14px;
}
.post-title {
  font-size: clamp(1.75rem, 4vw, 2.625rem);
  margin-bottom: 20px;
  line-height: 1.2;
}
.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.author-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.author-info { display: flex; flex-direction: column; }
.author-name { font-size: .85rem; font-weight: 600; color: var(--text-primary); }
.post-date { font-size: .78rem; color: var(--text-muted); }
.post-stats {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: .78rem;
  color: var(--text-muted);
}
.featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
}
.featured-image img { width: 100%; aspect-ratio: 16/6; object-fit: cover; }

/* TABLE OF CONTENTS */
.toc-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.toc-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.toc-list { list-style: none; padding: 0; counter-reset: toc; }
.toc-list li {
  counter-increment: toc;
  padding: 4px 0;
  font-size: .9rem;
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.toc-list li::before {
  content: counter(toc);
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  min-width: 18px;
  background: var(--accent-light);
  text-align: center;
  border-radius: 3px;
  padding: 1px 4px;
}
.toc-list a { color: var(--text-secondary); font-size: .875rem; }
.toc-list a:hover { color: var(--accent); }

/* ARTICLE CONTENT */
.entry-content h2 {
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.entry-content h3 { margin: 2rem 0 .75rem; }
.entry-content ul, .entry-content ol { margin-bottom: 1.25rem; }
.entry-content li { margin-bottom: .4rem; }
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  background: var(--accent-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}
.entry-content code {
  font-family: var(--font-mono);
  font-size: .85em;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.entry-content pre {
  background: #1A1A1A;
  color: #e8e8e8;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: .85rem;
}
.entry-content pre code { background: none; border: none; padding: 0; color: inherit; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* PRO TIP BOX */
.tip-box {
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 1.75rem 0;
  font-size: .9rem;
}
.tip-box-label {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* STEP-BY-STEP BOXES */
.steps-list { list-style: none; padding: 0; counter-reset: steps; margin: 1.5rem 0; }
.steps-list li {
  counter-increment: steps;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.steps-list li::before {
  content: counter(steps);
  min-width: 32px; height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ADSENSE SLOTS */
.ad-slot {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .75rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ad-slot-top    { width: 100%; height: 90px; margin-bottom: 32px; }
.ad-slot-mid    { width: 100%; height: 250px; margin: 32px 0; }
.ad-slot-bottom { width: 100%; height: 250px; margin-top: 32px; }
.ad-slot-sidebar { width: 100%; height: 250px; }
.ad-slot-sidebar-lg { width: 100%; height: 600px; }

/* ============================================================
   SIDEBAR
============================================================ */
.sidebar { position: sticky; top: calc(var(--header-height) + 24px); }
.widget { margin-bottom: 32px; }
.widget-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.widget-title span {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
  margin-bottom: -10px;
  display: inline-block;
}

/* POPULAR POSTS */
.popular-post {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.popular-post:last-child { border-bottom: none; }
.popular-post-thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}
.popular-post-title {
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-primary);
}
.popular-post-title:hover { color: var(--accent); }
.popular-post-meta { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* CATEGORY WIDGET */
.category-list { list-style: none; padding: 0; }
.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.category-list li:last-child { border-bottom: none; }
.category-count {
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 10px;
}

/* SEARCH WIDGET */
.search-form {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-form input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: .875rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
}
.search-form button {
  background: var(--accent);
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  color: #fff;
  transition: background .2s;
}
.search-form button:hover { background: var(--accent-dark); }

/* ============================================================
   RELATED POSTS
============================================================ */
.related-posts { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.related-title {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 640px) { .related-grid { grid-template-columns: 1fr; } }
.related-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .2s;
}
.related-card:hover { box-shadow: var(--shadow-md); }
.related-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.related-card-body { padding: 14px; }
.related-card-title { font-size: .9rem; line-height: 1.35; }
.related-card-title a { color: var(--text-primary); }
.related-card-title a:hover { color: var(--accent); }

/* ============================================================
   AUTHOR BOX (E-E-A-T)
============================================================ */
.author-box {
  display: flex;
  gap: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 40px;
  align-items: flex-start;
}
.author-box-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-box-name { font-weight: 600; font-size: 1rem; margin-bottom: 4px; }
.author-box-bio { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
@media (max-width: 500px) { .author-box { flex-direction: column; } }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
  background: #111;
  color: #aaa;
  margin-top: 80px;
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 48px 0;
}
@media (max-width: 768px) {
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 480px) {
  .footer-top { grid-template-columns: 1fr; }
}
.footer-brand .logo-text { color: #fff; }
.footer-desc { font-size: .875rem; line-height: 1.7; margin-top: 12px; color: #888; }
.footer-heading {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
}
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: .875rem; color: #888; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid #222;
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom a { color: #888; }
.footer-bottom a:hover { color: var(--accent); }

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 48px 0;
  flex-wrap: wrap;
}
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  color: var(--text-secondary);
  transition: all .2s;
  text-decoration: none;
}
.page-numbers:hover,
.page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   BREADCRUMBS
============================================================ */
.breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }

/* ============================================================
   UTILITY CLASSES
============================================================ */
.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   SCROLL TO TOP
============================================================ */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px; height: 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: all .3s;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.scroll-top.visible { opacity: 1; transform: translateY(0); }
.scroll-top:hover { background: var(--accent-dark); }

/* ============================================================
   RESPONSIVE TWEAKS
============================================================ */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .site-layout { padding: 24px 0; }
  .hero-section { padding: 28px 0; }
  .posts-grid { grid-template-columns: 1fr; }
}
