/* ==========================================================================
   Shaykh al-Islām Ibn Taymiyyah — Framed Shaykh Site Design System
   (Matched to ali-hudhaify / al-badr.net / binbaz.org.sa scholarly architecture)
   ========================================================================== */

: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;
  --quote-bg: #f2f7ee;
  --accent-soft: #edf5e6;

  /* Patterned outer page, masthead, and light green frame */
  --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.12);
  --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;
  --gold: #8cc06a;
  --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;
  --quote-bg: #141b15;
  --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.4);
  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;
  -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);
}

: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.65;
  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 & Tabs */

.masthead {
  position: relative;
  isolation: isolate;
  color: var(--name);
}

.masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 70% 10%, rgba(159, 208, 138, 0.18), transparent 55%),
    linear-gradient(to bottom, rgba(13, 42, 28, 0.85), rgba(13, 42, 28, 0.58) 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: 64px;
  height: 155px;
  color: var(--vine);
  flex: none;
}

.brand__text {
  display: flex;
  flex-direction: column;
  padding-bottom: 22px;
}
.brand__text small {
  font: 700 18px/1.5 var(--font-head);
  color: #fff;
}
.brand__text strong {
  font: 700 clamp(30px, 4vw, 50px) / 1.45 var(--font-name);
}

.plaque {
  margin-inline-start: auto;
  max-width: 360px;
  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;
  font-weight: 600;
}
.plaque__greg {
  font-size: 14.5px;
  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;
}

/* Folder-Tab Navigation standing on top of the frame */
.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__subtoggle {
  display: none;
}

.navbar__head > a {
  display: flex;
  align-items: center;
  gap: 5px;
  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,
.navbar__item:focus-within > .navbar__head > a {
  background: var(--frame);
  color: var(--heading);
}

.navbar__item.is-active > .navbar__head > a {
  padding-block: 10px 7px;
  background: var(--frame);
  color: var(--heading);
}

.navbar__caret {
  font-size: 14px;
  opacity: 0.75;
}

.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 0;
  z-index: 60;
  min-width: 245px;
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--frame-line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.dropdown::before {
  content: "";
  position: absolute;
  inset: -8px 0 auto;
  height: 8px;
}

.navbar__item:hover > .dropdown,
.navbar__item:focus-within > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.dropdown a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 15.5px;
}
.dropdown a:hover {
  background: var(--primary-soft);
  color: var(--link-hover);
}

/* ------------------------------------------------------------------ Framed Page */

.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;
}

/* Ticker and Search Bar */
.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: 15px;
  font-weight: 700;
}

.bar__ticker a {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  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-block: 4px;
  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 Grid */

main {
  padding-block: 20px 34px;
}

.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;
}

/* Framed 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: center;
  gap: 8px 14px;
  padding: 8px 16px;
  background: linear-gradient(to bottom, var(--head-a), var(--head-b));
  border-bottom: 1px solid var(--frame-line);
  flex-wrap: wrap;
}

.box__title {
  margin: 0;
  font-size: 19.5px;
  font-weight: 700;
  color: var(--head-ink);
  text-align: center;
}

.box__more {
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--link);
  background: none;
  border: 0;
  cursor: pointer;
}

.box__body {
  padding: 10px 18px 16px;
}
.box__body--flush {
  padding: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 15.5px;
  font-weight: 600;
  min-height: 42px;
  padding: 7px 20px;
  border-radius: 7px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
  color: #fff;
  border: 1px solid var(--primary-dark);
  cursor: pointer;
  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: 4px 13px;
}

.stackbtns {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

/* Featured Article */
.feature__kicker {
  display: block;
  text-align: center;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-top: 6px;
}

.feature__title {
  font-size: clamp(19px, 2.2vw, 24px);
  line-height: 1.65;
  text-align: center;
  margin: 6px 0 10px;
}
.feature__title a {
  color: var(--heading);
}
.feature__title a:hover {
  color: var(--link);
}

.feature__excerpt {
  font-size: 20px;
  line-height: 2;
  text-align: justify;
  color: var(--text);
  margin: 0 0 16px;
}

.feature__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Tabs */
.tabs__nav {
  display: flex;
  gap: 4px;
  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);
}

.tab-btn {
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.tab-btn:hover {
  color: var(--link);
}
.tab-btn.is-active {
  background: var(--card);
  color: var(--heading);
  box-shadow: var(--shadow-sm);
}

/* Post Lists */
.plist {
  list-style: none;
  margin: 0 -10px;
  padding: 0;
}

.plist__item {
  display: flex;
  gap: 12px;
  padding: 13px 10px;
  border-radius: 10px;
  position: relative;
  transition: background-color 0.15s;
}
.plist__item + .plist__item::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 10px;
  border-top: 1px solid var(--border);
}
.plist__item:hover {
  background: var(--surface-alt);
}
.plist__item:hover::before,
.plist__item:hover + .plist__item::before {
  border-color: transparent;
}

.plist__bullet {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  margin-top: 2px;
  flex: none;
}

.plist__main {
  min-width: 0;
  flex: 1;
}

.plist__title {
  font-family: var(--font-head);
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.75;
  color: var(--heading);
  display: inline-block;
  cursor: pointer;
}
.plist__title:hover {
  color: var(--link);
}

