/*
 * /new-muslim-materials landing page, from the designer's "New Muslim Library"
 * mock-up (Bootstrap there; plain CSS here so the site needs no new framework
 * and no Tailwind rebuild). Everything is scoped under .nm-landing.
 */
.nm-landing {
  --ink: #0f1117;
  --ink-soft: #4a5464;
  --cream: #f3fbf3;
  --paper: #ffffff;
  --green: #046a38;
  --green-deep: #023319;
  --gold: #f0c800;
  --gold-soft: #eaf3ee;
  --line: #dce9e1;
  --radius: 1.25rem;
  --shadow: 0 1px 2px rgba(15, 17, 23, .06), 0 12px 32px -12px rgba(15, 17, 23, .18);
  --shadow-hover: 0 2px 4px rgba(15, 17, 23, .08), 0 24px 48px -16px rgba(15, 17, 23, .28);
  --serif: "Fraunces", "IBM Plex Sans Arabic", Georgia, serif;

  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}
.nm-landing svg { width: 1em; height: 1em; flex: none; }
.nm-landing a:focus-visible, .nm-landing button:focus-visible, .nm-landing summary:focus-visible {
  outline: 3px solid rgba(240, 200, 0, .55); outline-offset: 2px;
}
.nm-muted { color: var(--ink-soft); }
.nm-eyebrow { display: block; font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--green); margin-bottom: .5rem; }
.nm-section-title { font-family: var(--serif); font-weight: 700; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.25; margin: 0 0 .5rem; color: var(--ink); }
.nm-section-head { max-width: 760px; margin-bottom: 1.75rem; }
.nm-section-head p { margin: 0; }

/* ---------- Buttons ---------- */
.nm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .35rem .95rem; border-radius: 999px; border: 1px solid #c9dccf; background: transparent;
  color: var(--ink); font-size: .875rem; font-weight: 500; line-height: 1.5; white-space: nowrap; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.nm-btn:hover { background: #e3efe7; }
.nm-btn.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.nm-btn .nm-count { font-size: .75rem; opacity: .65; }
.nm-btn-primary {
  display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; margin-top: auto;
  padding: .55rem 1.25rem; border-radius: 999px; background: var(--green); color: #fff; font-weight: 500;
  transition: background-color .2s ease;
}
.nm-btn-primary:hover { background: var(--green-deep); color: #fff; }

/* ---------- Toolbar: counts, type filter, language menu ---------- */
.nm-bar { position: relative; z-index: 40; background: rgba(243, 251, 243, .85); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line); }
.nm-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 0; }
.nm-bar-meta { font-size: .875rem; color: var(--ink-soft); }
.nm-types { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; }
.nm-types::-webkit-scrollbar { display: none; }
.nm-lang { position: relative; flex: none; }
.nm-lang summary { list-style: none; }
.nm-lang summary::-webkit-details-marker { display: none; }
.nm-lang summary .nm-caret { font-size: .7rem; }
.nm-lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + .4rem); z-index: 50; min-width: 13rem; padding: .4rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: .9rem; box-shadow: var(--shadow-hover);
}
.nm-lang-menu a { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: .5rem; color: var(--ink); }
.nm-lang-menu a:hover { background: var(--gold-soft); }
.nm-lang-menu a.is-active { background: var(--green); color: #fff; }
.nm-lang-menu .nm-native { margin-inline-start: auto; font-size: .85rem; opacity: .7; }
.nm-abbr {
  display: inline-grid; place-items: center; min-width: 1.9rem; padding: .05rem .3rem; border-radius: .4rem;
  background: var(--gold-soft); color: var(--green); font-size: .7rem; font-weight: 600; letter-spacing: .06em;
}
.nm-lang-menu a.is-active .nm-abbr { background: rgba(255, 255, 255, .18); color: #fff; }
@media (max-width: 767.98px) {
  .nm-bar-meta { display: none; }
  .nm-bar-inner { padding: .65rem 0; }
}

/* ---------- Hero ---------- */
.nm-hero { position: relative; overflow: hidden; padding: 4rem 0 3.5rem; }
.nm-hero::before {
  content: ""; position: absolute; inset: auto auto -40% -10%; width: 60vw; max-width: 720px; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(240, 200, 0, .22), transparent 70%); pointer-events: none;
}
.nm-hero-grid { position: relative; display: grid; gap: 3rem; align-items: stretch; }
.nm-hero-title { font-family: var(--serif); font-weight: 700; font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.25; margin: 0 0 1.5rem; color: var(--ink); text-wrap: balance; }
.nm-hero-lead { font-size: 1.25rem; font-weight: 300; line-height: 1.7; color: var(--ink-soft); margin: 0; }
.nm-hero-figure { position: relative; margin: 0; }
.nm-hero-figure img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow-hover); }
.nm-hero-badge {
  position: absolute; inset-inline-start: -1rem; bottom: 1.5rem; display: grid; place-content: center; text-align: center;
  width: 6rem; height: 6rem; border-radius: 50%; background: var(--green); color: #fff; box-shadow: var(--shadow-hover); border: 4px solid var(--cream);
}
.nm-hero-badge strong { font-family: var(--serif); font-size: 1.9rem; line-height: 1; color: var(--gold); }
.nm-hero-badge span { font-size: .75rem; }
@media (max-width: 575.98px) { .nm-hero-badge { inset-inline-start: .75rem; } }
@media (min-width: 992px) {
  .nm-hero { padding: 5.5rem 0 4.5rem; }
  .nm-hero-grid { grid-template-columns: 1fr 1fr; }
  .nm-hero-figure { margin-inline-start: 1rem; min-height: 100%; }
  .nm-hero-figure img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
}

