/*
 * Inside Books Project — site styles.
 *
 * Colours, fonts and sizes match the Squarespace site as of November 2026.
 * Desktop layout uses a 24-column grid (like Squarespace); each block sets
 * its columns with an inline style, e.g. style="--col: 3 / span 11".
 * Below 768px everything stacks in one column.
 */

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */

@font-face {
  font-family: "Anton";
  src: url("../fonts/anton-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Epilogue";
  src: url("../fonts/epilogue.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Epilogue";
  src: url("../fonts/epilogue-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --black: #0d0d0d;
  --ink: #191a1a;
  --peach: #facf9f;
  --orange: #ff6123;
  --paper: #fafaf9;

  --gutter: 4vw;            /* page side margin */
  --col-gap: 9.6px;         /* gap between the 24 grid columns */
  --header-h: 98px;
  --divider-h: 6vw;         /* height of the slanted section edge */

  --font-body: "Epilogue", system-ui, sans-serif;
  --font-head: "Anton", Impact, "Arial Narrow", sans-serif;

  /* Fluid type: mobile size at 390px wide, desktop size at 1440px. */
  --h1: clamp(48.4px, calc(48.4px + (100vw - 390px) * 0.017143), 66.4px);
  --h2: clamp(35.44px, calc(35.44px + (100vw - 390px) * 0.010286), 46.24px);
  --h3: clamp(28.96px, calc(28.96px + (100vw - 390px) * 0.006857), 36.16px);
  --h4: clamp(22.48px, calc(22.48px + (100vw - 390px) * 0.003429), 26.08px);
  --lead: clamp(20.32px, calc(20.32px + (100vw - 390px) * 0.002286), 22.72px);
  --small: 14.272px;
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--black);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, .h1, .h2, .h3, .h4, .list-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--heading, inherit);
}
h1, .h1 { font-size: var(--h1); line-height: 1.056; }
h2, .h2 { font-size: var(--h2); line-height: 1.1136; }
h3, .h3 { font-size: var(--h3); line-height: 1.1424; }
h4, .h4 { font-size: var(--h4); line-height: 1.1712; }

p { margin: 16px 0; }
p:first-child { margin-top: 0; }
p:last-child { margin-bottom: 0; }

.lead { font-size: var(--lead); line-height: 1.5; color: var(--lead-color, inherit); }
.small { font-size: var(--small); line-height: 1.5; }

a { color: var(--link, var(--orange)); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { opacity: 0.8; }

ul { margin: 16px 0; padding-left: 40px; }
li { margin: 0 0 8px; padding-left: 0; }
li:last-child { margin-bottom: 0; }
li::marker { font-size: 0.8em; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  padding: 8px 16px; background: var(--paper); color: var(--ink);
}
.skip-link:focus { top: 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 24px 35.2px;
  border: 2px solid var(--paper);
  background: var(--orange);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 17px;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn:hover { opacity: 0.8; }
.btn--dark { background: var(--ink); }
.btn--small { padding: 22.4px 32px; font-size: 14.272px; line-height: 17px; }

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 20;
  background: var(--black);
  color: var(--paper);
}
.header-bar {
  position: relative;
  z-index: 11;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  padding: 0 var(--gutter);
}
.header-nav { display: flex; gap: 0 24px; flex-wrap: wrap; }
.header-nav a,
.mobile-menu nav a {
  color: var(--paper);
  text-decoration: none;
  padding: 1.6px 0;
}
.header-nav a[aria-current="page"],
.header-nav a:hover { text-decoration: underline; text-underline-offset: 6px; opacity: 1; }
.header-logo { justify-self: center; }
.header-logo img { width: 448px; max-width: 100%; height: auto; }
.header-cta { justify-self: end; }

.burger {
  display: none;
  justify-self: end;
  width: 36px; height: 36px;
  padding: 0; border: 0; background: none; cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute; left: 4px; right: 4px; height: 1px; background: var(--paper);
  transition: transform 0.2s;
}
.burger span:first-child { top: 13px; }
.burger span:last-child { top: 22px; }
.burger[aria-expanded="true"] span:first-child { top: 18px; transform: rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { top: 18px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--header-h) + 26vh) 6vw 23px;
  background: var(--black);
}
.mobile-menu[hidden] { display: none; }
.mobile-menu nav { display: flex; flex-direction: column; align-items: center; gap: 21px; }
.mobile-menu nav a { font-size: 33.15px; line-height: 1; }
.mobile-menu .btn { width: 210px; padding: 26px 0; border-color: var(--orange); font-size: 19.2px; }
body.menu-open { overflow: hidden; }
body.menu-open .site-header { position: fixed; inset: 0 0 auto 0; }

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: var(--pt, 87px) var(--gutter) var(--pb, 87px);
  background: var(--bg);
  color: var(--text);
  --link: var(--orange);
}
.theme-black  { --bg: var(--black);  --text: var(--paper); --heading: var(--paper); }
.theme-peach  { --bg: var(--peach);  --text: var(--black); --heading: var(--ink); --lead-color: var(--black); }
.theme-orange { --bg: var(--orange); --text: var(--paper); --heading: var(--paper); --link: var(--paper); }
.theme-white  { --bg: var(--paper);  --text: var(--ink);   --heading: var(--ink); --lead-color: var(--black); }
.theme-white-bold { --bg: var(--paper); --text: var(--black); --heading: var(--orange); }
.theme-white h4, .theme-peach h4 { color: var(--black); }

