/* Layout modelled on ali-hudhaify / al-badr.net / binbaz.org.sa:
   patterned deep-green page, masthead with arabesque ornament & sage plaque,
   folder-tab navigation standing on a light framed sheet, green gradient-headed
   boxes, three-column home grid, Kufi headings with Naskh reading text. */

:root {
  --primary: #1f6b45;
  --primary-dark: #16523a;
  --primary-soft: #e7f2eb;
  --ink: #0d2a1c;
  --accent: #4f8a35;
  --accent-dark: #3b6b27;
  --gold: #4f8a35;
  --bg: #f5f8f6;
  --card: #ffffff;
  --border: #e1e9e4;
  --border-strong: #cfdcd4;
  --text: #1f2823;
  --muted: #3f4b44;
  --heading: #12261b;
  --link: #1f6b45;
  --link-hover: #16523a;
  --surface-alt: #f8fbf9;
  --pearl-bg: #f8fbf5;
  --pearl-border: #dce8d2;
  --accent-soft: #edf5e6;

  --page: #0d2a1c;
  --frame: #eaf2ea;
  --frame-line: #b5cbb9;
  --name: #eaf5d8;
  --vine: #9fd08a;
  --head-a: #f4f9ee;
  --head-b: #d9e9d0;
  --head-ink: #16523a;
  --plaque-a: #e9f4da;
  --plaque-b: #a8d08f;
  --plaque-line: #5f8f45;
  --plaque-ink: #0d2a1c;

  --font-name: "Aref Ruqaa", "Noto Naskh Arabic", serif;
  --font-head: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Noto Naskh Arabic", "Traditional Arabic", serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(13, 42, 28, 0.1);
  --shadow: 0 1px 2px rgba(13, 42, 28, 0.04), 0 6px 20px rgba(13, 42, 28, 0.05);
  --shadow-lg: 0 2px 4px rgba(13, 42, 28, 0.05), 0 14px 34px rgba(13, 42, 28, 0.14);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --container: 1200px;
  color-scheme: light;

  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.07'%3E%3Cpath d='M32 6 50 24 50 40 32 58 14 40 14 24Z'/%3E%3Cpath d='M32 14 58 32 32 50 6 32Z'/%3E%3Ccircle cx='32' cy='32' r='6'/%3E%3C/g%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  --primary: #2a8358;
  --primary-dark: #1f6a46;
  --primary-soft: #18301f;
  --ink: #06150d;
  --accent: #8cc06a;
  --accent-dark: #a3d083;
  --bg: #0d1310;
  --card: #151e19;
  --border: #26352c;
  --border-strong: #364a3e;
  --text: #dfe9e3;
  --muted: #c3d0c8;
  --heading: #eef6f1;
  --link: #7fd1a3;
  --link-hover: #a6e2c0;
  --surface-alt: #111a15;
  --pearl-bg: #141b14;
  --pearl-border: #2b3827;
  --accent-soft: #1b2716;
  --page: #07140d;
  --frame: #0f1712;
  --frame-line: #2c4033;
  --name: #d9ecc2;
  --vine: #7fae68;
  --head-a: #1b2a21;
  --head-b: #142019;
  --head-ink: #a6d78c;
  --plaque-a: #2a3d27;
  --plaque-b: #1d2c1b;
  --plaque-line: #4a6b3b;
  --plaque-ink: #dcecc9;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background-color: var(--page);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%239fd08a' stroke-opacity='.15'%3E%3Cpath d='M40 8 49.4 30.6 72 40 49.4 49.4 40 72 30.6 49.4 8 40 30.6 30.6Z'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 2.05;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-soft);
  color: var(--heading);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
a:hover {
  color: var(--link-hover);
}

button {
  font-family: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--heading);
  line-height: 1.7;
  margin: 0 0 0.5em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

.skip-link {
  position: absolute;
  inset-inline-start: 8px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary-dark);
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-head);
}
.skip-link:focus {
  top: 8px;
  color: #fff;
}

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

.icon {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.125em;
}

.anchor {
  scroll-margin-top: 24px;
}

/* ------------------------------------------------------------------ masthead & folder tabs */

