/* =============================================================================
   publishing.co.uk — Theme Stylesheet
   Brand: Navy #0f172a | Indigo #6366f1 | Rose #ec4899 | Emerald #10b981
   Font: Inter (Google Fonts)
   ============================================================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #0f172a;
  --indigo:  #6366f1;
  --rose:    #ec4899;
  --emerald: #10b981;
  --bg:      #f8fafc;
  --border:  #e2e8f0;
  --muted:   #64748b;
  --white:   #ffffff;
  --font:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-w:   1200px;
  --max-w-article: 780px;
  --radius:  8px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

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

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

a { color: var(--indigo); text-decoration: none; transition: color .15s; }
a:hover { color: var(--rose); }

img { max-width: 100%; height: auto; display: block; }

/* --- Typography --- */
h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.3; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.35rem; font-weight: 600; line-height: 1.4; margin: 2rem 0 .75rem; }
h4 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
p  { margin-bottom: 1.25rem; }

blockquote {
  border-left: 4px solid var(--indigo);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(99,102,241,.04);
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: #f1f5f9;
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .9em;
}

pre {
  background: var(--navy);
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}
pre code { background: none; padding: 0; color: inherit; }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
th, td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; background: #f1f5f9; font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }

ul, ol { margin: 0 0 1.25rem 1.5rem; }
li { margin-bottom: .35rem; }

/* --- Layout --- */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: var(--max-w-article); margin: 0 auto; padding: 0 1.5rem; }

/* --- Header / Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.site-logo {
  font-size: 1.25rem; font-weight: 700; color: var(--navy);
  text-decoration: none;
}
.site-logo .domain { color: var(--indigo); }

.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav a {
  font-size: .9rem; font-weight: 500; color: var(--muted);
  transition: color .15s;
}
.site-nav a:hover, .site-nav a.active { color: var(--navy); }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600; font-size: .9rem;
  transition: all .15s;
  cursor: pointer; border: none;
  text-decoration: none;
}
.btn--primary { background: var(--indigo); color: var(--white); }
.btn--primary:hover { background: #4f46e5; color: var(--white); }
.site-nav a.btn--primary { color: var(--white); white-space: nowrap; text-decoration: none; }
.site-nav a.btn--primary:hover { color: var(--white); }
.site-nav a.btn--rose { color: var(--white); }
.site-nav a.btn--rose:hover { color: var(--white); }
.btn--rose { background: var(--rose); color: var(--white); }
.btn--rose:hover { background: #db2777; color: var(--white); }
.btn--outline { background: transparent; border: 2px solid var(--indigo); color: var(--indigo); }
.btn--outline:hover { background: var(--indigo); color: var(--white); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle svg { width: 24px; height: 24px; stroke: var(--navy); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; flex-direction: column; gap: 1rem;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--white); padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .site-nav.open { display: flex; }
  .site-nav .btn { width: 100%; justify-content: center; }
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  padding: 4rem 0 2rem;
}
.section-header h1 { font-size: 2.75rem; }
.section-header p {
  font-size: 1.15rem; color: var(--muted);
  max-width: 600px; margin: .5rem auto 0;
}

/* --- Blog List --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
  padding: 2rem 0 4rem;
  margin: 0 auto;
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.post-card__image {
  width: 100%; height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--navy), var(--indigo));
}
.post-card__body { padding: 1.5rem; }
.post-card__meta {
  display: flex; align-items: center; gap: .75rem;
  font-size: .8rem; color: var(--muted);
  margin-bottom: .5rem;
}
.post-card__category {
  background: rgba(99,102,241,.1);
  color: var(--indigo);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-weight: 600; font-size: .75rem;
  text-transform: uppercase;
}
.post-card__title {
  font-size: 1.15rem; font-weight: 600;
  line-height: 1.4; margin-bottom: .5rem;
}
.post-card__title a { color: var(--navy); }
.post-card__title a:hover { color: var(--indigo); }
.post-card__excerpt {
  font-size: .9rem; color: var(--muted);
  line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- Article Single --- */
.article-header {
  padding: 3rem 0 2rem;
  text-align: center;
}
.article-header h1 {
  font-size: 2.25rem;
  max-width: 800px;
  margin: 0 auto 1rem;
}
.article-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; flex-wrap: wrap;
  font-size: .9rem; color: var(--muted);
}
.article-meta__item { display: flex; align-items: center; gap: .35rem; }

