/* Harmonica Tabs UK — theme stylesheet.
   System fonts only (no web-font requests), one file, no framework. */

:root {
    --accent: #0b6b8f;
    --bg: #f5f7f9;
    --surface: #ffffff;
    --text: #1b2430;
    --muted: #586474;
    --border: #dfe5eb;
    --code-bg: #f0f4f7;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --measure: 46rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 1.0625rem/1.7 var(--font);
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

h1, h2, h3, h4 { line-height: 1.25; color: var(--text); margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); letter-spacing: -.01em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.container--narrow { max-width: 50rem; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    background: var(--text); color: #fff; padding: .6rem 1rem; border-radius: 6px;
}
.skip-link:focus { top: 1rem; }

/* Header ------------------------------------------------------------------ */

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.5rem; padding-top: .8rem; padding-bottom: .8rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand__mark { color: var(--accent); flex: 0 0 auto; }
.brand img { display: block; max-height: 44px; width: auto; }

.header-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.5rem; margin-left: auto; }

.primary-nav ul { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav li { position: relative; }
.primary-nav a, .primary-nav span { display: block; padding: .5rem .8rem; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 600; }
.primary-nav a:hover { background: var(--bg); }
.primary-nav a[aria-current="page"] { color: var(--accent); background: var(--bg); }
.primary-nav .sub-menu {
    display: none; position: absolute; left: 0; top: 100%; z-index: 20; min-width: 13rem;
    flex-direction: column; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem;
}
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: flex; }
.primary-nav .sub-menu a { font-weight: 500; white-space: nowrap; }

.site-search { display: flex; }
.site-search input {
    width: 10rem; padding: .5rem .7rem; font: inherit; font-size: .95rem; color: var(--text);
    background: var(--bg); border: 1px solid var(--border); border-right: 0; border-radius: 6px 0 0 6px;
}
.site-search button, .button {
    display: inline-block; padding: .5rem .95rem; font: inherit; font-size: .95rem; font-weight: 600;
    color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 6px;
    text-decoration: none; cursor: pointer;
}
.site-search button { border-radius: 0 6px 6px 0; }
.site-search button:hover, .button:hover { filter: brightness(.92); }

.nav-toggle {
    display: none; margin-left: auto; padding: .5rem .9rem; font: inherit; font-weight: 600;
    color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
}

@media (max-width: 860px) {
    .js .nav-toggle { display: inline-block; }
    .js .header-tools { display: none; width: 100%; margin-left: 0; }
    .js .header-tools.is-open { display: block; }
    .header-tools { width: 100%; margin-left: 0; }
    .primary-nav ul { flex-direction: column; }
    .primary-nav .sub-menu { display: flex; position: static; border: 0; box-shadow: none; padding: 0 0 0 1rem; }
    .site-search { margin-top: .75rem; }
    .site-search input { flex: 1; width: auto; }
}

/* Main -------------------------------------------------------------------- */

.site-main { padding-bottom: 3.5rem; }

.hero { background: var(--surface); border-bottom: 1px solid var(--border); margin-bottom: 2.5rem; }
.hero__inner { padding-top: 3rem; padding-bottom: 3rem; max-width: 52rem; margin-left: auto; margin-right: auto; text-align: center; }
.hero__text { font-size: 1.15rem; color: var(--muted); margin: 0 auto 1.5rem; max-width: 40rem; }
.hero__links { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; list-style: none; margin: 0; padding: 0; }

.block { margin-bottom: 3rem; }
.block__header { margin-bottom: 1.1rem; }
.block__header h2 { margin-bottom: .2em; }
.block__header h2 a { color: inherit; text-decoration: none; }
.block__header h2 a:hover { color: var(--accent); }
.block__header p { margin: 0; color: var(--muted); max-width: var(--measure); }
.block__more { margin: 1.1rem 0 0; font-weight: 600; }

.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }

.card {
    display: flex; flex-direction: column; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.card__media { display: block; aspect-ratio: 16 / 9; background: var(--code-bg); }
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.card__body { padding: 1rem 1.1rem 1.15rem; }
.card__title { font-size: 1.1rem; margin: 0 0 .4em; }
.card__title a { color: var(--text); text-decoration: none; }
.card__title a:hover { color: var(--accent); text-decoration: underline; }
.card__excerpt { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }

.empty-note { color: var(--muted); }

/* Breadcrumbs ------------------------------------------------------------- */

.breadcrumbs { margin: 1.5rem 0 1rem; font-size: .9rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "›"; margin: 0 .5rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs span { overflow-wrap: anywhere; }

/* Article ----------------------------------------------------------------- */

.layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
    .layout { grid-template-columns: minmax(0, 1fr) 19rem; }
}

.entry { min-width: 0; }
.container--narrow .entry, .layout .entry {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: .5rem 1.5rem 2rem; margin-top: 1.5rem; box-shadow: var(--shadow);
}
@media (min-width: 700px) {
    .container--narrow .entry, .layout .entry { padding: .75rem 2.5rem 2.5rem; }
}

.entry-header { margin-bottom: 1.5rem; }
.entry-title { margin-bottom: .35em; }
.entry-meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0 0 1rem; font-size: .9rem; color: var(--muted); }
.entry-lead { font-size: 1.15rem; color: var(--muted); margin: 0; max-width: var(--measure); }

