/* Qalam — article reading mode (single posts) + category badges.
   Width and text size come from Customize → Article page. */

.q-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.q-badge--lang { background: transparent; color: var(--q-link); box-shadow: inset 0 0 0 1.5px currentColor; }
.q-badge--lang:hover { background: var(--q-accent); color: #fff; box-shadow: none; }

/* Floating buttons off on articles (copy-link toast still works) */
.q-no-fab .q-fab-stack { display: none !important; }

/* ---------- Reading layout ---------- */
.q-reading.no-sidebar .q-main { max-width: calc(var(--q-read-w, 760px) + 88px); }
.q-reading .q-content > .q-wrap { padding-top: 28px; }
.q-reading .q-crumbs { max-width: calc(var(--q-read-w, 760px) + 88px); margin-inline: auto; }
.q-reading:not(.no-sidebar) .q-crumbs { max-width: none; }

.q-reading .q-article-head { margin-block-end: 22px; }
.q-reading .q-article-title { margin-top: 14px; font-size: clamp(30px, 4vw, 46px); line-height: 1.18; text-wrap: balance; }
.q-reading .q-article-dek { font-size: 19px; line-height: 1.6; }

.q-reading .q-article-body {
	font-size: calc(var(--q-read-font, 18px) * var(--q-article-scale));
	line-height: 1.9;
	color: color-mix(in srgb, var(--q-ink) 92%, var(--q-muted));
}
.q-reading .q-article-body > * { margin-block: 0 1.35em; }
.q-reading .q-article-body p { text-wrap: pretty; }
.q-reading .q-article-body h2 { font-size: 1.55em; margin-block: 1.8em .6em; color: var(--q-ink); }
.q-reading .q-article-body h3 { font-size: 1.28em; margin-block: 1.6em .5em; color: var(--q-ink); }
.q-reading .q-article-body strong { color: var(--q-ink); }
.q-reading .q-article-body a { color: var(--q-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.q-reading .q-article-body blockquote {
	margin-inline: 0; padding: 14px 20px; border-inline-start: 4px solid var(--q-gold);
	background: color-mix(in srgb, var(--q-gold) 8%, var(--q-surface)); border-radius: 0 12px 12px 0;
	font-style: normal;
}
.q-reading .q-article-body blockquote > :last-child { margin-bottom: 0; }
.q-reading .q-article-body img { border-radius: 10px; }
.q-reading .q-article-body ul,
.q-reading .q-article-body ol { padding-inline-start: 1.3em; }
.q-reading .q-article-body li { margin-block: .35em; }
.q-reading .q-article-body[lang="ur"] { line-height: 2.3; }

/* Quieter end of article */
.q-reading .q-tags { margin-top: 28px; }
.q-reading .q-related { margin-top: 40px; }

/* ---------- Mobile: edge-to-edge reading ---------- */
@media (max-width: 782px) {
	.q-reading .q-content > .q-wrap { padding-top: 14px; }
	.q-reading .q-article { padding: 22px 18px 28px; border-radius: 14px; }
	.q-reading .q-article-title { font-size: clamp(26px, 7.4vw, 34px); }
	.q-reading .q-article-body { font-size: calc(max(16px, var(--q-read-font, 18px) - 1px) * var(--q-article-scale)); line-height: 1.85; }
	.q-reading .q-article-meta-row { gap: 10px; padding-block: 12px; margin-block-end: 20px; }
	.q-reading .q-article-meta-row .q-meta { width: 100%; gap: 4px 8px; font-size: 12.5px; flex-wrap: nowrap; white-space: nowrap; }
	.q-reading .q-article-meta-row .q-meta > * + *::before { margin-inline-end: 8px; }
	.q-reading .q-article-meta-row .q-meta-author { flex: none; }
	.q-reading .q-article-meta-row .q-meta-date { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
@media (max-width: 480px) {
	.q-reading .q-content > .q-wrap { padding-inline: 8px; }
	.q-reading .q-article { padding: 20px 16px 26px; }
}
@media (max-width: 420px) {
	.q-reading .q-article-meta-row .q-meta-read { display: none; }
}

/* ---------- Arabic and Mixed-language articles ---------- */
:root {
	--q-arabic: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", serif;
	--q-mixed: var(--q-font), "Noto Sans Devanagari", "Noto Nastaliq Urdu", sans-serif;
}
.q-article-head[lang="ar"] .q-article-title,
.q-card-title[lang="ar"],
.lang-ar .q-card-title,
.lang-ar .q-card-excerpt { font-family: var(--q-arabic); direction: rtl; text-align: right; line-height: 1.7; }
.q-article-body[lang="ar"] { font-family: var(--q-arabic); font-size: calc(1.3rem * var(--q-article-scale)); line-height: 2.1; }
.q-reading .q-article-body[lang="ar"] { font-size: calc((var(--q-read-font, 18px) + 3px) * var(--q-article-scale)); line-height: 2.15; }
.q-article-body[lang="ar"] h2,
.q-article-body[lang="ar"] h3 { font-family: var(--q-arabic); }

/* Mixed: every paragraph, heading and list item takes the direction of its own text */
.q-article-body[lang="mul"],
.q-article-head[lang="mul"] .q-article-title { font-family: var(--q-mixed); }
.q-article-head[lang="mul"] .q-article-title { font-family: var(--q-serif), "Noto Sans Devanagari", "Noto Nastaliq Urdu", serif; }
.q-article-body[lang="mul"] { line-height: 2.05; }
.q-article-body[lang="mul"] > *,
.q-article-body[lang="mul"] li,
.q-article-head[lang="mul"] .q-article-title,
.lang-mx .q-card-title,
.lang-mx .q-card-excerpt { unicode-bidi: plaintext; text-align: start; }
.lang-mx .q-card-title { font-family: var(--q-serif), "Noto Sans Devanagari", "Noto Nastaliq Urdu", serif; }

/* ---------- Category artwork (default thumbnails) ---------- */
.q-art { overflow: hidden; isolation: isolate; color: #fff; gap: 10px; }
.q-art--tone0 { background: linear-gradient(135deg, var(--q-accent), var(--q-dark)); }
.q-art--tone1 { background: linear-gradient(160deg, var(--q-dark), var(--q-accent) 120%); }
.q-art--tone2 { background: radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--q-gold) 35%, var(--q-accent)), var(--q-dark) 75%); }
.q-art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(0, 0, 0, .28)); }
.q-art-pattern { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; color: var(--q-gold); opacity: .2; }
.q-art-water { position: absolute; width: 62%; aspect-ratio: 1; right: -14%; bottom: -22%; z-index: -1; color: var(--q-gold); opacity: .13; }
.q-art-mark {
	display: grid; place-items: center; width: clamp(46px, 22%, 76px); aspect-ratio: 1; border-radius: 50%;
	color: var(--q-gold); font-size: inherit;
	background: color-mix(in srgb, var(--q-dark) 55%, transparent);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--q-gold) 55%, transparent), 0 0 0 6px color-mix(in srgb, var(--q-gold) 12%, transparent), 0 10px 24px rgba(0, 0, 0, .25);
}
.q-art-mark svg { width: 56%; height: 56%; }
.q-art-letter { font: 700 clamp(22px, 5vw, 34px)/1 var(--q-serif); color: var(--q-gold); }
.q-art-letter[lang="ur"] { font-family: var(--q-urdu); line-height: 1.6; }
.q-art-letter[lang="ar"] { font-family: var(--q-arabic, serif); }
.q-art-letter[lang="hi"] { font-family: var(--q-hindi); }
.q-art-name { display: inline-flex; align-items: center; gap: 10px; color: #fff; font: 600 clamp(12px, 2.4vw, 15px)/1.3 var(--q-font); letter-spacing: .14em; text-transform: uppercase; }
.q-art-name b { font-weight: 600; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.q-art-name i { display: block; width: 18px; height: 1px; background: color-mix(in srgb, var(--q-gold) 80%, transparent); }
.q-card:hover .q-art-mark { transform: scale(1.05); }
.q-art-mark { transition: transform .4s ease; }
.q-card--row .q-art-mark,
.q-hero-side .q-art-mark { width: 40px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--q-gold) 55%, transparent); }
.q-card--overlay .q-art { justify-content: flex-start; padding-top: 14%; }

