/**
 * Bismika Allahuma: article.css (3.0.6)
 *
 * The article as a reading page (inc/article.php): title and subtitle,
 * share links in the metadata bar, the reading column with the contents
 * beside it, the diamond drop cap and the notes as a references section.
 * Loads after single.css on articles only.
 */

/* ---------------------------------------------------------------
   Title and subtitle
   --------------------------------------------------------------- */
.bismika-article__title .bismika-title__colon { display: none; }
.bismika-article__title .bismika-title__sub {
	display: block;
	margin-top: .3em;
	font-size: .56em;
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: 0;
	color: var(--bm-text);
}

/* ---------------------------------------------------------------
   Metadata bar: five cells, the last one the share links
   --------------------------------------------------------------- */
.bismika-metabar { grid-template-columns: repeat(5, auto); }
.bismika-metabar__cell p:has(> .bismika-share) { margin: 0; }
.bismika-share { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-top: 1px; }
.bismika-share__btn {
	display: inline-grid;
	place-items: center;
	width: 30px;
	height: 30px;
	box-sizing: border-box;
	padding: 0;
	border: 1px solid var(--bm-border);
	border-radius: 50%;
	background: transparent;
	color: var(--bm-navy);
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.bismika-share__btn svg { width: 15px; height: 15px; }
.bismika-share__btn:hover,
.bismika-share__btn:focus-visible { border-color: var(--bm-accent); background: var(--bm-accent); color: #fff; }
.bismika-share__btn:focus-visible { outline: 2px solid var(--bm-gold, #b8913a); outline-offset: 2px; }
.bismika-share__copy.is-done { border-color: var(--bm-gold, #b8913a); background: var(--bm-gold, #b8913a); color: #fff; }

/* ---------------------------------------------------------------
   Reading column, with the contents beside it on wide screens
   --------------------------------------------------------------- */
.bismika-reading { --bm-measure: 760px; --bm-rail: 264px; --bm-rail-gap: 64px; }
.bismika-reading > .bismika-prose { max-width: var(--bm-measure); }
.bismika-rail { display: none; }

@media (min-width: 1240px) {
	.bismika-reading.has-rail {
		display: grid;
		grid-template-columns: var(--bm-rail) minmax(0, var(--bm-measure));
		column-gap: var(--bm-rail-gap);
		align-items: start;
	}
	.bismika-reading.has-rail > .bismika-prose { grid-column: 2; grid-row: 1; margin-block-start: 36px !important; }
	.bismika-reading.has-rail .bismika-prose .wp-toc { display: none; }
	.bismika-rail {
		display: block;
		grid-column: 1;
		grid-row: 1;
		position: sticky;
		top: 24px;
		margin-top: 36px;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
	}
	.admin-bar .bismika-rail { top: 56px; max-height: calc(100vh - 80px); }

	/* The box: a hairline frame, the title as a small heading, the list in the serif. */
	.bismika-rail .wp-toc {
		margin: 0;
		padding: 0;
		border: 1px solid var(--bm-border);
		border-radius: var(--bm-r-card, 10px);
		background: #fff;
		font-family: var(--bm-serif);
		font-size: 15px;
	}
	/* The box opens with a navy band in the star lattice of the minaret
	   base, fringed with the scalloped dome drum that runs under the menu. */
	.bismika-rail .wp-toc { overflow: hidden; }
	.bismika-rail .wp-toc-title {
		position: relative;
		display: flex;
		align-items: center;
		gap: 10px;
		margin: 0;
		padding: 14px 18px 15px;
		background-color: var(--bm-navy);
		background-image: var(--bm-motif-lattice);
		background-size: 56px 56px;
		background-position: center;
		font-family: var(--bm-sans);
		font-size: 11px;
		font-weight: 700;
		letter-spacing: .14em;
		color: #fff;
	}
	.bismika-rail .wp-toc-title::before {
		content: "";
		flex: 0 0 13px;
		width: 13px;
		height: 13px;
		background: var(--bm-gold-soft, #c9a24a);
		-webkit-mask: var(--bm-motif-star) center / contain no-repeat;
		mask: var(--bm-motif-star) center / contain no-repeat;
	}
	.bismika-rail .wp-toc-title::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: -6px;
		height: 6px;
		background: var(--bm-navy);
		-webkit-mask: var(--bm-motif-scallop) repeat-x 0 0 / 16px 6px;
		mask: var(--bm-motif-scallop) repeat-x 0 0 / 16px 6px;
	}
	.bismika-rail .wp-toc-list { margin: 0; padding: 16px 0 12px; list-style: none; counter-reset: none; }
	.bismika-rail .wp-toc-list > li { counter-increment: none; }
	.bismika-rail .wp-toc-list li { margin: 0; }
	.bismika-rail .wp-toc-list a {
		position: relative;
		display: block;
		padding: 7px 18px 7px 30px;
		border: 0;
		font-size: 15px;
		line-height: 1.35;
		color: var(--bm-text);
		text-decoration: none;
	}
	.bismika-rail .wp-toc-list > li > a::before { content: none; }
	.bismika-rail .wp-toc-list ul { margin: 0; padding: 0; list-style: none; }
	.bismika-rail .wp-toc-list ul a { padding-left: 44px; font-size: 14px; color: var(--bm-meta); }
	.bismika-rail .wp-toc-list a:hover { color: var(--bm-accent); }
	/* The section being read: a gold eight-point star and the navy. */
	.bismika-rail .wp-toc-list a.is-current { color: var(--bm-navy); font-weight: 700; }
	.bismika-rail .wp-toc-list a.is-current::after {
		content: "";
		position: absolute;
		left: 11px;
		top: calc(7px + .67em - 5.5px);
		width: 11px;
		height: 11px;
		background: var(--bm-gold, #b8913a);
		-webkit-mask: var(--bm-motif-star) center / contain no-repeat;
		mask: var(--bm-motif-star) center / contain no-repeat;
	}
	/* WP TOC's own show/hide button, if switched on, stays usable in the box. */
	.bismika-rail .wp-toc button { font: inherit; }
}

/* ---------------------------------------------------------------
   Drop cap: the letter in a gold eight-point star (the khatam of the
   Kapitan Keling minaret base), or in a diamond (Theme Options)
   --------------------------------------------------------------- */
.bismika-prose p.bismika-dropcap.has-letter::first-letter {
	float: none;
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
}
.bismika-dropcap__letter {
	position: relative;
	z-index: 0;
	float: left;
	display: grid;
	place-items: center;
	width: 1.8em;
	height: 1.8em;
	margin: .08em .42em .05em .04em;
	font-size: 2.5em;
	font-weight: 700;
	line-height: 1;
	color: var(--bm-accent);
}
.bismika-dropcap__letter::before,
.bismika-dropcap__letter::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 15%;
	border: 1.5px solid var(--bm-gold, #b8913a);
	transform: rotate(45deg);
}
/* The star: a second square, square to the page, over the diamond; the
   faint gold wash inside reads as gilding without crowding the letter. */
.bismika-dropcap--star .bismika-dropcap__letter::before { background: color-mix(in srgb, var(--bm-gold, #b8913a) 7%, transparent); }
.bismika-dropcap--star .bismika-dropcap__letter::after { transform: none; }
.bismika-dropcap--diamond .bismika-dropcap__letter::after { display: none; }
@media (max-width: 699px) {
	.bismika-dropcap__letter { font-size: 2.2em; margin-right: .32em; }
}

/* ---------------------------------------------------------------
   Notes as a references section
   --------------------------------------------------------------- */
.bismika-prose .wp-block-footnotes {
	margin-top: 3em !important;
	padding: 0 !important;
	font-size: .78em;
	list-style-position: outside;
}
.bismika-prose .wp-block-footnotes::before {
	content: "Notes";
	display: block;
	margin: 0 0 1em;
	padding: 1.1em 0 0;
	border-top: 1px solid var(--bm-border);
	background: none;
	font-family: var(--bm-serif);
	font-size: 2.05em;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.15;
	text-transform: none;
	color: var(--bm-navy);
	column-span: all;
}
/* The gold star on the rule above the notes, as on the home page's section rules. */
.bismika-prose .wp-block-footnotes { position: relative; }
.bismika-prose .wp-block-footnotes::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 16px;
	height: 16px;
	box-shadow: 0 0 0 5px var(--bm-ivory, #fbf9f3);
	background: var(--bm-gold, #b8913a);
	-webkit-mask: var(--bm-motif-star) center / contain no-repeat;
	mask: var(--bm-motif-star) center / contain no-repeat;
	transform: translateY(-50%);
}
.bismika-prose .wp-block-footnotes > li {
	margin: 0 0 0 2.1em !important;
	padding: .3em 0 .7em .2em;
	border-bottom: 0;
	break-inside: avoid;
}
.bismika-prose .wp-block-footnotes > li::marker { font-size: .78em; }
@media (min-width: 900px) {
	/* Long lists in two columns, as in a printed journal. */
	.bismika-prose .wp-block-footnotes:has(> li:nth-child(6)) { column-count: 2; column-gap: 40px; }
}

/* ---------------------------------------------------------------
   Smaller screens
   --------------------------------------------------------------- */
@media (max-width: 1099px) {
	.bismika-metabar { grid-template-columns: repeat(3, auto); }
	.bismika-metabar__cell:nth-child(4) { padding-left: 0; border-left: 0; }
	.bismika-metabar__cell:nth-child(n+4) { border-top: 1px solid var(--bm-border); }
}
@media (max-width: 699px) {
	.bismika-metabar { grid-template-columns: 1fr 1fr; }
	.bismika-metabar__cell:nth-child(4) { padding-left: 14px; border-left: 1px solid var(--bm-border); }
	.bismika-metabar__cell:last-child:nth-child(odd) { grid-column: 1 / -1; padding-left: 0; border-left: 0; }
}

@media print {
	.bismika-share,
	.bismika-rail { display: none !important; }
	.bismika-reading > .bismika-prose { max-width: none; }
}
