/* ==========================================================================
   A port of the orderedlist/minimal theme (https://github.com/orderedlist/minimal)
   to a Quarto website. The base rules below are the theme's own stylesheet;
   the "Quarto / personal-site additions" section adapts it for a profile photo,
   a vertical section nav, and a full-width blog.
   ========================================================================== */

/* ---------- minimal: base ---------- */

body {
  background-color: #fff;
  padding: 50px;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: #595959;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 { color: #222; margin: 0 0 20px; }
p, ul, ol, table, pre, dl { margin: 0 0 20px; }
h1, h2, h3 { line-height: 1.1; }
h1 { font-size: 28px; font-weight: 500; }
h2 { font-size: 22px; color: #393939; font-weight: 500; }
h3, h4, h5, h6 { font-size: 18px; color: #494949; font-weight: 500; }

a { color: #39c; text-decoration: none; }
a:hover { color: #069; }
a small { font-size: 11px; color: #777; margin-top: -0.3em; display: block; }
a:hover small { color: #777; }

.wrapper { width: 860px; margin: 0 auto; }

blockquote {
  border-left: 1px solid #e5e5e5;
  margin: 0;
  padding: 0 0 0 20px;
  font-style: italic;
}

code, pre {
  font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal,
    Consolas, "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace;
  color: #333;
}

pre {
  padding: 8px 15px;
  background: #f8f8f8;
  border-radius: 5px;
  border: 1px solid #e5e5e5;
  overflow-x: auto;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 5px 10px; border-bottom: 1px solid #e5e5e5; }
dt { color: #444; font-weight: 500; }
th { color: #444; }
img { max-width: 100%; }
strong { color: #222; font-weight: 500; }
small { font-size: 11px; }
hr { border: 0; background: #e5e5e5; height: 1px; margin: 0 0 20px; }

/* ---------- minimal: two-column frame ---------- */

.site-header {
  width: 270px;
  float: left;
  position: fixed;
  -webkit-font-smoothing: subpixel-antialiased;
}

.wrapper > section {
  width: 500px;
  float: right;
  padding-bottom: 50px;
}

/* The left column is `position: fixed`, so it adds no height to the flow. Give
   the content column a floor tall enough to clear it, so the footer's
   `clear: both` lands it below the sidebar rather than beside it on a short
   page. Bump this if the sidebar grows -- it is ~642px tall today. */
.wrapper > section { min-height: 660px; }

.site-footer {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 20px;
  margin-top: 50px;
  padding: 14px 0 40px;
  border-top: 1px solid #e5e5e5;
}

/* ==========================================================================
   Quarto / personal-site additions
   ========================================================================== */

/* Quarto renders the page's `title:` into this block; treat it as the page H1. */
#title-block-header { margin: 0; }
#title-block-header .title { margin: 0 0 20px; }
#title-block-header .subtitle,
#title-block-header .description { color: #777; margin: -14px 0 20px; }
.quarto-title-meta, .quarto-title-banner { display: none; }

/* --- 1. Profile photo (size/shape live in theme.css) --- */
.profile-photo {
  display: block;
  max-width: 100%;
  margin: 0 0 20px;
}

/* --- 2. Identity block under the photo --- */
.site-name { font-size: 24px; margin: 0 0 8px; }
.tagline { color: #777; margin: 0 0 14px; }
.contact { font-size: 12px; margin: 0 0 20px; }

/* --- 3. Section links, as minimal's rounded button box turned vertical --- */
.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 270px;
  background: #f4f4f4;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
}
.site-nav li + li { border-top: 1px solid #e0e0e0; }
.site-nav a {
  display: block;
  padding: 7px 14px;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}
.site-nav a:hover { background: #efefef; color: #222; }
.site-nav a.active { background: #fff; color: #222; font-weight: 500; box-shadow: inset 3px 0 0 #39c; }

/* --- 4. Blog: its own page, not side-by-side ---
   The left column markup is shared by every page; on blog pages the whole
   column collapses to a single back link and the content goes full width. */
.back-link { display: none; }

body.blog .wrapper { width: 700px; }
body.blog .site-header {
  position: static;
  float: none;
  width: auto;
  margin: 0 0 40px;
}
body.blog .site-header > *:not(.back-link) { display: none; }
body.blog .back-link { display: inline-block; font-size: 13px; color: #777; }
body.blog .back-link:hover { color: #39c; }
body.blog .wrapper > section { width: auto; float: none; }

/* Fade the right-hand column in when only <section> is swapped
   (see the navigation script in _includes/sidebar/nav-script.html). */
.section-enter { animation: section-enter 140ms ease-out; }
@keyframes section-enter {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .section-enter { animation: none; }
}

/* Listing (blog index). Quarto emits Bootstrap utility classes even with
   `theme: none`, so .d-none has to be defined here. */
.d-none { display: none !important; }

.quarto-listing { margin: 0; }

.quarto-post {
  display: flex;
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid #e5e5e5;
}
.quarto-post .body { flex: 1; }
.quarto-post .metadata { width: 90px; text-align: right; flex: none; }
.quarto-post .thumbnail { display: none; }

.listing-title { font-size: 18px; margin: 0 0 4px; }
.listing-title a { color: #222; }
.listing-title a:hover { color: #39c; }
.listing-date { font-size: 12px; color: #999; }
.listing-description p { margin: 0; }
.listing-description a { color: #595959; }
.listing-description a:hover { color: #39c; }

/* ---------- minimal: responsive ---------- */

@media print, screen and (max-width: 960px) {
  div.wrapper { width: auto; margin: 0; }
  .site-header, .wrapper > section { float: none; position: static; width: auto; min-height: 0; }
  .site-header { padding-right: 320px; }
  .wrapper > section {
    border: 1px solid #e5e5e5;
    border-width: 1px 0;
    padding: 20px 0;
    margin: 0 0 20px;
  }
  .site-nav ul { position: absolute; right: 50px; top: 52px; width: 270px; }
}

@media print, screen and (max-width: 720px) {
  body { word-wrap: break-word; }
  .site-header { padding: 0; }
  pre, code { word-wrap: normal; }

  /* 3-across grid once the layout is fully stacked -- echoes minimal's own
     3-button header box, instead of a six-row vertical list. */
  .site-nav ul {
    position: static;
    width: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .site-nav li {
    border-top: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
  }
  .site-nav li:nth-child(-n + 3) { border-top: none; }
  .site-nav li:nth-child(3n) { border-right: none; }
  .site-nav a { padding: 9px 10px; }

  .site-footer { justify-content: center; text-align: center; }
}

@media print, screen and (max-width: 480px) {
  body { padding: 15px; }
}

/* ---------- pinned section list ----------
   Above 960px the left column is `position: fixed` and the list is always on
   screen. Below it the column joins the flow and scrolls away, taking the
   current-page marker with it. `body.nav-pinned` is toggled by the script in
   _includes/sidebar/nav-script.html once the list's own position scrolls past the top.

   Pinned, the list is always the compact 3-across bar -- at 721-960px that is
   a change of shape from the 270px column it is at rest, but a 270px box fixed
   over the right-hand side would sit on top of the text. */

@media screen and (max-width: 960px) {
  body.nav-pinned .site-nav ul {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: auto;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-radius: 0;
    border-width: 0 0 1px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  }
  body.nav-pinned .site-nav li {
    border-top: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
  }
  body.nav-pinned .site-nav li:nth-child(-n + 3) { border-top: none; }
  body.nav-pinned .site-nav li:nth-child(3n) { border-right: none; }
  body.nav-pinned .site-nav a { padding: 9px 10px; }
}

@media screen and (max-width: 720px) {
  /* Here the list is in the flow, so pinning it leaves a hole. --nav-h is the
     height the script measured before it pinned. Above 720px the list is
     already absolutely positioned and there is no hole to fill. */
  body.nav-pinned .site-nav { height: var(--nav-h, auto); }
}

@media print {
  body { padding: 0.4in; font-size: 12pt; color: #444; }
}
