/* Shared layout for every page: loaded after each page's own styles, so these rules win.
   One content width (1200px) and one side gutter, used by nav, page content and footer alike.
   Bump the ?v= number in the <link> tags after editing: css files are cached for a year. */
:root { --page-w:1200px; --gutter:40px; }
@media (max-width:600px) { :root { --gutter:20px; } }

nav, footer {
  padding-left:max(var(--gutter), calc((100% - var(--page-w)) / 2));
  padding-right:max(var(--gutter), calc((100% - var(--page-w)) / 2));
}

/* Desktop nav: logo left, links centred, account right, whatever is in each part */
@media (min-width:701px) {
  nav { display:grid; grid-template-columns:1fr auto 1fr; }
  .nav-right { justify-self:end; }
}

/* Content blocks: same width and left edge on every page */
.hero, .stats-section, .categories, .page,
.page-header, .search-wrap, .filters, .compare-section, .categories-section {
  max-width:calc(var(--page-w) + 2 * var(--gutter));
  margin-left:auto; margin-right:auto;
  padding-left:var(--gutter); padding-right:var(--gutter);
}

/* Full-width section lines stop at the content edge */
body > .divider, .page-content > .divider {
  max-width:var(--page-w); width:auto; margin-left:max(var(--gutter), calc((100% - var(--page-w)) / 2)); margin-right:max(var(--gutter), calc((100% - var(--page-w)) / 2));
}

/* Page headers: same spacing and title size everywhere */
.page-header, .page { padding-top:64px; }
.page { padding-bottom:80px; }
.page-tag { margin-bottom:16px; }
.page-title { font-size:clamp(32px,5vw,52px); line-height:1.1; }

/* Text pages (about, privacy, terms): readable line length, aligned to the same left edge */
.page > * { max-width:720px; }

/* Category cards: 4 per row on desktop, like the homepage */
.cat-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
@media (max-width:1000px) { .cat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:560px) { .cat-grid { grid-template-columns:1fr; } }

.mobile-menu a { padding-left:var(--gutter); padding-right:var(--gutter); }
footer { margin-top:0; }
