/* Blog-specific CSS that mirrors the Tailwind/SPA design tokens */
/* This file is loaded by server-rendered blog pages to maintain visual consistency */
/* 
 * IMPORTANT: These tokens MUST match client/src/index.css :root values
 * If updating site colors in index.css, update these values to match:
 * - background: 188 32% 41% -> hsl(188, 32%, 41%)
 * - foreground: 0 0% 100% -> hsl(0, 0%, 100%)
 * - primary: 188 28% 35% -> hsl(188, 28%, 35%)
 * - card: 188 32% 45% -> hsl(188, 32%, 45%)
 * - border: 340 21% 35% -> hsl(340, 21%, 35%)
 * - muted: 180 4% 52% -> hsl(180, 4%, 52%)
 * - accent: 68 45% 50% -> hsl(68, 45%, 50%)
 * 
 * Additional hardcoded values used intentionally (match Navigation.tsx/Footer.tsx):
 * - #e5e5e5: Light gray text (logo-text, footer headings) matches text-gray-200
 * - #472f36: Mahogany/brown (logo-tagline) matches the site secondary color
 * - rgba(255,255,255,0.15): Semi-transparent white for tags
 * - hsl(188,28%,40%): Primary hover state (5% lighter)
 * - hsl(188,32%,48%): Card hover state (3% lighter)
 * - Georgia serif: Logo font family (matches Navigation.tsx)
 */

:root {
  --background: hsl(188, 32%, 41%);
  --foreground: hsl(0, 0%, 100%);
  --primary: hsl(188, 28%, 35%);
  --primary-foreground: hsl(0, 0%, 100%);
  --card: hsl(188, 32%, 45%);
  --card-foreground: hsl(0, 0%, 100%);
  --card-border: hsl(340, 21%, 30%);
  --muted: hsl(180, 4%, 52%);
  --muted-foreground: hsl(0, 0%, 90%);
  --border: hsl(340, 21%, 35%);
  --accent: hsl(68, 45%, 50%);
  --radius: 0.5rem;
  --elevate-1: rgba(255, 255, 255, 0.08);
  --elevate-2: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header - matches Navigation.tsx */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--background);
  border-bottom: 1px solid var(--border);
}

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

@media (min-width: 640px) {
  .header-inner { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
  .header-inner { padding: 0 2rem; }
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  font-family: Georgia, serif;
  color: #e5e5e5;
}

.logo-tagline {
  font-size: 0.75rem;
  font-weight: 500;
  font-family: Georgia, serif;
  font-style: italic;
  color: #472f36;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .header-nav { display: flex; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  min-height: 2.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  position: relative;
  transition: none;
}

.nav-link::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 999;
}

.nav-link:hover::after {
  background-color: var(--elevate-1);
}

.nav-link:active::after {
  background-color: var(--elevate-2);
}

.nav-link-dropdown {
  display: inline-flex;
  align-items: center;
}

.nav-chevron {
  margin-left: 0.25rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Mobile menu button */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.15s;
}

.mobile-menu-btn:hover {
  background: var(--elevate-1);
}

@media (min-width: 768px) {
  .mobile-menu-btn { display: none; }
}

.mobile-menu {
  display: none;
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.mobile-menu.open {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .mobile-menu { display: none !important; }
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--foreground);
  text-decoration: none;
  border-radius: var(--radius);
  transition: background-color 0.15s;
}

.mobile-nav-link:hover {
  background: var(--elevate-1);
}

/* Main content area */
.blog-main {
  flex: 1;
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

@media (min-width: 640px) {
  .blog-main { padding: 2rem 1.5rem; }
}

@media (min-width: 1024px) {
  .blog-main { padding: 2rem; }
}

/* Layout variants */
.blog-layout-single {
  max-width: 800px;
  margin: 0 auto;
}

.blog-layout-with-sidebar {
  display: flex;
  gap: 2rem;
}

/* Sidebar styles */
.blog-sidebar {
  display: none;
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .blog-sidebar { display: block; }
}

.sidebar-header {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--foreground);
  transition: background-color 0.15s;
}

.sidebar-item:hover {
  background: var(--elevate-1);
}

.sidebar-item.active {
  background: var(--card);
  border: 1px solid var(--card-border);
}

.sidebar-title {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-date {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* Mobile article selector */
.mobile-article-select {
  display: block;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

@media (min-width: 1024px) {
  .mobile-article-select { display: none; }
}

.mobile-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.mobile-select {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.mobile-select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Blog content wrapper */
.blog-content-wrapper {
  flex: 1;
  min-width: 0;
}

/* Blog post styles */
.blog-post-header {
  margin-bottom: 2rem;
}

.blog-post-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

@media (min-width: 640px) {
  .blog-post-title { font-size: 2.25rem; }
}

.blog-post-meta {
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

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

.blog-tag {
  background: rgba(255, 255, 255, 0.15);
  color: var(--foreground);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Article content styling */
.blog-content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--foreground);
}

.blog-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--foreground);
}

.blog-content p {
  margin-bottom: 1rem;
}

.blog-content ul, .blog-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.blog-content li {
  margin-bottom: 0.5rem;
}

.blog-content strong {
  font-weight: 600;
}

.blog-content a {
  color: var(--accent);
  text-decoration: underline;
}

.blog-content a:hover {
  opacity: 0.9;
}

/* CTA Section */
.blog-cta {
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 2rem;
  border-radius: var(--radius);
  margin-top: 3rem;
  text-align: center;
}

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

.blog-cta p {
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.blog-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s;
  position: relative;
}

.blog-cta-btn:hover {
  background: hsl(188, 28%, 40%);
}

/* Back link */
.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted-foreground);
  text-decoration: none;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.blog-back:hover {
  color: var(--foreground);
}

/* Blog list (index page) */
.blog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-list-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: background-color 0.15s;
}

.blog-list-item:hover {
  background: hsl(188, 32%, 48%);
}

.blog-list-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-list-item h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.blog-list-item p {
  color: var(--muted-foreground);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.blog-list-date {
  color: var(--muted-foreground);
  font-size: 0.85rem;
  opacity: 0.8;
}

.blog-empty {
  text-align: center;
  padding: 3rem;
  color: var(--muted-foreground);
}

.blog-404 {
  text-align: center;
  padding: 3rem;
}

.blog-404 h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Footer - matches Footer.tsx */
.site-footer {
  background: var(--primary);
  color: var(--primary-foreground);
  margin-top: auto;
}

.footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}

@media (min-width: 640px) {
  .footer-inner { padding: 3rem 1.5rem; }
}

@media (min-width: 1024px) {
  .footer-inner { padding: 3rem 2rem; }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #e5e5e5;
}

.footer-section p,
.footer-section a {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.footer-section a {
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer-tagline {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-business-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.footer-business-name {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.footer-business-emails {
  padding-top: 0.5rem;
}

.footer-business-emails a {
  text-decoration: underline;
}

.footer-business-reg {
  padding-top: 0.5rem;
  font-size: 0.75rem;
}

.footer-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.footer-disclaimers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-copyright {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
}

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}
