/* Layered on top of the inherited beautiful-jekyll stylesheet.
   Scope: typography refinements, the landing-page components defined in
   index.html, and cleanup for the pandoc-exported R posts. */

:root {
  --ink: #2b3440;
  --ink-soft: #5a6672;
  --accent: #1f6f7a;
  --accent-dark: #14505a;
  --rule: #e3e8ec;
  --wash: #f7f9fa;
}

/* --- Typography ---------------------------------------------------------- */

/* The upstream theme sets a generous serif body size. Tightening the scale and
   capping the measure makes long technical paragraphs easier to read. */
.post-heading h1,
.intro-header .page-heading h1 {
  letter-spacing: -0.01em;
}

article p,
.post-entry p,
#main-content > p,
.focus-list dd {
  max-width: 68ch;
}

h2 {
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.45rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.1rem;
  letter-spacing: -0.005em;
}

/* --- Landing page ------------------------------------------------------- */

.lead-statement {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink);
  max-width: 64ch;
  margin-bottom: 0.5rem;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.25rem 1.75rem;
  margin: 1.25rem 0 0.5rem;
}

.capability {
  min-width: 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent);
}

.capability h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.capability p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.focus-list {
  margin: 1.25rem 0 0.5rem;
}

.focus-list dt {
  font-weight: 700;
  color: var(--ink);
  margin-top: 1rem;
}

.focus-list dt:first-child {
  margin-top: 0;
}

.focus-list dd {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.recent-writing {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0.5rem;
}

.recent-writing li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

.recent-writing li:first-child {
  border-top: 1px solid var(--rule);
}

.recent-writing a {
  font-weight: 700;
}

.recent-writing .recent-sub,
.recent-writing time {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.recent-writing time {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.more-link {
  margin-top: 1rem;
  font-size: 0.95rem;
}

/* --- Pandoc / knitr post cleanup ---------------------------------------- */

/* These wrappers came from the standalone R exports and would otherwise add a
   second layer of Bootstrap gutters inside the theme's own container. */
article .main-container,
article .container-fluid,
article .fluid-row {
  width: auto;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
}

/* The theme already prints the post title, subtitle and date in the header. */
article .fluid-row > .author,
article .fluid-row > .date {
  display: none;
}

/* Figures from knitr are fixed-width bitmaps; keep them inside the column. */
article img {
  max-width: 100%;
  height: auto;
}

/* Code blocks must scroll themselves rather than widen the page. */
article pre {
  overflow-x: auto;
  max-width: 100%;
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 0.86rem;
  line-height: 1.5;
}

article pre code {
  white-space: pre;
  word-wrap: normal;
}

/* Plotly sizes itself to the container once the fixed pixel box is removed. */
article div.plotly.html-widget {
  width: 100%;
  min-height: 420px;
  margin: 1.5rem 0;
}

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

footer .footer-links a,
footer a {
  color: var(--accent);
}

footer .footer-links a:hover,
footer a:hover {
  color: var(--accent-dark);
}

/* Keep wide tables from pushing the page sideways on mobile. */
article table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
