/*
Theme Name: RealTalkUSA
Theme URI: https://realtalkusa.com
Author: RealTalkUSA Team
Description: A clean, fast, AdSense-friendly multi-niche blog theme with category color coding and SEO-optimized layout.
Version: 1.0.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: realtalkusa
Tags: blog, news, multi-niche, adsense, seo, responsive
*/

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:        #f8f9fa;
  --clr-white:     #ffffff;
  --clr-text:      #1c1c1e;
  --clr-muted:     #6b7280;
  --clr-border:    #e5e7eb;
  --clr-accent:    #e94560;
  --clr-dark:      #111827;
  --clr-card-bg:   #ffffff;

  /* Category colors */
  --cat-mental:    #7c3aed;
  --cat-finance:   #059669;
  --cat-food:      #d97706;
  --cat-home:      #0891b2;
  --cat-tech:      #2563eb;
  --cat-relation:  #db2777;
  --cat-parenting: #ea580c;
  --cat-pets:      #16a34a;
  --cat-travel:    #0369a1;
  --cat-health:    #dc2626;

  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --max-w: 1200px;
  --transition: .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--clr-accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* ── READING PROGRESS BAR ── */
#reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--clr-accent), #f97316);
  z-index: 9999; transition: width .1s linear;
}

/* ── TOP BAR ── */
.top-bar {
  background: var(--clr-dark); color: #d1d5db;
  font-size: .75rem; padding: .4rem 0;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: #9ca3af; }
.top-bar a:hover { color: #ffffff; }

/* ── HEADER ── */
.site-header {
  background: var(--clr-white);
  border-bottom: 1px solid var(--clr-border);
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 1rem 0; gap: 2rem;
}
.site-branding .site-title {
  font-family: var(--font-head);
  font-size: 1.6rem; font-weight: 700;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--clr-dark) 0%, var(--clr-accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.site-branding .site-description { font-size: .75rem; color: var(--clr-muted); margin-top: .1rem; }

/* ── NAVIGATION ── */
.main-nav ul { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; }
.main-nav ul li { position: relative; }
.main-nav ul li a {
  display: block; padding: .5rem .9rem;
  font-size: .88rem; font-weight: 500;
  color: var(--clr-text); border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.main-nav ul li a:hover { background: var(--clr-bg); color: var(--clr-accent); }
.main-nav ul li.current-menu-item > a { color: var(--clr-accent); }

.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: .5rem;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--clr-text); margin: 4px 0;
  transition: transform .3s;
}

/* ── SEARCH ── */
.header-search form { display: flex; gap: .5rem; }
.header-search input {
  border: 1px solid var(--clr-border); border-radius: 8px;
  padding: .4rem .8rem; font-size: .85rem;
  background: var(--clr-bg); width: 180px;
  transition: border-color var(--transition);
}
.header-search input:focus { outline: none; border-color: var(--clr-accent); }
.header-search button {
  background: var(--clr-accent); color: white;
  border: none; border-radius: 8px;
  padding: .4rem .8rem; cursor: pointer; font-size: .85rem;
}

/* ── ADSENSE LEADERBOARD (728×90) ── */
.ad-leaderboard {
  text-align: center; padding: 1rem 0;
  background: var(--clr-white); border-bottom: 1px solid var(--clr-border);
}
.ad-leaderboard ins, .ad-leaderboard .ad-placeholder {
  display: inline-block; width: 728px; max-width: 100%; height: 90px;
  background: #f0f0f0; border: 1px dashed #ccc;
  line-height: 90px; color: #999; font-size: .8rem; text-align: center;
}

/* ── HERO / FEATURED ── */
.hero-section { padding: 2rem 0 1.5rem; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.hero-main .post-card { height: 100%; }
.hero-side { display: flex; flex-direction: column; gap: 1rem; }

/* ── POST CARDS ── */
.post-card {
  background: var(--clr-card-bg); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-card .card-thumb { overflow: hidden; aspect-ratio: 16/9; }
.post-card .card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .card-thumb img { transform: scale(1.04); }
.post-card .card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.post-card .card-category {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: .25rem .6rem;
  border-radius: 4px; color: white; display: inline-block; margin-bottom: .7rem;
}
.post-card .card-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; line-height: 1.35; margin-bottom: .6rem; }
.post-card .card-title a:hover { color: var(--clr-accent); }
.post-card .card-excerpt { font-size: .88rem; color: var(--clr-muted); line-height: 1.6; flex: 1; margin-bottom: .8rem; }
.post-card .card-meta { font-size: .75rem; color: var(--clr-muted); display: flex; gap: 1rem; align-items: center; border-top: 1px solid var(--clr-border); padding-top: .8rem; margin-top: auto; }
.post-card .read-more { color: var(--clr-accent); font-size: .82rem; font-weight: 600; }
.post-card .read-more:hover { text-decoration: underline; }

.hero-main .post-card .card-title { font-size: 1.5rem; }

/* ── CATEGORY COLOR MAP ── */
.cat-mental-health { background: var(--cat-mental) !important; }
.cat-personal-finance { background: var(--cat-finance) !important; }
.cat-food-cooking { background: var(--cat-food) !important; }
.cat-home-living { background: var(--cat-home) !important; }
.cat-ai-technology { background: var(--cat-tech) !important; }
.cat-relationships { background: var(--cat-relation) !important; }
.cat-parenting { background: var(--cat-parenting) !important; }
.cat-pets { background: var(--cat-pets) !important; }
.cat-travel { background: var(--cat-travel) !important; }
.cat-health-body { background: var(--cat-health) !important; }

/* ── CATEGORY STRIPS ── */
.category-strip { padding: .5rem 0; margin-bottom: .5rem; overflow-x: auto; white-space: nowrap; }
.category-strip .strip-list { display: flex; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.category-strip .strip-list li a {
  display: inline-block; padding: .35rem .9rem; border-radius: 20px;
  font-size: .78rem; font-weight: 600; color: white;
  transition: opacity var(--transition);
}
.category-strip .strip-list li a:hover { opacity: .85; }

/* ── MAIN LAYOUT ── */
.site-main { padding: 2rem 0 3rem; }
.layout-grid { display: grid; grid-template-columns: 1fr 320px; gap: 2.5rem; align-items: start; }
.main-content { min-width: 0; }

/* ── SECTION HEADINGS ── */
.section-heading {
  font-family: var(--font-head); font-size: 1.3rem; font-weight: 700;
  margin-bottom: 1.2rem; padding-bottom: .6rem;
  border-bottom: 2px solid var(--clr-accent); display: flex;
  align-items: center; justify-content: space-between;
}
.section-heading a { font-size: .8rem; color: var(--clr-accent); font-family: var(--font-body); }

/* ── POST GRID ── */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 2rem; }
.posts-grid-2 { grid-template-columns: repeat(2, 1fr); }
.posts-list { display: flex; flex-direction: column; gap: 1rem; }

/* ── LIST CARD ── */
.list-card {
  display: flex; gap: 1rem; background: var(--clr-white);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.list-card:hover { transform: translateY(-2px); }
.list-card .card-thumb { flex: 0 0 130px; aspect-ratio: 4/3; overflow: hidden; }
.list-card .card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-card .card-body { padding: .9rem; flex: 1; }
.list-card .card-title { font-size: .95rem; font-weight: 700; font-family: var(--font-head); line-height: 1.35; margin-bottom: .35rem; }
.list-card .card-meta { font-size: .72rem; color: var(--clr-muted); }

/* ── SIDEBAR ── */
.sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1.5rem; }
.widget {
  background: var(--clr-white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.2rem; overflow: hidden;
}
.widget-title { font-family: var(--font-head); font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--clr-accent); }

/* ── AD RECTANGLE (300×250) ── */
.ad-sidebar ins, .ad-sidebar .ad-placeholder {
  display: block; width: 300px; max-width: 100%; height: 250px;
  background: #f0f0f0; border: 1px dashed #ccc;
  line-height: 250px; color: #999; font-size: .8rem; text-align: center;
}

/* ── CATEGORIES WIDGET ── */
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { border-bottom: 1px solid var(--clr-border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem 0; font-size: .88rem; font-weight: 500;
}
.cat-list li a:hover { color: var(--clr-accent); }
.cat-list .cat-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .5rem;
}
.cat-count { background: var(--clr-bg); padding: .15rem .5rem; border-radius: 20px; font-size: .72rem; color: var(--clr-muted); }

/* ── POPULAR POSTS WIDGET ── */
.popular-posts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .8rem; }
.popular-posts li { display: flex; gap: .8rem; align-items: flex-start; }
.popular-posts .pp-num { font-size: 1.5rem; font-weight: 900; color: var(--clr-border); line-height: 1; flex: 0 0 28px; }
.popular-posts .pp-title { font-size: .85rem; font-weight: 600; line-height: 1.35; }
.popular-posts .pp-title a:hover { color: var(--clr-accent); }
.popular-posts .pp-meta { font-size: .72rem; color: var(--clr-muted); margin-top: .2rem; }

/* ── NEWSLETTER WIDGET ── */
.newsletter-widget { background: linear-gradient(135deg, var(--clr-dark) 0%, #1e3a5f 100%); color: white; }
.newsletter-widget .widget-title { color: white; border-color: rgba(255,255,255,.3); }
.newsletter-widget p { font-size: .85rem; color: #d1d5db; margin-bottom: 1rem; }
.newsletter-widget input {
  width: 100%; padding: .6rem .8rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1);
  color: white; font-size: .85rem; margin-bottom: .6rem;
}
.newsletter-widget input::placeholder { color: rgba(255,255,255,.5); }
.newsletter-widget button {
  width: 100%; padding: .65rem; background: var(--clr-accent);
  border: none; border-radius: 8px; color: white;
  font-weight: 700; cursor: pointer; font-size: .88rem;
  transition: opacity var(--transition);
}
.newsletter-widget button:hover { opacity: .88; }

/* ── SINGLE POST ── */
.single-post-header { padding: 2.5rem 0 1.5rem; background: var(--clr-white); border-bottom: 1px solid var(--clr-border); margin-bottom: 2rem; }
.single-post-header .container { max-width: 860px; }
.single-post-header .post-category-badge {
  display: inline-block; padding: .3rem .8rem; border-radius: 6px;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: white; margin-bottom: 1rem;
}
.single-post-header h1 {
  font-family: var(--font-head); font-size: 2.4rem; font-weight: 700;
  line-height: 1.25; margin-bottom: 1rem;
}
.post-meta-bar { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--clr-muted); }
.post-meta-bar .author-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--clr-accent); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: .9rem; }
.post-meta-bar .meta-sep { color: var(--clr-border); }

.single-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

.article-content { max-width: 720px; }
.article-content .featured-img { border-radius: var(--radius); overflow: hidden; margin-bottom: 2rem; aspect-ratio: 16/9; }
.article-content .featured-img img { width: 100%; height: 100%; object-fit: cover; }

.article-content h2 { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; margin: 2rem 0 .8rem; color: var(--clr-dark); }
.article-content h3 { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 .6rem; }
.article-content p { margin-bottom: 1.1rem; font-size: 1.03rem; line-height: 1.8; }
.article-content ul, .article-content ol { margin-bottom: 1.1rem; }
.article-content li { margin-bottom: .4rem; font-size: 1.03rem; }
.article-content blockquote {
  border-left: 4px solid var(--clr-accent); padding: 1rem 1.5rem;
  background: #fff5f5; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0; font-style: italic; color: var(--clr-dark);
}
.article-content .key-takeaway {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd; border-radius: var(--radius);
  padding: 1.2rem 1.5rem; margin: 1.5rem 0;
}
.article-content .key-takeaway strong { color: #0369a1; }

/* ── IN-CONTENT AD (336×280) ── */
.ad-in-content { text-align: center; margin: 2rem 0; }
.ad-in-content ins, .ad-in-content .ad-placeholder {
  display: inline-block; width: 336px; max-width: 100%; height: 280px;
  background: #f0f0f0; border: 1px dashed #ccc;
  line-height: 280px; color: #999; font-size: .8rem;
}

/* ── TOC ── */
.toc {
  background: var(--clr-bg); border: 1px solid var(--clr-border);
  border-radius: var(--radius); padding: 1.2rem 1.5rem; margin: 1.5rem 0;
}
.toc-title { font-weight: 700; font-size: .92rem; margin-bottom: .8rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin-bottom: .35rem; font-size: .88rem; }
.toc a { color: var(--clr-accent); }

/* ── SHARE BUTTONS ── */
.share-bar { margin: 2rem 0; padding: 1.2rem; background: var(--clr-white); border-radius: var(--radius); box-shadow: var(--shadow); }
.share-bar p { font-weight: 700; margin-bottom: .8rem; font-size: .9rem; }
.share-buttons { display: flex; gap: .6rem; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 6px; font-size: .82rem; font-weight: 600;
  color: white; transition: opacity var(--transition);
}
.share-btn:hover { opacity: .88; color: white; }
.share-fb { background: #1877f2; }
.share-tw { background: #000000; }
.share-pin { background: #e60023; }
.share-copy { background: #6b7280; }

/* ── AUTHOR BOX ── */
.author-box { display: flex; gap: 1.5rem; background: var(--clr-white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin: 2rem 0; }
.author-box .author-avatar-lg { width: 70px; height: 70px; border-radius: 50%; background: var(--clr-accent); color: white; font-size: 1.5rem; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.author-box .author-name { font-weight: 700; font-size: 1rem; margin-bottom: .3rem; }
.author-box .author-bio { font-size: .88rem; color: var(--clr-muted); }

/* ── RELATED POSTS ── */
.related-posts { margin: 2rem 0; }
.related-posts .section-heading { font-size: 1.1rem; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  font-size: .88rem; font-weight: 600;
  border: 1px solid var(--clr-border); background: var(--clr-white);
  transition: all var(--transition);
}
.pagination a:hover, .pagination .current { background: var(--clr-accent); color: white; border-color: var(--clr-accent); }

/* ── CATEGORY PAGE ── */
.category-header { background: var(--clr-dark); color: white; padding: 2.5rem 0; margin-bottom: 2rem; }
.category-header h1 { font-family: var(--font-head); font-size: 2rem; margin-bottom: .4rem; }
.category-header p { color: #d1d5db; font-size: .9rem; }

/* ── TAGS ── */
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.post-tags a { background: var(--clr-bg); border: 1px solid var(--clr-border); border-radius: 4px; padding: .25rem .6rem; font-size: .78rem; color: var(--clr-muted); transition: all var(--transition); }
.post-tags a:hover { background: var(--clr-accent); color: white; border-color: var(--clr-accent); }

/* ── BREADCRUMBS ── */
.breadcrumbs { font-size: .8rem; color: var(--clr-muted); padding: .8rem 0; }
.breadcrumbs a { color: var(--clr-accent); }
.breadcrumbs span { margin: 0 .4rem; }

/* ── FOOTER ── */
.site-footer { background: var(--clr-dark); color: #d1d5db; padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2rem; }
.footer-brand .site-title { font-family: var(--font-head); font-size: 1.4rem; color: white; margin-bottom: .6rem; }
.footer-brand p { font-size: .85rem; line-height: 1.6; }
.footer-heading { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #9ca3af; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { font-size: .85rem; color: #9ca3af; transition: color var(--transition); }
.footer-links a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; font-size: .78rem; color: #6b7280; flex-wrap: wrap; gap: .5rem; }
.footer-bottom a { color: #9ca3af; }
.footer-bottom a:hover { color: white; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .layout-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .single-layout { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: white; border-top: 1px solid var(--clr-border); padding: 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.1); }
  .main-nav.open ul { flex-direction: column; }
  .hamburger { display: block; }
  .header-search { display: none; }
  .single-post-header h1 { font-size: 1.6rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .ad-leaderboard ins, .ad-leaderboard .ad-placeholder { width: 320px; height: 50px; line-height: 50px; }
  .author-box { flex-direction: column; }
}
@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
  .post-card .card-title { font-size: 1rem; }
  .hero-main .post-card .card-title { font-size: 1.2rem; }
}
