/* ==========================================================================
   UGF Story layout — single blog posts only (loaded on is_singular('post')).
   Edit the tokens below to retune colours, widths and type.
   ========================================================================== */

.ugf-story,
.ugf-progress {
	/* Site palette (UiCore Global Colors) — change them in UiCore, not here. */
	--ugf-highlight: var(--uicore-secondary-color, #ED970E); /* orange: rule, drop cap, progress bar, hovers */
	--ugf-accent: var(--uicore-accent-color, #5C3D1F);       /* brown: small labels and links (readable on white) */
	--ugf-accent-ink: var(--uicore-headline-color, #001836); /* navy: hover state for text links */
	--ugf-focus: var(--uicore-headline-color, #001836);
	--ugf-ink: var(--uicore-headline-color, #001836);
	--ugf-text: var(--uicore-body-color, #101828);
	--ugf-muted: #5b6472;
	--ugf-line: #e6e3dd;
	--ugf-chip: var(--uicore-light-color, #F5F5F5);
	--ugf-serif: "Newsreader", Georgia, "Times New Roman", serif;
	--ugf-sans: var(--uicore-text-font-family, "Plus Jakarta Sans"), system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ugf-gutter: 24px;
	--ugf-wide: 1180px;
	--ugf-head: 1100px;
	--ugf-meta: 920px;
	--ugf-text-w: 760px;
}

.ugf-story {
	display: block;
	padding: 28px 0 88px;
	background: #fff;
	color: var(--ugf-text);
}

.ugf-story .ugf-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--ugf-wide) + var(--ugf-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--ugf-gutter);
}

.ugf-story .ugf-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Hero ---------- */

.ugf-story .ugf-hero {
	margin: 0 0 30px;
	aspect-ratio: 3 / 1;
	overflow: hidden;
	border-radius: 12px;
	background: var(--ugf-chip);
}

.ugf-story .ugf-hero .ugf-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: var(--ugf-hero-pos, 50% 30%);
	border-radius: 0;
}

/* ---------- Headline block ---------- */

.ugf-story .ugf-head {
	max-width: var(--ugf-head);
	margin: 0 auto;
	text-align: center;
}

.ugf-story .ugf-kicker {
	margin: 0 0 14px;
	font-family: var(--ugf-serif);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ugf-accent);
}

.ugf-story .ugf-kicker a {
	color: inherit;
	text-decoration: none;
}

.ugf-story .ugf-kicker a:hover {
	color: var(--ugf-accent-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ugf-story .ugf-kicker__sep {
	display: inline-block;
	margin: 0 0.9em;
	font-weight: 400;
	opacity: 0.75;
}

.ugf-story .ugf-title {
	margin: 0 0 18px;
	font-family: var(--ugf-serif);
	font-size: clamp(2.125rem, 1.2rem + 2.6vw, 3.125rem);
	font-weight: 700;
	font-style: normal;
	font-optical-sizing: auto;
	line-height: 1.06;
	letter-spacing: -0.028em;
	text-transform: none;
	text-wrap: balance;
	color: var(--ugf-ink);
}

.ugf-story .ugf-title .ugf-title__lead {
	display: block;
}

.ugf-story .ugf-dek {
	max-width: 800px;
	margin: 0 auto;
	font-family: var(--ugf-serif);
	font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3125rem);
	font-weight: 400;
	line-height: 1.42;
	letter-spacing: 0;
	text-transform: none;
	text-wrap: pretty;
	color: var(--ugf-muted);
}

.ugf-story .ugf-rule {
	display: block;
	width: 96px;
	height: 2px;
	margin: 24px auto 30px;
	border-radius: 2px;
	background: var(--ugf-highlight);
}

/* ---------- Meta row: author · date · read time · share ---------- */

.ugf-story .ugf-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	max-width: var(--ugf-meta);
	margin: 0 auto 40px;
}

.ugf-story .ugf-meta__info {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 22px;
	font-family: var(--ugf-serif);
	font-size: 14.5px;
	line-height: 1.4;
	color: #3b4652;
}

.ugf-story .ugf-meta__author {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ugf-story .ugf-meta__avatar {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--ugf-chip);
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--ugf-line);
}

.ugf-story .ugf-meta__by {
	font-size: 15px;
	color: var(--ugf-text);
}

.ugf-story .ugf-meta__name {
	font-weight: 700;
	color: var(--ugf-ink);
	text-decoration: none;
}

.ugf-story a.ugf-meta__name:hover {
	color: var(--ugf-accent);
}

.ugf-story .ugf-meta__divider {
	width: 1px;
	height: 26px;
	background: #d6d1c8;
}

.ugf-story .ugf-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.ugf-story .ugf-meta__item svg {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	color: var(--ugf-ink);
}

.ugf-story .ugf-share {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ugf-story .ugf-share .ugf-share__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 38px;
	height: 38px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ugf-chip);
	box-shadow: none;
	color: var(--ugf-ink);
	font-size: 0;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ugf-story .ugf-share .ugf-share__btn svg {
	display: block;
	width: 16px;
	height: 16px;
}

.ugf-story .ugf-share .ugf-share__btn:hover,
.ugf-story .ugf-share .ugf-share__btn.is-copied {
	background: var(--ugf-highlight);
	color: var(--ugf-accent);
	transform: translateY(-1px);
}

.ugf-story .ugf-share .ugf-share__btn:focus-visible {
	outline: 2px solid var(--ugf-focus);
	outline-offset: 3px;
}

.ugf-story .ugf-share .ugf-share__btn.is-copied::after {
	content: attr(data-copied-label);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	padding: 5px 9px;
	border-radius: 4px;
	background: var(--ugf-ink);
	color: #fff;
	font-family: var(--ugf-sans);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	pointer-events: none;
}

/* ---------- Article body ---------- */

.ugf-story .ugf-body {
	max-width: var(--ugf-text-w);
	margin: 0 auto;
	font-family: var(--ugf-serif);
	font-size: 1.1875rem;
	font-weight: 400;
	line-height: 1.7;
	color: var(--ugf-text);
}

.ugf-story .ugf-body p,
.ugf-story .ugf-body li {
	font-family: inherit;
	font-size: inherit;
	font-style: normal;
	font-weight: 400;
	line-height: inherit;
	letter-spacing: 0;
	text-transform: none;
	color: inherit;
}

.ugf-story .ugf-body p {
	margin: 0 0 1.15em;
}

.ugf-story .ugf-body strong,
.ugf-story .ugf-body b {
	font-weight: 700;
}

.ugf-story .ugf-body em,
.ugf-story .ugf-body i {
	font-style: italic;
}

/* Drop cap on the opening paragraph */
.ugf-story .ugf-body > p:first-of-type::first-letter {
	float: left;
	margin: 0.07em 0.12em 0 -0.02em;
	font-family: var(--ugf-serif);
	font-size: 5.1em;
	font-weight: 700;
	line-height: 0.8;
	color: var(--ugf-highlight);
}

@supports (initial-letter: 3) or (-webkit-initial-letter: 3) {
	.ugf-story .ugf-body > p:first-of-type::first-letter {
		float: none;
		margin: 0 0.14em 0 0;
		font-size: inherit;
		line-height: inherit;
		-webkit-initial-letter: 3;
		initial-letter: 3;
	}
}

.ugf-story .ugf-body h2,
.ugf-story .ugf-body h3,
.ugf-story .ugf-body h4,
.ugf-story .ugf-body h5,
.ugf-story .ugf-body h6 {
	margin: 1.9em 0 0.55em;
	font-family: var(--ugf-serif);
	font-style: normal;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-transform: none;
	color: var(--ugf-ink);
}

.ugf-story .ugf-body h2 { font-size: 1.75rem; }
.ugf-story .ugf-body h3 { font-size: 1.45rem; }
.ugf-story .ugf-body h4 { font-size: 1.2rem; }
.ugf-story .ugf-body h5,
.ugf-story .ugf-body h6 { font-size: 1.05rem; }

.ugf-story .ugf-body h2 strong,
.ugf-story .ugf-body h3 strong,
.ugf-story .ugf-body h4 strong {
	font-weight: inherit;
}

.ugf-story .ugf-body a {
	color: var(--ugf-accent);
	text-decoration: underline;
	text-decoration-color: var(--ugf-highlight);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

.ugf-story .ugf-body a:hover {
	color: var(--ugf-accent-ink);
	text-decoration-thickness: 2px;
}

.ugf-story .ugf-body a strong {
	color: inherit;
}

.ugf-story .ugf-body ul,
.ugf-story .ugf-body ol {
	margin: 0 0 1.2em;
	padding-left: 1.3em;
}

.ugf-story .ugf-body ul { list-style: disc; }
.ugf-story .ugf-body ol { list-style: decimal; }

.ugf-story .ugf-body li {
	margin: 0 0 0.45em;
}

.ugf-story .ugf-body blockquote {
	margin: 1.8em 0;
	padding: 0.2em 0 0.2em 1.25em;
	border-left: 3px solid var(--ugf-highlight);
	background: none;
	font-size: 1.15em;
	font-style: italic;
	line-height: 1.55;
	color: var(--ugf-ink);
}

.ugf-story .ugf-body blockquote p {
	margin: 0 0 0.6em;
	font-size: inherit !important;
	font-style: italic;
	line-height: inherit !important;
}

.ugf-story .ugf-body blockquote cite {
	display: block;
	margin-top: 0.4em;
	font-family: var(--ugf-sans);
	font-size: 0.7em;
	font-style: normal;
	font-weight: 600;
	color: var(--ugf-muted);
}

.ugf-story .ugf-body figure {
	margin: 2em 0;
}

.ugf-story .ugf-body img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.ugf-story .ugf-body figcaption,
.ugf-story .ugf-body .wp-element-caption {
	margin-top: 0.6em;
	font-family: var(--ugf-sans);
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
	color: var(--ugf-muted);
}

.ugf-story .ugf-body hr {
	width: 96px;
	margin: 2.4em auto;
	border: 0;
	border-top: 2px solid var(--ugf-line);
}

.ugf-story .ugf-body table {
	width: 100%;
	font-family: var(--ugf-sans);
	font-size: 15px;
}

.ugf-story .ugf-pages {
	margin: 2em 0 0;
	font-family: var(--ugf-sans);
	font-size: 14px;
}

/* ---------- About the author ---------- */

.ugf-story .ugf-author {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	max-width: var(--ugf-text-w);
	margin: 48px auto 0;
	padding: 26px 0 0;
	border-top: 1px solid var(--ugf-line);
}

.ugf-story .ugf-author .ugf-author__avatar {
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--ugf-chip);
}

.ugf-story .ugf-author .ugf-author__label {
	margin: 0 0 4px;
	font-family: var(--ugf-serif);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--ugf-accent);
}

.ugf-story .ugf-author .ugf-author__name {
	margin: 0 0 6px;
	font-family: var(--ugf-serif);
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ugf-ink);
}

