/* ============================================================
   BAKER TESTED — Custom Design System
   Inspired by: Wirecutter, NerdWallet, PCMag, TechRadar
   Direction: Clean editorial, dark header, trust-forward
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Variables --- */
:root {
  --bt-navy: #0F172A;
  --bt-navy-light: #1E293B;
  --bt-slate: #334155;
  --bt-gray: #64748B;
  --bt-gray-light: #94A3B8;
  --bt-border: #E2E8F0;
  --bt-bg: #F8FAFC;
  --bt-white: #FFFFFF;
  --bt-teal: #0EA5E9;
  --bt-teal-dark: #0284C7;
  --bt-amber: #F59E0B;
  --bt-amber-light: #FEF3C7;
  --bt-green: #10B981;
  --bt-green-light: #D1FAE5;
  --bt-red: #EF4444;
  --bt-red-light: #FEE2E2;
  --bt-font-heading: 'Source Serif 4', Georgia, serif;
  --bt-font-body: 'Inter', -apple-system, sans-serif;
  --bt-font-mono: 'JetBrains Mono', monospace;
  --bt-radius: 8px;
  --bt-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --bt-shadow-md: 0 4px 6px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --bt-shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.1), 0 4px 6px rgba(15, 23, 42, 0.05);
  --bt-max-width: 1200px;
}

/* --- Base Reset & Typography --- */
body {
  font-family: var(--bt-font-body) !important;
  background: var(--bt-bg) !important;
  color: var(--bt-navy) !important;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--bt-font-heading) !important;
  color: var(--bt-navy) !important;
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 2.5rem !important; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem !important; letter-spacing: -0.01em; margin-top: 2.5rem; }
h3 { font-size: 1.35rem !important; }

p { color: var(--bt-slate); line-height: 1.8; margin-bottom: 1.25rem; }

a { color: var(--bt-teal-dark); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--bt-teal); }

code, pre {
  font-family: var(--bt-font-mono) !important;
  font-size: 0.875rem;
  background: var(--bt-navy);
  color: #E2E8F0;
  border-radius: 4px;
  padding: 2px 6px;
}

pre {
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: var(--bt-radius);
}

/* --- HEADER / NAV — Dark, Sticky, Professional --- */
.ast-primary-header,
.ast-main-header-wrap,
header.site-header {
  background: var(--bt-navy) !important;
  border-bottom: 1px solid var(--bt-navy-light) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

.ast-primary-header.ast-sticky-active {
  background: var(--bt-navy) !important;
}

/* Site Title */
.site-title,
.site-title a,
.ast-site-identity .site-title a {
  color: var(--bt-white) !important;
  font-family: var(--bt-font-heading) !important;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  letter-spacing: -0.02em;
}

/* Nav Links */
.main-header-menu a,
.ast-header-sections-navigation a,
.main-navigation a,
.ast-nav-menu a,
.ast-header-break-point .main-navigation ul li a {
  color: var(--bt-gray-light) !important;
  font-family: var(--bt-font-body) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  transition: color 0.2s !important;
}

.main-header-menu a:hover,
.ast-nav-menu a:hover,
.main-header-menu .current-menu-item > a {
  color: var(--bt-teal) !important;
}

/* --- CONTENT AREA --- */
.ast-container,
.site-content .ast-container {
  max-width: var(--bt-max-width) !important;
}

/* Page/Post Content */
.entry-content,
.page-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--bt-slate);
}

/* Article Cards / Post Entries */
.ast-article-post,
article.post {
  background: var(--bt-white);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--bt-shadow);
  transition: box-shadow 0.3s, transform 0.2s;
}

article.post:hover {
  box-shadow: var(--bt-shadow-md);
  transform: translateY(-2px);
}

.entry-title,
.entry-title a {
  font-family: var(--bt-font-heading) !important;
  font-size: 1.5rem !important;
  color: var(--bt-navy) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}

.entry-title a:hover {
  color: var(--bt-teal-dark) !important;
}

/* Post Meta (date, author, categories) */
.entry-meta,
.entry-meta a,
.ast-blog-single-element .post-meta {
  font-size: 0.8125rem !important;
  color: var(--bt-gray) !important;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Category badges */
.cat-links a,
.entry-meta .cat-links a {
  background: var(--bt-teal) !important;
  color: var(--bt-white) !important;
  padding: 3px 10px !important;
  border-radius: 4px !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em;
}

/* --- PAGES (trust pages, etc.) --- */
.page .entry-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--bt-border);
}

.page .entry-content h2 {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bt-border);
}

.page .entry-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.page .entry-content ul {
  padding-left: 0;
  list-style: none;
}

.page .entry-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.page .entry-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  background: var(--bt-teal);
  border-radius: 50%;
}

