/* =========================================================================
   Genius Post Design
   Token system (overridable via inline <style> injected from PHP options)
   ========================================================================= */
:root {
	--gpd-accent: #FFC738;
	--gpd-accent-ink: #17140F;
	--gpd-bg: #17140F;
	--gpd-bg-elevated: #211D16;
	--gpd-text: #F3EEE2;
	--gpd-text-muted: #B8AF9D;
	--gpd-line: rgba(243, 238, 226, 0.12);

	--gpd-font-display: "Fraunces", Georgia, "Times New Roman", serif;
	--gpd-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--gpd-font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

	--gpd-radius: 6px;
	--gpd-max: 1180px;
}

/* =========================================================================
   Reading progress bar
   ========================================================================= */
.gpd-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: transparent;
	z-index: 9999;
	pointer-events: none;
}
.gpd-progress #gpd-progress-bar {
	display: block;
	height: 100%;
	width: 0%;
	background: var(--gpd-accent);
	transition: width 80ms linear;
}

/* =========================================================================
   Post shell
   ========================================================================= */
.gpd-post {
	background: var(--gpd-bg);
	color: var(--gpd-text);
	font-family: var(--gpd-font-body);
	line-height: 1.65;
}

/* =========================================================================
   Hero
   ========================================================================= */
.gpd-hero {
	position: relative;
	min-height: 62vh;
	display: flex;
	align-items: flex-end;
	background-size: cover;
	background-position: center;
	background-color: var(--gpd-bg-elevated);
	padding: 96px 32px 56px;
	isolation: isolate;
}
.gpd-hero.no-image {
	min-height: 38vh;
	background:
		radial-gradient(ellipse at 20% 0%, rgba(255, 199, 56, 0.10), transparent 55%),
		var(--gpd-bg-elevated);
}
.gpd-hero-scrim {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(23, 20, 15, 0.55) 0%, rgba(23, 20, 15, 0.35) 35%, rgba(23, 20, 15, 0.94) 100%);
	z-index: 0;
}
.gpd-hero-inner {
	position: relative;
	z-index: 1;
	max-width: var(--gpd-max);
	margin: 0 auto;
	width: 100%;
}
.gpd-eyebrow {
	font-family: var(--gpd-font-mono);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-size: 12px;
	color: var(--gpd-accent);
	margin: 0 0 14px;
}
.gpd-title {
	font-family: var(--gpd-font-display);
	font-weight: 700;
	font-size: clamp(2.2rem, 5vw, 4.4rem);
	line-height: 1.04;
	letter-spacing: -0.01em;
	margin: 0 0 16px;
	color: var(--gpd-text);
	max-width: 20ch;
}
.gpd-hero-plain .gpd-title {
	padding: 64px 32px 0;
	max-width: var(--gpd-max);
	margin-left: auto;
	margin-right: auto;
}
.gpd-hero-plain .gpd-subtitle {
	padding: 0 32px;
	max-width: var(--gpd-max);
	margin-left: auto;
	margin-right: auto;
}
.gpd-subtitle {
	font-family: var(--gpd-font-display);
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.05rem, 1.6vw, 1.35rem);
	color: var(--gpd-text-muted);
	margin: 0 0 24px;
	max-width: 48ch;
}
.gpd-meta-row {
	display: flex;
	align-items: center;
	gap: 12px;
}
.gpd-avatar img {
	display: block;
	border-radius: 50%;
	border: 2px solid var(--gpd-accent);
}
.gpd-meta-text {
	font-family: var(--gpd-font-mono);
	font-size: 13px;
	color: var(--gpd-text-muted);
}
.gpd-meta-text .gpd-author {
	color: var(--gpd-text);
	font-weight: 500;
}
.gpd-dot {
	margin: 0 6px;
	opacity: 0.6;
}

/* =========================================================================
   Layout: content + sidebar
   ========================================================================= */
.gpd-layout {
	max-width: var(--gpd-max);
	margin: 0 auto;
	padding: 56px 32px 40px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 64px;
	align-items: start;
}

/* -- Article content typography ------------------------------------------ */
.gpd-content {
	font-size: 1.125rem;
	color: var(--gpd-text);
}
.gpd-content > * + * {
	margin-top: 1.4em;
}
.gpd-content p {
	margin: 0 0 1.4em;
}
.gpd-content h2 {
	font-family: var(--gpd-font-display);
	font-size: 1.7rem;
	font-weight: 700;
	color: var(--gpd-text);
	margin: 1.8em 0 0.7em;
	padding-top: 0.4em;
	border-top: 1px solid var(--gpd-line);
}
.gpd-content h3 {
	font-family: var(--gpd-font-display);
	font-size: 1.35rem;
	font-weight: 600;
	margin: 1.6em 0 0.6em;
}
.gpd-content a {
	color: var(--gpd-accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.gpd-content blockquote {
	margin: 1.8em 0;
	padding: 0.2em 0 0.2em 24px;
	border-left: 3px solid var(--gpd-accent);
	font-family: var(--gpd-font-display);
	font-style: italic;
	font-size: 1.3rem;
	color: var(--gpd-text);
}
.gpd-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--gpd-radius);
}
.gpd-content figcaption {
	font-family: var(--gpd-font-mono);
	font-size: 12px;
	color: var(--gpd-text-muted);
	margin-top: 8px;
}
.gpd-content ul,
.gpd-content ol {
	padding-left: 1.4em;
}
.gpd-content code {
	font-family: var(--gpd-font-mono);
	background: var(--gpd-bg-elevated);
	padding: 0.15em 0.4em;
	border-radius: 4px;
	font-size: 0.9em;
}
.gpd-page-links {
	font-family: var(--gpd-font-mono);
	font-size: 13px;
	color: var(--gpd-text-muted);
}

