/* 
 ---------------------------------
 |   LAST UPDATED: 2026-04-13    |
 ---------------------------------
 */

/* OWNER: inline TOC card shell, borders, shovel, and tocbot content styles.
   VIEWPORT HEADNOTE: Standard boundaries 1024, 768–1023, ≤767. */

/* ========================================================================
   VIEWPORT-AGNOSTIC (base styles)
   ======================================================================== */

/* === Shell: flex row with left/right ornament columns flanking .toc-card === */
.toc-card-shell {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	width: 100%;
	overflow: visible;
	position: relative;
	z-index: 1;
	margin: calc(2vw * var(--scale)) 0 calc(2.4vw * var(--scale));
	font-family: var(--font2);
	font-size: var(--toc-inline-font-size);
	line-height: 1.25;
	color: var(--text-color);
	letter-spacing: -0.02em;
	font-feature-settings: var(--font-features-global);
	font-variant-ligatures: normal;
	font-kerning: auto;
}

/* === Ornament columns (left + right vertical rails) === */
.toc-card-shell__ornament {
	position: relative;
	flex-shrink: 0;
	align-self: stretch;
	overflow: visible;
	color: var(--text-color);
	fill: currentColor;
	z-index: 2;
}

.toc-card-shell__ornament--left,
.toc-card-shell__ornament--right {
	/* Wider rail column so vertical art + text aren’t clipped (ISSUES-LIST-CURRENT2 follow-up). */
	width: clamp(36px, 5.5vw, 56px);
}

.toc-card-shell__ornament--left > svg,
.toc-card-shell__ornament--right > svg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
}

/* §2 vertical overfit — THEME_ARCH-borders.md */
.toc-card-shell__ornament--left > svg.orn-clef--vertical,
.toc-card-shell__ornament--right > svg.orn-clef--vertical {
	height: 120%;
	top: -10%;
	width: 100%;
	left: 0;
}

/* === Shovel (§4 — decorative glyph inside .toc-card, above .gh-toc) === */
.toc-card .toc-card-shell__ornament--shovel {
	display: block;
	position: relative;
	pointer-events: none;
	z-index: 1;
	align-self: center;
	width: 25%;
	max-width: 25%;
	margin: 0 0 1rem;
	flex-shrink: 0;
	box-sizing: border-box;
}

.toc-card .toc-card-shell__ornament--shovel svg {
	position: relative;
	width: 100%;
	height: auto;
	display: block;
	color: var(--text-color);
}

/* === TOC card (content area between ornament columns) === */
.toc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	flex: 1;
	min-width: 0;
	margin: 0;
	/* Min inline padding so left rail + shovel glyph are never clipped (ISSUES-LIST-CURRENT2). */
	padding-top: calc(0.55vw * var(--scale));
	padding-bottom: calc(0.55vw * var(--scale));
	padding-left: max(1.2rem, calc(1.4vw * var(--scale) + 0.25rem));
	padding-right: max(0.65rem, calc(1.4vw * var(--scale)));
	border: none;
	border-radius: 0;
	background: var(--background-color);
	font-family: var(--font2);
	font-size: var(--toc-inline-font-size);
	line-height: 1.2em !important;
	text-decoration: none;
}

.toc-card .gh-toc {
	margin: 0;
	padding: 0;
	width: 100%;
	align-self: stretch;
}

/* === Hard reset: neutralise .post-content list bleed === */
.toc-card ul,
.toc-card ol {
	list-style: none !important;
	padding-left: 0 !important;
	margin: 0 !important;
}

.toc-card li,
.toc-card p {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 0 .75em 0 !important;
	font-size: inherit !important;
	line-height: inherit !important;
}

.toc-card li::marker {
	content: none !important;
}

/* === Inline layout (tocbot items rendered inline with separators) === */
.toc-card .toc-list,
.toc-card .toc-list .toc-list {
	display: inline;
	padding: 0;
	margin: 0;
}

.toc-card .toc-list-item {
	display: inline;
	margin: 0;
	padding: 0;
}

.toc-card .toc-line-sep {
	display: inline;
	margin: 0 -0.05em;
	padding: 0;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: -0.02em;
	word-spacing: 0;
}

.toc-card .toc-link {
	display: inline;
	padding: 0;
	margin: 0;
	vertical-align: baseline;
	border: none;
	box-shadow: none;
	text-decoration: none;
	color: currentColor;
}

.toc-card .toc-link:hover,
.toc-card .toc-link:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-decoration-color: var(--footnote-ref-decoration-color);
}

.toc-card .toc-link:before {
	display: none;
}

/* === Depth labels: CommitMono spans with ISSUES-specified weights === */
.toc-card .toc-link span.toc1,
.toc-card .toc-link span.toc2,
.toc-card .toc-link span.toc3,
.toc-card .toc-link span.toc4 {
	font-family: var(--font3);
	margin: 0;
	padding: 0;
	color: inherit;
}

.toc-card .toc-link span.toc1 { font-weight: 700; }
.toc-card .toc-link span.toc2 { font-weight: 550; }
.toc-card .toc-link span.toc3 { font-weight: 400; font-style: normal; }
.toc-card .toc-link span.toc4 { font-weight: 275; }

/* Each top-level heading group is a .toc-line block */
.toc-card .toc-line {
	display: block;
	margin: 0 0 0.25em 0;
	padding: 0 0.25em 0 max(0.5rem, 0.45em);
	line-height: 1.2em !important;
	word-spacing: 0;
}

.toc-card .toc-line:last-child {
	margin-bottom: 0;
}

/* Inline active-link: inherit depth weight, no forced bold */
.toc-card .toc-link.is-active-link {
	font-weight: inherit;
}

/* === Collapsed state (toggled by motion-effects.js §6) === */
.toc-card-shell[data-collapsed="true"] .gh-toc {
	overflow: hidden;
}

/* ========================================================================
   DESKTOP + TABLET (768px+)
   ======================================================================== */
@media (min-width: 768px) {
	.toc-card-shell {
		float: right;
		max-width: 40%;
		margin: 0 0 calc(1.5vw * var(--scale)) calc(2vw * var(--scale));
	}

	/* Breathing room below excerpt/metadata before floated TOC (post.hbs order). */
	.post-content > .excerpt-and-metadata + .toc-card-shell {
		margin-top: 1.35rem;
	}

	.toc-card {
		padding-top: calc(0.45vw * var(--scale));
		padding-bottom: calc(0.45vw * var(--scale));
		padding-left: max(0.95rem, calc(1.0vw * var(--scale)));
		padding-right: max(0.55rem, calc(1.0vw * var(--scale)));
	}
}

/* ========================================================================
   TABLET + MOBILE (≤1023px)
   ======================================================================== */
@media (max-width: 1023px) {
	.toc-card-shell {
		/* Clear author/metadata row + avoid rail crowding preceding line (don’t shorthand margin — tablet float keeps 768px+ horizontal inset). */
		margin-top: 2.25rem;
		margin-bottom: 1.6em;
		padding-top: 0.35rem;
	}

	.toc-card-shell__ornament--left,
	.toc-card-shell__ornament--right {
		width: clamp(40px, 7vw, 56px);
	}

	.toc-card {
		padding-top: 0.45em;
		padding-bottom: 0.45em;
		padding-left: max(1.15rem, 0.85em);
		padding-right: max(0.65em, 0.75em);
	}
}
