/* 2.2.49: the guide «الدليل» (inc/guide.php, templates single-advance_guide.php, taxonomy-guide_cluster.php,
   archive-advance_guide.php, template-parts/guide/). Guide pages wear the light design (body.adv-light, light.css's
   tokens); the same list cards serve the door pages' «اقرأ في الدليل» block and the author page. No layout shift: the
   phone's table of contents is closed until tapped, every image has its size, and the boxes are in the text flow. */

.g-art, .g-hub { width: min(100% - 2 * var(--gutter), 1120px); margin: 0 auto; padding-block: 16px 64px; }
.adv-guide .site-main { margin: 0; }
.adv-guide .content-area { width: 100%; }

/* ---------- breadcrumb, title, byline ---------- */
.g-crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 8px; margin: 0 0 16px; padding: 0; list-style: none; color: var(--l-mute); font-size: 14px; line-height: 1.6; }
.g-crumbs li + li::before { content: "›"; margin-inline-end: 8px; color: var(--l-line); }
.g-crumbs a { color: var(--l-mute); text-decoration: none; }
.g-crumbs a:hover { color: var(--l-accent); text-decoration: underline; }
.g-title { margin: 0 0 12px; font-size: clamp(28px, 6.4vw, 42px); font-weight: 600; line-height: 1.4; }
.g-by { margin: 0 0 24px; color: var(--l-mute); font-size: 15px; line-height: 1.7; }
.g-by a { color: var(--l-ink); font-weight: 600; }
.g-by__i { white-space: nowrap; } /* each item whole: «8 دقائق قراءة» never splits */
.g-by__sep { margin-inline: 6px; }
.g-lede { max-width: 46rem; color: var(--l-mute); font-size: 19px; line-height: 1.7; }

/* ---------- layout: text, and on wide screens the contents beside it ---------- */
.g-grid { display: block; }
.g-main { min-width: 0; max-width: 46rem; }
.g-side { display: none; }
@media (min-width: 1024px) {
	.g-grid { display: grid; grid-template-columns: minmax(0, 46rem) 260px; gap: 56px; justify-content: space-between; align-items: start; }
	.g-side { display: block; position: sticky; top: calc(var(--head-h) + 24px); max-height: calc(100vh - var(--head-h) - 48px); overflow-y: auto; }
	.g-toc--in { display: none; }
}

/* ---------- table of contents ---------- */
.g-toc { font-size: 15px; line-height: 1.6; }
.g-toc--in { margin: 0 0 28px; border: 1px solid var(--l-hair); border-radius: 12px; background: var(--l-soft); }
.g-toc--in summary { min-height: 48px; padding: 12px 16px; cursor: pointer; font-weight: 600; list-style-position: inside; }
.g-toc--in .g-toc__list { margin: 0; padding: 0 16px 16px; }
.g-toc__h { margin: 0 0 8px; color: var(--l-mute); font-size: 13px; font-weight: 600; }
.g-toc__list { margin: 0; padding: 0; list-style: none; counter-reset: none; }
.g-toc__list li + li { margin-top: 2px; }
.g-toc__list a { display: block; padding: 6px 0; color: var(--l-ink); text-decoration: none; }
.g-toc__list a:hover { color: var(--l-accent); text-decoration: underline; }
.g-toc--side .g-toc__list a { padding: 5px 12px; border-inline-start: 2px solid var(--l-hair); }

/* ---------- the text ---------- */
.g-body { font-size: 18px; line-height: 1.85; overflow-wrap: anywhere; }
.g-body > :first-child { margin-top: 0; }
.g-body p, .g-body ul, .g-body ol { margin: 0 0 18px; }
.g-body ul, .g-body ol { padding-inline-start: 24px; }
.g-body li + li { margin-top: 6px; }
.g-body li > p { margin: 0; }
.g-body h2 { margin: 48px 0 16px; font-size: clamp(23px, 5.4vw, 28px); line-height: 1.45; scroll-margin-top: calc(var(--head-h) + 16px); }
.g-body h3 { margin: 32px 0 10px; font-size: 20px; line-height: 1.5; }
.g-body a { color: var(--l-accent); }
.g-body strong { font-weight: 600; }
.g-body blockquote { margin: 0 0 18px; padding: 12px 16px; border-inline-start: 3px solid var(--l-accent); border-radius: 0 8px 8px 0; background: var(--l-soft); }
.g-body blockquote p:last-child { margin: 0; }
.g-body code { padding: 1px 6px; border-radius: 6px; background: var(--l-soft); font-family: ui-monospace, Consolas, monospace; font-size: .88em; direction: ltr; unicode-bidi: isolate; }
.g-body pre { margin: 0 0 18px; padding: 14px 16px; overflow-x: auto; border-radius: 12px; background: var(--l-soft); font-size: 14px; line-height: 1.6; text-align: left; }
.g-body pre code { padding: 0; background: none; font-size: inherit; }
.g-body hr { margin: 32px 0; border: 0; border-top: 1px solid var(--l-hair); }