/* ---------- Comments: compact form ---------- */
.q-cform { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.q-cform > * { grid-column: 1 / -1; }
.q-cform .comment-form-author { grid-column: 1; }
.q-cform .comment-form-email { grid-column: 2; }
.q-cform .comment-notes { font-size: 13px; color: var(--q-muted); margin: 0 0 10px; }
.q-cform textarea { min-height: 110px; resize: vertical; }
.q-cform .comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--q-muted); }
.q-cform .comment-form-cookies-consent input { margin-top: 3px; }
.q-cform .form-submit { margin: 4px 0 0; }
.q-cform.is-collapsed .comment-notes,
.q-cform.is-collapsed .comment-form-author,
.q-cform.is-collapsed .comment-form-email,
.q-cform.is-collapsed .comment-form-url,
.q-cform.is-collapsed .comment-form-cookies-consent,
.q-cform.is-collapsed .form-submit { display: none; }
.q-cform.is-collapsed textarea { min-height: 0; height: 52px; resize: none; cursor: text; }
.q-cform.is-collapsed .comment-form-comment { margin-bottom: 0; }
.q-comments .comment-respond .q-section-title { margin-bottom: 12px; }
.q-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.q-cform .comment-form-author,
.q-cform .comment-form-email { margin-bottom: 10px; }
.q-cform .comment-form-author input,
.q-cform .comment-form-email input { width: 100%; min-width: 0; }
.q-cform .comment-form-comment { margin-bottom: 10px; }

