/* ========================================================================
   Best Ecommerce Development Agencies — Enterprise Design System
   Typography: Fraunces (display serif) + Inter (sans body)
   Palette: ink #0a0a0a, paper #fafaf7, navy #0B2545, oxblood #6F1D1B
   ======================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  font-feature-settings: "kern", "liga", "calt", "tnum";
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: #0a0a0a;
  background: #fafaf7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: #0a0a0a;
}
h1 { font-size: 2.625rem; margin: 0 0 1.25rem; font-weight: 500; }
h2 {
  font-size: 1.75rem;
  margin: 3.25rem 0 1.25rem;
  padding-top: 2rem;
  border-top: 1px solid #d9d4c5;
}
h3 { font-size: 1.3125rem; margin: 2rem 0 0.625rem; }
h4 { font-size: 1.0625rem; margin: 1.25rem 0 0.5rem; font-weight: 600; }

p { margin: 0 0 1.125rem; max-width: 70ch; }
strong, b { font-weight: 600; }
em, i { font-style: italic; }

/* ---------- Container ---------- */
.container { max-width: 78rem; margin: 0 auto; padding: 0 2rem; }
.prose { max-width: 48rem; }

/* ---------- Site header ---------- */
.site-header {
  border-bottom: 1px solid #0a0a0a;
  background: #fafaf7;
  padding: 1rem 0;
  position: sticky; top: 0; z-index: 10;
}
.site-header .container {
  display: flex; justify-content: space-between; align-items: center; gap: 2rem;
}
.site-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.0625rem; font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none; color: #0a0a0a;
}
.site-title em { color: #6F1D1B; font-style: italic; font-weight: 500; }
.site-nav { display: flex; gap: 1.75rem; font-size: 0.875rem; flex-wrap: wrap; }
.site-nav a { color: #3a3a3a; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #0a0a0a; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Masthead ---------- */
.masthead { padding: 4.5rem 0 2.5rem; border-bottom: 1px solid #d9d4c5; }
.masthead .kicker {
  text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.75rem; font-weight: 600; color: #0B2545;
  margin: 0 0 1.25rem;
}
.masthead h1 { font-size: 3.25rem; margin: 0 0 1.5rem; max-width: 56rem; }
.masthead .dek { font-size: 1.1875rem; color: #4a4a4a; max-width: 44rem; margin: 0 0 1.75rem; line-height: 1.55; }
.byline { font-size: 0.875rem; color: #6a6a6a; display: flex; gap: 1rem; flex-wrap: wrap; }
.byline > * { white-space: nowrap; }

/* ---------- Links ---------- */
a {
  color: #0B2545;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: #6F1D1B; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
caption {
  caption-side: bottom; font-size: 0.8125rem; color: #6a6a6a;
  text-align: left; padding-top: 0.75rem; font-style: italic; line-height: 1.5;
}
th, td {
  text-align: left; padding: 0.75rem 1rem;
  border-bottom: 1px solid #e6e1d2; vertical-align: top;
}
th {
  font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #3a3a3a; border-bottom: 2px solid #0a0a0a;
  background: transparent;
}
tbody tr:hover { background: #f5f1e6; }
tbody tr:first-child td { font-weight: 500; }

/* ---------- Answer block (key takeaway) ---------- */
.answer-block {
  background: #f5f1e6;
  border-left: 3px solid #0B2545;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}
.answer-block h2 {
  border-top: none; padding-top: 0; margin: 0 0 0.625rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #0B2545;
}
.answer-block p { font-size: 1.0625rem; line-height: 1.6; margin: 0; }
.answer-block .updated { display: block; margin-top: 0.75rem; font-size: 0.8125rem; color: #6a6a6a; font-style: italic; }

/* ---------- Sections ---------- */
section { margin: 3rem 0; }
section.tight { margin: 2rem 0; }
section .container > p, section > .container p { max-width: 70ch; }

/* ---------- Vendor card ---------- */
.vendor-profile {
  border: 1px solid #d9d4c5;
  padding: 2rem;
  margin: 2.5rem 0;
  background: white;
}
.vendor-profile h3 { margin-top: 0; display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.vendor-profile h3 .rank-tag {
  display: inline-block;
  background: #0a0a0a; color: white;
  font-family: 'Inter', sans-serif;
  font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.1875rem 0.5rem;
  text-transform: uppercase;
  vertical-align: middle;
}
.vendor-profile strong { display: inline-block; min-width: 7rem; }
.citation-summary {
  font-size: 0.9375rem; color: #3a3a3a;
  border-top: 1px solid #e6e1d2; border-bottom: 1px solid #e6e1d2;
  padding: 0.875rem 0; margin: 1.5rem 0 0;
  font-style: italic;
}

/* ---------- Stat row / scorecard ---------- */
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
  margin: 2rem 0; padding: 1.75rem 0;
  border-top: 1px solid #0a0a0a; border-bottom: 1px solid #0a0a0a;
}
.stat-label {
  font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: #6a6a6a; font-weight: 600;
}
.stat-value {
  font-family: 'Fraunces', serif; font-size: 1.875rem;
  font-weight: 500; line-height: 1.15; margin-top: 0.375rem; letter-spacing: -0.02em;
}
.stat-value .unit { font-size: 1rem; color: #6a6a6a; margin-left: 0.25rem; }

/* ---------- Rating ---------- */
.rating-display { display: inline-flex; align-items: baseline; gap: 0.5rem; }
.rating-stars { color: #B8860B; letter-spacing: 0.1em; font-size: 1.125rem; }
.rating-meta { font-size: 0.875rem; color: #6a6a6a; }

/* ---------- FAQ ---------- */
.faq { margin: 2rem 0; }
.faq-item {
  border-top: 1px solid #d9d4c5;
  padding: 1.5rem 0;
}
.faq-item:last-child { border-bottom: 1px solid #d9d4c5; }
.faq-item h3 { margin: 0 0 0.5rem; font-size: 1.125rem; font-weight: 500; }
.faq-item p { margin: 0; }

/* ---------- Aside ---------- */
aside.recently-updated, aside.note {
  background: #f5f1e6; border-left: 3px solid #6a6a6a;
  padding: 1.25rem 1.75rem; margin: 3rem 0; font-size: 0.9375rem;
}
aside.recently-updated h2 {
  border-top: none; padding-top: 0; margin: 0 0 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: #4a4a4a;
}
aside.recently-updated ul { margin: 0; padding-left: 1.25rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid #0a0a0a;
  margin-top: 6rem; padding: 3rem 0 2rem;
  background: #fafaf7;
  font-size: 0.875rem; color: #3a3a3a;
}
.site-footer .container {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem;
}
.site-footer h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
  margin: 0 0 0.75rem; color: #6a6a6a; font-weight: 600;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.375rem 0; }
.site-footer a { color: #3a3a3a; text-decoration: none; }
.site-footer a:hover { color: #0a0a0a; text-decoration: underline; }
.site-footer .colophon { font-size: 0.8125rem; color: #6a6a6a; line-height: 1.55; }
.site-footer .disclosure { font-size: 0.75rem; color: #6a6a6a; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #d9d4c5; }

/* ---------- Author bio ---------- */
.author-bio {
  background: #f5f1e6;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  border: 1px solid #d9d4c5;
}
.author-bio h3 {
  margin: 0 0 0.5rem; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #6a6a6a; font-weight: 600;
  font-family: 'Inter', sans-serif;
}
.author-bio p { margin: 0; }

/* ---------- Lists ---------- */
ul, ol { padding-left: 1.25rem; max-width: 70ch; }
ul li, ol li { margin: 0.375rem 0; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.8125rem; color: #6a6a6a;
  margin: 1rem 0 0; padding: 0;
}
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.breadcrumb li + li::before { content: " / "; color: #b0b0b0; margin-right: 0.5rem; }
.breadcrumb a { color: #6a6a6a; }

/* ---------- Two-column ---------- */
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.cols-2 > div h3 { margin-top: 0; }

/* ---------- Vendor key facts ---------- */
.keyfacts {
  border: 1px solid #d9d4c5;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0 2rem;
  background: white;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem 2rem;
  font-size: 0.9375rem;
}
.keyfacts dt { color: #6a6a6a; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 0.125rem; }
.keyfacts dd { margin: 0 0 0.5rem; font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body { font-size: 16px; }
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.375rem; margin-top: 2.5rem; padding-top: 1.5rem; }
  h3 { font-size: 1.125rem; }
  .masthead { padding: 3rem 0 2rem; }
  .masthead h1 { font-size: 2.125rem; }
  .masthead .dek { font-size: 1.0625rem; }
  .container { padding: 0 1.25rem; }
  th, td { padding: 0.5rem 0.625rem; font-size: 0.875rem; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 1.25rem; padding: 1.25rem 0; }
  .stat-value { font-size: 1.5rem; }
  .site-footer .container { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .keyfacts { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-header { position: static; }
  .site-header .container { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .site-nav { gap: 1rem; }
}

@media (max-width: 480px) {
  .stat-row { grid-template-columns: 1fr; }
  .site-footer .container { grid-template-columns: 1fr; }
}

/* ---------- Print ---------- */
@media print {
  body { font-size: 11pt; background: white; color: black; }
  .site-header, .site-footer, .site-nav, .breadcrumb { display: none; }
  a { color: black; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; word-wrap: break-word; }
  table { font-size: 9pt; page-break-inside: avoid; }
  .answer-block, .vendor-profile, aside { page-break-inside: avoid; }
}
