@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/*------------------------------------------------
base
------------------------------------------------*/

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

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

/*------------------------------------------------
body and links
------------------------------------------------*/

body {
  background: var(--bg-color);
	color: var(--text);
	font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.42857143;
  margin: 0;
  padding: 1.5rem 0 2.5rem 0;
}

/* background image under a warm tint, fixed behind the page */
body::before {
  background:
    linear-gradient(var(--bg-warmth), var(--bg-warmth)),
    var(--bg-color) var(--bg-image) center / cover;
  background-blend-mode: multiply, normal;
  filter: var(--bg-filter);
  content: '';
  inset: 0;
  position: fixed;
  z-index: -1;
}

a, a:visited {
  color: var(--link);
  outline: none;
	text-decoration: none;
}

a:hover {
	color: var(--link-hover);
	text-decoration: none;
}

strong {
	font-weight: 600;
}


/*------------------------------------------------
layout
------------------------------------------------*/

.container {
  margin: 0 auto;
  max-width: 1170px;
  padding: 0 15px;
}

/* the article, with the navigation in its own fixed-width sheet to the right */
.content {
  column-gap: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 12rem;
}

@media (max-width: 767px) {
  .content {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel-background {
  /* light gray, slightly see-through: the percentage is how solid the sheet is */
  background: color-mix(in srgb, var(--sheet-color) 85%, transparent);
  /* a faint edge, so the sheet shows against pale parts of the photo */
  border: 1px solid var(--edge);
  border-radius: 10px;
  /* a soft shadow lifts the sheet off the background */
  box-shadow: var(--sheet-shadow);
  margin-bottom: 1rem;
	padding: 2rem;
}

/* phones: keep the padding small so the text column stays wide */
@media (max-width: 767px) {
  body {
    padding-top: 1rem;
  }

  .panel-background {
    padding: 1rem;
  }
}


/*------------------------------------------------
typography
------------------------------------------------*/

h1, h2, h3 {
  /* a darker shade of the link green */
  color: var(--heading);
  font-weight: 500;
  line-height: 1.1;
}

h1 {
	font-size: 1.3rem;
	margin:0;
  margin-bottom: 1.5rem;
	padding: 0;
}

/* more space above a heading than below, so it sits with the text it introduces */
h2 {
	font-size: 1.2rem;
	margin: 2.25rem 0 1.13rem 0.63rem;
	padding: 0;
}

h3 {
	font-size: 1.1rem;
	margin:0;
  margin-left: 0.31rem;
	padding: 0;
}

p {
	font-size: 1rem;
  margin: 0 1.25rem 1.25rem 1.25rem;
	text-align: justify;
}

p a {
  font-weight: 600;
  text-decoration: underline;
}

blockquote {
  border: none;
  color: var(--text-quiet);
  font-style: italic;
  margin: 1.25rem 6.25rem 1.25rem 4.38rem;
  padding: 0;
	text-align: justify;
}

blockquote p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  blockquote {
    margin-left: 2.5rem;
    margin-right: 1.88rem;
    text-align: center;
  }
}

.img-responsive {
  border-radius: 6px;
  display: block;
  height: auto;
  max-width: 100%;
}

.page-standard {
 height: auto;
 margin: 1.88rem auto 0 auto;
}

.content ul {
  margin-bottom: 10px;
  margin-left: 0.94rem;
  margin-top: -0.63rem;
}

.content ol {
  margin-bottom: 10px;
  margin-left: 0.94rem;
  margin-top: -0.63rem;
}

.content li {
	color: var(--text);
	font-size: 1rem;
	padding: 0.63rem 0.94rem;
}


/*------------------------------------------------
navigation
------------------------------------------------*/

.nav li {
	font-size: 1rem;
	padding: 0.5rem 0;
}

/* the navigation sheet stays in view while the article scrolls */
.nav .panel-background {
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  /* extra space on the left sets the short links nearer the middle of the sheet;
     the side padding is kept in variables so the current link's tint can use it */
  --nav-pad-left: 2.5rem;
  --nav-pad-right: 1rem;
  /* how far the current link's tint stops short of the sheet's edges */
  --nav-gap: 1rem;
  padding: 1.5rem var(--nav-pad-right) 1.5rem var(--nav-pad-left);
  position: sticky;
  top: 1.5rem;
}

.nav ul {
  list-style: none;
	margin: 0;
	padding: 0;
}

/* each link fills its row, stopping the same small gap short of the sheet's
   edge on both sides; the padding is taken back by the margins so the text
   stays in line */
.nav ul li a {
  border-radius: 4px;
  display: block;
  margin: -0.25rem calc(var(--nav-gap) - var(--nav-pad-right)) -0.25rem calc(var(--nav-gap) - var(--nav-pad-left));
  padding: 0.25rem max(0rem, calc(var(--nav-pad-right) - var(--nav-gap))) 0.25rem max(0rem, calc(var(--nav-pad-left) - var(--nav-gap)));
}

/* hovering or clicking keeps the link's green; a faint row shows instead,
   and the same row marks the link reached with the keyboard */
.nav ul li a:hover,
.nav ul li a:active {
  color: var(--link);
}

.nav ul li a:focus-visible {
  background: var(--nav-hover-bg);
}

/* only where there is a pointer, so the row does not stay lit after a tap */
@media (hover: hover) {
  .nav ul li a:hover {
    background: var(--nav-hover-bg);
  }
}

.center-image {
  text-align: center;
}

/* a light sepia tone warms the grayscale photos toward the sheet color,
   and a faint edge like the one on the sheets */
.img-responsive,
.photo-row img {
  border: 1px solid var(--edge);
  filter: var(--image-filter);
}

/* the cushion cut-outs have no background, so no edge to outline;
   in the dark theme they sit on a light card */
.img-responsive[src$="/zafu.png"],
.img-responsive[src$="/zafu-towel.png"] {
  background: var(--cutout-bg);
  border: none;
}

/* a row of four photos, as on the about page */
.photo-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.88rem;
}

