/* jollyroger.biz: the Graphite look from the Hugo sites, served as one static stylesheet */

:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --surface-2: #e9e9ec;
  --ink: #0a0a0a;
  --text: #2a2a2e;
  --muted: #6e6e76;
  --rule: #e4e4e7;
  --accent: #0a0a0a;
  --on-panel: #ffffff;
  --code-bg: #111113;
  --code-text: #e7e7ea;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 80rem;
  --prose: 50rem;
  --wide: 72rem;
  --gutter: 16px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0c;
    --surface: #151517;
    --surface-2: #1d1d20;
    --ink: #fafafa;
    --text: #d6d6da;
    --muted: #9a9aa3;
    --rule: #26262a;
    --accent: #fafafa;
    --code-bg: #151517;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--bg);
  padding: .5rem 1rem; z-index: 20;
}
.skip:focus { left: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-prose { max-width: calc(var(--prose) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

@media (min-width: 700px) { :root { --gutter: 32px; } }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 2rem;
  min-height: 64px;
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand img { max-height: 2.2rem; width: auto; display: block; }

.nav { display: flex; flex-wrap: wrap; gap: .1rem .25rem; font-size: .9rem; font-weight: 500; }
.nav a { text-decoration: none; color: var(--muted); padding: .35rem .65rem; border-radius: 999px; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
@media (max-width: 699px) { .nav { margin-left: -.65rem; } }

/* ---------- Home intro ---------- */

.intro { padding: 3.5rem 0 1rem; }
.intro-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.045em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.intro-text { margin: 1.1rem 0 0; max-width: 44rem; font-size: 1.15rem; line-height: 1.55; color: var(--muted); }

/* ---------- Shared ---------- */

.eyebrow {
  margin: 0 0 .45rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--ink); }

.section-label { margin: 0 0 1.5rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }

.page-head { padding: 3rem 0 0; }
.page-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -.035em;
  color: var(--ink);
}
.page-body { padding-top: 2rem; padding-bottom: 4.5rem; }

.btn {
  display: inline-block;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: .65rem 1.25rem;
  cursor: pointer;
}
.btn:hover { opacity: .85; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); opacity: 1; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- Cards ---------- */

.feed { display: grid; gap: 3rem; }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 2.75rem 1.75rem; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.card { display: flex; flex-direction: column; min-width: 0; }

.card-media {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 1rem;
  text-decoration: none;
}
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.03); }

.card-title {
  margin: 0 0 .45rem;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.3;
  letter-spacing: -.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-text { margin: 0 0 .7rem; font-size: .95rem; line-height: 1.6; color: var(--muted); }
.card-meta { margin: auto 0 0; font-size: .8rem; color: var(--muted); }

.card-lead { padding-bottom: 3rem; border-bottom: 1px solid var(--rule); }
.card-lead .card-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.1; letter-spacing: -.035em; }
.card-lead .card-text { font-size: 1.08rem; }
@media (min-width: 860px) {
  .card-lead { display: grid; grid-template-columns: 7fr 5fr; gap: 2.5rem; align-items: center; }
  .card-lead .card-media { margin-bottom: 0; }
}