/* ---------- How to use ---------- */
.nm-how { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 3rem 0; }
.nm-how-grid { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .nm-how-grid { grid-template-columns: repeat(3, 1fr); } }
.nm-how-step { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; row-gap: .25rem; align-items: start; }
.nm-how-num {
  grid-row: span 2; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--gold-soft); color: var(--green); font-family: var(--serif); font-weight: 600;
}
.nm-how-step h2 { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin: .35rem 0 0; color: var(--ink); }
.nm-how-step p { margin: 0; color: var(--ink-soft); }

/* ---------- Card grids ---------- */
.nm-section { padding: 4.5rem 0 5rem; }
.nm-section:not(.nm-videos) + .nm-section:not(.nm-videos) { padding-top: 0; }
.nm-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 576px) { .nm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px) { .nm-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .nm-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Text typed in the dashboard can hold a word with no spaces; break it instead of widening the column. */
.nm-grid > * { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Book / reading card ---------- */
.nm-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.nm-card:hover, .nm-card:focus-within { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.nm-card-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 1.25rem; }
.nm-card-title { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; line-height: 1.3; margin: 0 0 .5rem; color: var(--ink); }
.nm-card-sub { display: block; font-size: .9rem; color: var(--ink-soft); margin: -.25rem 0 .5rem; }
.nm-desc { font-size: .92rem; line-height: 1.6; color: var(--ink-soft); margin: 0 0 .5rem; }
.nm-desc.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nm-read-more { align-self: flex-start; margin-bottom: 1rem; padding: 0; border: 0; background: none; color: var(--green); font-size: .85rem; font-weight: 500; cursor: pointer; }
.nm-read-more:hover { text-decoration: underline; }
.nm-card .nm-btn-primary { margin-top: auto; }
.nm-card-body > .nm-desc:last-of-type:not(.is-clamped) { margin-bottom: 1rem; }

.nm-cover { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--gold-soft); overflow: hidden; }
.nm-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .5s ease; }
.nm-card:hover .nm-cover img { transform: scale(1.04); }
.nm-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(15, 17, 23, .28), transparent 40%); pointer-events: none; }
.nm-num {
  position: absolute; top: .85rem; inset-inline-start: .85rem; z-index: 1; padding: .2rem .6rem; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--green); font-size: .75rem; font-weight: 600; letter-spacing: .06em;
}
/* No cover uploaded: a green cover with the title on it. */
.nm-cover.is-generated { background: radial-gradient(circle at 70% 20%, rgba(240, 200, 0, .25), transparent 55%), var(--green); }
.nm-cover.is-generated::after { background: linear-gradient(to top, rgba(2, 51, 25, .85), rgba(2, 51, 25, .1) 60%); }
.nm-cover-title {
  position: absolute; inset-inline: 1rem; bottom: 1.1rem; z-index: 1; font-family: var(--serif); font-weight: 600;
  font-size: 1.35rem; line-height: 1.25; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
/* Articles and audio have no covers to show: a shorter band keeps the grid calm. */
.nm-cover.is-short { aspect-ratio: 16 / 9; }

/* ---------- Videos ---------- */
.nm-videos { position: relative; overflow: hidden; background: var(--green-deep); color: #fff; border-top: 1px solid var(--line); }
.nm-videos::before, .nm-videos::after { content: ""; position: absolute; aspect-ratio: 1; pointer-events: none; }
.nm-videos::before { inset: -30% auto auto -20%; width: 70vw; max-width: 820px; background: radial-gradient(closest-side, rgba(240, 200, 0, .20), transparent 70%); }
.nm-videos::after { inset: auto -15% -35% auto; width: 55vw; max-width: 640px; background: radial-gradient(closest-side, rgba(240, 200, 0, .12), transparent 70%); }
.nm-videos > .container-custom { position: relative; z-index: 1; }
.nm-videos .nm-eyebrow { color: var(--gold); }
.nm-videos .nm-section-title { color: #fff; }
.nm-videos .nm-muted { color: rgba(255, 255, 255, .72); }

.nm-video-card {
  height: 100%; border-radius: var(--radius); overflow: hidden; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background-color .25s ease;
}
.nm-video-card:hover, .nm-video-card:focus-within {
  transform: translateY(-4px); background: rgba(255, 255, 255, .1); border-color: rgba(240, 200, 0, .55); box-shadow: 0 24px 48px -18px rgba(0, 0, 0, .55);
}
.nm-video-trigger {
  display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; margin: 0; border: 0;
  background: transparent; color: inherit; text-align: start; font: inherit; cursor: pointer;
}
.nm-video-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #011e0f; }
.nm-video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.nm-video-card:hover .nm-video-thumb img { transform: scale(1.05); }
.nm-video-thumb::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(1, 30, 15, .6), rgba(1, 30, 15, 0) 55%); }
.nm-play {
  position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 3.4rem; height: 3.4rem; border-radius: 50%; background: rgba(243, 251, 243, .92); color: var(--green-deep); font-size: 1.4rem;
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .5); transition: transform .25s ease, background-color .25s ease;
}
.nm-video-card:hover .nm-play, .nm-video-trigger:focus-visible .nm-play { transform: translate(-50%, -50%) scale(1.1); background: var(--gold); }
.nm-video-thumb .nm-num { background: rgba(1, 30, 15, .72); color: var(--gold-soft); backdrop-filter: blur(4px); top: .75rem; inset-inline-start: .75rem; font-size: .72rem; padding: .15rem .55rem; }
.nm-video-body { display: flex; flex-direction: column; flex: 1 1 auto; padding: 1.1rem 1.15rem 1.2rem; }
.nm-video-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.3; color: #fff; margin-bottom: .4rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nm-video-desc {
  font-size: .9rem; line-height: 1.55; color: rgba(255, 255, 255, .68); margin-bottom: .9rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nm-video-cta { margin-top: auto; display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; font-size: .875rem; font-weight: 500; color: var(--gold); }

