/* PhonoLogic Blog — core styles */
/* Matches the PhonoLogic design system: warm orange/navy palette, clean typography */

:root {
  /* Brand palette — matches phonologic.ca design system */
  --color-primary: #ff8a3d;
  --color-primary-hover: #e67a35;
  --color-primary-light: #fff7f2;
  --color-brand: #dc9435;
  --color-brand-hover: #c4842f;
  --color-text: #1f2937;
  --color-text-secondary: #374151;
  --color-text-muted: #374151;
  --color-bg: #faf8f6;
  --color-bg-card: #ffffff;
  --color-bg-secondary: #f3f4f6;
  --color-border: #e5e7eb;
  --color-link: #354B5E;
  --color-link-hover: #273845;
  --color-danger: #dc2626;
  --color-navy: #354B5E;
  --color-teal: #5B8F8A;
  --color-sand: #F0E6D8;
  --color-gold-pale: #FDF5E9;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1100px;
  --max-width-article: 720px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
}

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header — matches phonologic.ca global header */
.blog-header {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  box-sizing: border-box;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo img {
  height: 32px;
  width: auto;
}

.logo-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
  background: var(--color-gold-pale);
  padding: 2px 10px;
  border-radius: 9999px;
}

.header-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius);
  color: var(--color-navy);
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--color-gold-pale);
}

.nav-cta {
  background: var(--color-brand);
  color: #fff;
}

.nav-cta:hover {
  background: var(--color-brand-hover);
}

/* Hero */
.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Post Card */
.post-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
}

.post-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card-body {
  padding: 1.25rem;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-badge {
  font-size: 0.75rem;
  color: var(--color-primary);
  background: var(--color-bg-secondary);
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  text-decoration: none;
}

.tag-badge:hover {
  background: var(--color-primary);
  color: #fff;
}

.post-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-card-title a {
  color: var(--color-text);
  text-decoration: none;
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Single Post Article */
.post-article {
  max-width: var(--max-width-article);
  margin: 0 auto;
}

.post-header {
  margin-bottom: 2rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.post-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
}

.post-date {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  display: block;
}

.reading-time {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.featured-image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

/* Post Body — rendered HTML content */
.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-body h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.75rem;
}

.post-body h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.post-body p {
  margin-bottom: 1.25rem;
}

.post-body a {
  color: var(--color-link);
}

.post-body a:hover {
  color: var(--color-link-hover);
}

.post-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1rem 0;
}

.post-body blockquote {
  border-left: 4px solid var(--color-teal);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-gold-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-body pre {
  background: #1a1a2e;
  color: #e8e8e8;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.post-body code {
  background: var(--color-bg-secondary);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-body pre code {
  background: transparent;
  padding: 0;
}

.post-body ul, .post-body ol {
  margin: 0 0 1.25rem 1.5rem;
}

.post-body li {
  margin-bottom: 0.35rem;
}

/* Share Buttons */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.share-btn {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  background: var(--color-bg);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.share-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* Pagination */
.pagination {
  text-align: center;
  margin-top: 2rem;
}

.btn-load-more {
  padding: 0.75rem 2rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-load-more:hover {
  background: var(--color-primary-hover);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-text-secondary);
}

.btn-back {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
}

/* Tag Header */
.tag-header {
  margin-bottom: 2rem;
}

.tag-header h1 {
  font-size: 1.75rem;
}

#tag-name {
  color: var(--color-primary);
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: var(--color-bg-secondary);
}

.btn-danger {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-text {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

/* Footer */
.blog-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-card, #fff);
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.footer-nav {
  display: flex;
  gap: 1.25rem;
}

.footer-nav a {
  color: var(--color-text-secondary);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--color-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .blog-header { height: 52px; }
  .header-inner { height: 52px; padding: 10px 16px; }
  .logo img { height: 28px; }
  .logo-badge { display: none; }

  .hero h1 {
    font-size: 1.75rem;
  }

  .post-title {
    font-size: 1.75rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .blog-header { height: 48px; }
  .header-inner { height: 48px; padding: 10px 12px; }
  .logo img { height: 26px; }
  .header-nav { gap: 6px; }
  .nav-link { padding: 10px 14px; min-height: 44px; display: flex; align-items: center; font-size: 14px; }

  .container {
    padding: 1rem;
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
