@font-face { font-family: "Bitter"; src: url("/assets/fonts/bitter.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4.woff2") format("woff2-variations"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4-italic.woff2") format("woff2-variations"); font-weight: 200 900; font-style: italic; font-display: swap; }

/* Colours --ink, --accent and --wash are set per group from group.yaml */
:root {
  --paper: #ffffff;
  --text: #24233a;
  --text-soft: #55546b;
  --rule: #dcd9e6;
  --wide: 62rem;
  --measure: 36rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  font-optical-sizing: auto;
  font-size: 1.1875rem;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: "Bitter", Georgia, serif; color: var(--ink); line-height: 1.2; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--paper); padding: 0.5rem 0.75rem; z-index: 3; }
.skip:focus { top: 1rem; }

.preview-bar {
  background: var(--ink); color: #fff; text-align: center;
  font-size: 0.875rem; padding: 0.4rem 1rem;
}

/* Masthead */
.masthead {
  max-width: var(--wide); margin: 0 auto;
  padding: 1rem 1rem 0.5rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem;
}
.masthead__logo img { width: clamp(120px, 18vw, 160px); }
.masthead__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.masthead__nav a {
  font-family: "Bitter", Georgia, serif; font-weight: 500; font-size: 1.0625rem;
  text-decoration: none; color: var(--ink); padding: 0.25rem 0; border-bottom: 2px solid transparent;
}
.masthead__nav a:hover { border-bottom-color: var(--accent); color: var(--ink); }

/* Welcome */
.welcome { max-width: var(--wide); margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) 1rem clamp(2.5rem, 6vw, 4rem); }
.welcome__heading { margin: 0 0 1.25rem; font-size: clamp(2.25rem, 6vw, 3.5rem); font-weight: 600; max-width: 18ch; }
.welcome__intro { margin: 0; max-width: var(--measure); font-size: clamp(1.25rem, 2.4vw, 1.4375rem); line-height: 1.55; }

/* Book shelf */
.shelf { background: var(--wash); padding: clamp(2.5rem, 6vw, 4.5rem) 1rem; }
.shelf__inner, .members-books { max-width: var(--wide); margin: 0 auto; }
.section-heading { margin: 0 0 2rem; font-size: 1.75rem; font-weight: 600; }

