/* 330 Hosting Blog Styles
   Professional, accessible, and SEO-optimized blog styling
   ========================================================= */

/* CSS Custom Properties */
:root {
  --color-primary: #f59e0b;
  --color-primary-dark: #d97706;
  --color-primary-light: #fbbf24;
  --color-accent: #fbbf24;
  --color-dark: #0f172a;
  --color-dark-secondary: #1e293b;
  --color-text: #1e293b;
  --color-text-secondary: #4b5563;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-tertiary: #f1f5f9;
  --color-success: #10b981;
  --color-error: #ef4444;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 800px;
  --max-width-wide: 1200px;
}

/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-dark);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* Header Navigation - Matches main site */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  background: linear-gradient(90deg, #0a0f1a 0%, #0f172a 50%, #0a0f1a 100%);
  transition: all 0.5s ease-out;
}

.site-header.scrolled {
  padding: 8px 0;
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Animated gradient border at top */
.header-gradient-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #fbbf24 20%, #f97316 50%, #fbbf24 80%, transparent 100%);
  opacity: 1;
  transition: all 0.5s ease-out;
}

.site-header.scrolled .header-gradient-border {
  height: 1px;
  opacity: 0.8;
}

/* Subtle glow effects */
.header-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 0% 50%, rgba(251, 191, 36, 0.1) 0%, transparent 50%),
              radial-gradient(ellipse at 100% 50%, rgba(251, 191, 36, 0.08) 0%, transparent 50%);
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.site-header.scrolled .header-glow {
  opacity: 0.3;
}

/* Bottom shadow gradient */
.header-bottom-shadow {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  opacity: 0.5;
  transition: opacity 0.5s ease-out;
}

.site-header.scrolled .header-bottom-shadow {
  opacity: 1;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
}

/* Logo */
.logo-wrapper {
  transition: all 0.5s ease-out;
  transform-origin: left center;
}

.site-header.scrolled .logo-wrapper {
  transform: scale(0.75);
}

.logo-link {
  display: block;
}

.logo-link:hover .header-logo {
  filter: brightness(1.1) drop-shadow(0 4px 20px rgba(251, 191, 36, 0.3));
}

.header-logo {
  height: auto;
  object-fit: contain;
  width: 280px;
  filter: drop-shadow(0 4px 20px rgba(251, 191, 36, 0.2));
  transition: all 0.5s ease-out;
}

.site-header.scrolled .header-logo {
  width: 200px;
}

@media (max-width: 1024px) {
  .header-logo {
    width: 240px;
  }
  .site-header.scrolled .header-logo {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .header-logo {
    width: 180px;
  }
  .site-header.scrolled .header-logo {
    width: 160px;
  }
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.5s ease-out;
}

.site-header.scrolled .nav-container {
  gap: 4px;
  padding: 8px 16px;
}

/* Nav Links */
.nav-link {
  position: relative;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.site-header.scrolled .nav-link {
  font-size: 0.75rem;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0) 0%, rgba(245, 158, 11, 0) 50%, rgba(249, 115, 22, 0) 100%);
  transition: all 0.3s ease;
}

.nav-link:hover::before,
.nav-link.active::before {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, rgba(249, 115, 22, 0.2) 50%, rgba(245, 158, 11, 0.2) 100%);
}

.nav-text {
  position: relative;
  z-index: 1;
  transition: color 0.3s ease;
}

.nav-link:hover .nav-text,
.nav-link.active .nav-text {
  color: #fff;
}

/* Nav Indicator - Underline for active, dot for hover */
.nav-indicator {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: #fbbf24;
  transition: all 0.3s ease;
}

.nav-link:hover .nav-indicator {
  transform: translateX(-50%) scale(1);
}

.nav-link.active .nav-indicator {
  width: 75%;
  height: 2px;
  transform: translateX(-50%) scale(1);
}

/* CTA Button */
.nav-cta {
  position: relative;
  overflow: hidden;
  margin-left: 8px;
  padding: 10px 20px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #f97316 0%, #f59e0b 50%, #fbbf24 100%);
  transition: all 0.3s ease;
}

.site-header.scrolled .nav-cta {
  padding: 8px 16px;
  font-size: 0.75rem;
}

.cta-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.7s ease;
}

.nav-cta:hover .cta-shine {
  transform: translateX(100%);
}

.cta-text {
  position: relative;
  z-index: 1;
}

/* Mobile Navigation */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-bar {
  display: block;
  width: 24px;
  height: 2px;
  border-radius: 9999px;
  background: #fbbf24;
  transition: all 0.3s ease;
}