/* ---------- Translate menu ---------- */
.q-translate { position: relative; }
.q-translate > summary { list-style: none; cursor: pointer; }
.q-translate > summary::-webkit-details-marker { display: none; }
.q-translate[open] > summary { background: var(--q-accent); border-color: var(--q-accent); color: #fff; }
.q-translate-menu {
	position: absolute; z-index: 60; top: calc(100% + 8px); inset-inline-end: 0; width: 270px;
	padding: 12px; border-radius: 16px; background: var(--q-surface); border: 1px solid var(--q-line); box-shadow: var(--q-shadow-lg);
}
.q-translate-head { margin: 2px 4px 8px; font-size: 13px; font-weight: 700; color: var(--q-ink); }
.q-translate-menu ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: 300px; overflow-y: auto; }
.q-translate-menu a { display: grid; gap: 1px; padding: 7px 10px; border-radius: 10px; color: var(--q-ink); }
.q-translate-menu a:hover { background: var(--q-surface-2); color: var(--q-link); }
.q-translate-menu a span { font-size: 15px; font-weight: 600; line-height: 1.5; }
.q-translate-menu a[lang="ur"] span { font-family: var(--q-urdu); }
.q-translate-menu a[lang="hi"] span,
.q-translate-menu a[lang="mr"] span { font-family: var(--q-hindi); }
.q-translate-menu a small { font-size: 11px; color: var(--q-muted); }
.q-translate-note { margin: 10px 4px 2px; font-size: 11px; line-height: 1.5; color: var(--q-muted); }
@media (max-width: 600px) {
	.q-translate-menu { position: fixed; top: auto; bottom: 12px; inset-inline: 12px; width: auto; border-radius: 20px; padding: 16px; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
	.q-translate-menu ul { max-height: 50vh; }
}

/* ---------- Invite a writer ---------- */
.q-invite { position: relative; display: inline-block; }
.q-invite-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
	font: 600 14px/1.2 var(--q-font, inherit); color: var(--q-link, #0f5e4b); background: transparent; border: 1.5px dashed currentColor;
}
.q-invite-btn:hover { border-style: solid; }
.q-invite--light .q-invite-btn { color: #fff; border-color: rgba(255, 255, 255, .6); }
.q-invite-menu {
	position: absolute; z-index: 70; top: calc(100% + 8px); inset-inline-start: 0; min-width: 210px; display: grid; gap: 2px;
	padding: 8px; border-radius: 14px; background: var(--q-surface, #fff); border: 1px solid var(--q-line, #e3dfd6); box-shadow: 0 10px 30px rgba(16, 32, 28, .18);
}
.q-invite-menu[hidden] { display: none; }
.q-invite-menu a,
.q-invite-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 10px; background: none; cursor: pointer; text-decoration: none; text-align: start; font: 600 14px/1.2 var(--q-font, inherit); color: var(--q-ink, #1b1f1e); }
.q-invite-menu a:hover,
.q-invite-menu button:hover { background: var(--q-surface-2, #f8f6f1); }
.q-hero-panel .q-invite { margin-top: 14px; }

/* Copy full article */
.q-copy-article.is-done { background: var(--q-accent); border-color: var(--q-accent); color: #fff; }

/* Writer dashboard: invite card + profile photo */
.q-wd-invite { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 18px; padding: 18px 20px; border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--q-gold) 70%, var(--q-line)); background: color-mix(in srgb, var(--q-gold) 7%, var(--q-surface)); }
.q-wd-invite strong { display: block; color: var(--q-ink); }
.q-wd-invite span { font-size: 14px; color: var(--q-muted); }
.q-wd-invite .q-invite-menu { inset-inline-start: auto; inset-inline-end: 0; }
.q-wd-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.q-wd-fieldset:disabled input,
.q-wd-fieldset:disabled select,
.q-wd-fieldset:disabled textarea { opacity: .7; cursor: not-allowed; }
.q-wd-fieldset:disabled .q-wd-photo { cursor: default; }
.q-wd-fieldset:disabled .q-wd-photo-edit,
.q-wd-fieldset:disabled .q-wd-photo-hint { display: none; }
.q-wd-photo { position: relative; flex: none; cursor: pointer; }
.q-wd-photo .q-wd-avatar { width: 84px; height: 84px; object-fit: cover; }
.q-wd-photo-edit { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--q-accent); color: #fff; border: 2px solid var(--q-surface); }
