/* Basic styles. Phone layout first; the media query at the bottom
   adds the two-column home page on wider screens. */

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.6;
   color: #1c1b1a;      /* soft ink black (#222 reverts to black) */
  background: #fff; /* warm off-white paper (#fff is white if want to revert) */;
}

img { max-width: 100%; height: auto; }

a { color: #1a4fd6; }

/* Page width and side margins */
.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
}

/* Header and footer */
.site-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
.site-header .name { font-weight: bold; color: #222; text-decoration: none; }

.site-footer { margin-top: 3rem; color: #666; font-size: .9rem; }

/* Small grey headings like "Writing" */
.label { font-size: .85rem; text-transform: uppercase; color: #666; }

/* ---------- Home page ---------- */

/* On phones the blocks simply stack in the order they appear in the HTML */
.layout { display: grid; gap: 2rem; }

.portrait {
  width: 200px;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin-bottom: 1.5rem;
 }

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

.project-list { list-style: none; padding: 0; }
.project-list li { border-bottom: 1px solid #ddd; padding: 1rem 0; }
.project-list a { color: #222; text-decoration: none; }
.project-list h3 { margin: 0; }
.project-list .status { color: #666; }
.project-list .kind { display: block; color: #666; }

/* ---------- Manuscript pages ---------- */

.tagline { font-style: italic; color: #666; }

.facts dt { font-size: .85rem; text-transform: uppercase; color: #666; }
.facts dd { margin: 0 0 .75rem; }

.excerpt p { font-style: italic; }

.pager {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #ddd;
  margin-top: 2rem;
  padding-top: 1rem;
}
.pager .next { margin-left: auto; }

/* ---------- Wider screens ---------- */

/* Mobile: wrappers disappear, sections stack in this order.
   Needs .layout to be display: grid or flex at all widths. */
.col { display: contents; }
.who   { order: 1; }
.bio   { order: 2; }
.links { order: 3; }
.work  { order: 4; }

@media (min-width: 760px) {
  .layout {
    grid-template-columns: 15rem 1fr;
    align-items: start;
  }
  .col {
    display: flex;
    flex-direction: column;
    gap: inherit;
  }
}

.text-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.book-title {
  font-family: Georgia, serif;
  font-size: 1.4rem;
  font-weight: normal;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

a, .text-btn {
  color: #881337;
  text-decoration-color: rgba(139, 38, 53, 0.35);
  text-underline-offset: 3px;
}

a:hover, .text-btn:hover {
  color: #be123c; /* noticeably brighter crimson */
  text-decoration-color: #be123c;
  text-decoration-thickness: 2px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

/* Mobile: nav is a popover dropdown */
#nav {
  margin: 0;
  inset: 3.5rem 0 auto auto;   /* top right, under header */
  padding: 1rem;
  border: 1px solid #ccc;
}
#nav:popover-open {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.burger {
  background: none;
  border: none;
  padding: .25rem;
  font: inherit;
  font-size: 1.75rem;   /* size of the ☰ */
  line-height: 1;
  color: inherit;
  cursor: pointer;
  margin-left: auto;
}
.burger { display: flex; flex-direction: column; gap: 5px; }
.burger span { width: 24px; height: 2px; background: currentColor; }

#nav a[aria-current="page"] { font-weight: bold; }

/* Desktop: kill the burger, show nav inline */
@media (min-width: 900px) {
  .burger { display: none; }



  #nav {
    display: flex;          /* overrides UA's :not(:popover-open){display:none} */
    position: static;
    inset: auto;
    border: 0;
    padding: 0;
    background: none;
    overflow: visible;
    gap: 1.5rem;
    margin-left: auto;
  }
}

.project-page {
  max-width: 960px;
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

.project-header {
  margin-bottom: 2rem;
}

.project-header .book-title {
  font-size: 2rem;
  margin: 0 0 0.35rem 0;
}

/* Mobile default: image stacks cleanly over text */
.project-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

.project-cover {
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: 4px;
  display: block;
}

.project-text p:first-child {
  margin-top: 0;
}

/* Desktop (>= 760px): image on left, text on right */
@media (min-width: 760px) {
  .project-body {
    grid-template-columns: 240px 1fr;
    gap: 3.5rem;
  }
}

.page-title {
  font-size: 2.75rem;
  line-height: 1.1;
}