/* ---------------------------------------------------------------------------
   Tom Sunic - theme refinements on top of mkdocs-material.
   Everything here is layered on Material's CSS variables, so both the light
   and the dark palette keep working without a second set of colours.
   --------------------------------------------------------------------------- */

/* --- Reading measure ---------------------------------------------------- */

.md-grid {
  max-width: 68rem;
}

.md-typeset {
  font-size: 0.82rem;
  line-height: 1.72;
}

.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 1.2rem;
}

.md-typeset h2 {
  font-weight: 700;
  letter-spacing: -0.005em;
  margin-top: 2rem;
}

.md-typeset h1 + p,
.md-typeset h2 + p {
  margin-top: 0.6rem;
}

.md-typeset blockquote {
  border-left-width: 2px;
  border-left-color: var(--md-accent-fg-color);
  color: var(--md-default-fg-color--light);
  font-style: italic;
}

.md-typeset hr {
  border-bottom-color: var(--md-default-fg-color--lightest);
  margin: 2.4em 0;
}

/* Footnotes carry most of the scholarly apparatus on this site. */
.md-typeset .footnote {
  border-top: 1px solid var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color--light);
  font-size: 0.92em;
  margin-top: 2.4em;
  padding-top: 0.8em;
}

/* --- Images ------------------------------------------------------------- */

.md-typeset img {
  border-radius: 3px;
  max-width: 100%;
}

/* Standalone portraits, e.g. on the contact page, are originals of about
   400px; letting them run the full column width only blurs them. */
.md-typeset img.portrait {
  border-radius: 4px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.2);
  max-width: 13rem;
}

/* --- Header and tabs ---------------------------------------------------- */

.md-header {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-header__title {
  font-family: "Playfair Display", var(--md-text-font-family), serif;
  font-size: 1rem;
  font-weight: 700;
}

.md-tabs {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
}

.md-tabs__link {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  opacity: 0.72;
  text-transform: uppercase;
}

.md-tabs__link:hover,
.md-tabs__link--active {
  opacity: 1;
}

.md-tabs__item--active .md-tabs__link {
  border-bottom: 2px solid var(--md-accent-fg-color);
  font-weight: 700;
}

/* --- Home page: portrait and standfirst --------------------------------- */

.hero {
  align-items: center;
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  display: grid;
  gap: 1.8rem;
  grid-template-columns: 9.2rem 1fr;
  margin-bottom: 2.4rem;
  padding-bottom: 2rem;
}

/* The portrait is a small original (183px wide), so the column is sized to it
   rather than blowing it up. */
.md-typeset .hero img {
  border-radius: 4px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.2);
  display: block;
  width: 100%;
}

/* The portrait arrives wrapped in its own paragraph; it is the first grid
   column and must not carry paragraph spacing. */
.md-typeset .hero > p {
  margin: 0;
}

.md-typeset .hero p {
  margin: 0 0 0.8em;
}

.md-typeset .hero p:last-child {
  margin-bottom: 0;
}

.md-typeset .hero .hero-lede {
  font-size: 1.02em;
  line-height: 1.6;
}

.md-typeset .hero .md-button {
  font-size: 0.64rem;
  margin: 0.5em 0.4em 0 0;
  padding: 0.4em 1em;
}

@media screen and (max-width: 44.9375em) {
  .hero {
    gap: 1.2rem;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .hero img {
    max-width: 9rem;
  }
}

/* --- Books -------------------------------------------------------------- */

.book {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  display: grid;
  gap: 2rem;
  grid-template-columns: 12rem 1fr;
  padding: 2.2rem 0;
}

.book:last-of-type {
  border-bottom: none;
}

.book-cover {
  position: sticky;
  top: 5rem;
}

.md-typeset .book-cover p {
  margin: 0;
}

.md-typeset .book-cover img {
  border-radius: 2px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.22);
  display: block;
  width: 100%;
}

.md-typeset .book-text > h2 {
  font-size: 1.25em;
  margin: 0 0 0.2em;
}

.md-typeset .book-text .book-meta {
  color: var(--md-default-fg-color--light);
  font-size: 0.92em;
  margin: 0 0 0.6em;
}

.md-typeset .book-text > p:last-child {
  margin-bottom: 0;
}

/* The short bibliographic run at the end of a couple of entries. */
.md-typeset .book-text .book-details {
  color: var(--md-default-fg-color--light);
  font-size: 0.92em;
  line-height: 1.6;
}

.md-typeset .book-text .book-details ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.md-typeset .book-text .book-details li {
  margin-bottom: 0.15em;
}

/* Buy link sits tight under the title, not floated away from it. */
.md-typeset .book-text .md-button {
  font-size: 0.64rem;
  margin: 0;
  padding: 0.35em 1em;
}

.md-typeset .book-text > p:has(> .md-button) {
  margin: 0 0 1.2em;
}

@media screen and (max-width: 59.9375em) {
  .book {
    gap: 1.2rem;
    grid-template-columns: 8rem 1fr;
  }

  .book-cover {
    position: static;
  }
}

@media screen and (max-width: 44.9375em) {
  .book {
    grid-template-columns: 1fr;
  }

  .book-cover {
    max-width: 10rem;
  }
}

/* --- Blog post list ----------------------------------------------------- */

.md-post--excerpt {
  border-bottom: 1px solid var(--md-default-fg-color--lightest);
  margin-bottom: 2rem;
  padding-bottom: 1.4rem;
}

.md-post--excerpt:last-child {
  border-bottom: none;
}

.md-typeset .md-post--excerpt h2 {
  margin-top: 0;
}

.md-post__action {
  font-weight: 700;
}

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

.md-footer-meta {
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.md-copyright {
  line-height: 1.5;
}
