/* ========================================
   KwikInvoice Website Styles
   Based on Fiona's Wireframe Design
   ======================================== */

/* CSS Variables */
:root {
  --primary-blue: #2563EB;
  --success-green: #10B981;
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --background: #FFFFFF;
  --border-color: #E5E7EB;
  --hover-blue: #1D4ED8;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 1200px;
  --border-radius: 8px;
  --transition: all 0.2s ease;
}

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

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

body {
  font-family: var(--font-family);
  color: var(--text-dark);
  background-color: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
}

p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

a {
  color: var(--primary-blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--hover-blue);
}

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

@media (min-width: 768px) {
  .container {
    padding: 0 3rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 4rem;
  }
}

/* Header */
.site-header {
  background-color: var(--background);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

.logo:hover {
  color: var(--primary-blue);
}

.logo-image {
  width: 32px;
  height: 32px;
}

/* Navigation */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.5rem 0;
}

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

@media (max-width: 640px) {
  .main-nav ul {
    gap: 1rem;
    font-size: 0.875rem;
  }
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  text-align: center;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .hero {
    padding: 6rem 0;
  }
  
  .hero h1 {
    font-size: 3rem;
  }
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

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

.btn-primary:hover {
  background-color: var(--hover-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background-color: white;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

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

/* Sections */
section {
  padding: 3rem 0;
}

@media (min-width: 768px) {
  section {
    padding: 4rem 0;
  }
}

section h2 {
  text-align: center;
  margin-bottom: 3rem;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

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

/* Cards */
.card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.card-link {
  color: var(--primary-blue);
  font-weight: 600;
}

.card-link:hover {
  text-decoration: underline;
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.post-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.post-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-card time {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-category {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
}

.category-updates {
  background-color: #DBEAFE;
  color: var(--primary-blue);
}

.category-legal {
  background-color: #F3F4F6;
  color: var(--text-muted);
}

.category-tips {
  background-color: #FEF3C7;
  color: #D97706;
}

.category-features {
  background-color: #D1FAE5;
  color: var(--success-green);
}

.post-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.post-card h3 a {
  color: var(--text-dark);
}

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

.post-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.read-more {
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 0.9375rem;
}

.read-more:hover {
  text-decoration: underline;
}

/* Page Content */
.page-content {
  padding: 3rem 0;
}

.page-content h1 {
  margin-bottom: 2rem;
}

.content {
  max-width: 75ch;
  line-height: 1.8;
}

.content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  text-align: left;
}

.content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

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

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

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

.content code {
  background-color: #F3F4F6;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
}

/* Blog Post */
.blog-post {
  padding: 3rem 0;
}

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

.back-link {
  display: inline-block;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.back-link:hover {
  color: var(--primary-blue);
}

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

.post-content {
  max-width: 75ch;
  line-height: 1.8;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

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

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

/* Blog List */
.blog-list {
  max-width: 800px;
  margin: 0 auto;
}

.blog-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
}

.blog-item:last-child {
  border-bottom: none;
}

.blog-item-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.blog-item time {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.blog-item h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.blog-item h2 a {
  color: var(--text-dark);
}

.blog-item h2 a:hover {
  color: var(--primary-blue);
}

.excerpt {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Contact Section */
.contact {
  background-color: #F9FAFB;
  text-align: center;
}

.contact a {
  font-weight: 600;
}

/* Footer */
.site-footer {
  background-color: var(--text-dark);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

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

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

.footer-section h3,
.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: #D1D5DB;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 1.5rem;
  text-align: center;
  color: #9CA3AF;
  font-size: 0.875rem;
}

.footer-bottom p {
  margin-bottom: 0.25rem;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .hero-cta,
  .back-link {
    display: none;
  }
  
  body {
    color: black;
  }
  
  a {
    color: black;
    text-decoration: underline;
  }
  
  .container {
    max-width: 100%;
    padding: 0;
  }
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Loading State */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
