/*
Theme Name: TaxBull Blog
Theme URI: https://taxbull.co.uk
Author: TaxBull
Author URI: https://taxbull.co.uk
Description: Warm cream and gold blog theme matching the TaxBull UK Capital Gains Tax Calculator. Clean, fast, SEO-optimised finance blog for UK investors.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: taxbull-theme
Tags: blog, light, finance, custom-background, custom-header, custom-menu, featured-images, threaded-comments, translation-ready
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES — matches TaxBull app warm cream/gold theme
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg: #FAF8F4;
  --card: #FFFFFF;
  --card-alt: #F5F2EC;
  --border: #E8E2D8;
  --border-hover: #D4CCC0;
  --accent: #B8860B;
  --accent-dim: rgba(184,134,11,0.08);
  --accent-hover: #9A7209;
  --green: #16803C;
  --red: #DC2626;
  --text: #1C1917;
  --text-dim: #57534E;
  --text-muted: #78716C;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  --max-width: 1120px;
  --content-width: 720px;
  --radius: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  line-height: 1.7; font-size: 16px;
}
::selection { background: rgba(184,134,11,0.15); color: var(--text); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════ */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo {
  font-size: 22px; font-weight: 800; color: var(--accent);
  letter-spacing: -0.02em; text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.site-logo:hover { color: var(--accent-hover); }
.site-logo .bull-icon {
  width: 32px; height: 32px; background: var(--accent);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.site-logo .bull-icon svg { width: 20px; height: 20px; }

/* Navigation */
.main-nav ul {
  list-style: none; display: flex; gap: 4px; align-items: center;
}
.main-nav a {
  padding: 8px 16px; border-radius: 8px; font-size: 13px;
  font-weight: 600; color: var(--text-dim); transition: all 0.2s;
}
.main-nav a:hover,
.main-nav .current-menu-item a {
  background: var(--accent-dim); color: var(--accent);
}
.cta-button {
  background: var(--accent) !important; color: #fff !important;
  padding: 8px 20px !important; border-radius: 8px !important;
  font-weight: 700 !important; font-size: 13px !important;
  box-shadow: 0 2px 8px rgba(184,134,11,0.2);
  transition: all 0.2s !important;
}
.cta-button:hover {
  background: var(--accent-hover) !important;
  box-shadow: 0 4px 16px rgba(184,134,11,0.3) !important;
  transform: translateY(-1px);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px; color: var(--text);
}
.menu-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text-dim); margin: 4px 0;
  border-radius: 1px; transition: all 0.2s;
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.site-content {
  max-width: var(--max-width); margin: 0 auto;
  padding: 40px 24px;
  display: grid; grid-template-columns: 1fr 320px; gap: 48px;
}
.site-content.full-width {
  grid-template-columns: 1fr; max-width: var(--content-width);
}

/* ═══════════════════════════════════════════════════════════════
   POSTS / ARTICLES
   ═══════════════════════════════════════════════════════════════ */
.post-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all 0.25s; margin-bottom: 24px;
}
.post-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}
.post-card-image {
  width: 100%; height: 220px; object-fit: cover;
  border-bottom: 1px solid var(--border);
}
.post-card-body { padding: 24px; }
.post-card-meta {
  display: flex; gap: 12px; align-items: center;
  font-size: 12px; color: var(--text-muted); margin-bottom: 10px;
}
.post-card-meta .category {
  background: var(--accent-dim); color: var(--accent);
  padding: 3px 10px; border-radius: 20px; font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
}
.post-card-title {
  font-size: 20px; font-weight: 800; line-height: 1.3;
  margin-bottom: 10px; letter-spacing: -0.02em;
}
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt {
  font-size: 14px; color: var(--text-dim);
  line-height: 1.7; margin-bottom: 16px;
}
.read-more {
  font-size: 13px; font-weight: 700; color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
}
.read-more::after { content: "→"; transition: transform 0.2s; }
.read-more:hover::after { transform: translateX(4px); }

/* Featured post (first/sticky) */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1.2fr 1fr;
  border: 2px solid var(--accent);
}
.post-card.featured .post-card-image {
  height: 100%; border-bottom: none; border-right: 1px solid var(--border);
}
.post-card.featured .post-card-title { font-size: 26px; }

