/*
Theme Name: ShoutDial Blog
Theme URI: https://www.shoutdial.com
Description: Clean, minimal blog theme matching the ShoutDial marketing site. Inter font, blue brand color, dark mode support.
Version: 1.0.0
Author: ShoutDial
Author URI: https://www.shoutdial.com
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shoutdial
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
*/

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

:root {
  --brand-500: #2563eb;
  --brand-600: #1d4ed8;
  --brand-700: #1e40af;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-400: #60a5fa;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --slate-950: #020617;
  --bg: #ffffff;
  --bg-alt: var(--slate-50);
  --text: var(--slate-900);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-400);
  --border: var(--slate-200);
  --link: var(--brand-500);
  --link-hover: var(--brand-700);
}

.dark {
  --bg: var(--slate-950);
  --bg-alt: #0d1117;
  --text: var(--slate-100);
  --text-secondary: var(--slate-400);
  --text-muted: var(--slate-500);
  --border: rgba(255,255,255,0.05);
  --link: var(--brand-400);
  --link-hover: #93bbfd;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

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

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

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.dark .site-header {
  background: rgba(2,6,23,0.8);
}

.site-header nav {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.logo .shout { color: var(--text); }
.logo .dial { color: var(--brand-500); }

.header-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: color 0.2s, background 0.2s;
}

.header-links a:hover {
  color: var(--text);
  background: var(--bg-alt);
}

.header-links .cta {
  background: var(--brand-600);
  color: #fff !important;
  padding: 0.5rem 1rem;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(37,99,235,0.2);
}

.header-links .cta:hover {
  background: var(--brand-700);
}

#theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

#theme-toggle:hover {
  background: var(--bg-alt);
}

.dark .sun-icon { display: none; }
.moon-icon { display: none; }
.dark .moon-icon { display: inline; }

/* ── Main Content ── */
.site-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}

/* ── Blog Index ── */
.blog-header {
  margin-bottom: 3rem;
}

.blog-header .label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-500);
  margin-bottom: 0.75rem;
}

.dark .blog-header .label { color: var(--brand-400); }

.blog-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.blog-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

.post-list { list-style: none; }

.post-list article {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list article:first-child { padding-top: 0; }

.post-list .post-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-list h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.post-list h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-list h2 a:hover { color: var(--brand-500); }
.dark .post-list h2 a:hover { color: var(--brand-400); }

.post-list .excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-500);
  margin-top: 0.75rem;
  transition: gap 0.2s;
}

.dark .read-more { color: var(--brand-400); }
.read-more:hover { gap: 0.5rem; }

/* ── Single Post ── */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brand-500);
  margin-bottom: 1.5rem;
}

.dark .post-header .back-link { color: var(--brand-400); }

.post-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.post-header .post-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Article Content ── */
.entry-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.entry-content p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 1.0625rem;
}

.entry-content ul, .entry-content ol {
  color: var(--text-secondary);
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

.entry-content li {
  margin-bottom: 0.4rem;
  font-size: 1.0625rem;
}

.entry-content strong {
  color: var(--text);
  font-weight: 600;
}

.entry-content a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content a:hover { color: var(--link-hover); }

.entry-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.entry-content blockquote {
  border-left: 3px solid var(--brand-500);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.dark .entry-content blockquote { border-left-color: var(--brand-400); }

/* ── CTA Box ── */
.post-cta {
  margin-top: 4rem;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
}

.dark .post-cta {
  background: rgba(37,99,235,0.1);
  border-color: rgba(37,99,235,0.2);
}

.post-cta h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.post-cta p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.post-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  background: var(--brand-600);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  box-shadow: 0 1px 3px rgba(37,99,235,0.2);
}

.post-cta .btn:hover { background: var(--brand-700); color: #fff; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2rem 1rem;
  margin-top: 3rem;
}

.site-footer .inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.site-footer a:hover { color: var(--text-secondary); }

.footer-links {
  display: flex;
  gap: 1.5rem;
}

/* ── Pagination ── */
.pagination {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.pagination a, .pagination span {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.pagination a {
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.pagination a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.pagination .current {
  background: var(--brand-500);
  color: #fff;
  border: 1px solid var(--brand-500);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .blog-header h1, .post-header h1 { font-size: 1.75rem; }
  .site-main { padding: 2rem 1rem; }
  .header-links .hide-mobile { display: none; }
}
