/* ============================================================
   Muslim Curatory — House Stylesheet
   Derived from the Muslim Curatory House Design System.
   Typefaces: Cardo (prose) · Inter (interface)
   Cardo carries everything meant to be read as writing; Inter carries
   everything that is apparatus — nav, labels, buttons, small headings.
   Ink: #1A1A18   Muted: #5A5A56
   No drop caps. No ornaments. Restraint is the design.
   ============================================================ */

:root {
  --ink: #1A1A18;          /* house body colour */
  --ink-body: #1A1A18;
  --muted: #5A5A56;        /* house muted */
  --rule: #E4E1DA;
  --paper: #FFFFFF;        /* white ground */
  --paper-raised: #F7F5F1;
  --accent: #8A6A2F;       /* warm ochre — the cover's amber, darkened for screen legibility */
  --accent-soft: #B8934A;  /* lighter ochre for rules and small marks */
  --paper-tint: #FBF8F2;   /* very faint warm ground for raised blocks */
  --measure: 40rem;          /* ~78 characters at 19px */
  --serif: "Cardo", "Liberation Serif", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
          "Liberation Sans", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--serif);
  font-size: 1.1875rem;      /* 19px */
  line-height: 1.65;
  font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Structure ---------- */

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.narrow { max-width: var(--measure); }

/* Two-column pages need a wider frame so the columns can spread
   to the edges instead of clustering in the middle. */
.wrap.wide { max-width: 78rem; }

main { padding: 3.5rem 0 5rem; }

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 2px solid var(--accent-soft);
  padding: 1.75rem 0 1.5rem;
}

.masthead .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.wordmark span { white-space: nowrap; }

.wordmark:hover { color: var(--muted); }

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

nav a {
  font-family: var(--serif);
  color: var(--muted);
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: 0;
  position: relative;
  padding-bottom: 0.3rem;
  transition: color 140ms ease;
}

/* underline that grows on hover */
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}

nav a:hover { color: var(--ink); }
nav a:hover::after { transform: scaleX(1); }

/* the page you are on stays underlined */
nav a[aria-current="page"] { color: var(--ink); }
nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---------- Typography ---------- */

h1, h2, h3 { font-weight: 400; line-height: 1.25; }

h1 {
  font-size: 2.5rem;
  margin: 0 0 1.25rem;
  letter-spacing: 0.005em;
}

h2 {
  font-size: 1.5rem;
  margin: 3rem 0 1rem;
  padding-top: 1.25rem;
  position: relative;
}

h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 2.25rem;
  height: 2px;
  background: var(--accent-soft);
}

h3 {
  font-size: 1.125rem;
  margin: 2rem 0 0.5rem;
  letter-spacing: 0.02em;
}

p { margin: 0 0 1.35rem; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--muted); }

.muted { color: var(--muted); }

.lede {
  font-size: 1.375rem;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 1.75rem;
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

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

.button {
  font-family: var(--sans);
  font-weight: 500;
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.04em;
  background: transparent;
}

.button:hover { background: var(--ink); color: var(--paper); }

.button.secondary { border-color: var(--rule); color: var(--muted); }
.button.secondary:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.75rem 0 0; }

/* ---------- Home hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
  padding: 1rem 0 1rem;
}

.hero h1 { font-size: 2.875rem; }

@media (max-width: 48rem) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero h1 { font-size: 2.125rem; }
  h1 { font-size: 2rem; }
}

/* ---------- Cover ---------- */

.cover {
  width: 100%;
  max-width: 20rem;
  margin: 0 auto;
  display: block;
}

.cover-frame {
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 26rem;
}