.book {
  display: grid; grid-template-columns: minmax(9rem, 15rem) 1fr; gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start; padding: 0 0 clamp(2.5rem, 5vw, 3.5rem);
}
.book + .book { border-top: 1px solid var(--rule); padding-top: clamp(2.5rem, 5vw, 3.5rem); }
.book__cover img, .book__cover-empty {
  width: 100%;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 0 1px 2px rgba(20, 18, 50, 0.25), 0 10px 24px -8px rgba(20, 18, 50, 0.35);
}
/* the hinge of a paperback, catching the light */
.book__cover { position: relative; }
.book__cover:not(:has(.book__cover-empty))::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 7%;
  background: linear-gradient(90deg, rgba(0,0,0,0.12), rgba(255,255,255,0.18) 40%, rgba(0,0,0,0.04));
  border-radius: 2px 0 0 2px; pointer-events: none;
}
.book__title { margin: 0 0 0.75rem; font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 600; }
.book__subtitle { display: block; font-size: 0.6em; font-weight: 400; color: var(--text-soft); margin-top: 0.3rem; }
.book__author { margin: -0.5rem 0 0.75rem; color: var(--text-soft); }
.book__lead { font-size: 1.25rem; font-style: italic; }
.book__text p { margin: 0 0 0.9rem; max-width: var(--measure); }
.book__meta { color: var(--text-soft); font-size: 1rem; }
.book__buy { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.button {
  display: inline-block; font-family: "Bitter", Georgia, serif; font-weight: 600; font-size: 1rem;
  padding: 0.7rem 1.2rem; border-radius: 4px; text-decoration: none;
  border: 2px solid var(--ink); color: var(--ink); background: transparent;
}
.button:hover { border-color: var(--accent); color: var(--accent); }
.button--primary { background: var(--ink); color: #fff; }
.button--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* A book the group still has to supply details for (preview only) */
.book__cover-empty {
  display: grid; place-items: center;
  border: 2px dashed var(--rule); box-shadow: none; background: rgba(255,255,255,0.6);
  color: var(--text-soft); font-size: 0.9375rem;
}
.book--placeholder .book__title { color: var(--text-soft); }
.book__note { color: var(--text-soft); font-style: italic; }
/* Text written for the group that they have not yet signed off (preview only) */
.book__draft { border-left: 4px solid var(--accent); padding: 0.25rem 0 0.25rem 1.25rem; margin: 0 0 1rem; }
.book__draft-label {
  display: inline-block; margin: 0 0 0.75rem !important;
  font-family: "Bitter", Georgia, serif; font-size: 0.875rem; font-weight: 600;
  color: var(--accent); background: #fff; border: 1px solid var(--accent); border-radius: 3px; padding: 0.15rem 0.5rem;
}

/* Charity */
.charity { max-width: var(--wide); margin: 0 auto; padding: 2rem 1rem; border-bottom: 1px solid var(--rule); }
.charity p { margin: 0; max-width: 44rem; }

.members-books { padding: clamp(2.5rem, 6vw, 4rem) 1rem 1rem; }

/* Footer */
.footer { background: var(--ink); color: #fff; margin-top: 3rem; }
.footer__inner { max-width: var(--wide); margin: 0 auto; padding: 2.5rem 1rem; }
.footer a { color: #fff; }
.footer a:hover { color: #ffd9df; }
.footer__invite { margin: 0 0 1rem; font-size: 1.25rem; }
.footer__small { margin: 0; font-size: 0.9375rem; opacity: 0.8; }
.footer :focus-visible { outline-color: #fff; }

@media (max-width: 40rem) {
  .book { grid-template-columns: 1fr; }
  .book__cover { max-width: 13rem; }
  .masthead { justify-content: center; text-align: center; }
  .masthead__nav ul { justify-content: center; }
}

/* Current page in the menu */
.masthead__nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Inner pages */
.page-head { max-width: var(--wide); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) 1rem clamp(1.5rem, 4vw, 2.5rem); }
.page-head__title { margin: 0 0 1rem; font-size: clamp(2.25rem, 6vw, 3.25rem); font-weight: 600; }
.page-head__intro { margin: 0; max-width: var(--measure); color: var(--text-soft); }

.prose { max-width: var(--wide); margin: 0 auto; padding: 0 1rem 2.5rem; }
.prose p { max-width: var(--measure); margin: 0 0 1.1rem; }
.prose__lead { font-size: clamp(1.25rem, 2.4vw, 1.4375rem); line-height: 1.55; }
.prose__links { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.section-heading--small { font-size: 1.375rem; margin: 2.5rem 0 0.75rem; }
.contact__email { font-size: 1.375rem; }
.contact__social { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; }

/* Book contents and forewords (books page) */
.book__subhead { font-family: "Bitter", Georgia, serif; color: var(--ink); font-size: 1.125rem; font-weight: 600; margin: 2rem 0 0.5rem; }
.book__contents { margin: 0; padding-left: 1.6rem; max-width: var(--measure); }
.book__contents li { margin: 0 0 0.25rem; }
.book__story { font-style: italic; }
.book__story-author { color: var(--text-soft); }
.book__story-author::before { content: "by "; }
.book__contributors { max-width: var(--measure); }
.book__more { margin-top: 1rem; font-size: 1rem; }
.book__foreword { margin-top: 1.5rem; max-width: var(--measure); border-top: 1px solid var(--rule); padding-top: 1rem; }
.book__foreword summary {
  cursor: pointer; font-family: "Bitter", Georgia, serif; font-weight: 600; color: var(--ink);
  list-style-position: outside;
}
.book__foreword summary:hover { color: var(--accent); }
.book__foreword[open] summary { margin-bottom: 1rem; }
.book__foreword p { font-size: 1.0625rem; }

/* Floating "Follow us" panel */
.follow {
  position: fixed; z-index: 40; right: 0; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 1.1rem 0.65rem 0.9rem; background: rgba(250, 249, 253, 0.96);
  border: 1px solid var(--rule); border-right: 0; border-bottom: 3px solid color-mix(in srgb, var(--ink) 35%, #c9b8e8);
  border-radius: 14px 0 0 14px; box-shadow: -2px 4px 18px rgba(38, 36, 87, 0.08);
}
.follow__label {
  margin: 0 0 0.35rem; writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.6875rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink);
}
.follow__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.follow__link {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 10px;
  background: #fff; border: 1px solid var(--rule); color: var(--ink); box-shadow: 0 1px 2px rgba(38, 36, 87, 0.06);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.follow__link:hover, .follow__link:focus-visible { color: var(--accent); border-color: var(--accent); transform: translateX(-2px); }
/* Phones: no spare margin, so the panel becomes a row just above the footer. */
@media (max-width: 48rem) {
  .follow {
    position: static; transform: none; flex-direction: row; justify-content: center; gap: 1rem;
    margin: 2rem 1rem 0; padding: 0.75rem 1rem; border: 1px solid var(--rule); border-bottom-width: 3px; border-radius: 14px; box-shadow: none;
  }
  .follow__label { writing-mode: horizontal-tb; transform: none; margin: 0 0.25rem 0 0; }
  .follow__list { flex-direction: row; }
}
@media print { .follow { display: none; } }

/* Fourth collection page */
.page-head__subtitle { margin: -0.25rem 0 0; font-family: "Bitter", Georgia, serif; font-size: clamp(1.25rem, 3vw, 1.625rem); color: var(--ink); line-height: 1.3; }
.fourth__notice {
  display: inline-block; margin: 0 0 2rem !important; padding: 0.75rem 1.25rem; max-width: var(--measure);
  background: #111; color: #fff; font-weight: 700; font-size: 1.125rem; letter-spacing: 0.01em; border-radius: 4px;
}
.fourth__dates { margin: 0 0 2.25rem; padding: 0; max-width: var(--measure); border-top: 1px solid var(--rule); }
.fourth__date { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.25rem 1.5rem; padding: 0.85rem 0; border-bottom: 1px solid var(--rule); }
.fourth__date dt { color: var(--text-soft); }
.fourth__date dd { margin: 0; font-weight: 700; color: var(--ink); }
@media (max-width: 34rem) { .fourth__date { grid-template-columns: 1fr; } }
.fourth__guidelines { max-width: var(--measure); margin: 0 0 2rem; padding-left: 1.3rem; }
.fourth__guidelines li { margin: 0 0 0.6rem; }
.footer__feature { margin: 0 0 1.25rem; font-family: "Bitter", Georgia, serif; font-size: 1.125rem; font-weight: 600; }
.footer__feature a { text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

/* About page: everyone in the group */
.members { max-width: var(--wide); margin: 0 auto; padding: 0.5rem 1rem 3rem; }
.members__intro { max-width: var(--measure); margin: 0 0 1.75rem; color: var(--text-soft); }
.members__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 1.75rem 1.25rem; }
.member { text-align: center; }
.member__link { display: block; color: inherit; text-decoration: none; }
.member__link:hover .member__name { color: var(--accent); text-decoration: underline; }
.member__photo { display: block; width: 6rem; height: 6rem; margin: 0 auto 0.6rem; border-radius: 50%; object-fit: cover; }
.member__photo--empty {
  display: grid; place-items: center; background: var(--wash); border: 2px dashed var(--rule);
  font-family: "Bitter", Georgia, serif; font-size: 2rem; color: var(--text-soft);
}
.member__name { display: block; font-size: 1rem; line-height: 1.3; }
@media (max-width: 30rem) {
  .members__list { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
  .member__photo { width: 4.75rem; height: 4.75rem; }
}

/* Writers */
.writers { max-width: var(--wide); margin: 0 auto; padding: 0 1rem 2rem; }
.writers__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: 2.5rem 3rem; }
.writer { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.25rem; align-items: start; }
.writer__photo { width: 7.5rem; height: 7.5rem; border-radius: 50%; object-fit: cover; }
.writer__photo--empty {
  display: grid; place-items: center; background: var(--wash); border: 2px dashed var(--rule);
  font-family: "Bitter", Georgia, serif; font-size: 2.5rem; color: var(--text-soft);
}
.writer__name { margin: 0.25rem 0 0.5rem; font-size: 1.375rem; font-weight: 600; }
.writer__text p { margin: 0 0 0.75rem; font-size: 1.0625rem; }
.writer__books { list-style: none; margin: 0; padding: 0.75rem 0 0; border-top: 1px solid var(--rule); font-size: 0.9375rem; color: var(--text-soft); }
.writer__books li { margin: 0 0 0.3rem; }
.writer--to-come .writer__name { color: var(--text-soft); }
.writers__credit { margin: 3rem 0 0; font-size: 0.9375rem; color: var(--text-soft); }

@media (max-width: 30rem) {
  .writer { grid-template-columns: 5rem 1fr; }
  .writer__photo { width: 5rem; height: 5rem; }
}

/* Book titles link to their own page */
.book__title a { color: inherit; text-decoration: none; }
.book__title a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; }

/* Books drop-down in the menu: opens on hover or keyboard focus */
.has-sub { position: relative; }
.sub {
  position: absolute; right: -1rem; top: 100%; z-index: 5;
  list-style: none; margin: 0; padding: 0.5rem 0;
  min-width: 22rem; background: var(--paper);
  border: 1px solid var(--rule); border-radius: 4px;
  box-shadow: 0 12px 28px -10px rgba(20, 18, 50, 0.3);
  display: none;
}
.masthead__nav .sub { display: none; flex-direction: column; gap: 0; }
.masthead__nav .has-sub:hover .sub, .masthead__nav .has-sub:focus-within .sub { display: block; }
.masthead__nav .sub a {
  display: block; padding: 0.5rem 1rem; border-bottom: 0;
  font-weight: 400; font-size: 1rem; line-height: 1.35;
}
.masthead__nav .sub a:hover, .masthead__nav .sub a[aria-current="page"] { background: var(--wash); color: var(--ink); }
.masthead__nav .sub a[aria-current="page"] { font-weight: 600; }
/* a hover bridge so the menu doesn't close in the gap below "Books" */
.has-sub::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 0.6rem; }
@media (hover: none), (max-width: 40rem) {
  .sub { display: none !important; }   /* on phones, "Books" opens the books page instead */
}

/* An individual book's page */
.crumbs { max-width: var(--wide); margin: 0 auto; padding: 1.5rem 1rem 0; font-size: 1rem; }
.crumbs a::before { content: "‹ "; }
.book-page {
  max-width: var(--wide); margin: 0 auto; padding: 1.5rem 1rem 3rem;
  display: grid; grid-template-columns: minmax(12rem, 20rem) 1fr; gap: clamp(1.5rem, 5vw, 3.5rem); align-items: start;
}
.book-page__cover { position: sticky; top: 1.5rem; }
.book-page__cover img, .book-page__cover .book__cover-empty {
  width: 100%; border-radius: 2px 4px 4px 2px;
  box-shadow: 0 1px 2px rgba(20, 18, 50, 0.25), 0 14px 30px -10px rgba(20, 18, 50, 0.4);
}
.book-page__title { margin: 0 0 1rem; font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 600; }
.book-page__text > p, .book-page__text .book__draft p { max-width: var(--measure); margin: 0 0 1rem; }
.book-page__subhead { margin: 2.5rem 0 0.75rem; font-size: 1.375rem; font-weight: 600; }
.book-page__foreword { max-width: var(--measure); padding-left: 1.25rem; border-left: 3px solid var(--wash); }
.book-page__foreword p { margin: 0 0 1rem; font-size: 1.0625rem; }
.book-page__foreword-by { font-style: italic; color: var(--text-soft); }
.book-page__charity { margin-top: 2.5rem !important; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--text-soft); }
@media (max-width: 40rem) {
  .book-page { grid-template-columns: 1fr; }
  .book-page__cover { position: static; max-width: 14rem; }
}

.privacy__updated { font-size: 0.9375rem; color: #5a5470; }

/* Things still to come (e.g. writers without a bio): hidden on the public site, shown in edit mode. */
html:not(.edit-mode) .review-only { display: none; }

/* The footer's "Edit" link is pointless when already editing. */
html.edit-mode .footer__edit { display: none; }