/* --- TABLES (for comparison articles) --- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  overflow: hidden;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

thead th {
  background: var(--bt-navy) !important;
  color: var(--bt-white) !important;
  font-family: var(--bt-font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  text-align: left;
}

tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--bt-border);
  color: var(--bt-slate);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: var(--bt-bg);
}

tbody tr:hover {
  background: #EFF6FF;
}

/* --- BLOCKQUOTES (for callouts) --- */
blockquote {
  border-left: 4px solid var(--bt-teal) !important;
  background: #F0F9FF;
  padding: 1.25rem 1.5rem !important;
  margin: 1.5rem 0 !important;
  border-radius: 0 var(--bt-radius) var(--bt-radius) 0;
  font-style: normal !important;
}

blockquote p {
  color: var(--bt-navy) !important;
  font-weight: 500;
}

/* --- AFFILIATE DISCLOSURE BANNER --- */
.entry-content > p:first-of-type strong:first-child {
  display: block;
  background: var(--bt-amber-light);
  border: 1px solid #FDE68A;
  border-radius: var(--bt-radius);
  padding: 0.875rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #92400E;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* --- SIDEBAR WIDGETS --- */
.widget {
  background: var(--bt-white);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--bt-shadow);
}

.widget-title {
  font-family: var(--bt-font-body) !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--bt-gray) !important;
  border-bottom: 2px solid var(--bt-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

/* --- FOOTER — Dark, Professional --- */
.ast-footer-overlay,
.site-footer,
footer.site-footer,
.ast-small-footer {
  background: var(--bt-navy) !important;
  color: var(--bt-gray-light) !important;
  border-top: 1px solid var(--bt-navy-light) !important;
}

.site-footer a,
.ast-small-footer a,
footer a {
  color: var(--bt-gray-light) !important;
}

.site-footer a:hover,
footer a:hover {
  color: var(--bt-teal) !important;
}

.ast-small-footer .ast-footer-copyright {
  color: var(--bt-gray) !important;
  font-size: 0.8125rem;
}

/* Hide "Powered by Astra WordPress Theme" */
.ast-small-footer .ast-footer-copyright a[href*="wpastra"] {
  display: none !important;
}

/* --- BUTTONS / CTA --- */
.wp-block-button__link,
.ast-custom-button,
button,
input[type="submit"] {
  background: var(--bt-teal) !important;
  color: var(--bt-white) !important;
  border: none !important;
  border-radius: var(--bt-radius) !important;
  font-family: var(--bt-font-body) !important;
  font-weight: 600 !important;
  font-size: 0.9375rem !important;
  padding: 0.75rem 1.75rem !important;
  transition: background 0.2s, transform 0.15s !important;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.wp-block-button__link:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--bt-teal-dark) !important;
  transform: translateY(-1px);
}

/* --- IMAGES --- */
.entry-content img,
.wp-block-image img {
  border-radius: var(--bt-radius);
  border: 1px solid var(--bt-border);
}

/* --- PAGINATION --- */
.ast-pagination a,
.nav-links a {
  background: var(--bt-white);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-radius);
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.ast-pagination a:hover {
  background: var(--bt-teal);
  color: var(--bt-white);
  border-color: var(--bt-teal);
}

/* --- SCROLL-TO-TOP --- */
.ast-scroll-to-top-right {
  background: var(--bt-navy) !important;
  border-radius: 50% !important;
  box-shadow: var(--bt-shadow-md) !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  h1 { font-size: 1.875rem !important; }
  h2 { font-size: 1.375rem !important; }
  .entry-content { font-size: 1rem; }
  article.post { padding: 1.25rem; }
}

/* --- PRINT --- */
@media print {
  .ast-primary-header, .site-footer, .ast-scroll-to-top-right { display: none; }
  body { background: white; }
  article { box-shadow: none; border: none; }
}

/* --- Hide page title on the homepage --- */
.home .entry-header,
.home .page-header,
body.home .entry-title {
  display: none !important;
}

/* --- Remove "Home" redundant link highlight --- */
.home .entry-header {
  display: none !important;
}

/* --- Better spacing on homepage content --- */
.home .entry-content {
  padding-top: 0 !important;
  margin-top: -1rem;
}

/* --- Footer copyright — replace Astra branding --- */
.ast-small-footer .ast-footer-copyright {
  font-size: 0.8125rem;
  color: #64748B !important;
}

.ast-small-footer .ast-footer-copyright a {
  display: none !important;
}

.ast-small-footer .ast-footer-copyright::after {
  content: '© 2026 Baker Tested. All rights reserved. AI tools reviewed with a security-first lens.';
}

/* --- Nav cleanup: only show key pages, hide "Home" link --- */
.main-header-menu li.page_item a[href*="/home/"] {
  display: none !important;
}