.cover-placeholder {
  text-align: center;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.cover-placeholder strong {
  display: block;
  color: var(--ink);
  font-weight: 400;
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

/* ---------- Book entry (Catalog) ---------- */

.book {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 2.5rem 0 0;
  border-top: 1px solid var(--rule);
}

@media (max-width: 48rem) {
  .book { grid-template-columns: 1fr; gap: 2rem; }
}

.book-meta {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
  margin-top: 1.5rem;
  line-height: 1.7;
}

.book-meta dt { font-family: var(--sans); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.6875rem; }
.book-meta dd { margin: 0 0 0.75rem; }

/* ---------- Praise ---------- */

blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  font-size: 1.0625rem;
  color: var(--ink);
}

blockquote cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- Forms ---------- */

form { margin-top: 1.5rem; }

.field { margin-bottom: 1.5rem; }

label {
  font-family: var(--sans);
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule);
  background: #fff;
  font-family: var(--serif);
  font-size: 1.125rem;
  color: var(--ink);
  font-variant-numeric: oldstyle-nums proportional-nums;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

textarea { min-height: 9rem; resize: vertical; }

.hint { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin-top: 0.45rem; line-height: 1.5; }

button[type="submit"] {
  font-family: var(--sans);
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink-body);
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

button[type="submit"]:hover { background: var(--ink); color: var(--paper); }

/* ---------- Quiet signup (never a gate) ---------- */

.signup-quiet {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.75rem 0;
  margin: 3rem 0;
}

.signup-quiet p { margin: 0 0 1rem; font-size: 1.0625rem; }

.signup-inline { display: flex; gap: 0.6rem; flex-wrap: wrap; max-width: 30rem; }
.signup-inline input { flex: 1 1 14rem; }

/* ---------- Excerpt ---------- */

.excerpt p { margin-bottom: 0; text-indent: 1.4rem; }
.excerpt p:first-of-type { text-indent: 0; }

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

footer {
  border-top: 1px solid var(--rule);
  background: var(--paper-tint);
  padding: 2.5rem 0 3.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }

footer {
  font-family: var(--sans);
}

footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.25rem; flex-wrap: wrap; }



/* ============================================================
   Arabic — Qur'anic blocks
   English prose carries a first-line indent. Arabic never does.
   ============================================================ */

.ayah-block {
  direction: rtl;
  text-align: right;
  text-indent: 0;
  margin: 2.75rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--rule);
}

.ayah {
  direction: rtl;
  text-align: right;
  text-indent: 0;
  font-size: 1.5rem;
  line-height: 2.4;
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: "Scheherazade New", "KFGQPC Uthmanic Script HAFS",
               "Amiri", "Noto Naskh Arabic", serif;
}

.ayah-ref {
  direction: rtl;
  text-align: right;
  text-indent: 0;
  font-size: 0.9375rem;
  color: var(--accent);
  margin: 0.5rem 0 0;
  padding: 0;
  font-family: "Scheherazade New", "KFGQPC Uthmanic Script HAFS",
               "Amiri", "Noto Naskh Arabic", serif;
}

/* The English rendering: bold, one point smaller than body, so it
   reads as a quotation rather than as competing with the Arabic. */
.ayah-translation {
  text-indent: 0;
  font-size: 1.0625rem;      /* one point below the 1.1875rem body */
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink);
  margin: 1.5rem 0 2.75rem;
}

.ayah-cite {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.excerpt .ayah-block p,
.excerpt .ayah-translation { text-indent: 0; }


/* ---------- Two-column page layout ---------- */
/* Used on About, Contact, Curatory: a narrow reading column beside a
   wider support column, so the page is balanced on a large screen
   instead of being one narrow strip with empty margins. */

.page {
  display: grid;
  grid-template-columns: minmax(0, 40rem) minmax(0, 1fr);
  gap: 5rem;
  align-items: start;
}

.page-main { max-width: 40rem; }
.page-aside { position: sticky; top: 2rem; max-width: 20rem; }

/* Long-reading variant (the excerpt).
   A chapter runs several thousand pixels; a sidebar balanced against a
   short page would leave one empty column for the whole scroll. Here the
   reading column keeps a comfortable measure on its own, and the sidebar
   sits beside the opening rather than floating down the entire chapter. */
.page.page-reading {
  grid-template-columns: minmax(0, 44rem) minmax(0, 1fr);
  gap: 4.5rem;
}

.page-reading .page-main { max-width: 44rem; }
.page-reading .page-aside { position: static; max-width: 19rem; }

@media (max-width: 62rem) {
  .page.page-reading { grid-template-columns: 1fr; gap: 2.5rem; }
  .page-reading .page-aside { max-width: none; }
}

@media (max-width: 56rem) {
  .page { grid-template-columns: 1fr; gap: 2.5rem; }
  .page-aside { position: static; }
}

.aside-card {
  border-top: 2px solid var(--accent-soft);
  padding-top: 1.25rem;
}

.aside-card + .aside-card { margin-top: 2.5rem; }

.aside-card h2,
.aside-card h3 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.9rem;
  font-weight: 400;
}

.aside-card p { font-family: var(--sans); font-size: 0.875rem; line-height: 1.7; margin: 0 0 0.9rem; }
.aside-card p:last-child { margin-bottom: 0; }

.aside-card dl { margin: 0; font-family: var(--sans); font-size: 0.875rem; line-height: 1.65; }
.aside-card dt {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  color: var(--muted);
  margin-top: 1rem;
}
.aside-card dt:first-child { margin-top: 0; }
.aside-card dd { margin: 0.15rem 0 0; }
