/* Guides page. Loaded by guides/index.html only. Checklists, panels and the download band come
   from sections.css; label pills, icon badges and the medical note from components.css.
   Layout: two "choose your guides" links overlapping the page header, then one card grid for
   patients and one for doctors. Each card: the guide's first page on a patterned mat, then its
   tags, title, Urdu title, contents and the download and read-online buttons. */

/* ---------- Choose: patients or doctors ---------- */
.audience-nav {
  position: relative;
  margin-block-start: calc(var(--space-6) * -1);
}

.audience-nav__list {
  display: grid;
  gap: var(--space-3);
  max-inline-size: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .audience-nav__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5);
  }
}

.audience-link {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  block-size: 100%;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--c-rule);
  border-radius: calc(var(--radius-l) - 8px);
  background: var(--c-surface);
  box-shadow: var(--shadow-card);
  color: var(--c-ink);
  text-decoration: none;
  transition:
    translate 200ms ease,
    border-color 200ms ease;
}

.audience-link:hover {
  border-color: var(--c-emerald);
  translate: 0 -2px;
}

.audience-link .icon-badge {
  inline-size: 3.25rem;
  block-size: 3.25rem;
}

.audience-link .icon-badge .icon {
  inline-size: 1.5rem;
  block-size: 1.5rem;
}

.audience-link__text {
  display: grid;
  flex: 1;
  gap: var(--space-1);
}

.audience-link__title {
  color: var(--c-emerald);
  font-family: var(--font-head);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.3;
}

.audience-link__meta {
  color: var(--c-ink-soft);
  font-size: var(--fs-small);
  line-height: 1.4;
}

.audience-link__arrow {
  flex: none;
  color: var(--c-emerald);
  rotate: 90deg; /* points down: the guides are further down this page */
}

/* ---------- Card grid ----------
   As many columns as fit at 20rem or more: the two patient guides share the row. The three
   doctor guides: one column on phones, two on tablets with the third centred under them (not
   left alone at half width), three on desktop. */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--space-5);
}

.guide-grid--three {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .guide-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 720px) and (max-width: 1023.98px) {
  .guide-grid--three > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    inline-size: calc((100% - var(--space-5)) / 2);
  }
}

@media (min-width: 1024px) {
  .guide-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------- Guide card ---------- */
.guide {
  --cover-bg: var(--c-olive-tint);
  --cover-pattern: var(--c-brass);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-rule);
  border-radius: calc(var(--radius-l) - 8px);
  background: var(--c-surface);
  box-shadow: var(--shadow-card);
}

.guide--doctor {
  --cover-bg: var(--c-night);
  --cover-pattern: var(--c-on-night);
}

/* The guide's first page, lying on a patterned mat */
.guide__cover {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  padding: var(--space-6) var(--space-5) var(--space-5);
  background: var(--cover-bg);
}

.guide__cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--cover-pattern);
  opacity: 0.14;
  -webkit-mask: url("/assets/images/pattern-star-cross.svg") center / 72px 72px repeat;
  mask: url("/assets/images/pattern-star-cross.svg") center / 72px 72px repeat;
}

.guide__cover img {
  inline-size: auto;
  max-inline-size: 100%;
  block-size: auto;
  max-block-size: 240px;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-photo);
  transition: translate 200ms ease;
}

.guide:hover .guide__cover img,
.guide:focus-within .guide__cover img {
  translate: 0 -4px;
}

.guide__kind {
  position: absolute;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-3);
  padding: 0.125rem var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--c-surface);
  color: var(--c-emerald);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}

.guide__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

.guide__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-inline-size: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem var(--space-3);
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-pill);
  color: var(--c-ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}

.guide__tag--topic {
  border-color: transparent;
  background: var(--c-dawn);
  color: var(--c-emerald);
}

.guide__tag .icon {
  inline-size: 1rem;
  block-size: 1rem;
}

.guide__title {
  font-size: var(--fs-h3);
  line-height: 1.35;
}

/* The guide's own Urdu title. System Urdu/Arabic fonts; nothing extra is downloaded. */
.guide__native {
  margin-block-start: calc(var(--space-2) * -1);
  color: var(--c-brass-text);
  font-family: "Segoe UI", "Noto Naskh Arabic", Tahoma, "Geeza Pro", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.7;
  text-align: left; /* line up with the English title above */
}

.guide__summary {
  color: var(--c-ink-soft);
}

.guide .checklist {
  font-size: var(--fs-small);
}

.guide__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-block-start: auto;
  padding-block-start: var(--space-4);
  border-block-start: 1px dashed var(--c-rule);
}

/* Patients get larger, full-width buttons (design spec 6.4) */
.guide--patient .guide__actions .btn {
  flex: 1 1 100%;
  min-block-size: 56px;
  font-size: var(--fs-body);
}

.guide__note {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  color: var(--c-ink-soft);
  font-size: 0.9375rem;
}

.guide__note .icon {
  flex: none;
  margin-block-start: 0.2em;
}

/* ---------- Medical note above the download band ---------- */
.guides-end {
  padding-block: var(--space-6) var(--space-5);
}

.guides-note {
  max-inline-size: none;
}