/* -- Annotations (the Genius signature) ----------------------------------- */
.gpd-annotation {
	background: linear-gradient(transparent 60%, rgba(255, 199, 56, 0.32) 60%);
	border-bottom: 1px dotted var(--gpd-accent);
	cursor: pointer;
	transition: background 120ms ease;
}
.gpd-annotation:hover,
.gpd-annotation:focus-visible,
.gpd-annotation.is-active {
	background: linear-gradient(transparent 0%, rgba(255, 199, 56, 0.55) 0%);
	outline: none;
}

.gpd-popover {
	position: absolute;
	max-width: 320px;
	background: var(--gpd-bg-elevated);
	color: var(--gpd-text);
	border: 1px solid var(--gpd-line);
	border-radius: var(--gpd-radius);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
	padding: 14px 16px;
	font-size: 14.5px;
	line-height: 1.5;
	z-index: 500;
}
.gpd-popover[hidden] {
	display: none;
}
.gpd-popover-arrow {
	position: absolute;
	top: -6px;
	left: 24px;
	width: 12px;
	height: 12px;
	background: var(--gpd-bg-elevated);
	border-left: 1px solid var(--gpd-line);
	border-top: 1px solid var(--gpd-line);
	transform: rotate(45deg);
}
.gpd-popover-body::before {
	content: "\201C";
	color: var(--gpd-accent);
	font-family: var(--gpd-font-display);
	font-size: 1.4em;
	margin-right: 2px;
}

/* -- Highlight-to-share tooltip -------------------------------------------- */
.gpd-highlight-tooltip {
	position: absolute;
	display: flex;
	gap: 2px;
	background: var(--gpd-bg-elevated);
	border: 1px solid var(--gpd-line);
	border-radius: var(--gpd-radius);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
	padding: 4px;
	z-index: 500;
}
.gpd-highlight-tooltip[hidden] {
	display: none;
}
.gpd-highlight-tooltip button {
	font-family: var(--gpd-font-mono);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	background: transparent;
	color: var(--gpd-text);
	border: none;
	padding: 6px 10px;
	border-radius: 4px;
	cursor: pointer;
}
.gpd-highlight-tooltip button:hover {
	background: var(--gpd-accent);
	color: var(--gpd-accent-ink);
}

::selection {
	background: rgba(255, 199, 56, 0.35);
}

/* =========================================================================
   Sidebar
   ========================================================================= */
.gpd-sidebar {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}
.gpd-card {
	background: var(--gpd-bg-elevated);
	border: 1px solid var(--gpd-line);
	border-radius: var(--gpd-radius);
	padding: 20px;
}
.gpd-card-title {
	font-family: var(--gpd-font-mono);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 12px;
	color: var(--gpd-accent);
	margin: 0 0 14px;
}
.gpd-credits-list {
	margin: 0;
}
.gpd-credits-list dt {
	font-family: var(--gpd-font-mono);
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--gpd-text-muted);
	margin-top: 12px;
}
.gpd-credits-list dt:first-child {
	margin-top: 0;
}
.gpd-credits-list dd {
	margin: 2px 0 0;
	font-size: 14.5px;
}
.gpd-credit-plain {
	margin: 0 0 6px;
}

.gpd-share-buttons {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.gpd-share-btn {
	display: block;
	text-align: left;
	font-family: var(--gpd-font-body);
	font-size: 14px;
	font-weight: 500;
	color: var(--gpd-text);
	background: var(--gpd-bg);
	border: 1px solid var(--gpd-line);
	border-radius: 4px;
	padding: 9px 12px;
	cursor: pointer;
	text-decoration: none;
	transition: border-color 120ms ease, color 120ms ease;
}
.gpd-share-btn:hover {
	border-color: var(--gpd-accent);
	color: var(--gpd-accent);
}

.gpd-suggested-card {
	padding: 0;
	overflow: hidden;
}
.gpd-suggested-card .gpd-card-title {
	margin: 0;
	padding: 18px 20px;
	border-bottom: 1px solid var(--gpd-line);
}
.gpd-suggested-list {
	display: flex;
	flex-direction: column;
}
.gpd-suggested-item {
	display: flex;
	align-items: center;
	text-decoration: none;
	padding: 16px 20px;
	border-bottom: 1px solid var(--gpd-line);
	transition: background 120ms ease;
}
.gpd-suggested-item:last-child {
	border-bottom: none;
}
.gpd-suggested-item:hover {
	background: var(--gpd-bg);
}
.gpd-suggested-item:hover .gpd-suggested-title {
	color: var(--gpd-accent);
}
.gpd-suggested-text {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}
.gpd-suggested-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--gpd-text);
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 120ms ease;
}
.gpd-suggested-meta {
	font-size: 13px;
	color: var(--gpd-text-muted);
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* =========================================================================
   Comments wrapper (inherits theme styles, just keeps palette consistent)
   ========================================================================= */
.gpd-comments {
	max-width: var(--gpd-max);
	margin: 0 auto;
	padding: 0 32px 64px;
	color: var(--gpd-text);
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
	.gpd-layout {
		grid-template-columns: 1fr;
		gap: 40px;
		padding: 40px 20px 24px;
	}
	.gpd-sidebar {
		position: static;
	}
	.gpd-hero {
		padding: 72px 20px 40px;
		min-height: 52vh;
	}
	.gpd-hero-plain .gpd-title,
	.gpd-hero-plain .gpd-subtitle {
		padding-left: 20px;
		padding-right: 20px;
	}
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
	.gpd-progress #gpd-progress-bar,
	.gpd-annotation {
		transition: none;
	}
}
