﻿:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #20231f;
  --muted: #777b75;
  --line: #e8e7e2;
  --green: #315c4b;
  --green-dark: #24483a;
  --gold: #a38342;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

/* HEADER */

.topbar {
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(250,249,246,.94);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1080px;
  height: 100%;
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .16em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid #c9c8c1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 26px;
}

nav a {
  color: var(--muted);
  font-size: 13px;
}

nav a:hover {
  color: var(--green);
}

/* MAIN */

#content {
  max-width: 1080px;
  margin: auto;
  padding: 0 24px 80px;
}

.page {
  max-width: 760px;
  margin: 0 auto;
}

/* HOME */

.home {
  padding-top: 90px;
}

.home-intro {
  margin-bottom: 42px;
}

.kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.home h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 68px);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -.04em;
}

.home-subtitle {
  max-width: 580px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.search-box {
  margin-top: 34px;
  display: flex;
  max-width: 680px;
  border: 1px solid #dcdcd5;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 16px 18px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.search-box button {
  border: 0;
  padding: 0 24px;
  background: var(--green);
  color: white;
  cursor: pointer;
}

.search-box button:hover {
  background: var(--green-dark);
}

.home-links {
  margin-top: 55px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.home-link {
  background: var(--surface);
  padding: 24px;
}

.home-link:hover {
  background: #fdfdfb;
}

.home-link strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}

.home-link span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

/* PAGE HEAD */

.page-head {
  padding: 64px 0 35px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 38px;
  font-weight: 500;
  line-height: 1.2;
}

.page-head p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* LIST */

.list {
  margin-top: 10px;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
}

.list-item:hover .list-title {
  color: var(--green);
}

.list-title {
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.45;
  transition: color .15s;
}

.list-meta {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}

/* HADITH */

.reader {
  max-width: 720px;
  margin: auto;
  padding-top: 55px;
}

.reader-head {
  margin-bottom: 38px;
}

.reader-kitab {
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.reader-bab {
  margin-top: 10px;
  font-family: Georgia, serif;
  font-size: 25px;
  line-height: 1.45;
  font-weight: 500;
}

.reader-number {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.hadith {
  padding-bottom: 45px;
}

.arabic {
  margin: 0 0 45px;
  direction: rtl;
  text-align: right;
  font-family:
    "Noto Naskh Arabic",
    "Amiri",
    "Scheherazade New",
    "Traditional Arabic",
    serif;
  font-size: clamp(27px, 4vw, 34px);
  line-height: 2.05;
  color: #171a17;
}

.text-label {
  margin-bottom: 12px;
  color: var(--green);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.latin {
  margin: 0 0 35px;
  color: #565b55;
  font-family: Georgia, serif;
  font-size: 17px;
  line-height: 1.9;
  font-style: italic;
}

.translation {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.9;
}

.source {
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.reader-actions {
  display: flex;
  gap: 8px;
  margin-top: 35px;
}

.action-btn {
  border: 1px solid #dcdcd5;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
}

.action-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.reader-nav {
  margin-top: 55px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.nav-btn {
  border: 1px solid var(--line);
  background: white;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.nav-btn.next {
  text-align: right;
}

.nav-btn:hover {
  border-color: #c8c8c0;
}

.nav-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav-number {
  display: block;
  margin-top: 3px;
  color: var(--green);
  font-family: Georgia, serif;
}

/* SEARCH */

.search-result {
  margin-top: 35px;
}

.search-title {
  font-family: Georgia, serif;
  font-size: 18px;
}

.search-excerpt {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* LOADING */

.loading {
  padding: 100px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.spinner {
  width: 22px;
  height: 22px;
  margin: 0 auto 14px;
  border: 2px solid #ddd;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  margin-top: 60px;
  padding: 20px;
  border: 1px solid #e5d6d6;
  color: #8a4d4d;
  background: #fffafa;
}

/* FOOTER */

footer {
  max-width: 1080px;
  margin: auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .04em;
}

/* MOBILE */

@media (max-width: 700px) {
  .topbar {
    height: 60px;
  }

  .topbar-inner {
    padding: 0 17px;
  }

  nav {
    gap: 14px;
  }

  nav a {
    font-size: 11px;
  }

  #content {
    padding: 0 18px 55px;
  }

  .home {
    padding-top: 55px;
  }

  .home h1 {
    font-size: 44px;
  }

  .home-subtitle {
    font-size: 15px;
  }

  .search-box button {
    padding: 0 17px;
  }

  .home-links {
    grid-template-columns: 1fr;
  }

  .page-head {
    padding-top: 45px;
  }

  .page-head h1 {
    font-size: 31px;
  }

  .list-item {
    padding: 18px 2px;
  }

  .list-title {
    font-size: 16px;
  }

  .list-meta {
    font-size: 10px;
  }

  .reader {
    padding-top: 38px;
  }

  .reader-bab {
    font-size: 21px;
  }

  .arabic {
    font-size: 28px;
    line-height: 2.05;
    margin-bottom: 38px;
  }

  .translation {
    font-size: 17px;
  }

  .reader-nav {
    grid-template-columns: 1fr;
  }

  .nav-btn.next {
    text-align: left;
  }

  footer {
    padding: 20px 18px;
  }
}
