/* Redesign 2026-11 (preview). Loaded after main.css only when swg_redesign() is on.
   Same palette and typefaces; drops the template tells: caps labels, pill badges, coloured card borders,
   arrows on links, fake window chrome and fake stats. Articles are listed as rows with their photo. */

:root {
  --ink:        #121417;
  --paper:      #F3F4F2;
  --rule:       #DFE2DE;
  --measure:    68ch;
  --tone-green: #0C6848;
  --tone-blue:  #1C3D72;
  --tone-amber: #9A5F0C;
  --tone-dark:  #121417;
}

body { background: var(--paper); font-weight: 400; }
:focus-visible { outline: 2px solid var(--accent-mid); outline-offset: 2px; border-radius: 3px; }
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; z-index: 200;
  width: auto; height: auto; clip: auto; padding: .6rem 1rem;
  background: #fff; color: var(--ink); border-radius: 6px;
}

/* ── Nav ── */
.site-nav { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 100; }
.admin-bar .site-nav { top: 32px; }
.site-nav .nav-inner { height: 64px; gap: 2rem; }
.site-nav .logo-text { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; }
.site-nav .nav-links { gap: 0.25rem; align-items: center; justify-content: flex-end; }
.site-nav .nav-links a {
  font-size: 14px; color: var(--ink-muted); padding: 21px 10px 19px; border-radius: 0;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.site-nav .nav-links a:hover { background: none; color: var(--ink); }
.site-nav .nav-links a.active { background: none; color: var(--ink); font-weight: 500; border-bottom-color: var(--accent); }
.site-nav .nav-links a.nav-contact {
  margin-left: .75rem; padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--ink);
}
.site-nav .nav-links a.nav-contact:hover { border-color: var(--ink); }