.article-content {
  max-width: var(--max-w-article);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.article-content h2 { color: var(--navy); border-bottom: 2px solid var(--border); padding-bottom: .5rem; }
.article-content a { text-decoration: underline; text-underline-offset: 2px; }

.article-featured-image {
  max-width: 900px; margin: 0 auto 2rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.article-featured-image img { width: 100%; }

/* --- Table of Contents (sidebar) --- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.article-layout__main { min-width: 0; }
.article-layout__sidebar {
  position: sticky; top: 80px; align-self: start;
}

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-card h4 {
  font-size: .85rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
  margin-bottom: .75rem;
}
.sidebar-card ul { list-style: none; margin: 0; padding: 0; }
.sidebar-card li { margin-bottom: .5rem; }
.sidebar-card li a {
  font-size: .85rem; color: var(--muted);
  transition: color .15s;
}
.sidebar-card li a:hover { color: var(--indigo); }

@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-layout__sidebar { display: none; }
}

/* --- Tags & Categories --- */
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.tag {
  display: inline-block;
  padding: .25rem .65rem;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: .8rem; font-weight: 500;
  color: var(--muted);
  transition: all .15s;
}
.tag:hover { background: var(--indigo); color: var(--white); }

/* --- Newsletter CTA --- */
.newsletter-cta {
  background: linear-gradient(135deg, var(--navy), #1e293b);
  color: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  margin: 3rem 0;
}
.newsletter-cta h3 { color: var(--white); font-size: 1.5rem; margin-bottom: .5rem; }
.newsletter-cta p { color: #94a3b8; margin-bottom: 1.25rem; }
.newsletter-cta form {
  display: flex; gap: .5rem;
  max-width: 480px; margin: 0 auto;
}
.newsletter-cta input[type="email"] {
  flex: 1; padding: .7rem 1rem;
  border: 1px solid #334155; border-radius: 9999px;
  background: #1e293b; color: var(--white);
  font-size: .9rem; font-family: var(--font);
}
.newsletter-cta input[type="email"]::placeholder { color: #64748b; }
.newsletter-cta input[type="email"]:focus { outline: none; border-color: var(--indigo); }

@media (max-width: 540px) {
  .newsletter-cta form { flex-direction: column; }
}

/* --- Related Posts --- */
.related-posts { padding: 2rem 0 3rem; }
.related-posts h3 { text-align: center; margin-bottom: 1.5rem; }
.related-posts .blog-grid { padding-top: 0; }

/* --- Tools / Resources Grid --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0 4rem;
  margin: 0 auto;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: box-shadow .2s, transform .2s;
}
.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.tool-card__icon {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  background: rgba(99,102,241,.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.tool-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.tool-card p { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }

/* --- SEO Programmatic Pages --- */
.seo-page { padding: 3rem 0; }
.seo-page .container--narrow { max-width: 800px; }
.seo-comparison-table { margin: 2rem 0; }
.seo-cta-box {
  background: linear-gradient(135deg, var(--indigo), #4f46e5);
  color: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 2.5rem 0;
}
.seo-cta-box h3 { color: var(--white); margin-bottom: .5rem; }
.seo-cta-box p { color: rgba(255,255,255,.85); margin-bottom: 1rem; }

/* --- Pagination --- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; padding: 2rem 0 4rem;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius);
  font-size: .9rem; font-weight: 500;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all .15s;
}
.pagination a:hover { background: var(--indigo); color: var(--white); border-color: var(--indigo); }
.pagination .active { background: var(--indigo); color: var(--white); border-color: var(--indigo); }

/* --- Footer --- */
.site-footer {
  background: var(--navy);
  color: #94a3b8;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}
.footer-brand .site-logo { font-size: 1.15rem; }
.footer-brand p { font-size: .9rem; margin-top: .5rem; line-height: 1.6; }
.footer-col h4 {
  color: var(--white); font-size: .85rem;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: #94a3b8; font-size: .9rem; }
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 1.5rem;
  font-size: .8rem;
  text-align: center;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  padding: 1rem 0;
  font-size: .85rem;
  color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--indigo); }
.breadcrumbs span { margin: 0 .35rem; }

/* --- Utility --- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
