
/* Alahazrat Modules Shared Frontend Core */
.ahm-reader-toolbar{
	display:flex;justify-content:space-between;align-items:center;gap:10px;
	margin:0 auto 12px;padding:9px 12px;background:#fff;border:1px solid var(--ahm-border);
	border-radius:12px;box-shadow:0 3px 12px rgba(0,0,0,.035)
}
.ahm-toolbar-group{display:flex;gap:7px;align-items:center}
.ahm-tool-btn{
	display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:6px 10px;
	border:1px solid #e3dbea;border-radius:8px;background:#fff;color:#463d4d;
	font:600 13px/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
	text-decoration:none;cursor:pointer
}
.ahm-tool-btn:hover{background:#f8f4fb;border-color:#cbb9db;color:var(--ahm-purple)}
.ahm-share-views{
	display:flex;
	flex-direction:column;
	justify-content:center;
	align-items:center;
	gap:10px;
	text-align:center;
	border-top:1px solid var(--ahm-border);
	padding-top:14px;
	margin-top:8px
}
.ahm-views{font:500 13px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#665d6b}
.ahm-sharing{display:flex;gap:6px;align-items:center;justify-content:center}
.ahm-share-btn{width:36px;height:32px;border:0;border-radius:6px;cursor:pointer;color:#fff;font:700 15px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.ahm-email{background:#9aa6ad}.ahm-facebook{background:#1877f2}.ahm-x{background:#111820}.ahm-whatsapp{background:#25d366}

/* Common typography hooks modules can opt into */
.ahm-urdu{font-family:var(--ahm-urdu-font)!important;direction:rtl}
.ahm-arabic{font-family:var(--ahm-arabic-font)!important;direction:rtl}

/* Common dark reader mode */
body.ahm-dark-mode .ahm-reader-surface{background:#1c1721!important;color:#eee!important;border-color:#3d3146!important}
body.ahm-dark-mode .ahm-reader-surface h1,
body.ahm-dark-mode .ahm-reader-surface h2{color:#e8ca6f!important}
body.ahm-dark-mode .ahm-reader-toolbar{background:#1c1721;border-color:#3d3146;color:#eee}
body.ahm-dark-mode .ahm-tool-btn{background:#26202d;border-color:#44384d;color:#eee}
body.ahm-dark-mode .ahm-share-views{border-color:#3d3146}
body.ahm-dark-mode .ahm-views{color:#cfc6d4}

@media(max-width:620px){
	.ahm-reader-toolbar{align-items:stretch}
	.ahm-toolbar-group{flex-wrap:wrap}
	.ahm-share-views{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
	.ahm-sharing{margin-top:0;justify-content:center}
}
@media print{
	.ahm-reader-toolbar,.ahm-share-views{display:none!important}
	body.ahm-dark-mode .ahm-reader-surface{background:#fff!important;color:#000!important}
}


/* v1.1.4: keep engagement centered across every Shared Core module */
.ahm-share-views{
	width:100%;
	box-sizing:border-box;
	margin-left:auto!important;
	margin-right:auto!important;
}
.ahm-share-views .ahm-views,
.ahm-share-views .ahm-sharing{
	width:auto;
	max-width:100%;
	margin-left:auto;
	margin-right:auto;
}
@media(max-width:620px){
	.ahm-share-views{
		padding-left:12px;
		padding-right:12px;
	}
}


/* ==========================================================
   v1.2.0 — CENTRAL READER TOOLBAR STANDARD
   Desktop/tablet: sticky top
   Mobile: fixed bottom
   Applies to every CPT using ahm_render_reader_toolbar().
   ========================================================== */

.ahm-reader-toolbar{
	position:-webkit-sticky!important;
	position:sticky!important;
	top:52px!important;
	bottom:auto!important;
	left:auto!important;
	right:auto!important;
	z-index:9998!important;
	width:100%!important;
	max-width:100%!important;
	min-height:48px;
	box-sizing:border-box!important;
	display:flex!important;
	flex-direction:row!important;
	justify-content:space-between!important;
	align-items:center!important;
	gap:10px!important;
	margin:0 auto 14px!important;
	padding:8px max(12px,calc((100vw - 1240px)/2))!important;
	background:rgba(255,255,255,.96)!important;
	border:0!important;
	border-top:1px solid var(--ahm-border)!important;
	border-bottom:1px solid var(--ahm-border)!important;
	border-radius:0!important;
	box-shadow:0 5px 18px rgba(36,16,79,.07)!important;
	backdrop-filter:blur(10px);
	-webkit-backdrop-filter:blur(10px);
}

.admin-bar .ahm-reader-toolbar{
	top:84px!important;
}

.ahm-toolbar-group{
	display:flex!important;
	flex-direction:row!important;
	align-items:center!important;
	gap:7px!important;
	min-width:0;
}

.ahm-tool-btn{
	min-width:42px;
	min-height:34px;
	padding:6px 11px;
	white-space:nowrap;
}

body.ahm-dark-mode .ahm-reader-toolbar{
	background:rgba(28,23,33,.96)!important;
	border-color:#3d3146!important;
	box-shadow:0 5px 18px rgba(0,0,0,.22)!important;
}

/* Toolbar should span cleanly even when a module wraps it in a constrained page. */
.zoa-page>.ahm-reader-toolbar,
.dcm-page>.ahm-reader-toolbar,
.mdm-single-container>.ahm-reader-toolbar,
.naat-single-wrapper>.ahm-reader-toolbar{
	max-width:none!important;
}

/* Phones: one common bottom control bar. */
@media(max-width:768px){
	body:has(.ahm-reader-toolbar){
		padding-bottom:66px!important;
	}

	.ahm-reader-toolbar{
		position:fixed!important;
		top:auto!important;
		bottom:0!important;
		left:0!important;
		right:0!important;
		width:100vw!important;
		max-width:100vw!important;
		min-height:56px;
		margin:0!important;
		padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important;
		border-top:1px solid var(--ahm-border)!important;
		border-bottom:0!important;
		box-shadow:0 -5px 18px rgba(36,16,79,.10)!important;
		z-index:99999!important;
	}

	.admin-bar .ahm-reader-toolbar{
		top:auto!important;
	}

	.ahm-toolbar-group{
		flex-wrap:nowrap!important;
		gap:5px!important;
	}

	.ahm-tool-btn{
		min-width:38px;
		min-height:34px;
		padding:6px 8px;
		font-size:12px;
	}

	.ahm-toolbar-group:last-child .ahm-tool-btn{
		min-width:auto;
	}

	body.ahm-dark-mode .ahm-reader-toolbar{
		box-shadow:0 -5px 18px rgba(0,0,0,.34)!important;
	}
}

@media(max-width:380px){
	.ahm-reader-toolbar{
		padding-left:6px!important;
		padding-right:6px!important;
	}
	.ahm-toolbar-group{gap:4px!important}
	.ahm-tool-btn{
		min-width:35px;
		padding-left:6px;
		padding-right:6px;
		font-size:11px;
	}
}

@media print{
	.ahm-reader-toolbar{display:none!important}
	body:has(.ahm-reader-toolbar){padding-bottom:0!important}
}

@media(max-width:768px){
	body.ahm-has-reader-toolbar{padding-bottom:66px!important}
}


/* ==========================================================
   v1.3.0 — UNIFIED READER GRID + RELATED SIDEBAR
   Visual reference: Naat Lyrics right-side panel.
   Content/query remains module-specific; presentation is central.
   ========================================================== */
.ahm-reader-grid{
	width:100%;
	max-width:1400px;
	margin-left:auto;
	margin-right:auto;
	display:grid!important;
	grid-template-columns:minmax(0,1fr) 320px!important;
	gap:40px!important;
	align-items:start!important;
	box-sizing:border-box;
}
.ahm-reader-main{min-width:0}
.ahm-reader-sidebar{
	position:sticky;
	top:120px;
	min-width:0;
	width:100%;
}
.admin-bar .ahm-reader-sidebar{top:152px}
.ahm-sidebar-card{
	background:#F6F0E3;
	border:1px solid #E6D6AE;
	border-radius:14px;
	padding:22px;
	box-shadow:0 8px 24px rgba(0,0,0,.05);
	box-sizing:border-box;
}
.ahm-sidebar-kicker{
	display:block;
	margin:0 0 5px;
	color:var(--ahm-gold);
	font:800 10px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
	letter-spacing:.13em;
	text-transform:uppercase;
}
.ahm-sidebar-card h3{
	margin:0 0 18px;
	color:#8A6B16;
	font-size:18px;
	line-height:1.45;
}
.ahm-sidebar-card ul{list-style:none!important;padding:0!important;margin:0!important}
.ahm-sidebar-card li{
	padding:12px 0;
	margin:0;
	border-bottom:1px solid rgba(0,0,0,.08);
	list-style:none!important;
}
.ahm-sidebar-card li:last-child{border-bottom:0}
.ahm-related-link{
	display:flex!important;
	flex-direction:row-reverse;
	align-items:flex-start;
	gap:10px;
	text-decoration:none!important;
	color:#222;
}
.ahm-related-title{
	flex:1;
	min-width:0;
	text-align:right;
	font-family:var(--ahm-urdu-font)!important;
	font-size:20px;
	line-height:2;
	color:inherit;
}
.ahm-related-icon{
	flex:0 0 auto;
	color:var(--ahm-gold);
	font-size:13px;
	line-height:1;
	margin-top:12px;
	transition:transform .2s ease;
}
.ahm-sidebar-card li:hover{background:#fcf8ef}
.ahm-sidebar-card li:hover .ahm-related-icon{transform:translateX(-4px)}
body.ahm-dark-mode .ahm-sidebar-card{
	background:#211a27;
	border-color:#493b54;
	color:#eee;
}
body.ahm-dark-mode .ahm-sidebar-card h3,
body.ahm-dark-mode .ahm-sidebar-kicker{color:#e8ca6f}
body.ahm-dark-mode .ahm-sidebar-card li{border-color:#3b3043}
body.ahm-dark-mode .ahm-related-link,
body.ahm-dark-mode .ahm-related-title{color:#eee}
body.ahm-dark-mode .ahm-sidebar-card li:hover{background:#2a2130}

@media(max-width:900px){
	.ahm-reader-grid{
		grid-template-columns:minmax(0,1fr)!important;
		gap:20px!important;
	}
	.ahm-reader-sidebar{
		position:static!important;
		top:auto!important;
		width:100%;
	}
	.ahm-sidebar-card{width:100%}
}
@media(max-width:480px){
	.ahm-sidebar-card{padding:16px}
	.ahm-related-title{font-size:18px}
}
@media print{
	.ahm-reader-sidebar{display:none!important}
	.ahm-reader-grid{grid-template-columns:1fr!important}
}


/* ==========================================================
   v1.3.1 — UNIFIED SINGLE READER SHELL
   Master visual rhythm: Naat Lyrics + Masnoon Duas.
   ========================================================== */
.ahm-reader-page{
	--ahm-reader-max:1220px;
	background:#f7f7f8;
	color:#222;
}
.ahm-reader-shell{
	max-width:var(--ahm-reader-max);
	margin:0 auto;
	padding:0 20px 36px;
	box-sizing:border-box;
}
.ahm-reader-hero{
	max-width:var(--ahm-reader-max);
	margin:0 auto;
	padding:34px 20px 26px;
	text-align:center;
	box-sizing:border-box;
}
.ahm-reader-home-link{
	display:inline-flex;
	align-items:center;
	gap:6px;
	color:var(--ahm-gold);
	font-size:13px;
	text-decoration:none;
	margin-bottom:14px;
}
.ahm-reader-category{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	margin:0 4px 10px;
	padding:5px 12px;
	border:1px solid #ead7a2;
	background:var(--ahm-gold-soft);
	border-radius:999px;
	color:#8a6b16;
	font-size:11px;
	font-weight:700;
	text-decoration:none;
}
.ahm-reader-title{
	font-family:var(--ahm-urdu-font)!important;
	font-size:clamp(30px,3.3vw,42px)!important;
	line-height:1.75!important;
	font-weight:500!important;
	color:var(--ahm-purple)!important;
	margin:4px auto 0!important;
	max-width:900px;
	text-align:center!important;
}
.ahm-reader-subtitle{
	margin:8px auto 0;
	color:#6f6676;
	text-align:center;
}
.ahm-reader-shell>.ahm-reader-toolbar,
.ahm-reader-page>.ahm-reader-toolbar{
	margin-bottom:18px!important;
}
.ahm-reader-grid{
	max-width:var(--ahm-reader-max)!important;
}
.ahm-reader-main>.ahm-reader-surface{
	width:100%;
	max-width:none!important;
	margin:0!important;
	box-sizing:border-box;
}
.ahm-reader-engagement{
	max-width:var(--ahm-reader-max);
	margin:8px auto 0;
	padding:0 20px;
	box-sizing:border-box;
}
.ahm-reader-navigation{
	max-width:var(--ahm-reader-max);
	margin:20px auto 0;
	padding:0 20px;
	display:flex;
	align-items:stretch;
	justify-content:space-between;
	gap:18px;
	box-sizing:border-box;
}
.ahm-reader-navigation>div{min-width:0}
.ahm-reader-navigation a,
.ahm-reader-navigation .nav-btn{
	display:inline-flex;
	align-items:center;
	justify-content:center;
	min-height:48px;
	padding:8px 14px;
	background:#fff;
	color:#26202d;
	border:1px solid var(--ahm-border);
	border-radius:10px;
	text-decoration:none;
	box-sizing:border-box;
}
body.ahm-dark-mode .ahm-reader-page{background:#120f16;color:#eee}
body.ahm-dark-mode .ahm-reader-title{color:#ead071!important}
body.ahm-dark-mode .ahm-reader-category{background:#2b2430;border-color:#5b4b66;color:#e8ca6f}
body.ahm-dark-mode .ahm-reader-navigation a,
body.ahm-dark-mode .ahm-reader-navigation .nav-btn{background:#1c1721;border-color:#3d3146;color:#eee}

@media(max-width:900px){
	.ahm-reader-shell{padding-left:10px;padding-right:10px}
	.ahm-reader-hero{padding:28px 14px 22px}
	.ahm-reader-navigation{padding-left:10px;padding-right:10px}
}
@media(max-width:620px){
	.ahm-reader-title{font-size:29px!important}
	.ahm-reader-hero{padding-top:24px;padding-bottom:18px}
	.ahm-reader-navigation{gap:10px}
	.ahm-reader-navigation>div{flex:1}
	.ahm-reader-navigation a,
	.ahm-reader-navigation .nav-btn{width:100%;font-size:12px}
}
@media print{
	.ahm-reader-page{background:#fff!important}
	.ahm-reader-navigation{display:none!important}
}


/* ==========================================================
   v1.3.2 — AUTHORITATIVE READER TOP / HERO NORMALIZATION
   The module-specific old hero CSS must not change the common rhythm.
   ========================================================== */
.ahm-reader-page.naat-single-wrapper,
.ahm-reader-page.mdm-single-wrapper,
.ahm-reader-page.zoa-page,
.ahm-reader-page.dcm-page{
	max-width:none!important;
	width:100%!important;
	margin:0!important;
	padding:0!important;
	background:#f7f7f8!important;
}

.ahm-reader-page .ahm-reader-hero,
.ahm-reader-page .naat-hero.ahm-reader-hero,
.ahm-reader-page .mdm-single-head.ahm-reader-hero{
	width:100%!important;
	max-width:1220px!important;
	min-height:178px!important;
	margin:0 auto!important;
	padding:30px 20px 26px!important;
	display:flex!important;
	flex-direction:column!important;
	align-items:center!important;
	justify-content:center!important;
	text-align:center!important;
	background:transparent!important;
	box-shadow:none!important;
	box-sizing:border-box!important;
}

.ahm-reader-home-link{
	margin:0 0 8px!important;
	font:600 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
	color:var(--ahm-gold)!important;
}

.ahm-reader-chip-row{
	display:flex;
	flex-wrap:wrap;
	justify-content:center;
	align-items:center;
	gap:6px;
	min-height:27px;
	margin:0 0 8px;
}

.ahm-reader-page .ahm-reader-category,
.ahm-reader-page .mdm-hero-category.ahm-reader-category,
.ahm-reader-page .zoa-chip.ahm-reader-category,
.ahm-reader-page .dcm-chip.ahm-reader-category{
	display:inline-flex!important;
	width:auto!important;
	max-width:100%!important;
	margin:0!important;
	padding:5px 12px!important;
	border:1px solid #ead7a2!important;
	border-radius:999px!important;
	background:var(--ahm-gold-soft)!important;
	color:#8a6b16!important;
	font:700 11px/1.45 var(--ahm-urdu-font)!important;
	text-decoration:none!important;
	letter-spacing:0!important;
}

.ahm-reader-page .ahm-reader-title,
.ahm-reader-page .naat-title.ahm-reader-title,
.ahm-reader-page .mdm-title.ahm-reader-title{
	width:100%!important;
	max-width:900px!important;
	margin:2px auto 0!important;
	padding:0!important;
	font-family:var(--ahm-urdu-font)!important;
	font-size:38px!important;
	line-height:1.65!important;
	font-weight:500!important;
	color:var(--ahm-purple)!important;
	text-align:center!important;
}

.ahm-reader-page .ahm-reader-subtitle{
	margin:6px auto 0!important;
	color:#6f6676!important;
	font-size:13px!important;
	line-height:1.5!important;
	text-align:center!important;
}

/* Desktop toolbar gets one identical width/location for every reader CPT. */
@media(min-width:769px){
	.ahm-reader-page > .ahm-reader-toolbar,
	.ahm-reader-page > .ahm-reader-shell > .ahm-reader-toolbar,
	.ahm-reader-page .mdm-single-shell > .ahm-reader-toolbar{
		width:calc(100% - 40px)!important;
		max-width:1180px!important;
		margin:0 auto 18px!important;
		padding:8px 12px!important;
		top:52px!important;
		border:1px solid var(--ahm-border)!important;
		border-radius:0!important;
	}
	.admin-bar .ahm-reader-page > .ahm-reader-toolbar,
	.admin-bar .ahm-reader-page > .ahm-reader-shell > .ahm-reader-toolbar,
	.admin-bar .ahm-reader-page .mdm-single-shell > .ahm-reader-toolbar{
		top:84px!important;
	}
}

/* Main grid begins at the same visual line in all modules. */
.ahm-reader-page .ahm-reader-grid{
	width:calc(100% - 40px)!important;
	max-width:1180px!important;
	margin:0 auto!important;
	padding:0!important;
}
.ahm-reader-page .ahm-reader-main>.ahm-reader-surface{
	border-radius:16px!important;
}

/* Old module-specific title/category containers should not add spacing. */
.ahm-reader-page .naat-hero-inner,
.ahm-reader-page .zoa-single-cats,
.ahm-reader-page .dcm-single-cats{
	width:100%;
	max-width:none;
	margin:0!important;
	padding:0!important;
}
.ahm-reader-page .naat-collection,
.ahm-reader-page .naat-poet{
	margin:0!important;
}

/* Engagement/navigation width also matches the reader grid. */
.ahm-reader-page .ahm-reader-engagement,
.ahm-reader-page .ahm-reader-navigation{
	width:calc(100% - 40px)!important;
	max-width:1180px!important;
	margin-left:auto!important;
	margin-right:auto!important;
	padding-left:0!important;
	padding-right:0!important;
}

body.ahm-dark-mode .ahm-reader-page.naat-single-wrapper,
body.ahm-dark-mode .ahm-reader-page.mdm-single-wrapper,
body.ahm-dark-mode .ahm-reader-page.zoa-page,
body.ahm-dark-mode .ahm-reader-page.dcm-page{
	background:#120f16!important;
}

@media(max-width:768px){
	.ahm-reader-page .ahm-reader-hero,
	.ahm-reader-page .naat-hero.ahm-reader-hero,
	.ahm-reader-page .mdm-single-head.ahm-reader-hero{
		min-height:auto!important;
		padding:24px 14px 18px!important;
	}
	.ahm-reader-page .ahm-reader-title,
	.ahm-reader-page .naat-title.ahm-reader-title,
	.ahm-reader-page .mdm-title.ahm-reader-title{
		font-size:29px!important;
		line-height:1.7!important;
	}
	.ahm-reader-page .ahm-reader-grid,
	.ahm-reader-page .ahm-reader-engagement,
	.ahm-reader-page .ahm-reader-navigation{
		width:calc(100% - 20px)!important;
	}
}