.plist__excerpt {
  color: var(--muted);
  font-size: 18.5px;
  line-height: 1.9;
  margin: 4px 0 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-family: var(--font-head);
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-head);
  font-size: 13.5px;
  line-height: 1.2;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--link-hover);
  white-space: nowrap;
}

/* Pearls (فوائد ودرر) */
.pearls {
  display: grid;
  gap: 12px;
  padding: 8px 0 2px;
}

.pearl {
  background: var(--pearl-bg);
  border: 1px solid var(--pearl-border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.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:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.pearl__title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--heading);
  padding-inline-end: 28px;
}

.pearl__text {
  font-size: 19.5px;
  line-height: 2;
  color: var(--text);
  margin: 0;
}

.pearl__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dotted var(--border-strong);
  font-family: var(--font-head);
  font-size: 14px;
  color: var(--muted);
}

.copy-btn {
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--link);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px 12px;
  cursor: pointer;
}
.copy-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* Sidebar Link Lists & Titles */
.linklist {
  list-style: none;
  margin: 0;
  padding: 4px 8px;
}
.linklist li + li {
  border-top: 1px dotted var(--border-strong);
}
.linklist a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 15px;
  line-height: 1.65;
}
.linklist a: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;
}

.titles {
  list-style: none;
  margin: 0;
  padding: 0;
}
.titles li + li {
  border-top: 1px dotted var(--border-strong);
}
.titles a,
.titles .title-row {
  display: block;
  padding: 9px 0;
  color: var(--heading);
  font-size: 17.5px;
  line-height: 1.8;
}
.titles a:hover {
  color: var(--link);
}
.titles small {
  display: block;
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--muted);
}

.note {
  margin: 8px 0 12px;
  font-size: 17.5px;
  color: var(--muted);
  line-height: 1.9;
}

/* Generated Book Cover Card (signature ali-hudhaify motif) */
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  color: var(--text);
  margin: 8px 0 10px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card: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: 22px 18px;
  position: relative;
  border-inline-start: 10px solid rgba(0, 0, 0, 0.22);
}
.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: 19px;
  line-height: 1.75;
  font-weight: 700;
}
.book__author {
  font-family: var(--font-head);
  font-size: 13.5px;
  line-height: 1.7;
  color: #b9e0a7;
  margin-top: 10px;
}

.card__body {
  padding: 10px 12px 12px;
  text-align: center;
}
.card__title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--heading);
  margin: 0;
}

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

.footer {
  background: var(--pattern), linear-gradient(to bottom, var(--primary-dark), var(--ink));
  color: #bdd3c5;
  font-family: var(--font-head);
  font-size: 15px;
  border-top: 3px solid var(--accent);
}

.footer .container {
  padding-block: 36px 26px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}

.footer h3 {
  color: #fff;
  font-size: 17px;
  margin-bottom: 10px;
}

.footer p {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.95;
  margin: 0;
}

.footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  line-height: 2.2;
}

.footer a {
  color: #e3efe7;
}
.footer a:hover {
  color: #b9e0a7;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 16px;
  font-size: 14.5px;
  color: #a9c2b2;
}

/* ------------------------------------------------------------------ Modal & Toast */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(7, 20, 13, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-backdrop[hidden] {
  display: none;
}

.modal-box {
  width: min(680px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.modal-box__header {
  justify-content: space-between;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--frame-line);
  background: var(--card);
  color: var(--heading);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover {
  background: var(--primary-soft);
}

.modal-box__body {
  overflow-y: auto;
  padding: 18px 24px 24px;
}

.modal-box__body h3 {
  font-size: 17.5px;
  color: var(--primary);
  margin: 18px 0 6px;
}
.modal-box__body p {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 2.05;
}
.modal-box__body ul {
  margin: 0;
  padding-inline-start: 22px;
  font-size: 19px;
  line-height: 2;
}

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--primary-dark);
  color: #fff;
  font-family: var(--font-head);
  font-size: 15px;
  box-shadow: var(--shadow-lg);
}

/* ------------------------------------------------------------------ Responsive */

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

@media (max-width: 1000px) {
  .plaque {
    display: none;
  }
  .masthead__tools {
    flex-direction: row;
    align-self: center;
    margin-inline-start: auto;
  }
  .navbar__toggle {
    display: inline-grid;
  }
  .masthead__row {
    min-height: 0;
    padding-bottom: 16px;
  }
  .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;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text);
  }
  .navbar__item.is-active > .navbar__head > a {
    background: var(--primary-soft);
    color: var(--link);
  }
  .navbar__caret {
    display: none;
  }
  .navbar__subtoggle {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
  }
  .dropdown {
    display: none;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0 16px 4px 0;
  }
  .navbar__item.is-open > .dropdown {
    display: block;
  }
}

@media (max-width: 800px) {
  .home {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "start" "end";
  }
  .bar {
    flex-direction: column;
    gap: 8px;
  }
  .bar__search {
    flex: none;
  }
  .footer .container {
    grid-template-columns: 1fr 1fr;
  }
  .footer .container > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 0;
  }
  .frame {
    border-radius: 0;
    border-inline: 0;
  }
  .brand__ornament {
    width: 38px;
    height: 92px;
  }
  .brand__text strong {
    font-size: 26px;
  }
}
