/* MIA's soft-cover notebook. Fibers live on the cover; ink lives on paper. */
@font-face {
  font-family: "Notebook Serif";
  src: url("../fonts/notebook-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --book-serif: Georgia, "Notebook Serif", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --book-fleece: url("../textures/ivory-fleece.webp");
  --book-fabric: #f5e5dd;
  --book-paper: #fffaf1;
  --book-paper-edge: #ebdcc6;
  --book-ink: #513736;
  --book-muted: #8b6c63;
  --book-thread: #d3b6a4;
  --book-red: #a52f43;
  --book-red-soft: #f1c8c7;
  --book-shadow: 0 3px 7px #88533b16, 0 14px 32px -22px #6e382e66;
  --book-page-width: 57rem;
  --book-page-gutter: 3rem;
  --book-page-radius: 1.1rem;
  /* Fabric showing around the sheet, the same on every side and page. */
  --book-margin: 1.6rem;
  --book-sheet: min(calc(100% - 2 * var(--book-margin)), var(--book-page-width));
}

body[data-md-color-scheme="slate"] {
  --book-fabric: #453038;
  --book-paper: #30282a;
  --book-paper-edge: #57444a;
  --book-ink: #f6e8da;
  --book-muted: #c4aba2;
  --book-thread: #9d6c72;
  --book-red: #f5a2aa;
  --book-red-soft: #59353e;
  --book-shadow: 0 3px 7px #0003, 0 14px 32px -22px #000b;
}

/* Keep the two palettes in step while allowing the cover to be more tactile. */
body[data-md-color-scheme]:has(#lp),
body[data-md-color-scheme]:not(:has(#lp)) {
  --w3-bg: var(--book-paper);
  --w3-surface: color-mix(in srgb, var(--book-paper) 80%, var(--book-fabric));
  --w3-surface-2: color-mix(in srgb, var(--book-paper) 58%, var(--book-fabric));
  --w3-line: var(--book-paper-edge);
  --w3-line-soft: color-mix(in srgb, var(--book-paper-edge) 64%, transparent);
  --w3-text: var(--book-ink);
  --w3-text-2: var(--book-ink);
  --w3-muted: var(--book-muted);
  --w3-faint: var(--book-muted);
  --w3-link: var(--book-red);
  --w3-red: var(--book-red);
  --w3-red-line: var(--book-thread);
  --w3-red-soft: var(--book-red-soft);
  --w3-nav: var(--book-paper);
  --w3-code-bg: var(--w3-surface);
  --w3-action: #a52f43;
  --w3-action-hover: #862638;
  --w3-on-action: #fff9ef;
  background-color: var(--book-fabric);
  background-image: var(--book-fleece);
  background-size: 32rem 32rem;
  background-blend-mode: multiply;
}

/* A textile cover with one sheet of cream paper on it. The top bar is the
   sheet's top edge (it stays pinned while scrolling), the footer is its
   bottom, and the photo is tucked in with washi tape. */
body:has(#lp) .lp {
  background: var(--book-paper);
  border: 1px solid var(--book-paper-edge);
  border-top: 0;
  border-radius: 0 0 var(--book-page-radius) var(--book-page-radius);
  box-shadow: var(--book-shadow);
  margin: 0 auto var(--book-margin);
  width: var(--book-sheet);
}

.lp-wrap {
  margin: 0;
  max-width: none;
  padding: 0 var(--book-page-gutter);
}

.lp-nav {
  background-color: var(--book-paper);
  border: 1px solid var(--book-paper-edge);
  border-bottom: 1px dashed var(--book-thread);
  border-radius: var(--book-page-radius) var(--book-page-radius) 0 0;
  box-shadow: none;
  left: auto;
  margin: var(--book-margin) auto 0;
  position: sticky;
  right: auto;
  top: 0;
  width: var(--book-sheet);
}

.lp-nav__bar {
  max-width: none;
  padding: 0 var(--book-page-gutter);
}

.lp-nav__brand img {
  border: 2px solid var(--book-paper);
  box-shadow: 0 0 0 1px var(--book-thread), 0 2px 4px #6e382e25;
}

.lp-nav__brand span,
.lp-nav__links a {
  color: var(--book-ink);
}

.lp-hero {
  padding: 3rem 0;
}

.lp-hero__text {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  padding: 0;
}

.lp-postcard::before {
  background: color-mix(in srgb, var(--book-red-soft) 78%, var(--book-paper));
  border-left: 1px dashed var(--book-thread);
  border-right: 1px dashed var(--book-thread);
  box-shadow: 0 1px 2px #6e382e16;
  content: "";
  height: 1.2rem;
  left: 1.3rem;
  opacity: .92;
  pointer-events: none;
  position: absolute;
  top: -.55rem;
  transform: rotate(-5deg);
  width: 4.2rem;
  z-index: 1;
}

.lp-hero__title {
  font-family: var(--book-serif);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: 1.45;
}

.lp-hero__sub {
  font-family: var(--book-serif);
  font-size: .85rem;
  line-height: 1.95;
  margin-top: .9rem;
}

.lp-hero__grid {
  gap: 2.4rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
}

.lp-hero__actions {
  column-gap: 1rem;
  margin-top: 1.2rem;
}

.lp-btn,
.md-typeset .w3-btn--primary {
  background-color: #a52f43;
  background-image: var(--book-fleece);
  background-size: 12rem;
  background-blend-mode: multiply;
  border: 1px solid #a12f43;
  border-radius: .75rem;
  box-shadow: inset 0 1px 2px #ffe2d580, inset 0 -3px 3px #63203655, 0 3px 0 #713142, 0 5px 8px #71314226;
  color: #fff9ef;
  outline: 1px dashed #f4c6c59c;
  outline-offset: -5px;
  padding: .65rem 1.15rem;
}

.lp-btn:hover,
.lp-btn:focus-visible {
  background-color: #ba3b50;
  box-shadow: inset 0 1px 2px #ffe2d580, inset 0 -2px 3px #63203655, 0 2px 0 #713142, 0 4px 8px #71314226;
}

.lp-link {
  font-size: .73rem;
}

.lp-postcard {
  background: var(--book-paper);
  border: 1px solid var(--book-paper-edge);
  border-radius: .7rem;
  box-shadow: var(--book-shadow);
  padding: .65rem .65rem .8rem;
}

.lp-postcard::before {
  left: 35%;
  transform: rotate(4deg);
  width: 3.4rem;
}

.lp-postcard .lp-sticker {
  background: #fffaf1;
  border: 1px dashed #cda4a0;
  box-shadow: 0 2px 0 #cda4a0, 0 4px 7px #71314230;
  padding: .25rem;
}

.lp-section {
  background: transparent;
  border-top: 1px dashed var(--book-thread);
  margin: 0;
  max-width: none;
  padding: 3rem 0;
}

.lp-hero + .lp-section {
  border-radius: 0;
  box-shadow: none;
}

.lp-section--alt {
  background: transparent;
}

.lp-h2 {
  font-family: var(--book-serif);
  font-size: 1.9rem;
  font-weight: 400;
  line-height: 1.55;
}

.lp-round__no {
  color: var(--book-red);
  font-size: 2.5rem;
  margin-bottom: .8rem;
}

.lp-reports,
.lp-list,
.lp-calendar {
  border-top: 1px dashed var(--book-thread);
}

.lp-reports li,
.lp-list li,
.lp-calendar li {
  border-bottom: 1px dashed var(--book-thread);
}

.lp-reports__t,
.lp-list__t,
.lp-calendar__name {
  font-family: var(--book-serif);
  font-weight: 400;
}

.lp-calendar__r {
  background: var(--book-red-soft);
  border: 1px dashed var(--book-thread);
  border-radius: .5rem;
  color: var(--book-red);
  padding: .15rem .4rem;
}

/* The footer lives inside the sheet, below a stitched line. */
.lp-footer {
  background: transparent;
  border: 0;
  border-top: 1px dashed var(--book-thread);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  max-width: none;
  width: auto;
}

.lp-footer__colophon {
  font-family: var(--book-serif);
  font-size: .7rem;
  line-height: 2;
}

.lp-menu {
  background-color: var(--book-paper);
}

.lp-menu a {
  font-family: var(--book-serif);
  font-weight: 400;
}

/* Home: a small "planning" line under the intro, and the study-group QR card
   beside the invitation to edit. */
.lp-hero__now {
  color: var(--book-muted);
  font-size: .7rem;
  line-height: 1.8;
  margin-top: .8rem;
}

.lp-hero__now span {
  border: 1px dashed var(--book-thread);
  border-radius: .4rem;
  color: var(--book-red);
  margin-right: .5rem;
  padding: .05rem .4rem;
}

.lp-join {
  align-items: center;
  display: grid;
  gap: 2.4rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 13rem);
}

.lp-join .lp-head {
  margin-bottom: 0;
}

.lp-qr {
  background: var(--book-paper);
  border: 1px dashed var(--book-thread);
  border-radius: .8rem;
  box-shadow: 0 2px 0 var(--book-paper-edge);
  padding: .8rem .8rem 1rem;
  text-align: center;
}

.lp-qr img {
  border-radius: .4rem;
  display: block;
  height: auto;
  margin: 0 auto;
  width: 100%;
}

.lp-qr__title {
  color: var(--book-ink);
  font-family: var(--book-serif);
  font-size: .9rem;
  margin-top: .6rem;
}

.lp-qr__text {
  color: var(--book-muted);
  font-size: .65rem;
  line-height: 1.7;
  margin-top: .3rem;
}

/* The navigation is the fabric binding; it never textures the article text. */
.md-sidebar--primary,
.md-sidebar--primary .md-nav,
.md-sidebar--primary .md-nav .md-nav__list {
  background-color: #6d293b;
  background-image: var(--book-fleece);
  background-size: 16rem 16rem;
  background-blend-mode: multiply;
}

.md-sidebar--primary {
  border-right: 4px solid #a9616c;
  box-shadow: inset -3px 0 6px #36101e55, 3px 0 6px #88533b19;
}

.md-sidebar--primary::after {
  border: 1px dashed #e3b0aa9c;
  border-radius: 1rem;
  content: "";
  inset: .6rem;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.md-sidebar--primary .md-sidebar__inner {
  position: relative;
  z-index: 1;
}

.w3-doc-brand__link b {
  font-family: var(--book-serif);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: -.035em;
}

.w3-doc-brand__link img {
  border: 2px solid #f1d1b8;
  box-shadow: 0 0 0 2px #a85e68, 0 3px 5px #36101e44;
}

.w3-doc-search {
  background: #562332;
  border: 1px dashed #dda3a3;
  border-radius: .75rem;
  box-shadow: inset 0 2px 4px #36101e55, 0 1px 0 #e4a6a145;
  color: #f2d5ca;
}

.w3-doc-colophon {
  border-top: 1px dashed #dfa4a1a6;
  color: #e6c4b8;
}

.md-header {
  background: var(--book-paper);
  border-bottom: 1px dashed var(--book-thread);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--book-paper-edge) 45%, transparent);
}

.md-banner {
  background: var(--w3-surface);
}

.md-main,
.md-container {
  background: transparent;
}

.md-content {
  background: var(--book-paper);
  border: 1px solid var(--book-paper-edge);
  border-radius: 1.2rem .85rem 1.1rem .65rem;
  box-shadow: var(--book-shadow), 4px 4px 0 var(--book-paper-edge), 7px 7px 0 var(--book-paper);
  margin: 1.4rem 0 2.5rem;
  padding: 0 1.25rem;
}

.md-content__inner {
  margin-bottom: 2rem;
}

.md-typeset {
  font-family: var(--book-serif);
  font-size: .85rem;
  line-height: 2;
}

.md-typeset :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--book-serif);
  font-weight: 400;
  letter-spacing: -.025em;
}