/* ── Home hero (dark gradient kept) ── */
.home-hero { background: linear-gradient(160deg, #0d1117 0%, #131e2b 100%); color: #fff; }
.home-hero-inner {
  max-width: 1160px; margin: 0 auto; padding: 4.5rem 2rem 4rem;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 4.5rem; align-items: end;
}
.home-hero h1 {
  font-family: var(--font-display); font-optical-sizing: auto;
  font-size: clamp(38px, 5.4vw, 64px); font-weight: 400; line-height: 1.04; letter-spacing: -0.03em;
  max-width: 13ch; margin-bottom: 1.5rem;
}
.home-hero-sub { font-size: 16px; line-height: 1.7; color: rgba(255,255,255,.66); max-width: 46ch; margin-bottom: 2rem; font-weight: 300; }
.home-hero .hero-search { max-width: 460px; }

.home-questions h2 { font-family: var(--font-body); font-size: 14px; font-weight: 500; color: rgba(255,255,255,.55); margin-bottom: .5rem; }
.home-questions ul { list-style: none; border-top: 1px solid rgba(255,255,255,.14); }
.home-questions li { border-bottom: 1px solid rgba(255,255,255,.14); }
.home-questions a {
  display: block; padding: .85rem 0; font-family: var(--font-display); font-optical-sizing: auto;
  font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; color: rgba(255,255,255,.92);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 5px; text-decoration-thickness: 1px;
  transition: text-decoration-color .15s, color .15s;
}
.home-questions a:hover { color: #fff; text-decoration-color: var(--accent-mid); }

/* ── Layout ── */
.layout {
  max-width: 1160px; margin: 0 auto; padding: 3rem 2rem 4rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start;
}
.list-heading { font-family: var(--font-display); font-size: 28px; font-weight: 400; letter-spacing: -0.02em; margin-bottom: 1rem; }

/* ── Article rows ── */
.rows { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 1.5rem; padding: 1.5rem; border-top: 1px solid var(--rule); }
.row:first-child { border-top: none; }
.row:not(:has(.row-thumb)) { grid-template-columns: minmax(0, 1fr); }
.row-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--surface-3); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-cat { display: inline-block; font-size: 13px; font-weight: 600; margin-bottom: .35rem; }
.row-cat:hover { text-decoration: underline; text-underline-offset: 3px; }
.tone-green { color: var(--tone-green); }
.tone-blue  { color: var(--tone-blue); }
.tone-amber { color: var(--tone-amber); }
.tone-dark  { color: var(--tone-dark); }
.row-title {
  font-family: var(--font-display); font-optical-sizing: auto; font-size: 22px; font-weight: 450;
  line-height: 1.22; letter-spacing: -0.015em; margin-bottom: .5rem;
}
.row-title a { color: var(--ink); }
.row-title a:hover { color: var(--accent); }
.row-excerpt {
  font-size: 14.5px; line-height: 1.6; color: var(--ink-muted); max-width: var(--measure);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.row-meta { margin-top: .75rem; font-size: 13px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.row-meta span { margin-left: 1.25rem; }

.row--large { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 1.5rem 1.5rem 1.75rem; }
.row--large .row-thumb { aspect-ratio: 2 / 1; border-radius: 10px; }
.row--large .row-title { font-size: clamp(26px, 3vw, 34px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 400; }
.row--large .row-excerpt { font-size: 16px; -webkit-line-clamp: 4; }

/* ── Pillar strip ── */
.pillar {
  margin-top: 2rem; background: var(--ink); color: #fff; border-radius: 14px; padding: 2rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center;
}
.pillar h2 { font-family: var(--font-display); font-size: 26px; font-weight: 400; letter-spacing: -0.02em; margin-bottom: .4rem; }
.pillar p { color: rgba(255,255,255,.62); font-size: 14.5px; line-height: 1.6; max-width: 52ch; font-weight: 300; }
.pillar-link {
  background: var(--accent-mid); color: #fff; padding: 11px 20px; border-radius: 7px; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.pillar-link:hover { background: var(--accent); }

/* ── Page and archive heads ── */
.page-head, .post-head { background: var(--surface); border-bottom: 1px solid var(--rule); }
.page-head-inner, .post-head-inner { max-width: 1160px; margin: 0 auto; padding: 3.25rem 2rem 2.75rem; }
.page-head h1 {
  font-family: var(--font-display); font-optical-sizing: auto; font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 400; letter-spacing: -0.03em; line-height: 1.05; margin-bottom: .75rem;
}
.page-head-desc, .page-head-desc p { font-size: 17px; line-height: 1.6; color: var(--ink-muted); max-width: 56ch; font-weight: 300; }
.page-head-count { margin-top: .75rem; font-size: 13.5px; color: var(--ink-faint); }
.page-head-search { margin-top: 1.25rem; max-width: 460px; background: var(--paper); border-color: var(--rule); }
.page-head-search .search-field { color: var(--ink); }
.page-head-search .search-field::placeholder { color: var(--ink-faint); }

/* ── Single post ── */
.post-head .row-cat { margin-bottom: .75rem; font-size: 14px; }
.post-head .post-title { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.08; letter-spacing: -0.03em; max-width: 22ch; margin-bottom: 1rem; }
.post-head .post-meta { font-size: 13.5px; color: var(--ink-faint); display: block; }
.post-head .post-meta span { margin-left: 1.25rem; }
.swg-redesign .post-content { border-color: var(--rule); border-radius: 14px; padding: 2.75rem 3rem; }
.swg-redesign .post-content > p,
.swg-redesign .post-content > ul,
.swg-redesign .post-content > ol,
.swg-redesign .post-content > h2,
.swg-redesign .post-content > h3 { max-width: var(--measure); }
.swg-redesign .post-content p, .swg-redesign .post-content li { font-size: 16.5px; line-height: 1.75; }
.swg-redesign .post-content h2 { border-top: none; padding-top: 0; margin-top: 2.75rem; font-size: 28px; }
.swg-redesign .post-content th {
  text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--ink); background: var(--paper);
}
.swg-redesign .post-content tr:hover td { background: none; }
.swg-redesign .post-content figure.article-image img { box-shadow: none; border-color: var(--rule); max-width: 100%; }
.swg-redesign .post-content figure.article-image--hero img { height: auto; aspect-ratio: 2 / 1; box-shadow: none; }
.swg-redesign .post-content figcaption { font-size: 13px; color: var(--ink-faint); margin-top: .5rem; }
.related { margin-top: 3rem; }

/* ── Sidebar ── */
.sidebar { gap: 1.25rem; }
.side-block { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 1.25rem 1.25rem 1rem; }
.side-block h2 { font-family: var(--font-body); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: .6rem; }
.side-list { list-style: none; }
.side-list li { border-top: 1px solid var(--rule); }
.side-list li:first-child { border-top: none; }
.side-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; font-size: 14px; color: var(--ink); }
.side-list a:hover span:first-child { color: var(--accent); }
.side-count, .side-note { color: var(--ink-faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.side-newsletter { background: var(--accent-light); border-color: rgba(12,104,72,.18); }
.side-newsletter p { font-size: 14px; line-height: 1.55; color: var(--ink-muted); margin-bottom: .85rem; }
.side-newsletter .newsletter-fineprint { margin: .75rem 0 0; font-size: 12.5px; color: var(--ink-faint); }
.side-newsletter .newsletter-fineprint a { color: var(--ink-muted); text-decoration: underline; }
.side-newsletter .newsletter-status { margin: 0; font-size: 13px; font-weight: 500; }
.side-newsletter .newsletter-status:empty { display: none; }

/* ── Pagination ── */
.swg-redesign .pagination .page-numbers { border-color: var(--rule); }
.swg-redesign .pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); }

/* ── Footer ── */
.site-footer { margin-top: 0; background: var(--ink); }
.site-footer .footer-inner { grid-template-columns: 1.6fr 1fr 1fr; }
.site-footer .logo-text { color: #fff; font-size: 15px; font-weight: 600; }
.site-footer .logo-mark { background: rgba(20,151,106,.25); border: 1px solid rgba(20,151,106,.3); }
.site-footer .footer-tagline { max-width: 34ch; color: rgba(255,255,255,.55); font-size: 14px; }
.site-footer .footer-col h2 { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.55); margin-bottom: .85rem; }
.site-footer .footer-col ul li a { font-size: 14px; color: rgba(255,255,255,.78); }
.site-footer .footer-col ul li a:hover { color: #fff; }
.site-footer .footer-bottom { color: rgba(255,255,255,.4); font-size: 13px; }


/* ── Split: lead story with compact list ── */
.split {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}
.split-lead .row { border: none; }
.split-side { border-left: 1px solid var(--rule); padding: .5rem 1.25rem; }
.compact { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: .9rem; padding: 1rem 0; border-top: 1px solid var(--rule); align-items: start; }
.compact:first-child { border-top: none; }
.compact-thumb { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.compact-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.compact-title { font-family: var(--font-display); font-optical-sizing: auto; font-size: 17px; font-weight: 450; line-height: 1.28; letter-spacing: -0.01em; }
.compact-title a { color: var(--ink); }
.compact-title a:hover { color: var(--accent); }
.compact .row-meta { margin-top: .35rem; }
.list-heading--sub { margin-top: 2.75rem; font-size: 24px; }

/* ── Tiles ── */
.tiles { display: grid; gap: 2rem 1.5rem; }
.tiles--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile-thumb { display: block; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; background: var(--surface-3); margin-bottom: .85rem; }
.tile-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-title { font-family: var(--font-display); font-optical-sizing: auto; font-size: 19px; font-weight: 450; line-height: 1.25; letter-spacing: -0.012em; }
.tile-title a { color: var(--ink); }
.tile-title a:hover { color: var(--accent); }
.tile .row-meta { margin-top: .45rem; }

/* ── Topic bands on the home page ── */
.band { padding: 3.5rem 0; border-top: 1px solid var(--rule); }
.band--white { background: var(--surface); }
.band-inner { max-width: 1160px; margin: 0 auto; padding: 0 2rem; }
.band-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1.75rem; }
.band-head h2 { font-family: var(--font-display); font-size: 32px; font-weight: 400; letter-spacing: -0.025em; line-height: 1.1; }
.band-head p { color: var(--ink-muted); font-size: 15px; margin-top: .35rem; }
.band-link { font-size: 14px; font-weight: 500; color: var(--accent); white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(12,104,72,.35); }
.band-link:hover { text-decoration-color: var(--accent); }
.band-inner > .pillar { margin: 3.5rem 0; }

/* ── Archive head with a start-here guide ── */
.page-head-inner--split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 3rem; align-items: end; }
.start-here { display: block; padding: 1.25rem 1.4rem; border-radius: 12px; background: var(--ink); color: #fff; }
.start-here-label { display: block; font-size: 15px; color: rgba(255,255,255,.78); font-weight: 400; margin-bottom: .45rem; }
.start-here-title { display: block; font-family: var(--font-display); font-size: 20px; line-height: 1.25; letter-spacing: -0.01em; }
.start-here:hover .start-here-title { text-decoration: underline; text-underline-offset: 4px; }

/* ── Sidebar popular guides ── */
.side-list--titles a { font-size: 14px; line-height: 1.4; padding: .65rem 0; }
.side-list--titles a:hover { color: var(--accent); }

/* ── Home: latest, popular and newsletter (no sidebar, so no gap) ── */
.home-latest { max-width: 1160px; margin: 0 auto; padding: 3rem 2rem 3.5rem; }
.split--wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.split--wide .split-side { display: block; padding: .5rem 1.5rem; }
.home-extras { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 1.5rem; }
.home-popular .side-list--titles { columns: 2; column-gap: 2rem; }
.home-popular .side-list--titles li { break-inside: avoid; }
.home-popular .side-list li:nth-child(4) { border-top: none; }

/* ── Responsive ── */
.site-nav .nav-links a { white-space: nowrap; }
@media (max-width: 1100px) {
  .site-nav .nav-links { display: none; }
  .site-nav .hamburger { display: block; }
  .site-nav .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch; position: absolute; left: 0; right: 0; top: 64px;
    gap: 0; padding: .5rem 1rem 1rem; background: var(--surface); border-bottom: 1px solid var(--rule);
  }
  .site-nav .nav-links.open a { padding: .7rem .25rem; border-bottom: 1px solid var(--rule); }
  .site-nav .nav-links.open a.active { border-bottom-color: var(--accent); }
  .site-nav .nav-links.open a.nav-contact { margin: .75rem 0 0; text-align: center; }
}
@media (max-width: 1240px) {
  .split { grid-template-columns: 1fr; }
  .split-side { border-left: none; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; padding: .25rem 1.5rem .75rem; }
  .split-side .compact:nth-child(2) { border-top: none; }
}
@media (max-width: 1000px) {
  .tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head-inner--split { grid-template-columns: 1fr; gap: 1.5rem; }
  .home-hero-inner { grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .home-latest { padding: 2rem 1rem 2.5rem; }
  .home-extras { grid-template-columns: 1fr; }
  .home-popular .side-list--titles { columns: 1; }
  .home-popular .side-list li:nth-child(4) { border-top: 1px solid var(--rule); }
  .split-side { grid-template-columns: 1fr; }
  .split-side .compact:nth-child(2) { border-top: 1px solid var(--rule); }
  .tiles--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band { padding: 2.5rem 0; }
  .band-inner { padding: 0 1rem; }
  .band-head { flex-direction: column; align-items: start; gap: .75rem; }
  .band-head h2 { font-size: 26px; }
  .home-hero-inner, .layout, .page-head-inner, .post-head-inner { padding-left: 1rem; padding-right: 1rem; }
  .home-hero-inner { padding-top: 3rem; padding-bottom: 2.5rem; }
  .row { grid-template-columns: 112px minmax(0, 1fr); gap: 1rem; padding: 1.1rem; }
  .row-title { font-size: 19px; }
  .row-excerpt { -webkit-line-clamp: 2; font-size: 14px; }
  .pillar { grid-template-columns: 1fr; padding: 1.5rem; }
  .swg-redesign .post-content { padding: 1.5rem 1.1rem; }
  .site-footer .footer-inner { grid-template-columns: 1fr 1fr; }
  .site-footer .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .tiles--2, .tiles--3, .tiles--4 { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row-thumb { aspect-ratio: 16 / 9; }
  .row-meta span { margin-left: .9rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.band .tile .row-cat { display: none; }
.category .tile .row-cat, .category .split .row-cat { display: none; }

/* Home split has no sidebar next to it, so it can stay side by side down to tablet width. */
.split--wide .row--large .row-thumb { aspect-ratio: 16 / 9; }
@media (max-width: 1240px) {
  .split.split--wide { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .split--wide .split-side { display: block; border-top: none; border-left: 1px solid var(--rule); padding: .5rem 1.25rem; }
  .split--wide .split-side .compact:nth-child(2) { border-top: 1px solid var(--rule); }
}
@media (max-width: 860px) {
  .split.split--wide { grid-template-columns: 1fr; }
  .split--wide .split-side { border-left: none; border-top: 1px solid var(--rule); }
}

/* ── Article tables: fit the content box, never scroll ──
   Desktop: compact type and padding, cells wrap, and the table may use the article's side padding.
   Phones: tables with 4+ columns become one block per row; main.js copies each header into data-label. */
.swg-redesign .post-content table {
  width: calc(100% + 2rem); margin-left: -1rem; margin-right: -1rem;
  table-layout: auto; font-size: 13.5px; line-height: 1.45;
}
.swg-redesign .post-content th,
.swg-redesign .post-content td { padding: .65rem .6rem; vertical-align: top; overflow-wrap: break-word; hyphens: auto; }
.swg-redesign .post-content th { font-size: 13px; }
.swg-redesign .post-content td:first-child { font-weight: 500; }
@media (max-width: 1240px) {
  .swg-redesign .post-content table { width: 100%; margin-left: 0; margin-right: 0; font-size: 13px; }
  .swg-redesign .post-content th, .swg-redesign .post-content td { padding: .55rem .45rem; }
}
@media (max-width: 640px) {
  .swg-redesign .post-content table.is-stacked,
  .swg-redesign .post-content table.is-stacked tbody,
  .swg-redesign .post-content table.is-stacked tr,
  .swg-redesign .post-content table.is-stacked td { display: block; width: 100%; }
  .swg-redesign .post-content table.is-stacked { border: none; }
  .swg-redesign .post-content table.is-stacked thead,
  .swg-redesign .post-content table.is-stacked tr:first-child:has(th) { display: none; }
  .swg-redesign .post-content table.is-stacked tr { border: 1px solid var(--rule); border-radius: 10px; margin-bottom: .75rem; padding: .35rem .85rem; }
  .swg-redesign .post-content table.is-stacked td { border: none; border-top: 1px solid var(--rule); padding: .5rem 0; font-size: 14px; }
  .swg-redesign .post-content table.is-stacked td:first-child { border-top: none; font-family: var(--font-display); font-size: 18px; font-weight: 450; }
  .swg-redesign .post-content table.is-stacked td[data-label]:not(:first-child)::before {
    content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-muted); margin-bottom: .1rem;
  }
}
/* Tables with 6+ columns (class set by main.js): use almost the full article width and slightly smaller type.
   overflow-wrap:anywhere is a last resort so a long word can never push a table out of the box. */
.swg-redesign .post-content th, .swg-redesign .post-content td { overflow-wrap: anywhere; }
@media (min-width: 641px) {
  .swg-redesign .post-content table.is-wide { width: calc(100% + 5rem); margin-left: -2.5rem; margin-right: -2.5rem; font-size: 12.5px; }
  .swg-redesign .post-content table.is-wide th, .swg-redesign .post-content table.is-wide td { padding: .55rem .4rem; }
  .swg-redesign .post-content table.is-wide th { font-size: 12.5px; }
}
@media (min-width: 641px) and (max-width: 768px) {
  .swg-redesign .post-content table.is-wide { width: calc(100% + 1.6rem); margin-left: -.8rem; margin-right: -.8rem; }
}
/* The first column holds names (vendors, products): never split those mid-word. */
.swg-redesign .post-content td:first-child, .swg-redesign .post-content th:first-child { overflow-wrap: normal; hyphens: manual; min-width: 6.5rem; }
@media (max-width: 640px) { .swg-redesign .post-content table.is-stacked td:first-child { min-width: 0; } }