/* Full-bleed photo behind a section, darkened like Squarespace's overlay. */
.section-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
}
.section-bg img { width: 100%; height: 100%; object-fit: cover; }
.section-bg::after {
  content: ""; position: absolute; inset: 0;
  background: var(--black); opacity: var(--overlay, 0.75);
}
.section > :not(.section-bg) { position: relative; z-index: 1; }

/* Slanted bottom edge with an orange stroke. Set --next to the colour of
   the section below. */
.has-divider { padding-bottom: calc(var(--pb, 47px) + var(--divider-h)); }
.has-divider::before,
.has-divider::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  height: var(--divider-h);
}
.has-divider::before {
  background: var(--orange);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.has-divider::after {
  background: var(--next);
  clip-path: polygon(0 6px, 100% calc(100% + 6px), 100% 100%, 0 100%);
}
.has-divider + * { margin-top: 0; }

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: start;
}
.grid > * { grid-column: 1 / -1; min-width: 0; margin-top: 0; margin-bottom: 0; }
@media (min-width: 768px) {
  .grid > [style*="--col"] { grid-column: var(--col); }
  .grid > [style*="--row"] { grid-row: var(--row); }
}
.align-center { align-self: center; }
.align-end { align-self: end; }
.text-center { text-align: center; }
.justify-end { justify-self: end; }

/* ---------- Shared blocks ---------- */

/* Big page titles scale with the viewport, like Squarespace's "fit text". */
.page-title { font-size: var(--title-d); line-height: 1; }
@media (max-width: 767px) { .page-title { font-size: var(--title-m); } }

.quote h3 { margin: 0; }
.quote .attribution { margin: 0; }

/* Two cards with a centred title (volunteer sign-up, where to donate). */
.list-title { font-size: var(--h2); line-height: 1.5; text-align: center; }
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--cards-gap, 20px);
  margin: var(--cards-mt, 70px) 0 0;
  padding: 0;
  list-style: none;
}
.cards > li { margin: 0; padding: 0 var(--card-pad, 81px); text-align: center; }
.cards h2 { font-size: var(--card-h, 26.08px); line-height: 1.1136; }
.cards .card-body { margin-top: var(--card-gap, 39px); }
.cards .btn { margin-top: 40px; }