.md-typeset h1 {
  font-size: 1.8rem;
  line-height: 1.55;
}

.md-typeset h2 {
  line-height: 1.65;
}

.md-typeset :is(strong, b) {
  font-weight: 400;
  color: var(--book-red);
}

.md-typeset :is(code, pre, kbd, .highlight) {
  font-family: var(--w3-font-mono);
}

.md-typeset .w3-lead {
  font-size: .87rem;
  line-height: 2;
}

.md-typeset :is(.admonition, details, .w3-tldr) {
  background: var(--w3-surface);
  border: 1px dashed var(--book-thread);
  border-radius: .8rem;
  box-shadow: 0 2px 0 var(--book-paper-edge);
}

.md-typeset :is(.w3-meta, .w3-comments) {
  font-family: var(--w3-font);
}

.md-typeset :is(.w3-release--latest, .w3-card, .w3-note) {
  border: 1px dashed var(--book-thread);
  border-radius: .8rem;
  box-shadow: 0 2px 0 var(--book-paper-edge);
}

.md-typeset :is(.w3-poster img, .w3-photos img) {
  border: .3rem solid var(--book-paper);
  box-shadow: 0 0 0 1px var(--book-paper-edge), 0 3px 8px #88533b20;
}

.md-nav--secondary {
  background: var(--book-paper);
  border: 1px dashed var(--book-thread);
  border-radius: .8rem;
  box-shadow: var(--book-shadow);
  padding: .9rem .7rem;
}