/* ═══════════════════════════════════════════════════════════════
   SINGLE POST
   ═══════════════════════════════════════════════════════════════ */
.single-post-header {
  max-width: var(--content-width); margin: 0 auto;
  padding: 48px 24px 0; text-align: center;
}
.single-post-header .category {
  background: var(--accent-dim); color: var(--accent);
  padding: 5px 14px; border-radius: 20px; font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  display: inline-block; margin-bottom: 16px;
}
.single-post-header h1 {
  font-size: 36px; font-weight: 800; line-height: 1.2;
  letter-spacing: -0.03em; margin-bottom: 16px; color: var(--text);
}
.post-meta {
  font-size: 13px; color: var(--text-muted);
  display: flex; gap: 16px; justify-content: center;
  align-items: center; flex-wrap: wrap;
}
.post-meta .sep { color: var(--border); }

.single-post-content {
  max-width: var(--content-width); margin: 0 auto;
  padding: 40px 24px 64px;
}
.single-post-content h2 {
  font-size: 24px; font-weight: 800; margin: 40px 0 16px;
  letter-spacing: -0.02em; color: var(--text);
  padding-bottom: 8px; border-bottom: 2px solid var(--accent-dim);
}
.single-post-content h3 {
  font-size: 19px; font-weight: 700; margin: 32px 0 12px;
  color: var(--text);
}
.single-post-content p {
  margin-bottom: 20px; color: var(--text-dim);
  font-size: 16px; line-height: 1.8;
}
.single-post-content ul, .single-post-content ol {
  margin: 0 0 20px 24px; color: var(--text-dim);
}
.single-post-content li { margin-bottom: 8px; line-height: 1.7; }
.single-post-content blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-dim); padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0; font-style: italic; color: var(--text-dim);
}
.single-post-content code {
  background: var(--card-alt); color: var(--accent);
  padding: 2px 6px; border-radius: 4px; font-family: var(--mono);
  font-size: 14px;
}
.single-post-content pre {
  background: #1C1917; color: #FAF8F4; padding: 20px;
  border-radius: var(--radius); overflow-x: auto;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  margin: 24px 0; border: 1px solid var(--border);
}
.single-post-content pre code {
  background: none; color: inherit; padding: 0;
}
.single-post-content table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 14px;
}
.single-post-content th {
  text-align: left; padding: 12px 16px;
  background: var(--card-alt); color: var(--text);
  font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border);
}
.single-post-content td {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.single-post-content tr:hover td { background: var(--accent-dim); }

/* Info/warning boxes */
.info-box {
  background: rgba(37,99,235,0.06); border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius); padding: 20px; margin: 24px 0;
}
.info-box.warning {
  background: rgba(217,119,6,0.06); border-color: rgba(217,119,6,0.2);
}
.info-box.tip {
  background: var(--accent-dim); border-color: rgba(184,134,11,0.2);
}
.info-box-title {
  font-size: 13px; font-weight: 800; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Featured image on single */
.single-featured-image {
  max-width: 900px; margin: 24px auto; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.single-featured-image img { width: 100%; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */
.sidebar { position: sticky; top: 80px; align-self: start; }
.widget {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-bottom: 20px;
}
.widget-title {
  font-size: 12px; font-weight: 800; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-dim);
}
.widget ul { list-style: none; }
.widget li { margin-bottom: 8px; }
.widget li a {
  font-size: 14px; color: var(--text-dim); font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}
.widget li a:hover { color: var(--accent); padding-left: 4px; }
.widget li .count {
  font-size: 11px; color: var(--text-muted);
  background: var(--card-alt); padding: 2px 8px; border-radius: 10px;
}

/* CTA Widget */
.widget-cta {
  background: linear-gradient(135deg, var(--accent), #9A7209);
  border: none; color: #fff; text-align: center;
}
.widget-cta .widget-title { color: rgba(255,255,255,0.8); border-bottom-color: rgba(255,255,255,0.15); }
.widget-cta p { font-size: 14px; margin-bottom: 16px; opacity: 0.9; }
.widget-cta .cta-btn {
  display: inline-block; background: #fff; color: var(--accent);
  padding: 10px 24px; border-radius: 8px; font-weight: 800;
  font-size: 14px; transition: all 0.2s;
}
.widget-cta .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }

/* Search widget */
.search-form {
  display: flex; gap: 0;
}
.search-form input[type="search"] {
  flex: 1; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius); background: var(--bg);
  color: var(--text); font-family: var(--font); font-size: 14px;
  outline: none;
}
.search-form input[type="search"]:focus { border-color: var(--accent); }
.search-form button {
  padding: 10px 16px; background: var(--accent); color: #fff;
  border: none; border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; font-weight: 700; transition: background 0.2s;
}
.search-form button:hover { background: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  border-top: 1px solid var(--border); background: var(--card);
  margin-top: 64px;
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 48px 24px;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand .footer-logo {
  font-size: 20px; font-weight: 800; color: var(--accent);
  margin-bottom: 12px; letter-spacing: -0.02em;
}
.footer-brand p {
  font-size: 13px; color: var(--text-muted); line-height: 1.7;
}
.footer-col h4 {
  font-size: 11px; font-weight: 800; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 13px; color: var(--text-muted); }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  max-width: var(--max-width); margin: 0 auto;
  padding: 20px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 11px; color: var(--text-muted); }
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 40px;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  font-size: 14px; font-weight: 700; transition: all 0.2s;
  border: 1px solid var(--border); color: var(--text-dim);
}
.pagination a:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.pagination .current {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   COMMENTS
   ═══════════════════════════════════════════════════════════════ */
.comments-area { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--border); }
.comments-title { font-size: 20px; font-weight: 800; margin-bottom: 24px; }
.comment-list { list-style: none; }
.comment-body {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.comment-author { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 4px; }
.comment-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.comment-content p { font-size: 14px; color: var(--text-dim); }
.comment-reply-link {
  font-size: 12px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.comment-respond { margin-top: 32px; }
.comment-form textarea, .comment-form input[type="text"],
.comment-form input[type="email"], .comment-form input[type="url"] {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; margin-bottom: 12px;
}
.comment-form textarea:focus, .comment-form input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.comment-form .submit {
  background: var(--accent); color: #fff; border: none;
  padding: 12px 24px; border-radius: 8px; font-weight: 700;
  font-size: 14px; cursor: pointer; font-family: var(--font);
  transition: all 0.2s;
}
.comment-form .submit:hover { background: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   404 PAGE
   ═══════════════════════════════════════════════════════════════ */
.error-404 {
  text-align: center; padding: 80px 24px;
  max-width: var(--content-width); margin: 0 auto;
}
.error-404 h1 {
  font-size: 120px; font-weight: 900; color: var(--accent-dim);
  letter-spacing: -0.05em; line-height: 1;
}
.error-404 h2 { font-size: 28px; margin: 16px 0 12px; color: var(--text); }
.error-404 p { color: var(--text-muted); margin-bottom: 24px; }
.error-404 .btn-home {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 12px 28px; border-radius: 8px; font-weight: 700;
}
.error-404 .btn-home:hover { background: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════
   TAG CLOUD
   ═══════════════════════════════════════════════════════════════ */
.tagcloud a {
  display: inline-block; padding: 4px 12px; margin: 0 4px 6px 0;
  background: var(--card-alt); border: 1px solid var(--border);
  border-radius: 20px; font-size: 12px !important; color: var(--text-dim);
  font-weight: 600; transition: all 0.2s;
}
.tagcloud a:hover {
  background: var(--accent-dim); color: var(--accent); border-color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .site-content { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .post-card.featured { grid-template-columns: 1fr; }
  .post-card.featured .post-card-image { height: 220px; border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .header-inner { padding: 12px 16px; }
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--card); border-bottom: 1px solid var(--border); padding: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.08); }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; padding: 10px 16px; }
  .site-content { padding: 24px 16px; }
  .single-post-header h1 { font-size: 26px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.post-card { animation: fadeUp 0.5s cubic-bezier(0.22,1,0.36,1) forwards; }
.post-card:nth-child(2) { animation-delay: 0.08s; }
.post-card:nth-child(3) { animation-delay: 0.16s; }
.post-card:nth-child(4) { animation-delay: 0.24s; }

/* Print */
@media print {
  .site-header, .sidebar, .site-footer, .comments-area { display: none; }
  .site-content { grid-template-columns: 1fr; }
  body { background: #fff; color: #000; }
}
