/*
Theme Name:  AK Child
Theme URI:   https://ahamedkameel.com
Description: Scholarly Classic for ahamedkameel.com. A child of Astra that sets the reading typography for Prof. Dr. Ahamed Kameel Mydin Meera's papers and books.
Author:      AK Publishing
Template:    astra
Version:     1.0.1
License:     GNU General Public License v2 or later
Text Domain: ak-child
*/

/* ==========================================================================
   Fonts — self-hosted.
   Split into 'latin' and 'latin-ext' with their unicode-range descriptors
   intact. This split is load-bearing: the macron vowels the author uses
   (ā U+0101, ī U+012B, ū U+016B in Maqāsid, al-Sharī'ah, zakāt, fulūs,
   Marwān) live ONLY in the latin-ext file, while the curly quotes and en
   dash live ONLY in latin. Collapse these into one @font-face pointing at
   the latin file and the macron vowels fall back to a system font
   mid-word, so the reader sees two typefaces inside a single word.
   ========================================================================== */

/* Source Serif 4 — reading face */
@font-face {
	font-family: 'Source Serif 4';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/sourceserif4-400-normal-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Source Serif 4';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/sourceserif4-400-normal-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Source Serif 4';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('assets/fonts/sourceserif4-600-normal-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Source Serif 4';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('assets/fonts/sourceserif4-600-normal-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Source Serif 4';
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/sourceserif4-400-italic-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Source Serif 4';
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/sourceserif4-400-italic-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Sans 3 — apparatus: metadata, captions, tables, notes */
@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/sourcesans3-400-normal-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('assets/fonts/sourcesans3-400-normal-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('assets/fonts/sourcesans3-600-normal-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('assets/fonts/sourcesans3-600-normal-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Tokens
   ========================================================================== */

:root {
	--ak-font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
	--ak-font-sans:  'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;

	--ak-ink:    #23201b;   /* warm near-black, not #000 */
	--ak-muted:  #6b6558;
	--ak-ground: #fdfcf9;   /* faintly warm off-white */
	--ak-rule:   #ded7c9;
	--ak-accent: #1f5140;   /* deep green, one accent used sparingly */
	--ak-tint:   #f4f1e9;

	--ak-measure: 68ch;
}

/* ==========================================================================
   Reading typography
   Astra sets these on .entry-content and its own containers; scoping to
   .ak-article beats Astra's selectors without an !important war.
   ========================================================================== */

/*
 * Specificity notes, verified against getComputedStyle on the live page rather
 * than assumed:
 *
 * 1. A bare `body { background }` (0,0,1) LOSES to Astra's
 *    `.ast-separate-container` / `.ast-plain-container` (0,1,0), which is a class
 *    on the body element. Order does not save it. Qualify with the body class.
 * 2. `.ak-article` (0,1,0) LOSES to `.ast-separate-container .ast-article-single`
 *    (0,2,0), so `margin-inline: auto` silently never applied and the reading
 *    column sat hard left. Match the two-class weight and rely on this sheet
 *    loading after Astra's.
 *
 * If either rule stops working, read the computed style before editing. Grepping
 * for the selector proves nothing when a longer one exists elsewhere.
 */
body.ast-plain-container,
body.ast-separate-container,
body.ast-page-builder-template {
	background-color: var(--ak-ground);
	color: var(--ak-ink);
}

.ak-article,
.ak-article.ast-article-single {
	max-width: var(--ak-measure);
	margin-inline: auto;
	padding-inline: 0;
	background: transparent;
	font-family: var(--ak-font-serif);
	font-size: 1.1875rem;      /* 19px */
	line-height: 1.7;
	color: var(--ak-ink);
}

/* Keep the column off the bezel on small screens now that Astra's padding is gone. */
@media (max-width: 782px) {
	.ak-article,
	.ak-article.ast-article-single,
	.ak-archive {
		padding-inline: 1.25rem;
	}
}

@media (max-width: 782px) {
	.ak-article {
		font-size: 1.125rem;   /* 18px */
	}
}

/* Journal prose: paragraphs run on with a first-line indent rather than
   sitting in separate blocks. The first paragraph after a heading is flush. */
.ak-article .entry-content p {
	margin: 0;
	text-indent: 1.5em;
}

.ak-article .entry-content > p:first-child,
.ak-article .entry-content h2 + p,
.ak-article .entry-content h3 + p,
.ak-article .entry-content h4 + p,
.ak-article .entry-content .ak-table-scroll + p,
.ak-article .entry-content figure + p,
.ak-article .entry-content blockquote + p {
	text-indent: 0;
}

.ak-article .entry-content h2,
.ak-article .entry-content h3,
.ak-article .entry-content h4 {
	font-family: var(--ak-font-serif);
	font-weight: 600;
	line-height: 1.25;
	color: var(--ak-ink);
	margin: 2.25rem 0 0.75rem;
	text-wrap: balance;
}

.ak-article .entry-content h2 { font-size: 1.5rem; }
.ak-article .entry-content h3 { font-size: 1.25rem; }
.ak-article .entry-content h4 { font-size: 1.0625rem; }

.ak-article .entry-content blockquote {
	margin: 1.5rem 0 1.5rem 1.5rem;
	padding-left: 1rem;
	border-left: 2px solid var(--ak-rule);
	font-size: 1.0625rem;
	color: var(--ak-ink);
}

.ak-article .entry-content ul,
.ak-article .entry-content ol {
	margin: 1rem 0 1rem 1.5rem;
}

.ak-article .entry-content li {
	margin-bottom: 0.375rem;
}

/* Links in prose are always underlined. Colour alone never carries meaning. */
.ak-article .entry-content a {
	color: var(--ak-accent);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 0.06em;
}

/* ==========================================================================
   Paper header
   ========================================================================== */

.ak-paper-header {
	max-width: var(--ak-measure);
	margin: 0 auto 2rem;
	padding-top: 1rem;
}

.ak-title {
	font-family: var(--ak-font-serif);
	font-size: clamp(1.875rem, 4.5vw, 2.5rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	color: var(--ak-ink);
	margin: 0 0 0.5rem;
	text-wrap: balance;
}

/* ==========================================================================
   Archives
   ========================================================================== */

.ak-archive {
	max-width: var(--ak-measure);
	margin-inline: auto;
}

.ak-archive__intro {
	font-family: var(--ak-font-serif);
	font-size: 1.125rem;
	color: var(--ak-muted);
	margin: 0 0 2.5rem;
}

.ak-year {
	font-family: var(--ak-font-sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ak-muted);
	margin: 2.5rem 0 0.75rem;
	padding-bottom: 0.375rem;
	border-bottom: 1px solid var(--ak-rule);
}

.ak-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ak-list li {
	padding: 0.875rem 0;
	border-bottom: 1px solid var(--ak-rule);
}

.ak-list__title {
	display: block;
	font-family: var(--ak-font-serif);
	font-size: 1.1875rem;
	line-height: 1.3;
	color: var(--ak-ink);
	text-decoration: none;
}

.ak-list__title:hover,
.ak-list__title:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.ak-list__meta {
	display: block;
	font-family: var(--ak-font-sans);
	font-size: 0.875rem;
	color: var(--ak-muted);
	margin-top: 0.25rem;
}

/* Books read as a cover grid rather than a list. */
.ak-books {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
	gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ak-books img {
	width: 100%;
	height: auto;
	display: block;
	box-shadow: 0 2px 12px rgba(35, 32, 27, 0.14);
}

/* ==========================================================================
   Book
   ========================================================================== */

.ak-book {
	display: grid;
	grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
	max-width: var(--ak-measure);
	margin: 0 auto 2.5rem;
}

/* Cover above details once the two columns stop earning their keep. */
@media (max-width: 640px) {
	.ak-book {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
	.ak-book__cover {
		max-width: 12rem;
	}
}

.ak-book__cover img {
	width: 100%;
	height: auto;
	display: block;
	box-shadow: 0 3px 18px rgba(35, 32, 27, 0.18);
}

.ak-book__facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.25rem 1rem;
	font-family: var(--ak-font-sans);
	font-size: 0.9375rem;
	margin: 1.25rem 0;
}

.ak-book__facts dt {
	color: var(--ak-muted);
}

.ak-book__facts dd {
	margin: 0;
	color: var(--ak-ink);
}

/* ==========================================================================
   Reading progress — the only thing that follows the scroll
   ========================================================================== */

.ak-progress {
	position: fixed;
	inset-block-start: 0;
	inset-inline-start: 0;
	block-size: 2px;
	inline-size: 0;
	background: var(--ak-accent);
	z-index: 999;
}

@media (prefers-reduced-motion: no-preference) {
	.ak-progress { transition: inline-size 80ms linear; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
	.ak-progress,
	.site-header,
	.site-footer,
	.ast-above-header,
	.ast-below-header {
		display: none !important;
	}

	.ak-article {
		max-width: none;
		font-size: 11pt;
	}
}