/* --- CONTENT WIDTH FIX — 720px max for readability --- */
.page .entry-content,
.single .entry-content {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* --- H3 SPACING FIX --- */
.entry-content h3 {
  margin-top: 2rem !important;
  padding-top: 0.5rem;
}

/* --- FOOTER — Consistent across ALL pages --- */
.ast-small-footer .ast-footer-copyright a[href*="wpastra"],
.ast-small-footer .ast-footer-copyright a[href*="wordpress.org"] {
  display: none !important;
}

/* Hide the default Astra footer text completely and replace */
.site-footer .ast-small-footer .ast-footer-copyright {
  visibility: hidden;
  position: relative;
  height: auto;
}

.site-footer .ast-small-footer .ast-footer-copyright::before {
  visibility: visible;
  content: '© 2026 Baker Tested — AI tools reviewed with a security-first lens.';
  display: block;
  color: #64748B;
  font-size: 0.8125rem;
}

.site-footer .ast-small-footer .ast-footer-copyright::after {
  visibility: visible;
  content: 'About · How We Test · Editorial Standards · How We Make Money · About the Reviewer';
  display: block;
  margin-top: 0.75rem;
  color: #94A3B8;
  font-size: 0.75rem;
}

/* --- Homepage full-width override (hero needs to be wider) --- */
.home .entry-content {
  max-width: 100% !important;
}

/* --- HOMEPAGE TITLE — Additional hiding for Astra variants --- */
.home .ast-article-single .entry-header,
.home .entry-header .entry-title,
body.page-id-22 .entry-header {
  display: none !important;
}

/* --- LOGO SIZE FIX — constrain to header height --- */
.site-logo-img img,
.custom-logo,
.ast-site-identity .custom-logo-link img,
header .custom-logo-link img {
  max-height: 45px !important;
  width: auto !important;
  height: auto !important;
  max-width: 45px !important;
}

/* Keep the text title next to the logo */
.ast-site-identity {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* Ensure site title still shows alongside logo */
.site-title {
  display: block !important;
}

/* === INNER PAGE HEADER BANNER === */
body:not(.home) .entry-header {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  margin: -2rem -9999px 2.5rem -9999px;
  padding: 2.5rem 9999px 2rem 9999px;
  border-bottom: 3px solid #0EA5E9;
}

body:not(.home) .entry-title {
  color: #FFFFFF !important;
  font-size: 2.25rem !important;
  font-family: var(--bt-font-heading) !important;
  margin-bottom: 0 !important;
}

/* Fix H1 > H2 hierarchy — H1 must be bigger */
body:not(.home) .entry-content h2 {
  font-size: 1.5rem !important;
}

/* Better body line height */
.entry-content p {
  line-height: 1.65 !important;
}

/* Inner page content width (override for non-homepage) */
body:not(.home) .entry-content {
  max-width: 680px !important;
  margin-left: auto;
  margin-right: auto;
}

/* === FOOTER FIX — Global, consistent === */
.ast-small-footer {
  background: #0F172A !important;
  padding: 2rem 0 !important;
  border-top: 1px solid #1E293B !important;
}

.ast-small-footer .ast-footer-copyright,
.ast-small-footer .ast-footer-copyright * {
  color: #64748B !important;
  font-size: 0.8125rem !important;
}

/* Kill ALL Astra links in footer */
.ast-small-footer a[href*="wpastra"],
.ast-small-footer a[href*="wordpress.org"],
.ast-small-footer .ast-footer-copyright a {
  display: none !important;
}

/* Override footer content completely */
.ast-small-footer .ast-footer-copyright .ast-footer-html-inner {
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

.ast-small-footer .ast-footer-copyright::before {
  visibility: visible !important;
  display: block !important;
  content: '© 2026 Baker Tested · AI tools reviewed with a security-first lens' !important;
  color: #94A3B8 !important;
  font-size: 0.8125rem !important;
  text-align: center !important;
  margin-bottom: 0.75rem !important;
}

.ast-small-footer .ast-footer-copyright::after {
  visibility: visible !important;
  display: block !important;
  content: 'About · How We Test · Editorial Standards · How We Make Money · About the Reviewer' !important;
  color: #64748B !important;
  font-size: 0.75rem !important;
  text-align: center !important;
}

/* === HERO CTA BUTTON === */
.hero-cta {
  display: inline-block;
  background: #0EA5E9;
  color: #FFFFFF !important;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-family: var(--bt-font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  margin-top: 1.5rem;
}

.hero-cta:hover {
  background: #0284C7;
  transform: translateY(-2px);
  color: #FFFFFF !important;
}

/* === DUPLICATE H1 FIX — hide Astra's page title on homepage === */
body.home .ast-article-single .entry-header,
body.page-id-22 .ast-article-single .entry-header,
body.home .entry-header .entry-title,
body.page-id-22 h1.entry-title {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