.masthead {
  position: relative;
  isolation: isolate;
  color: var(--name);
}
.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(159, 208, 138, 0.18), transparent 65%),
    linear-gradient(to bottom, rgba(13, 42, 28, 0.72), rgba(13, 42, 28, 0.52) 55%, rgba(13, 42, 28, 0.92));
  -webkit-mask-image: linear-gradient(to bottom, #000 68%, transparent);
  mask-image: linear-gradient(to bottom, #000 68%, transparent);
}
.masthead__in {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.masthead__row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 24px 12px;
  min-height: 210px;
}
.brand {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  color: var(--name);
  flex: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.brand:hover {
  color: var(--name);
}
.brand__ornament {
  width: 62px;
  height: 155px;
  color: var(--vine);
  flex: none;
}
.brand__text {
  display: flex;
  flex-direction: column;
  padding-bottom: 24px;
}
.brand__text small {
  font: 700 18px/1.6 var(--font-head);
  color: #fff;
}
.brand__text strong {
  font: 700 clamp(30px, 4.2vw, 50px) / 1.45 var(--font-name);
}

.plaque {
  margin-inline-start: auto;
  max-width: 350px;
  padding: 15px 24px;
  text-align: center;
  color: var(--plaque-ink);
  background: linear-gradient(to bottom, var(--plaque-a), var(--plaque-b));
  border: 1px solid var(--plaque-line);
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 4px color-mix(in srgb, var(--plaque-a) 70%, transparent),
    inset 0 0 0 5px rgba(13, 42, 28, 0.35),
    0 3px 10px rgba(0, 0, 0, 0.35);
  line-height: 1.75;
  font-family: var(--font-head);
}
.plaque p {
  margin: 0;
}
.plaque__date {
  font-weight: 700;
  font-size: 16px;
}
.plaque__sub {
  font-family: var(--font-body);
  font-size: 18px;
}
.plaque__greg {
  font-size: 15px;
  opacity: 0.85;
}

.masthead__tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
}
.iconbtn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: var(--name);
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.iconbtn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.theme-switch__light,
:root[data-theme="dark"] .theme-switch__dark {
  display: none;
}
:root[data-theme="dark"] .theme-switch__light,
.theme-switch__dark {
  display: inline-grid;
}
.navbar__toggle {
  display: none;
}

.navbar {
  font-family: var(--font-head);
  position: relative;
  z-index: 50;
}
.navbar__menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0 16px;
}
.navbar__item {
  position: relative;
}
.navbar__head {
  display: flex;
  align-items: center;
}
.navbar__head > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px 6px;
  border: 1px solid var(--frame-line);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(to bottom, var(--head-a), var(--head-b));
  color: var(--head-ink);
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.navbar__head > a:hover {
  background: var(--frame);
  color: var(--heading);
}
.navbar__item.is-active > .navbar__head > a {
  padding-block: 10px 7px;
  background: var(--frame);
  color: var(--heading);
}

/* ------------------------------------------------------------------ framed page & bar */

.page {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 20px 40px;
}
.frame {
  background: var(--frame);
  border: 1px solid var(--frame-line);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  overflow: clip;
}

.bar {
  display: flex;
  gap: 16px;
  padding: 16px 20px 0;
}
.bar__ticker,
.bar__search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border-radius: 9px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 4px rgba(0, 0, 0, 0.2);
  font-family: var(--font-head);
}
.bar__ticker {
  flex: 1;
}
.bar__label {
  flex: none;
  padding: 4px 12px;
  border-radius: 5px;
  background: linear-gradient(to bottom, var(--plaque-a), var(--plaque-b));
  color: var(--plaque-ink);
  font-size: 14.5px;
  font-weight: 700;
}
.bar__ticker a {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 17.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 6px;
}
.bar__ticker a::after {
  content: " ←";
}
.bar__ticker a:hover {
  color: #e6f4dc;
  text-decoration-color: currentColor;
}
.bar__search {
  flex: 0 1 360px;
}
.bar__search input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 5px;
  background: var(--card);
  padding: 4px 12px;
  font: 14.5px var(--font-head);
  color: var(--text);
  outline: none;
}
.bar__search .btn {
  min-height: 40px;
  padding: 4px 14px;
  background: linear-gradient(to bottom, var(--plaque-a), var(--plaque-b));
  border-color: var(--plaque-line);
  color: var(--plaque-ink);
  box-shadow: none;
}
.bar__search .btn:hover {
  background: var(--plaque-b);
  color: var(--plaque-ink);
}

/* ------------------------------------------------------------------ main & 3-column home */

main {
  padding-block: 20px 36px;
}
main:focus {
  outline: none;
}

.home {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 250px;
  grid-template-areas: "start main end";
  gap: 18px;
  align-items: start;
}
.home__main {
  grid-area: main;
}
.home__start {
  grid-area: start;
}
.home__end {
  grid-area: end;
}
.home__main > * + *,
.home__start > * + *,
.home__end > * + * {
  margin-top: 18px;
}

/* ------------------------------------------------------------------ boxes */

.box {
  background: var(--card);
  border: 1px solid var(--frame-line);
  border-radius: 9px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  overflow: clip;
}
.box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 8px 16px;
  background: linear-gradient(to bottom, var(--head-a), var(--head-b));
  border-bottom: 1px solid var(--frame-line);
}
.home__start .box__header,
.home__end .box__header {
  justify-content: center;
}
.box__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--head-ink);
}
.box__more {
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--link);
  background: none;
  border: 0;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.box__more:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
