:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #d4af37;
  --accent-hover: #b5952f;
  --bg: #f8fafc;
  --text: #334155;
  --text-light: #64748b;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 0.5rem;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  line-height: 1.2;
  margin-top: 0;
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.75rem; }

p { margin-bottom: 1rem; }

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

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

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

.img-content {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-dark {
  background-color: var(--primary);
  color: var(--white);
}

.section-dark h2, .section-dark h3, .section-dark p {
  color: var(--white);
}

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

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

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

.brand a {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand span {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
}

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

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary);
}

/* Hero */
.hero {
  background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.75)), url('../img/hero-bg.webp');
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 8rem 0 6rem;
  text-align: center;
  position: relative;
}

.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.hero .lead {
  font-size: 1.25rem;
  color: #cbd5e1;
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

/* Components */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-outline {
  border: 2px solid var(--accent);
  color: var(--accent);
}

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

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.feature-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* Blog */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.post-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.post-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.post-excerpt {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  flex: 1;
}

.read-more {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Blog Post Typography */
.post-body h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.75rem;
  color: var(--primary);
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 0.5rem;
}

.post-body h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
  color: var(--primary-light);
}

.post-body ul, .post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

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

.post-body p {
  margin-bottom: 1.5rem;
  color: #334155;
}

/* Styled Blockquotes */
.post-body blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: #f8fafc;
  border-left: 5px solid var(--accent);
  font-style: italic;
  color: #475569;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Tables */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.post-body th, .post-body td {
  border: 1px solid var(--border);
  padding: 0.75rem;
  text-align: left;
}

.post-body th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: var(--primary);
}

.post-body tr:nth-child(even) {
  background-color: #f8fafc;
}

/* Table of Contents */
.toc-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.toc-title {
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--primary);
}

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

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.toc-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.breadcrumbs a {
  color: #cbd5e1;
  text-decoration: underline;
}

.breadcrumbs a:hover {
  color: var(--white);
}

/* Author Box */
.author-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding: 2rem;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
}

/* Responsive Images in Blog */
.post-body img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

/* FAQ Accordion */
details.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

details.faq-item[open] {
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

details.faq-item summary {
  padding: 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
  position: relative;
  padding-right: 3rem;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 300;
  transition: transform 0.3s;
}

details.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

details.faq-item .faq-content {
  padding: 0 1.25rem 1.25rem;
  color: var(--text);
  line-height: 1.6;
  border-top: 1px solid transparent;
}

details.faq-item[open] .faq-content {
  border-top-color: #f1f5f9;
  padding-top: 1rem;
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: #94a3b8;
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 1.25rem;
}

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

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

.footer-links a {
  color: #94a3b8;
}

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

.copyright {
  border-top: 1px solid #334155;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
}

/* Error Pages */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
}

/* Responsive */
@media (min-width: 769px) {
  .swap-desktop > :first-child { order: 2; }
  .swap-desktop > :last-child { order: 1; }
}

@media (max-width: 768px) {
  .mobile-menu-toggle { display: block; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid var(--border);
  }
  .nav-menu.active { display: flex; }
  .hero h1 { font-size: 2.25rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}