.ugf-story .ugf-author .ugf-author__name a {
	color: inherit;
	text-decoration: none;
}

.ugf-story .ugf-author .ugf-author__name a:hover {
	color: var(--ugf-accent);
}

.ugf-story .ugf-author .ugf-author__bio {
	margin: 0;
	font-family: var(--ugf-serif);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.6;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ugf-muted);
}

.ugf-story .ugf-comments {
	max-width: var(--ugf-text-w);
	margin: 40px auto 0;
}

/* ---------- Related articles ---------- */

.ugf-story .ugf-related {
	margin-top: 64px;
}

.ugf-story .ugf-related__inner {
	padding-top: 22px;
	border-top: 1px solid var(--ugf-line);
}

.ugf-story .ugf-related__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 20px;
}

.ugf-story .ugf-related .ugf-related__label {
	margin: 0;
	font-family: var(--ugf-serif);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--ugf-accent);
}

.ugf-story .ugf-related__all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--ugf-sans);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ugf-accent);
	text-decoration: none;
	white-space: nowrap;
}

.ugf-story .ugf-related__all:hover {
	color: var(--ugf-accent-ink);
}

.ugf-story .ugf-related__all svg {
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

.ugf-story .ugf-related__all:hover svg {
	transform: translateX(3px);
}

.ugf-story .ugf-related__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.ugf-story .ugf-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 0;
}