/* figures: the picture at its own size, the caption under it */
.g-fig { margin: 24px 0; }
.g-fig img { width: 100%; height: auto; border-radius: 12px; background: var(--l-soft); }
.g-fig figcaption { margin-top: 8px; color: var(--l-mute); font-size: 15px; line-height: 1.7; }

/* tables scroll inside their own box, never the page */
.g-table { margin: 0 0 22px; overflow-x: auto; border: 1px solid var(--l-hair); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.g-table table { width: max-content; min-width: 100%; margin: 0; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.g-table th, .g-table td { min-width: 88px; max-width: 260px; padding: 10px 12px; border-bottom: 1px solid var(--l-hair); overflow-wrap: normal; text-align: start; vertical-align: top; } /* words and numbers whole; the box scrolls */
.g-table th { background: var(--l-soft); font-weight: 600; }
.g-table tr:last-child td { border-bottom: 0; }

/* checklists («- [ ]»): an empty box before each line */
.g-body .g-checklist { padding: 0; list-style: none; }
.g-check { position: relative; padding-inline-start: 32px; }
.g-check::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 18px; height: 18px; border: 1.5px solid var(--l-field-line); border-radius: 4px; background: var(--l-bg); }

/* ---------- the blocks: caution, source and method, the door's call, the coupon ---------- */
.g-warn, .g-source, .g-cta, .g-coupon { margin: 28px 0; padding: 18px 20px; border-radius: 14px; }
.g-warn > :last-child, .g-source > :last-child, .g-cta > :last-child, .g-coupon > :last-child { margin-bottom: 0; }
.g-warn { border: 1px solid #f0d9a8; border-inline-start: 4px solid #b26a00; background: #fff8ea; }
.g-source { border: 1px solid var(--l-hair); background: var(--l-soft); color: var(--l-ink); font-size: 16px; line-height: 1.8; }
.g-cta { border: 1px solid var(--l-line); background: var(--l-bg); box-shadow: var(--sh-1); }
.g-cta a { font-weight: 600; }
.g-coupon { border: 1.5px dashed var(--l-accent); background: #f6f7fd; text-align: start; }
.g-coupon__t { margin: 0 0 6px; font-size: 20px; font-weight: 600; line-height: 1.5; }
.g-coupon__b { margin: 0 0 14px; }
.g-coupon__go { margin: 0 0 10px; }
.g-coupon__n { margin: 0; color: var(--l-mute); font-size: 14px; line-height: 1.7; }
.g-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border-radius: 999px; background: var(--l-btn); color: var(--l-btn-ink) !important; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none; }
.g-btn:hover { background: var(--l-btn-hover); }

/* ---------- lists of guide pages (cluster hub, related, door pages, author page) ---------- */
.g-list { margin: 48px 0 0; }
.g-list__h, .entry-content .g-list__h { margin: 0 0 16px; font-size: 22px; line-height: 1.5; }
.g-list ul, .g-clusters { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.g-card { padding: 16px 18px; border: 1px solid var(--l-hair); border-radius: 14px; background: var(--l-bg); }
.g-card + .g-card { margin-top: 0; }
.g-card__a { color: var(--l-ink); font-size: 18px; font-weight: 600; line-height: 1.55; text-decoration: none; }
.g-card__a:hover { color: var(--l-accent); text-decoration: underline; }
.g-card__p { margin: 6px 0 0; color: var(--l-mute); font-size: 15px; line-height: 1.7; }
.g-card__n { margin: 8px 0 0; color: var(--l-mute); font-size: 13px; }
.g-list__all { margin: 14px 0 0; }
@media (min-width: 720px) { .g-clusters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.entry-content .g-door { margin-top: 64px; }
.entry-content .g-door ul { padding: 0; }

/* ---------- the author box ---------- */
.g-author { display: flex; gap: 16px; align-items: flex-start; margin: 48px 0 0; padding: 20px; border: 1px solid var(--l-hair); border-radius: 16px; background: var(--l-soft); }
.g-author__photo { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.g-author__name { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.g-author__bio { margin: 0 0 10px; font-size: 16px; line-height: 1.8; }
.g-author__links { margin: 0; font-size: 15px; line-height: 1.9; }
.g-author__links span { margin-inline: 4px; color: var(--l-mute); }
@media (max-width: 479px) { .g-author { flex-direction: column; } }