.site-header.scrolled .menu-bar {
  width: 20px;
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 15, 26, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main-nav.open {
    display: block;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .nav-link {
    padding: 12px 16px;
    border-radius: 8px;
  }

  .nav-cta {
    margin-left: 0;
    margin-top: 8px;
    text-align: center;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

/* Add top padding to body to account for fixed header */
body {
  padding-top: 100px;
}

.site-header.scrolled ~ .breadcrumbs,
.site-header.scrolled ~ main {
  /* Content adjusts when header shrinks */
}

/* Breadcrumbs */
.breadcrumbs {
  background: var(--color-bg-secondary);
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.breadcrumbs-container {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 20px;
}

.breadcrumbs nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.breadcrumbs span[aria-current="page"] {
  color: var(--color-text);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--color-text-muted);
}

/* Main Content Container */
.blog-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* Article Header */
.article-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
}

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0 0 20px 0;
  letter-spacing: -0.02em;
}

/* Article Meta */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-meta-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  color: var(--color-text);
}

.author-title {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.meta-divider {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-muted);
}

/* Article Content */
.article-content {
  font-size: 1.0625rem;
  color: var(--color-text);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 48px 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-accent);
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 36px 0 16px 0;
}

.article-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 28px 0 12px 0;
}

.article-content p {
  margin: 0 0 20px 0;
}

/* Subsection labels - styled as bold inline headers without using strong tags */
.article-content .subsection-label {
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.article-content a {
  color: var(--color-primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.article-content a:hover {
  color: var(--color-primary);
}

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

.article-content ul,
.article-content ol {
  margin: 0 0 24px 0;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 10px;
}

.article-content li::marker {
  color: var(--color-primary);
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}

.article-content table thead {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.article-content table tbody {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.article-content table th,
.article-content table td {
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--color-border);
}

.article-content table th {
  background: var(--color-bg-secondary);
  font-weight: 600;
  color: var(--color-text);
}

.article-content table tr:nth-child(even) {
  background: var(--color-bg-secondary);
}

/* Blockquotes */
.article-content blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--color-bg-secondary);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Code */
.article-content code {
  background: var(--color-bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article-content pre {
  background: var(--color-dark);
  color: #e5e7eb;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
}

.article-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Call-to-Action Box */
.cta-box {
  background: linear-gradient(135deg, var(--color-dark), var(--color-dark-secondary));
  color: #fff;
  padding: 32px;
  border-radius: var(--radius-lg);
  margin: 40px 0;
  text-align: center;
}

.cta-box h3 {
  color: #fff;
  font-size: 1.5rem;
  margin: 0 0 12px 0;
}

.cta-box p {
  color: #d1d5db;
  margin: 0 0 24px 0;
}

.cta-box .cta-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
  transform: translateY(-2px);
}

.cta-btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: var(--color-dark);
}

.cta-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Info Box */
.info-box {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 24px 0;
}

.info-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.info-box.tip {
  border-left: 4px solid var(--color-success);
}

.info-box.warning {
  border-left: 4px solid var(--color-primary);
}

/* Related Posts Section */
.related-posts {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--color-border);
}

.related-posts h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 24px 0;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.related-post-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.related-post-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.related-post-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.related-post-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.related-post-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Author Box */
.author-box {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 48px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.author-box-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.author-box-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px 0;
}

.author-box-content .author-role {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.author-box-content p {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 600px) {
  .author-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* Site Footer */
.site-footer {
  background: var(--color-dark);
  color: #d1d5db;
  margin-top: 60px;
}

.footer-main {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 48px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.footer-brand {
  grid-column: span 1;
}

.footer-brand .site-logo {
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.9rem;
  color: #9ca3af;
  margin: 0 0 16px 0;
}

.footer-contact {
  font-size: 0.9rem;
}

.footer-contact a {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-nav h4 {
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px 0;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav li {
  margin-bottom: 10px;
}

.footer-nav a {
  color: #9ca3af;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

.footer-bottom a {
  color: #9ca3af;
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--color-accent);
}

/* Blog Index Page Styles */
.blog-index-header {
  text-align: center;
  padding: 48px 0 32px;
}

.blog-index-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--color-text);
  margin: 0 0 16px 0;
  border-bottom: none;
}

.blog-index-header p {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

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

.blog-item h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.blog-item h2 a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s;
}

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

.blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 12px;
}

.blog-description {
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.6;
}

.blog-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary-dark);
  text-decoration: none;
  font-weight: 500;
  margin-top: 12px;
  font-size: 0.9rem;
}

.blog-read-more:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Utility Classes */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .cta-box,
  .related-posts {
    display: none;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .blog-container {
    max-width: 100%;
    padding: 0;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000;
  }

  .article-content h2 {
    border-bottom-color: var(--color-text);
  }
}