.ugf-story .ugf-card .ugf-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: 8px;
	background: var(--ugf-chip);
}

.ugf-story .ugf-card .ugf-card__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.ugf-story .ugf-card:hover .ugf-card__img {
	transform: scale(1.04);
}

.ugf-story .ugf-card .ugf-card__kicker {
	margin: 0 0 6px;
	font-family: var(--ugf-serif);
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--ugf-accent);
}

.ugf-story .ugf-card .ugf-card__title {
	margin: 0 0 8px;
	font-family: var(--ugf-serif);
	font-size: 1.25rem;
	font-style: normal;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	text-transform: none;
	color: var(--ugf-ink);
}

.ugf-story .ugf-card .ugf-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

/* Whole card is clickable via the title link */
.ugf-story .ugf-card .ugf-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 8px;
}

.ugf-story .ugf-card:hover .ugf-card__title a {
	color: var(--ugf-accent);
}

.ugf-story .ugf-card .ugf-card__title a:focus-visible {
	outline: none;
}

.ugf-story .ugf-card .ugf-card__title a:focus-visible::after {
	outline: 2px solid var(--ugf-focus);
	outline-offset: 4px;
}

.ugf-story .ugf-card .ugf-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	font-family: var(--ugf-serif);
	font-size: 13.5px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ugf-muted);
}

