/* tech-help.uk: one small stylesheet, no framework. Colours live in :root. */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #e3e7ee;
  --brand: #0f766e;
  --brand-dark: #0b5953;
  --brand-soft: #e6f4f2;
  --accent: #f59e0b;
  --warn-bg: #fff4e5;
  --warn-border: #f59e0b;
  --tip-bg: #e8f3ff;
  --tip-border: #3b82f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --wrap: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #161d27;
    --text: #e6ebf2;
    --muted: #9aa6b6;
    --border: #263142;
    --brand: #2dd4bf;
    --brand-dark: #5eead4;
    --brand-soft: #12302d;
    --warn-bg: #2b2112;
    --tip-bg: #13233a;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.0625rem; line-height: 1.65; }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .2em 0 .4em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.section { padding: 40px 16px; }
.section-title { font-size: 1.35rem; margin: 0 0 18px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
.meta { color: var(--muted); font-size: .9rem; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0; }
.empty { color: var(--muted); }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--brand-dark); color: #fff; }
@media (prefers-color-scheme: dark) { .btn, .btn:hover { color: #062420; } }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.logo { white-space: nowrap; flex-shrink: 0; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.2rem; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 800; }
.logo-tld { color: var(--brand); }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.site-nav ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
.site-nav a { white-space: nowrap; display: block; padding: 6px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: .95rem; }
.site-nav a:hover, .site-nav a[aria-current] { background: var(--brand-soft); color: var(--brand-dark); }
.header-search input { width: 160px; }
input[type="search"] { font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); }
.nav-toggle { display: none; margin-left: auto; font: inherit; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; color: var(--text); }
@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 12px 16px 16px; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .header-search input { width: 100%; }
}

/* Hero */
.hero { background: linear-gradient(135deg, var(--brand-soft), var(--bg)); padding: 56px 0 48px; border-bottom: 1px solid var(--border); }
.hero h1 { max-width: 22ch; }
.hero h1 span { color: var(--brand); display: block; }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 52ch; }
.hero-search { display: flex; gap: 8px; max-width: 560px; margin-top: 20px; }
.hero-search input { flex: 1; min-width: 0; padding: 13px 16px; background: var(--surface); }

/* Category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.cat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.cat-tile:hover { transform: translateY(-2px); border-color: var(--brand); color: var(--text); }
.cat-icon { font-size: 1.8rem; }
.cat-icon--lg { font-size: 3rem; }
.cat-name { font-weight: 700; }
.cat-count { color: var(--muted); font-size: .85rem; }
.cat-header { display: flex; gap: 18px; align-items: center; margin-bottom: 28px; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
@media (max-width: 360px) { .card-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card h3 { margin: 6px 0 8px; font-size: 1.15rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--brand); }
.card p { margin: 0 0 10px; color: var(--muted); font-size: .97rem; }
.card .meta { margin-top: auto; margin-bottom: 0; }
.card-cat { font-size: .82rem; font-weight: 600; text-decoration: none; }

/* Article */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-top: 24px; padding-bottom: 48px; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } }
.article { min-width: 0; max-width: 760px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; font-size: .88rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; }
.breadcrumbs a { color: var(--muted); }
.pill { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; text-decoration: none; }
.article-header { margin-bottom: 20px; }
.quick-answer { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand); border-radius: 10px; padding: 14px 18px; margin: 20px 0; }
.quick-answer p { margin: 4px 0 0; }
.prose h2 { margin-top: 2em; font-size: 1.45rem; }
.prose h3 { margin-top: 1.6em; font-size: 1.15rem; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose img { border-radius: 10px; }
.prose code { background: var(--brand-soft); padding: .1em .35em; border-radius: 5px; font-size: .92em; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.callout { display: block; border-radius: 10px; padding: 12px 16px; margin: 1.4em 0; border-left: 4px solid var(--tip-border); background: var(--tip-bg); }
.callout strong { display: block; margin-bottom: 2px; }
.callout p { margin: .3em 0; }
.callout--warning { background: var(--warn-bg); border-color: var(--warn-border); }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }

/* Sidebar */
.sidebar-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.sidebar-box h2 { font-size: 1rem; margin: 0 0 8px; }
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box li { padding: 6px 0; border-top: 1px solid var(--border); }
.sidebar-box li:first-child { border-top: 0; }
.sidebar-box a { text-decoration: none; }
@media (min-width: 961px) { .sidebar { position: sticky; top: 84px; align-self: start; } }

/* Coffee block */
.coffee { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, #fff7e6, #fff1d6); border: 1px solid #f7d79b; color: #3b2a0b; border-radius: var(--radius); padding: 20px 22px; margin: 36px 0; }
.coffee h2 { margin: 0 0 4px; font-size: 1.2rem; }
.coffee p { margin: 0; font-size: .97rem; }
.coffee-icon { font-size: 2.2rem; }
.btn--coffee { background: #ffdd00; color: #1c1300; white-space: nowrap; margin-left: auto; }
.btn--coffee:hover { background: #f5cf00; color: #1c1300; }
@media (prefers-color-scheme: dark) { .coffee { background: #2a2210; border-color: #5a4518; color: #f6e7c4; } .btn--coffee, .btn--coffee:hover { color: #1c1300; } }
@media (max-width: 600px) { .coffee { flex-direction: column; text-align: center; } .btn--coffee { margin: 0; } }

/* Ad slots: reserve space so the page doesn't jump when ads load */
.ad-slot { margin: 28px 0; min-height: 100px; text-align: center; }
.ad-slot--placeholder { display: grid; place-items: center; border: 2px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: .85rem; background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(127,127,127,.05) 10px 20px); }

/* Topic list + search */
.topic-list { border-top: 1px solid var(--border); padding: 16px 0; }
.topic-list h2 { margin: 0 0 4px; font-size: 1.2rem; }
.topic-list h2 a { text-decoration: none; }
.topic-list p { margin: 0 0 6px; color: var(--muted); }
.search-results { list-style: none; padding: 0; }
.search-results li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 10px 0; }
.search-results a { font-weight: 700; font-size: 1.05rem; }
.search-results p { margin: 4px 0 0; color: var(--muted); }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 40px; padding: 36px 0 20px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { font-weight: 800; font-size: 1.15rem; margin: 0 0 6px; }
.site-footer h2 { font-size: .95rem; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 3px 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.footer-base { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; color: var(--muted); font-size: .85rem; }