.photo-row img {
  border-radius: 6px;
  display: block;
  height: auto;
  width: 100%;
}

/* phones: only the first and third photos, side by side */
@media (max-width: 767px) {
  .photo-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-row img:nth-child(even) {
    display: none;
  }
}

.caption{
  color: var(--text-quiet);
  font-size: 0.9rem;
	font-weight: 600;
  margin-bottom: 1.25rem;
  margin-top: 0.44rem;
  text-align: center;
}

/* the current page's link: a darker shade of the sheet behind its row */
#focal {
  background: var(--nav-current-bg);
  font-weight: 600;
}

/*------------------------------------------------
theme switch
------------------------------------------------*/

/* day and night: two small moons in the upper right corner of the window */
.theme-switch {
  align-items: center;
  display: flex;
  gap: 0.25rem;
  position: fixed;
  right: 15px;
  top: 0.15rem;
  z-index: 10;
}

/* with room beside the sheets, they come down level with the sheets' top edge */
@media (min-width: 1280px) {
  .theme-switch {
    right: 1rem;
    top: 1.25rem;
  }
}

.theme-switch button {
  background: none;
  border: none;
  cursor: pointer;
  line-height: 0;
  padding: 0.25rem;
}

/* the moons keep their own colors in both themes: day is paper, night is ink */
.theme-switch .moon {
  border: 1px solid #5f594e;
  border-radius: 50%;
  display: block;
  height: 0.7rem;
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.15s;
  width: 0.7rem;
}

.theme-switch .moon-light {
  background: #eeebe6;
}

.theme-switch .moon-dark {
  background: #33362f;
}

[data-theme="dark"] .theme-switch .moon {
  border-color: #cfc9bc;
}

/* the chosen moon is full strength and slightly larger */
.theme-switch button[aria-pressed='true'] .moon {
  opacity: 1;
  transform: scale(1.25);
}

.nav-toggle,
.nav-close,
.nav-overlay {
  display: none;
}

/* phones: a floating button opens the navigation as a drawer on the right */
@media (max-width: 767px) {
  /* room at the end of the page so the button does not sit on the last lines */
  .js body {
    padding-bottom: 5rem;
  }

  .js .nav-toggle {
    align-items: center;
    /* the sheet color, a few shades darker so it shows against the sheets */
    background: var(--button-bg);
    border: 1px solid var(--edge);
    border-radius: 50%;
    bottom: 1.25rem;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);
    color: var(--link);
    cursor: pointer;
    display: flex;
    height: 3rem;
    justify-content: center;
    position: fixed;
    right: 1.25rem;
    width: 3rem;
    z-index: 100;
  }

  .js .nav-overlay {
    background: rgb(0 0 0 / 0.4);
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.2s ease-out;
    z-index: 200;
  }

  .js .nav.open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  /* the navigation sheet becomes the drawer, parked off the right edge */
  .js .nav .panel-background {
    background: var(--sheet-color);
    border: none;
    border-radius: 0;
    bottom: 0;
    margin: 0;
    max-height: none;
    overflow-y: auto;
    --nav-pad-left: 1.75rem;
    --nav-pad-right: 1.5rem;
    --nav-gap: 0.5rem;
    padding: 1rem var(--nav-pad-right) 2rem var(--nav-pad-left);
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform 0.2s ease-out, visibility 0s 0.2s;
    visibility: hidden;
    width: min(75vw, 18rem);
    z-index: 201;
  }

  .js .nav.open .panel-background {
    transform: translateX(0);
    transition: transform 0.2s ease-out, visibility 0s;
    visibility: visible;
  }

  /* the theme switch sits in the drawer, level with the close button */
  .js .theme-switch {
    left: calc(100vw - min(75vw, 18rem) + 1.5rem);
    opacity: 0;
    pointer-events: none;
    right: auto;
    top: 1.35rem;
    transition: opacity 0.2s ease-out;
    z-index: 202;
  }

  .js .nav.open .theme-switch {
    opacity: 1;
    pointer-events: auto;
  }

  .js .theme-switch button {
    padding: 0.5rem;
  }

  .js .nav-close {
    background: none;
    border: none;
    color: var(--text-quiet);
    cursor: pointer;
    display: flex;
    margin: 0 -0.5rem 0.5rem auto;
    padding: 0.5rem;
  }

  .js .nav ul li {
    margin-bottom: 0;
    padding: 0;
    text-align: left;
  }

  /* taller rows in the drawer, for fingers */
  .js .nav ul li a {
    margin-block: 0;
    padding-block: 0.65rem;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .js .nav-overlay,
  .js .nav .panel-background,
  .js .nav.open .panel-background {
    transition: none;
  }
}

@media (max-width: 768px) {
  .nav .panel-background {
    --nav-pad-left: 1rem;
    --nav-pad-right: 1rem;
    --nav-gap: 0.5rem;
    max-height: none;
    padding: 0.5rem 1rem;
    position: static;
  }

  .nav ul li {
    margin-bottom: 1.88rem;
    text-align: center;
  }

  .nav ul li:last-child {
    margin-bottom: 0;
  }
}

/*------------------------------------------------
sources
------------------------------------------------*/

.sources {
  margin-left: 1.25rem;
  padding: 0;
}