/* ---------- Reading progress bar (injected by ugf-story.js) ---------- */

.ugf-progress {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 100000;
	height: 3px;
	background: transparent;
	pointer-events: none;
}

.ugf-progress .ugf-progress__bar {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--ugf-highlight);
	transform: scaleX(0);
	transform-origin: 0 50%;
	will-change: transform;
}

body.admin-bar .ugf-progress {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .ugf-progress {
		top: 46px;
	}
}

@media screen and (max-width: 600px) {
	body.admin-bar .ugf-progress {
		top: 0;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.ugf-story .ugf-hero {
		aspect-ratio: 2.2 / 1;
	}

	.ugf-story .ugf-related__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.ugf-story {
		--ugf-gutter: 16px;
		padding: 16px 0 64px;
	}

	.ugf-story .ugf-hero {
		aspect-ratio: 16 / 10;
		margin-bottom: 22px;
		border-radius: 10px;
	}

	.ugf-story .ugf-title .ugf-title__lead {
		display: inline;
	}

	.ugf-story .ugf-rule {
		margin: 20px auto 24px;
	}

	.ugf-story .ugf-meta {
		flex-direction: column;
		align-items: center;
		margin-bottom: 32px;
	}

	.ugf-story .ugf-meta__info {
		justify-content: center;
		gap: 10px 18px;
	}

	.ugf-story .ugf-meta__author {
		flex-basis: 100%;
		justify-content: center;
	}

	.ugf-story .ugf-meta__divider {
		display: none;
	}

	.ugf-story .ugf-body {
		font-size: 1.0625rem;
	}

	.ugf-story .ugf-author {
		gap: 14px;
		margin-top: 40px;
	}

	.ugf-story .ugf-author .ugf-author__avatar {
		width: 52px;
		height: 52px;
	}

	.ugf-story .ugf-related {
		margin-top: 48px;
	}
}

@media (max-width: 640px) {
	.ugf-story .ugf-related__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ugf-story *,
	.ugf-story *::after {
		transition: none !important;
	}

	.ugf-story .ugf-card:hover .ugf-card__img,
	.ugf-story .ugf-share .ugf-share__btn:hover {
		transform: none;
	}
}

@media print {
	.ugf-progress,
	.ugf-story .ugf-share,
	.ugf-story .ugf-related {
		display: none !important;
	}
}