/* Donut charts (Donate Funds page). Edit the --a / --b ... percentages. */
.chart { position: relative; margin-top: 70px; }
.chart + h4 { margin-top: 54px; }
.chart-legend {
  position: absolute; top: 0; left: 15px; z-index: 1;
  margin: 0; padding: 0; list-style: none;
}
.chart-legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.chart-legend li::before { content: ""; width: 10px; height: 10px; background: var(--swatch); }
.donut {
  width: 356px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, transparent 59.2%, #000 59.8%);
          mask: radial-gradient(closest-side, transparent 59.2%, #000 59.8%);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 48px var(--gutter) 57px;
  background: var(--black);
  color: var(--paper);
  border-bottom: 3px solid var(--orange);
}
.footer-grid { row-gap: 0; }
.footer-logo img { width: 186px; margin: 0 auto; }
.site-footer h2 { font-size: var(--h3); line-height: 1.2; margin-bottom: 16px; }
.footer-contact h2 { margin-bottom: 32px; }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.newsletter-form input {
  width: 284px; max-width: 100%;
  padding: 22.4px 32px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff; color: #000;
  font: 16px/19.2px var(--font-body);
}
.newsletter-form input::placeholder { color: rgba(0, 0, 0, 0.45); }
.newsletter-form .btn { padding: 22.4px 32px; line-height: 19.2px; }
.newsletter-status { margin: 16px 0 0; }
.privacy { margin-top: 40px; }
.social { display: flex; gap: 10px; margin: 52px 0 0; padding: 0; list-style: none; }
.social li { margin: 0; }
.social a {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border: 1.5px solid var(--paper);
  color: var(--paper);
}
.social svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Page-specific spacing ---------- */

.btn-row { margin-top: 29px; }

/* Home */
.get-involved .card { margin-top: 50px; }
.get-involved h3 + p { margin-top: 38px; }
.home-cta .btn-row { margin-top: 12px; }

/* Page heroes (Volunteer, Donate Books, Donate Funds) */
.page-hero h4 { margin-top: 28px; }
.hero--books h4 { margin-top: 46px; }
.page-hero .page-title { white-space: nowrap; }
.side-photo { width: 100%; object-fit: cover; }
.page-hero .hero-side { margin-top: 40px; }
.page-hero .hero-side--top { margin-top: 0; }
.page-hero .hero-side--top h4 { margin-top: 0; }
.page-hero .hero-side--top p { margin-top: 11px; }

/* About */
.about-hero .page-title { line-height: 1; }
.about-text { margin-top: 69px; }
.about-photo {
  margin: calc(-1 * var(--pt)) calc(-1 * var(--gutter)) calc(-1 * var(--pb)) 0;
  align-self: stretch;
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
/* Gallery: three columns on desktop, two balanced columns on phones. */
.gallery { display: flex; gap: 66px; }
.gallery-col { flex: 1; min-width: 0; }
.gallery-col img { margin-bottom: 66px; }

/* Volunteer */
.more-info { margin-top: 59px; }

/* Donate Books */
.what-to-donate .wishlist { margin: 0; }
.what-to-donate .lists,
.what-to-donate .side-photo { margin-top: 11px; }
.what-to-donate .lists ul { margin-top: 18px; }
.what-to-donate .no-need { margin-top: 59px; }
.what-to-donate .no-need + p { margin-top: 10px; }
.cards .card-body.small p { margin: 16px 0; }
.cards .card-body.small p:first-child { margin-top: 0; }
.where-to-donate .cards a { color: inherit; }

/* Donate Funds */
.methods .method + .method { margin-top: 56px; }
.methods h4 + p { margin-top: 31px; }
.paypal-form { margin-top: 16px; }
.paypal-form select { font: 16px var(--font-body); max-width: 100%; }
.paypal-form input[type="image"] { display: block; margin-top: 4px; }
.donations-help h2 + p { margin-top: 31px; }
.charts { margin-right: calc(-1 * var(--gutter)); }
.charts .chart { margin: 72px 0 0; }
.charts .chart + h4 { margin-top: 57px; }

/* Resources */
.resources .by-mail,
.resources .download { margin-top: 101px; }
.resources .btn-row { margin-top: 31px; }
.resources .updated { margin-top: 11px; }
.resources .thanks { margin-top: 76px; }

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  :root { --gutter: 6vw; --header-h: 84px; --small: 14.92px; }

  .header-bar { grid-template-columns: 1fr auto; }
  .header-nav, .header-cta { display: none; }
  .header-logo { justify-self: start; }
  .header-logo img { width: 283px; }
  .burger { display: block; }

  .section { padding-top: var(--pt-m, var(--pt)); padding-bottom: var(--pb-m, var(--pb)); }
  .has-divider { padding-bottom: calc(var(--pb-m, var(--pb)) + var(--divider-h)); }

  /* Stacked blocks: default gap, then per-page tweaks. */
  .grid > * + * { margin-top: 46px; }

  /* Home */
  .home-hero .btn-row { margin-top: 35px; }
  .get-involved h3 + p { margin-top: 24px; }
  .get-involved .card + .card { margin-top: 63px; }
  .home-cta .btn-row { margin-top: 19px; }

  /* Page heroes */
  .page-hero h4 { margin-top: 13px; }
  .hero--volunteer h4 { margin-top: 23px; }
  .page-hero .grid > .hero-side { margin-top: 11px; }
  .page-hero .grid > .hero-side--top { margin-top: 40px; }
  .page-hero .hero-side--top p { margin-top: 43px; }

  /* About */
  .about-hero .grid > .about-photo { margin: 27px 0 0; }
  .about-hero .grid > .about-text { margin-top: 11px; }
  .about-photo img { aspect-ratio: 343 / 304; }
  .gallery { display: block; columns: 2; column-gap: 5px; }
  .gallery-col { display: contents; }
  .gallery-col img { margin-bottom: 5px; break-inside: avoid; }

  /* Cards (Volunteer, Donate Books) */
  .list-title { margin: 0 calc(16px - var(--gutter)); }
  .cards { grid-template-columns: 1fr; gap: 20px; }
  .cards > li { padding: 0 37px; }
  .cards h2 { font-size: var(--card-h-m, 22.48px); }
  .cards .card-body { margin-top: 22px; }
  .cards .btn { margin-top: 22px; }
  .btn--small { font-size: 14.92px; }
  .where-to-donate .cards { gap: 99px; }

  /* Volunteer */
  .more-info { margin-top: 15px; }
  .grid > .side-photo { margin-top: 11px; aspect-ratio: 343 / 199 !important; }

  /* Donate Books */
  .what-to-donate .grid > h3 { order: 0; }
  .what-to-donate .grid > .side-photo { order: 1; margin-top: 37px; }
  .what-to-donate .grid > .lists { order: 2; margin-top: 46px; }
  .what-to-donate .grid > .wishlist { order: 3; justify-self: start; margin-top: 16px; }
  .what-to-donate .no-need { margin-top: 54px; }

  /* Donate Funds */
  .ways-to-give .grid > .methods { margin-top: 66px; }
  .grid > .charts { margin: 46px 0 0; }
  .charts .chart { margin-top: 24px; }
  .chart { display: flex; flex-direction: column-reverse; }
  .chart-legend { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 24px; }
  .donut { width: 236px; }

  /* Resources */
  .resources .grid > .intro { margin-top: 22px; }
  .resources .grid > .download { order: 1; margin-top: 27px; }
  .resources .grid > .by-mail { order: 2; margin-top: 48px; }
  .resources .grid > .thanks { order: 3; margin-top: 46px; }
  .resources .btn-row { margin-top: 33px; }

  /* Quotes */
  .quote .grid > .attribution { margin-top: 12px; }

  /* Footer */
  .site-footer { padding: 30px var(--gutter) 93px; }
  .footer-grid.grid > * + * { margin-top: 0; }
  .footer-logo img { width: 199px; }
  .footer-contact { order: 1; margin-top: 46px !important; }
  .footer-subscribe { order: 2; margin-top: 34px !important; }
  .footer-contact h2 { margin-bottom: 32px; }
  .footer-contact .social { margin-top: 3px; }
  .newsletter-form { flex-direction: column; align-items: flex-start; gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