/* Panel for posts without a photo */
.panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 100%;
  padding: 1.25rem 1.4rem;
  color: #f7f1e6;
  background-color: #23303b;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 28px 28px;
  transition: filter .3s ease;
}
.card:hover .panel { filter: brightness(1.12); }
/* Six tones: slate, terracotta, sea, olive, plum, ochre */
.hue-0 { background-color: #23303b; }
.hue-1 { background-color: #a4492a; }
.hue-2 { background-color: #2e5e66; }
.hue-3 { background-color: #5c5a33; }
.hue-4 { background-color: #5e3a55; }
.hue-5 { background-color: #946a24; }
.panel-word {
  font-weight: 800;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.card-lead .panel { padding: 2rem 2.2rem; }
.card-lead .panel-word { font-size: clamp(2.4rem, 5vw, 4rem); }

/* Pager */
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 3.5rem;
  font-size: .9rem;
}
.pager-step {
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .5rem 1.1rem;
}
.pager-step:hover { border-color: var(--ink); }
.pager-step.is-off { color: var(--muted); opacity: .45; }
.pager-step.is-off:hover { border-color: var(--rule); }
.pager-count { color: var(--muted); }

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

.article-head { padding: 3.25rem 0 0; }
.article-title {
  margin: 0 0 1rem;
  font-weight: 800;
  font-size: clamp(2.1rem, 5.5vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -.03em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.article-meta {
  margin: 0 0 2.25rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.1rem;
  font-size: .88rem;
  color: var(--muted);
}

.prose { font-size: 1.1rem; line-height: 1.78; color: var(--text); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table, .prose figure, .prose dl { margin: 0 0 1.35rem; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.025em; margin: 2.6rem 0 .8rem; }
.prose h2 { font-size: 1.7rem; font-weight: 750; }
.prose h3 { font-size: 1.3rem; font-weight: 700; }
.prose h4 { font-size: 1.1rem; font-weight: 700; }
.prose a { color: var(--ink); text-decoration-color: var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose li { margin-bottom: .35rem; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.75rem 0; }
.prose blockquote {
  margin-left: 0;
  padding: .1rem 0 .1rem 1.25rem;
  border-left: 3px solid var(--ink);
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink);
}

/* Code */
.prose code { font-family: var(--mono); font-size: .86em; background: var(--surface); border: 1px solid var(--rule); border-radius: 5px; padding: .1em .35em; }
.prose pre, .prose .highlight pre {
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.6;
  background: var(--code-bg) !important;
  color: var(--code-text);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.prose .highlight { margin: 0 0 1.35rem; }
.prose .highlight pre { margin: 0; }

/* Tables */
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: .6rem .7rem; text-align: left; vertical-align: top; }
.prose th { font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.prose iframe, .prose video { max-width: 100%; }

/* Photos in the text run wider than the column */
.prose img { display: block; margin: 0 auto; border-radius: var(--radius); }
.prose p > img:only-child,
.prose figure img {
  width: min(calc(100vw - 2 * var(--gutter)), var(--wide));
  max-width: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.prose p:has(> img:only-child) { margin: 2.25rem 0; }
.prose figure { margin: 2.25rem 0; }
.prose figcaption { margin-top: .6rem; text-align: center; font-size: .85rem; color: var(--muted); }

.toc { margin: 0 0 2rem; padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); font-size: .95rem; }
.toc-title { margin: 0 0 .5rem; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ul { margin: 0; padding-left: 1.1rem; }

.tags { list-style: none; padding: 0; margin: 2.75rem 0 4.5rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.tags a, .term-cloud a {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  font-size: .85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  background: var(--surface);
  border-radius: 999px;
  padding: .32rem .8rem;
}
.tags a:hover, .term-cloud a:hover { background: var(--surface-2); }

.related { border-top: 1px solid var(--rule); padding: 3.25rem 0 4.5rem; }

/* ---------- Tags index ---------- */

.term-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.term-cloud a { font-size: .95rem; padding: .4rem .9rem; }
.term-cloud .count { font-size: .75rem; color: var(--muted); }

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

.archive-year h2 { font-size: 1.4rem; font-weight: 750; letter-spacing: -.02em; margin: 2.5rem 0 .4rem; color: var(--ink); }
.archive-year:first-child h2 { margin-top: 0; }
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li { display: flex; gap: 1.25rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.archive-list time { flex: 0 0 3.6rem; font-size: .82rem; color: var(--muted); padding-top: .15rem; font-variant-numeric: tabular-nums; }
.archive-list a { text-decoration: none; color: var(--ink); }
.archive-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Contact form shortcode ---------- */

.contact-form { display: grid; gap: .4rem; margin: 1.5rem 0; }
.contact-form label { font-size: .88rem; font-weight: 600; margin-top: .8rem; color: var(--ink); }
.contact-form input, .contact-form textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: .75rem .9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
}
.contact-note { margin: 0; font-size: .82rem; color: var(--muted); }
.contact-form .btn { margin-top: 1rem; justify-self: start; }

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

.site-footer { background: var(--surface); border-top: 1px solid var(--rule); padding: 3.5rem 0 2rem; font-size: .93rem; }
.site-footer a { text-decoration: none; color: var(--text); }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-footer .brand { font-size: 1.25rem; color: var(--ink); }
.footer-grid { display: flex; flex-wrap: wrap; gap: 2.5rem 3rem; }
.footer-brand { flex: 2 1 18rem; }
.footer-col { flex: 1 1 9rem; }
.footer-col.media-partners { flex: 2 1 16rem; }
.footer-col.media-partners ul { display: block; columns: 2 9rem; column-gap: 2rem; }
.media-partners li { margin-bottom: .4rem; break-inside: avoid; }
.footer-brand p { margin: .7rem 0 0; max-width: 26rem; color: var(--muted); line-height: 1.6; }
.footer-heading { margin: 0 0 .8rem; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer-bottom { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: .82rem; }
.footer-bottom a { color: var(--muted); }

/* ---------- jollyroger extras ---------- */

.no-posts { color: var(--muted); }
.page-count { margin: .6rem 0 0; font-size: .9rem; color: var(--muted); }
.article-title--page { margin-bottom: 0; }
.article-feature { margin: 0 0 2rem; }
.article-feature img { width: 100%; height: auto; display: block; border-radius: var(--radius); }
.prose .table-wrap { overflow-x: auto; margin: 0 0 1.35rem; }
.prose .table-wrap table { display: table; margin: 0; }