.md-nav--secondary .md-nav__title {
  font-family: var(--book-serif);
  font-size: .7rem;
  font-weight: 400;
}

.md-footer {
  background: var(--book-paper);
  border-top: 1px dashed var(--book-thread);
}

/* Reading pages are the same single sheet as the home page: the banner, the
   top bar, the article with its contents column and the footer share one
   width and join without gaps, with the same fabric margin around them.
   The article and the contents are no longer separate cards. */
body:not(:has(#lp)) :is(.md-banner, .md-header, .md-main, .md-footer) {
  margin-left: auto;
  margin-right: auto;
  width: var(--book-sheet);
}

body:not(:has(#lp)) .md-banner {
  background: var(--w3-surface);
  border: 1px solid var(--book-paper-edge);
  border-bottom: 0;
  border-radius: var(--book-page-radius) var(--book-page-radius) 0 0;
  margin-top: var(--book-margin);
}

body:not(:has(#lp)) .md-header {
  border-left: 1px solid var(--book-paper-edge);
  border-right: 1px solid var(--book-paper-edge);
  box-shadow: none;
}

/* Without the banner (dismissed), the top bar starts the sheet. */
body:not(:has(#lp)) :is([data-md-component="announce"][hidden], [data-md-component="announce"]:not(:has(.md-banner))) + .md-header {
  border-radius: var(--book-page-radius) var(--book-page-radius) 0 0;
  border-top: 1px solid var(--book-paper-edge);
  margin-top: var(--book-margin);
}

body:not(:has(#lp)) .md-main {
  background: var(--book-paper);
  border-left: 1px solid var(--book-paper-edge);
  border-right: 1px solid var(--book-paper-edge);
  box-shadow: var(--book-shadow);
}

body:not(:has(#lp)) .md-footer {
  border: 1px solid var(--book-paper-edge);
  border-top: 1px dashed var(--book-thread);
  border-radius: 0 0 var(--book-page-radius) var(--book-page-radius);
  box-shadow: var(--book-shadow);
  margin-bottom: var(--book-margin);
  overflow: hidden;
}

body:not(:has(#lp)) .md-content {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

body:not(:has(#lp)) .md-sidebar--secondary .md-nav--secondary {
  background: transparent;
  border: 0;
  border-left: 1px dashed var(--book-thread);
  border-radius: 0;
  box-shadow: none;
  padding: .2rem 0 .2rem .8rem;
}

@media screen and (min-width: 76.25em) {
  .md-nav--primary .md-nav__link {
    border-radius: .55rem;
  }

  .md-nav--primary .md-nav__container:has(> .md-nav__link--active),
  .md-nav--primary .md-nav__link--active {
    background: #a35363;
    border-radius: .55rem;
    box-shadow: inset 0 1px 1px #f4c5b578, 0 2px 2px #36101e33;
    outline: 1px dashed #e4b2ab99;
    outline-offset: -4px;
  }

  .md-nav--primary .md-nav__container > .md-nav__link--active {
    background: transparent;
    box-shadow: none;
    outline: none;
  }

  .md-sidebar--secondary {
    padding-top: 3.5rem;
  }
}

@media screen and (max-width: 76.234375em) {
  .md-sidebar--primary .md-nav__title {
    background: #783345;
  }

  .md-sidebar--primary .md-nav--secondary {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media screen and (max-width: 52em) {
  .lp-hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .lp-hero__text {
    max-width: none;
  }

  .lp-hero__title {
    font-size: 2.2rem;
  }
}

@media screen and (max-width: 45.875em) {
  :root {
    --book-page-gutter: 1.1rem;
    --book-page-radius: .8rem;
    --book-margin: .6rem;
  }

  .lp-wrap,
  .lp-nav__bar {
    padding: 0 var(--book-page-gutter);
  }

  .lp-hero {
    padding: 2.2rem 0;
  }

  .lp-hero__text {
    padding: 0;
  }

  .lp-join {
    gap: 1.6rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .lp-qr {
    max-width: 15rem;
  }

  .lp-hero__title {
    font-size: 1.65rem;
  }

  .lp-h2 {
    font-size: 1.4rem;
  }

  .lp-section {
    padding-top: 2.2rem;
    padding-bottom: 2.2rem;
  }
}

@media screen and (max-width: 59.984375em) {
  .md-content {
    border-radius: .8rem;
    margin: .9rem .65rem 1.6rem;
    padding: 0 .35rem;
    box-shadow: var(--book-shadow), 3px 3px 0 var(--book-paper-edge);
  }

  .md-content__inner {
    margin-left: .75rem;
    margin-right: .75rem;
  }

  .md-path {
    margin-left: .75rem;
    margin-top: 1rem;
  }

  .md-typeset {
    font-size: .82rem;
  }

  .md-typeset h1 {
    font-size: 1.5rem;
  }
}

@media print {
  body,
  .md-content {
    background: white !important;
    background-image: none !important;
    border: 0;
    box-shadow: none;
    color: black;
    margin: 0;
    padding: 0;
  }
}