.box__body {
  padding: 12px 18px 16px;
}
.box__body--flush {
  padding: 0;
}

/* ------------------------------------------------------------------ buttons & badges */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 15.5px;
  font-weight: 600;
  padding: 7px 18px;
  min-height: 42px;
  border-radius: 7px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
  color: #fff;
  border: 1px solid var(--primary-dark);
  cursor: pointer;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: background-color 0.15s;
}
.btn:hover {
  background: var(--primary-dark);
  color: #fff;
}
.btn--sm {
  font-size: 14.5px;
  padding: 5px 14px;
  min-height: 38px;
}
.btn--soft {
  background: var(--primary-soft);
  color: var(--link);
  border-color: var(--border);
  box-shadow: none;
}
.btn--soft:hover {
  background: var(--primary);
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-head);
  font-size: 13.5px;
  line-height: 1.2;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--link-hover);
  border: 1px solid transparent;
  cursor: pointer;
}
.badge.is-active,
.badge:hover {
  background: var(--primary);
  color: #fff;
}

/* ------------------------------------------------------------------ feature */

.feature__kicker {
  display: block;
  text-align: center;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-top: 4px;
}
.feature__title {
  font-size: clamp(20px, 2.3vw, 24px);
  line-height: 1.7;
  text-align: center;
  margin: 4px 0 12px;
}
.feature__excerpt {
  font-size: 20px;
  line-height: 2.05;
  text-align: justify;
  color: var(--text);
  margin: 0 0 14px;
}
.book-note {
  margin: 10px 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  border-inline-start: 3px solid var(--primary);
  color: var(--heading);
  font-size: 18px;
  line-height: 1.95;
}
.feature__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-family: var(--font-head);
  font-size: 14.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ tabs & book rows */

.tabs__nav {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--frame-line);
}
:root[data-theme="dark"] .tabs__nav {
  background: rgba(0, 0, 0, 0.25);
}
.tabs__nav button {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.15s, background-color 0.15s;
}
.tabs__nav button:hover {
  color: var(--link);
}
.tabs__nav button.is-active {
  background: var(--card);
  color: var(--heading);
  box-shadow: var(--shadow-sm);
}

.books {
  list-style: none;
  margin: 0;
  padding: 0;
}
.books li + li {
  border-top: 1px solid var(--border);
}
.books__row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  background: transparent;
  border: 0;
  text-align: start;
  color: var(--heading);
  font-family: var(--font-head);
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s, color 0.15s;
}
.books__row:hover {
  color: var(--link);
  background: var(--surface-alt);
}
.books__icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--link);
}
.books__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.books__name {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.7;
}
.books__sub {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.7;
}
.books__n {
  flex: none;
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}
.books__go {
  flex: none;
  color: var(--accent);
  font-size: 16px;
}

/* ------------------------------------------------------------------ pearls */

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.pearls {
  display: grid;
  gap: 12px;
  padding: 4px 0;
}
.pearl {
  background: var(--pearl-bg);
  border: 1px solid var(--pearl-border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pearl.is-highlighted {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.pearl::before {
  content: "”";
  position: absolute;
  top: 2px;
  inset-inline-end: 16px;
  font-family: Georgia, serif;
  font-size: 52px;
  line-height: 1;
  color: var(--gold);
  opacity: 0.35;
  pointer-events: none;
}
.pearl__title {
  font-family: var(--font-head);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--heading);
  padding-inline-end: 28px;
}
.pearl__text {
  font-size: 20px;
  line-height: 2.05;
  color: var(--text);
  margin: 0;
}
.pearl__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

/* ------------------------------------------------------------------ manhaj plist */

.plist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plist__item {
  display: flex;
  gap: 12px;
  padding: 12px 6px;
  border-radius: 10px;
}
.plist__item + .plist__item {
  border-top: 1px solid var(--border);
}
.plist__bullet {
  color: var(--accent);
  font-size: 18px;
  line-height: 1.8;
  flex: none;
}
.plist__main {
  flex: 1;
  min-width: 0;
}
.plist__title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 4px;
}
.plist__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.95;
}

/* ------------------------------------------------------------------ sidebars */

.linklist {
  list-style: none;
  margin: 0;
  padding: 4px 8px;
}
.linklist a,
.linklist button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 15.5px;
  line-height: 1.6;
  cursor: pointer;
  text-align: start;
}
.linklist li + li {
  border-top: 1px dotted var(--border-strong);
}
.linklist a:hover,
.linklist button:hover {
  background: var(--primary-soft);
  color: var(--link);
}
.linklist .count {
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 1px 9px;
  min-width: 34px;
  text-align: center;
  flex: none;
}

.statgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}
.statgrid a {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  color: var(--text);
  font-family: var(--font-head);
}
.statgrid a:hover {
  background: var(--primary-soft);
  border-color: transparent;
}
.statgrid b {
  display: block;
  font-size: 21px;
  color: var(--link);
  line-height: 1.3;
}
.statgrid span {
  font-size: 13.5px;
  color: var(--muted);
}

.featured-book-btn {
  width: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.featured-book-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.book {
  aspect-ratio: 3 / 4;
  background: var(--pattern), linear-gradient(150deg, var(--primary) 0%, #154a32 55%, var(--ink) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  position: relative;
  border-inline-start: 10px solid rgba(0, 0, 0, 0.22);
  width: 100%;
}
.book::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(159, 208, 138, 0.55);
  border-radius: 4px;
  pointer-events: none;
}
.book__title {
  font-family: var(--font-head);
  font-size: 16.5px;
  line-height: 1.85;
  font-weight: 700;
}
.book__author {
  font-family: var(--font-head);
  font-size: 13.5px;
  color: #b9e0a7;
  margin-top: 10px;
}
.card__body {
  padding: 10px 12px 12px;
}
.card__title {
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.7;
  color: var(--heading);
  margin: 0;
}

.titles {
  list-style: none;
  margin: 0;
  padding: 0;
}
.titles li {
  padding: 8px 0;
}
.titles li + li {
  border-top: 1px dotted var(--border-strong);
}
.titles__name {
  display: block;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.65;
}
.titles__sub {
  display: block;
  font-size: 16.5px;
  color: var(--muted);
  line-height: 1.75;
}

/* ------------------------------------------------------------------ search results */

.search-results-box {
  margin-bottom: 18px;
}

/* ------------------------------------------------------------------ footer */

.footer {
  background: var(--pattern), linear-gradient(to bottom, var(--primary-dark), var(--ink));
  border-top: 3px solid var(--accent);
  color: rgba(255, 255, 255, 0.88);
}
.footer .container {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 28px;
  padding-block: 32px 24px;
}
.footer h3 {
  color: var(--name);
  font-size: 17px;
  margin-bottom: 10px;
}
.footer p {
  margin: 0;
  font-size: 17.5px;
  line-height: 1.95;
  color: rgba(255, 255, 255, 0.82);
}
.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-head);
  font-size: 15px;
}
.footer li a {
  display: inline-block;
  padding-block: 5px;
  color: rgba(255, 255, 255, 0.84);
}
.footer li a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer__bottom {
  text-align: center;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-head);
  font-size: 14.5px;
  color: var(--name);
}

/* ------------------------------------------------------------------ modal & toast */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(7, 20, 13, 0.68);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal[hidden] {
  display: none;
}
.modal__card {
  width: min(100%, 720px);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--frame-line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.modal__body {
  padding: 18px 22px 22px;
}
.modal__quote {
  background: var(--pearl-bg);
  border: 1px solid var(--pearl-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 14px;
}
.modal__quote-label {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 6px;
}
.modal__quote-text {
  margin: 0;
  font-size: 20px;
  line-height: 2.05;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--ink);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 14.5px;
  box-shadow: var(--shadow-lg);
}
.toast[hidden] {
  display: none;
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .home {
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-areas: "start main" "end main";
  }
}

@media (max-width: 1040px) {
  .navbar__toggle {
    display: inline-grid;
  }
  .masthead__row {
    padding-bottom: 16px;
    min-height: 0;
  }
  .masthead:not(.is-menu-open) .navbar {
    display: none;
  }
  .navbar__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    margin-bottom: 12px;
    background: var(--card);
    border: 1px solid var(--frame-line);
    border-radius: 10px;
  }
  .navbar__head > a,
  .navbar__item.is-active > .navbar__head > a {
    flex: 1;
    border: 0;
    border-radius: 6px;
    padding: 9px 12px;
    background: none;
    color: var(--text);
  }
  .navbar__item.is-active > .navbar__head > a {
    background: var(--primary-soft);
    color: var(--link);
  }
  .plaque {
    display: none;
  }
  .masthead__tools {
    flex-direction: row;
    align-self: center;
    margin-inline-start: auto;
  }
}

@media (max-width: 820px) {
  .home {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "start" "end";
  }
  .footer .container {
    grid-template-columns: 1fr 1fr;
  }
  .footer .container > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .masthead__in {
    padding-inline: 12px;
  }
  .brand__ornament {
    width: 36px;
    height: 90px;
  }
  .brand__text {
    padding-bottom: 8px;
  }
  .page {
    padding: 0;
  }
  .frame {
    border-radius: 0;
    border-inline: 0;
  }
  .bar {
    flex-direction: column;
    gap: 8px;
    padding: 12px 12px 0;
  }
  .bar__search {
    flex: none;
  }
  .container {
    padding-inline: 10px;
  }
}