.entry-content { max-width: var(--measure); overflow-wrap: break-word; }
.entry-content > :first-child { margin-top: 0; }
.entry-content h2 { margin-top: 2.2em; padding-top: .2em; }
.entry-content h3 { margin-top: 1.8em; }
.entry-content p, .entry-content ul, .entry-content ol, .entry-content pre, .entry-content table, .entry-content figure, .entry-content blockquote { margin: 0 0 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content li > ul, .entry-content li > ol { margin-top: .4em; margin-bottom: 0; }

.entry-content code { font-family: var(--mono); font-size: .92em; background: var(--code-bg); padding: .12em .35em; border-radius: 4px; }
.entry-content pre {
    font-family: var(--mono); font-size: 1rem; line-height: 1.75; background: var(--code-bg);
    border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 6px;
    padding: 1rem 1.15rem; overflow-x: auto; white-space: pre; tab-size: 4;
}
.entry-content pre code { background: none; padding: 0; font-size: inherit; }

.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { padding: .55rem .75rem; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.entry-content thead th { background: var(--code-bg); font-weight: 600; }
.entry-content thead th:empty { display: none; }
.entry-content tbody tr:nth-child(even) td { background: #fafbfc; }
.table-scroll { overflow-x: auto; margin: 0 0 1.2em; }
.table-scroll table { margin: 0; min-width: 30rem; }

.entry-content blockquote { margin-left: 0; padding: .25rem 1.1rem; border-left: 4px solid var(--border); color: var(--muted); }
.entry-content hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; background: var(--code-bg); }
.entry-content figcaption { margin-top: .5rem; text-align: center; font-size: .85rem; color: var(--muted); line-height: 1.5; }

.entry-terms { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 2rem 0 0; font-size: .9rem; color: var(--muted); }
.entry-terms a, .chip-nav a {
    display: inline-block; padding: .25rem .75rem; background: var(--bg); border: 1px solid var(--border);
    border-radius: 999px; color: var(--text); text-decoration: none; font-size: .9rem;
}
.entry-terms a:hover, .chip-nav a:hover { border-color: var(--accent); color: var(--accent); }
.chip-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.entry-adjacent { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.entry-adjacent a { display: block; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; font-weight: 600; line-height: 1.4; }
.entry-adjacent a:hover { border-color: var(--accent); }
.entry-adjacent span { display: block; font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.entry-adjacent a[rel="next"] { text-align: right; }

/* Sidebar ----------------------------------------------------------------- */

.sidebar { min-width: 0; }
@media (min-width: 1000px) { .sidebar { margin-top: 1.5rem; } }
.sidebar__block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.sidebar__block h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .7em; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { padding: .45rem 0; border-top: 1px solid var(--border); line-height: 1.4; }
.link-list li:first-child { border-top: 0; padding-top: 0; }
.link-list a { text-decoration: none; }
.link-list a:hover { text-decoration: underline; }

/* Archive ----------------------------------------------------------------- */

.archive-header { margin: 0 0 1.75rem; }
.archive-description { max-width: var(--measure); color: var(--muted); font-size: 1.1rem; }
.archive-description p { margin: 0 0 .8em; }
.chip-nav ul { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1rem 0 0; padding: 0; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: 2.25rem; }
.pagination a, .pagination span { padding: .45rem .85rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); text-decoration: none; }
.pagination span[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination span[aria-disabled="true"] { color: var(--muted); background: transparent; }

/* Advertising ------------------------------------------------------------- */

.ad-slot { margin: 1.75rem 0; min-height: 280px; text-align: center; }
.ad-slot--sidebar { min-height: 250px; margin: 0 0 1.25rem; }
.ad-slot__label { display: block; margin-bottom: .3rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Error ------------------------------------------------------------------- */

.error { text-align: center; padding-top: 2rem !important; }
.error__status { font-size: 4rem; font-weight: 800; line-height: 1; color: var(--accent); margin: 0 0 .25em; }
.error .link-list { display: inline-block; text-align: left; margin-bottom: 1.5rem; min-width: 14rem; }

/* Footer ------------------------------------------------------------------ */

.site-footer { background: var(--text); color: #cfd6de; font-size: .95rem; }
.footer-inner { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); padding-top: 2.75rem; padding-bottom: 2rem; }
.footer-brand__name { font-size: 1.15rem; font-weight: 700; color: #fff; margin: 0 0 .5em; }
.footer-brand__note { margin: 0; max-width: 24rem; line-height: 1.55; }
.footer-nav h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: .8em; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: .4rem; }
.site-footer a { color: #cfd6de; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer a:focus-visible { outline-color: #fff; }
.footer-bottom { padding-top: 1.1rem; padding-bottom: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .14); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

@media print {
    .site-header, .site-footer, .sidebar, .ad-slot, .entry-adjacent, .breadcrumbs { display: none; }
    body { background: #fff; }
    .entry { border: 0 !important; box-shadow: none !important; padding: 0 !important; }
}