/* ---------- Video player ---------- */
.nm-modal { margin: auto; width: min(800px, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 0; border: 0; border-radius: var(--radius); overflow: auto; background: var(--paper); color: var(--ink); box-shadow: 0 32px 80px -24px rgba(0, 0, 0, .6); }
.nm-modal::backdrop { background: rgba(1, 20, 10, .7); }
.nm-modal-stage { position: relative; aspect-ratio: 16 / 9; background: #000; }
.nm-modal-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nm-modal-close {
  position: absolute; z-index: 5; top: .7rem; inset-inline-end: .7rem; display: grid; place-items: center; width: 2.3rem; height: 2.3rem;
  border: 0; border-radius: 50%; background: rgba(1, 30, 15, .62); color: #fff; cursor: pointer; backdrop-filter: blur(6px);
}
.nm-modal-close:hover { background: var(--gold); color: var(--green-deep); }
.nm-modal-body { padding: 1.5rem; }
.nm-modal-title { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.25; margin: 0 0 .5rem; }
.nm-modal-desc { font-size: .94rem; line-height: 1.65; color: var(--ink-soft); margin: 0 0 .5rem; }
.nm-modal-youtube { display: inline-flex; margin-top: .75rem; font-size: .85rem; color: var(--ink-soft); }
.nm-modal-youtube:hover { color: var(--green); text-decoration: underline; }

/* ---------- More in this language ---------- */
.nm-portal { text-align: center; padding: 0 0 5rem; }
.nm-videos + .nm-portal { padding-top: 3rem; }
.nm-portal .nm-btn-primary { display: inline-flex; width: auto; padding: .65rem 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  .nm-card, .nm-cover img, .nm-video-card, .nm-video-thumb img, .nm-play { transition: none; }
}

/* The site nav is absolutely placed (it normally floats over the page hero), so it gets its own band here. */
.nm-site-header { position: relative; height: 88px; background: #fff; }
/* The design runs wider than the site's 1220px container on large screens. */
@media (min-width: 1400px) { .nm-landing .container-custom { max-width: 1320px; } }
