/* ============================================================
   Iqamah Resources — shared styles
   ----------------------------------------------------------
   Used by:
     /resources/index.html              — landing page
     /resources/<slug>/index.html       — per-presentation page
   Builds on /styles.css for typography/palette tokens (--brand,
   --gold, --text, etc.). This file adds only the patterns
   specific to the resource library: presentation cards on the
   landing page, slide+notes layout on the per-presentation
   page, series navigation, citation/Arabic typography.
   ============================================================ */

/* ────────────────────────────────────────────────────────────
   Shared page container — works for both landing & detail
   ──────────────────────────────────────────────────────────── */
.res-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 28px 64px;
  position: relative;
  z-index: 1;
}

/* Detail-page top section — breadcrumb, series tag, title, summary */
.res-header {
  padding: 16px 0 32px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.res-breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.res-breadcrumb a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.res-breadcrumb a:hover {
  text-decoration: underline;
}

.res-bc-sep {
  color: var(--line);
}

.res-bc-series {
  font-weight: 600;
  color: var(--text-secondary);
}

.res-series-pos {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 0 16px;
}

.res-title {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
}

.res-summary {
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 720px;
}

.res-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding: 16px 0;
  margin: 0 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.res-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.res-meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.res-meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.res-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
}

.res-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.res-actions .btn svg {
  flex-shrink: 0;
}

.res-actions .btn-solid {
  background: var(--brand);
  color: #fff;
}

.res-actions .btn-solid:hover {
  background: var(--brand-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.res-actions .btn-ghost {
  background: #fff;
  color: var(--brand);
  border-color: var(--line);
}

.res-actions .btn-ghost:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

/* ────────────────────────────────────────────────────────────
   Cover slide — large hero image at top of detail page
   ──────────────────────────────────────────────────────────── */
.res-cover {
  margin: 0 0 32px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.res-cover img {
  display: block;
  width: 100%;
  height: auto;
}

/* ────────────────────────────────────────────────────────────
   Slide + speaker notes — the main reading flow on detail page
   ──────────────────────────────────────────────────────────── */
.res-slides {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin: 0 0 64px;
}

.res-slide {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  scroll-margin-top: 80px; /* offset for sticky header on anchor jumps */
}

.res-slide-image {
  position: relative;
}

.res-slide-zoom {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.res-slide-zoom:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.res-slide-zoom img {
  display: block;
  width: 100%;
  height: auto;
}

.res-slide-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.res-slide-num {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.res-slide-anchor {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.res-slide:hover .res-slide-anchor,
.res-slide:focus-within .res-slide-anchor {
  opacity: 1;
}

.res-slide-anchor:hover {
  background: var(--brand-light);
  color: var(--brand);
}

/* The notes prose. This is the article-like reading content.
   Long lines hurt reading speed; cap measure at ~65ch.
   Generous line-height for dense scholarly content. */
.res-slide-notes {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  max-width: 65ch;
  margin: 0 auto;
  padding: 8px 4px;
}

.res-slide-notes p {
  margin: 0 0 16px;
}

.res-slide-notes p:last-child {
  margin-bottom: 0;
}

.res-slide-notes em {
  font-style: italic;
  color: var(--text-secondary);
}

.res-slide-notes p.no-notes {
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}

/* Arabic typography — Noto Naskh Arabic is already loaded by the
   page font block. We don't auto-wrap inline Arabic; the original
   notes have Arabic terms transliterated then occasionally followed
   by the Arabic in parens. Browsers handle Arabic codepoint
   shaping; we just ensure the script is sized appropriately and
   spacing isn't crowded. */
.res-slide-notes :lang(ar),
.res-slide-notes .ar {
  font-family: "Noto Naskh Arabic", "AmiriWeb", serif;
  font-size: 1.05em;
  direction: rtl;
}

/* ────────────────────────────────────────────────────────────
   Series navigation — at bottom of detail page
   ──────────────────────────────────────────────────────────── */
.res-series-nav {
  padding: 32px 28px;
  margin: 0 0 32px;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.res-series-nav h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
}

.res-series-nav p {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 720px;
}

.res-series-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.res-series-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.res-series-list li.current {
  border-color: var(--brand);
  border-width: 2px;
  padding: 13px 17px;
  background: linear-gradient(180deg, #fff 0%, var(--brand-light) 100%);
}

.res-series-list li.upcoming {
  opacity: 0.6;
}

.res-series-num {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
}

.res-series-list li.current .res-series-num {
  background: var(--brand);
  color: #fff;
}

.res-series-list li > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.res-series-list li > div strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.res-series-list li > div span {
  font-size: 13px;
  color: var(--text-secondary);
}

.res-series-tag {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ────────────────────────────────────────────────────────────
   Footer — back link + attribution
   ──────────────────────────────────────────────────────────── */
.res-footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.res-footer .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
}

.res-footer .btn:hover {
  border-color: var(--brand);
}

.res-attribution {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 720px;
}

.res-attribution a {
  color: var(--brand);
  word-break: break-word;
}

/* ────────────────────────────────────────────────────────────
   Landing page — the cards
   ──────────────────────────────────────────────────────────── */
.res-landing-header {
  text-align: center;
  padding: 48px 0 32px;
}

.res-landing-header .label {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.res-landing-header h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.res-landing-header p {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

.res-series-section {
  margin: 48px 0;
}

.res-series-section h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
}

.res-series-section .res-series-tagline {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--muted);
}

.res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.res-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease, border-color 0.2s ease;
}

.res-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

.res-card-thumb {
  position: relative;
  background: var(--brand);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.res-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.res-card-thumb .res-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 79, 82, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.res-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 22px;
}

.res-card-series {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.res-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.res-card-summary {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.res-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.res-card-meta strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Coming-soon placeholder card */
.res-card-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: repeating-linear-gradient(
    135deg,
    var(--surface) 0,
    var(--surface) 10px,
    var(--surface-soft) 10px,
    var(--surface-soft) 20px
  );
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 56px 24px;
  color: var(--muted);
  font-size: 14px;
  min-height: 240px;
}

.res-card-placeholder strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ────────────────────────────────────────────────────────────
   Mobile tweaks
   ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .res-page {
    padding: 20px 18px 48px;
  }
  .res-meta-row {
    gap: 20px;
  }
  .res-slides {
    gap: 40px;
  }
  .res-slide-notes {
    font-size: 15px;
    line-height: 1.65;
  }
  .res-series-nav {
    padding: 24px 20px;
  }
  .res-series-list li {
    flex-wrap: wrap;
    gap: 12px;
  }
}
