/* Resources hub, guides and glossary */
:root {
    --bg: #f8fafc; --card: #ffffff; --text: #0f172a; --muted: #475569; --line: #e2e8f0;
    --brand: #2563eb; --brand-dark: #1d4ed8; --brand-soft: #dbeafe; --accent: #0f766e; --warn: #b45309; --warn-soft: #fef3c7;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #0b1220; --card: #131c2e; --text: #f1f5f9; --muted: #a8b3c7; --line: #243049; --brand: #60a5fa; --brand-dark: #93c5fd; --brand-soft: #1e3a8a; --accent: #5eead4; --warn: #fbbf24; --warn-soft: #3b2f0a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif; }
a { color: var(--brand-dark); }
a:hover { text-decoration: none; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15,23,42,.06); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand img { border-radius: 12px; box-shadow: 0 3px 10px rgba(30,58,138,.28); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; color: #1e3a8a; }
.brand-text small { margin-top: 3px; font-size: .68rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
@media (prefers-color-scheme: dark) { .brand-text strong { color: #bfdbfe; } }
.main-nav { display: flex; gap: 4px; }
.main-nav a { color: var(--muted); text-decoration: none; padding: 10px 14px; border-radius: 10px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.main-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.main-nav a[aria-current="page"] { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .main-nav a[aria-current="page"] { color: #0b1220; } }

.resource-bar { background: var(--card); border-bottom: 1px solid var(--line); }
.resource-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding-top: 10px; padding-bottom: 10px; }
.back-btn, .calc-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 2px solid var(--brand); color: var(--brand-dark); background: transparent; }
.calc-btn { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .calc-btn { color: #0b1220; } }
.back-btn:hover { background: var(--brand-soft); }
.crumbs { font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }

h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.2; margin: .2em 0 .4em; }
h2 { font-size: 1.45rem; line-height: 1.3; margin: 1.8em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.2em 0 .4em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--accent); margin: 28px 0 0; }
.lede { font-size: 1.15rem; color: var(--muted); }
.page-head { padding: 24px 0 8px; }
.hero { padding-bottom: 20px; }

.article-layout { padding-bottom: 40px; }
.article { max-width: 760px; }
.article p, .article li { overflow-wrap: break-word; }
.article section > h2:first-child { margin-top: 1.4em; }
.example, .tips, .ato-box, .notice { border-radius: 14px; padding: 4px 20px 14px; margin: 26px 0; }
.example { background: var(--brand-soft); }
.tips { background: var(--card); border: 1px solid var(--line); }
.ato-box { background: var(--warn-soft); border: 1px solid var(--warn); }
.notice { background: var(--warn-soft); border: 1px solid var(--warn); margin-top: 48px; }
.example h2, .tips h2, .ato-box h2, .notice h2 { font-size: 1.1rem; margin: 16px 0 6px; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 20px; margin: 20px 0; }
.toc ol { margin: 6px 0 0; padding-left: 20px; }

.chip-list { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list a { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: .95rem; }
.chip-list a:hover { border-color: var(--brand); }
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 36px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .95rem; }
.back-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0 8px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--brand); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.card .more { margin-top: auto; font-weight: 700; color: var(--brand-dark); }
.link-list { padding-left: 20px; }
.link-list li { margin: 6px 0; }

.hub-search, .glossary-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.hub-search input, .glossary-tools input, .glossary-tools select { font: inherit; font-size: 16px; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); }
.hub-search input, .glossary-tools input { flex: 1 1 260px; }
.hub-search button { min-height: 48px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
@media (prefers-color-scheme: dark) { .hub-search button { color: #0b1220; } }
.count { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .9rem; }
.az { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 18px; }
.az a { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 700; }
.letter h2 { border-bottom: 2px solid var(--line); padding-bottom: 4px; margin-top: 1.4em; scroll-margin-top: 76px; }
.term-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.term-list li[hidden], .letter[hidden] { display: none; }
.term-list a { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.term-list a:hover { border-color: var(--brand); }
.term-list strong { display: block; color: var(--brand-dark); }
.term-list span { display: block; font-size: .88rem; color: var(--muted); line-height: 1.45; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.none { padding: 20px; text-align: center; color: var(--muted); }

.site-footer { margin-top: 48px; background: var(--card); border-top: 1px solid var(--line); padding: 24px 0 32px; }
.footer-links { margin: 0 0 10px; }
.footer-links a { display: inline-block; padding: 8px 6px; }
.fine { margin: 4px 0; font-size: .85rem; color: var(--muted); }

@media (max-width: 600px) {
    body { font-size: 16px; }
    .main-nav a { padding: 10px 10px; }
    .brand-text small { display: none; }
    .brand-text strong { font-size: 1.15rem; }
    .term-list { grid-template-columns: 1fr; }
    .resource-bar-row { gap: 6px 14px; }
}
@media print { .site-header, .resource-bar, .site-footer, .back-row, .pager { display: none; } body { background: #fff; color: #000; } }

.ad-slot { text-align: center; margin: 28px 0; overflow: hidden; }
.ad-label { display: block; font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
@media print { .ad-slot { display: none; } }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 8px; }
.contact-form { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.contact-form label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
.contact-form label:first-child { margin-top: 0; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; font: inherit; font-size: 16px; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--brand); background: var(--card); }
.hp { position: absolute; left: -9999px; }
.calc-note { margin-top: 16px; background: var(--brand-soft); border-radius: 12px; padding: 12px 14px; font-size: .9rem; }
.calc-note[hidden] { display: none; }
.calc-note pre { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: .8rem/1.5 ui-monospace, Menlo, Consolas, monospace; max-height: 180px; overflow: auto; }
.send-btn { margin-top: 18px; width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
@media (prefers-color-scheme: dark) { .send-btn { color: #0b1220; } }
.send-btn:disabled { opacity: .6; cursor: wait; }
.form-status { min-height: 1.5em; margin: 12px 0 0; font-weight: 600; }
.form-status.ok { color: #16a34a; }
.form-status.err { color: #dc2626; }
.contact-side h2 { margin-top: 0; font-size: 1.15rem; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Colourful, clearly clickable cards ---- */
:root { --tint: 96%; --tint2: 99%; --ink: 36%; --bar: 52%; }
@media (prefers-color-scheme: dark) { :root { --tint: 17%; --tint2: 12%; --ink: 72%; --bar: 58%; } }

.card { position: relative; overflow: hidden; border: 1px solid hsl(var(--h) 45% 82%); border-top: 6px solid hsl(var(--h) 70% var(--bar));
        background: linear-gradient(160deg, hsl(var(--h) 90% var(--tint)) 0%, var(--card) 62%); padding: 20px 22px 18px;
        box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 18px hsl(var(--h) 60% 40% / .10); }
@media (prefers-color-scheme: dark) { .card { border-color: hsl(var(--h) 35% 28%); } }
.card:hover { transform: translateY(-3px); border-color: hsl(var(--h) 70% var(--bar)); box-shadow: 0 10px 26px hsl(var(--h) 60% 40% / .22); }
.card .num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; margin-bottom: 10px;
             background: hsl(var(--h) 70% var(--bar)); color: #fff; font-weight: 800; font-size: .95rem; }
.card h3 { font-size: 1.12rem; line-height: 1.3; }
.card .more { display: inline-flex; align-items: center; align-self: flex-start; margin-top: auto; padding: 8px 16px; border-radius: 999px;
              background: hsl(var(--h) 70% var(--bar)); color: #fff; font-weight: 700; font-size: .92rem; }
.card:hover .more { filter: brightness(1.08); box-shadow: 0 4px 12px hsl(var(--h) 60% 40% / .35); }

.term-list a { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px 12px 18px; border: 1px solid hsl(var(--h) 40% 84%);
               border-left: 6px solid hsl(var(--h) 70% var(--bar)); border-radius: 12px;
               background: linear-gradient(135deg, hsl(var(--h) 90% var(--tint)) 0%, var(--card) 70%);
               box-shadow: 0 1px 2px rgba(15,23,42,.05); transition: transform .15s, box-shadow .15s; }
@media (prefers-color-scheme: dark) { .term-list a { border-color: hsl(var(--h) 30% 26%); border-left-color: hsl(var(--h) 70% var(--bar)); } }
.term-list a:hover { transform: translateY(-2px); box-shadow: 0 8px 20px hsl(var(--h) 60% 40% / .20); border-color: hsl(var(--h) 60% var(--bar)); }
.term-list .cat { font-style: normal; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: hsl(var(--h) 60% var(--ink)); }
.term-list strong { font-size: 1.05rem; color: var(--text); }
.term-list .def { margin-top: 0; }
.term-list .go { margin-top: 8px; font-weight: 700; font-size: .85rem; color: hsl(var(--h) 65% var(--ink)); }
.term-list a:hover .go { text-decoration: underline; }

.chip-list li[style] a { border: 1px solid hsl(var(--h) 45% 80%); background: hsl(var(--h) 90% var(--tint)); color: hsl(var(--h) 60% var(--ink)); font-weight: 600; }
@media (prefers-color-scheme: dark) { .chip-list li[style] a { border-color: hsl(var(--h) 30% 30%); } }
.chip-list li[style] a:hover { border-color: hsl(var(--h) 70% var(--bar)); box-shadow: 0 3px 10px hsl(var(--h) 60% 40% / .2); }
.eyebrow.chip { display: inline-block; padding: 5px 12px; border-radius: 999px; background: hsl(var(--h) 85% var(--tint)); color: hsl(var(--h) 60% var(--ink)); border: 1px solid hsl(var(--h) 45% 80%); margin-top: 22px; }
@media (prefers-color-scheme: dark) { .eyebrow.chip { border-color: hsl(var(--h) 30% 30%); } }
.hero { background: linear-gradient(135deg, var(--brand-soft), transparent 70%); border-radius: 20px; padding: 24px 24px 22px; margin-top: 16px; }

/* Live traffic counter */
.traffic-counter { display: flex; justify-content: center; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-top: 12px; font-size: .85rem; color: var(--muted); }
.traffic-counter[hidden], .traffic-counter [hidden] { display: none; }
.traffic-counter strong { color: inherit; }
.traffic-counter .live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #22c55e; animation: trafficPulse 2s infinite; }
@keyframes trafficPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
