/* ========================================
   FaxGuide — Design System
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, .05), 0 2px 4px rgba(0, 0, 0, .03);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, .08);
  --max-w: 1120px;
  --header-h: 64px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s;
}

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

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

/* --- Header --- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
}

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

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: .9rem;
  transition: color .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: .3s;
}

/* --- Hero (Homepage) --- */
.hero {
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

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

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

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

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.article-card a {
  color: inherit;
}

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

.card-body {
  padding: 1.25rem;
}

.card-category {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 50px;
  margin-bottom: .5rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .5rem;
}

.card-excerpt {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: .75rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .75rem;
  color: var(--text-muted);
}

/* --- Article Page --- */
.article-hero {
  width: 100%;
  max-height: 830px;
  object-fit: cover;
  object-position: center;
  border-radius: 0 0 var(--radius) var(--radius);
  display: block;
  margin: 0 auto;
  max-width: var(--max-w);
}

.article-wrapper {
  max-width: 740px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  overflow-x: hidden;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}

.article-wrapper .breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-wrapper .breadcrumb a {
  color: var(--accent);
}

.article-wrapper h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin-bottom: .75rem;
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .825rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-wrapper h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.25rem 0 .75rem;
  letter-spacing: -.01em;
}

.article-wrapper h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 .5rem;
}

.article-wrapper p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  line-height: 1.8;
}

.article-wrapper ul,
.article-wrapper ol {
  margin: 0 0 1.25rem 1.25rem;
}

.article-wrapper li {
  margin-bottom: .4rem;
  line-height: 1.7;
}

.article-wrapper blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: #334155;
}

.article-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .9rem;
}

.article-wrapper th,
.article-wrapper td {
  padding: .75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article-wrapper th {
  background: #f1f5f9;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}

.article-wrapper strong {
  font-weight: 600;
}

.content-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.content-image-caption {
  text-align: center;
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: -.75rem;
  margin-bottom: 1.5rem;
}

/* Tip/Info box */
.tip-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #22c55e;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .9rem;
}

.tip-box strong {
  color: #15803d;
}

.warning-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .9rem;
}

/* Related articles */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-articles h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.related-card {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid var(--border);
  transition: border-color .2s;
}

.related-card:hover {
  border-color: var(--accent);
}

.related-card a {
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
}

/* --- Footer --- */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 3rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.footer-brand p {
  font-size: .875rem;
  line-height: 1.7;
  max-width: 320px;
}

.footer-brand .logo {
  color: #fff;
  margin-bottom: .75rem;
}

.footer-col h4 {
  color: #fff;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .75rem;
}

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

.footer-col li {
  margin-bottom: .4rem;
}

.footer-col a {
  color: #94a3b8;
  font-size: .85rem;
  transition: color .2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #1e293b;
  text-align: center;
  font-size: .8rem;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero {
    padding: 2.5rem 1rem 2rem;
  }

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

  .article-wrapper h1 {
    font-size: 1.5rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .card-image {
    height: 170px;
  }

  .article-wrapper table {
    font-size: .8rem;
    min-width: 500px;
  }

  .article-wrapper th,
  .article-wrapper td {
    padding: .5rem .6rem;
    white-space: nowrap;
  }
}