/* Gold cross-promo banner — sticky, links back to the main site's Scottish Baronies explainer */
:root { --bexH: 32px; }
.bex-bar { position: sticky; top: 0; z-index: 50; display: block; background: #6e1423; text-decoration: none; transition: background-color .15s; }
.bex-bar:hover { background: #4d0f17; }
.bex-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; height: var(--bexH, 32px); padding: 0 16px; font-family: Quicksand, 'Quicksand Fallback', sans-serif; font-size: .62rem; font-weight: 500; text-transform: uppercase; letter-spacing: .2em; color: #faf6ec; }
.bex-sub { display: none; color: rgba(231, 220, 196, .85); }
.bex-here { display: none; }
@media (min-width: 640px) { .bex-sub, .bex-here { display: inline; } }
.bex-arrow { display: inline-block; transition: transform .15s; }
.bex-bar:hover .bex-arrow { transform: translateX(2px); }

/* Top Navigation Links — sit below the sticky gold banner (banner reserves --bexH at the top) */
.top-links {
	position: absolute;
	top: calc(var(--bexH, 32px) + 20px);
	left: 30px;
	z-index: 10;
}

.top-links a {
	font-family: 'Arapey', serif;
	font-size: 16px;
	color: white;
	text-decoration: none;
	margin-right: 15px;
}

.top-links a:hover {
	text-decoration: underline;
}

@media (min-width: 768px) {
	.svg-coat-of-arms {
		position: absolute;
		/* Ensures it stays above the text */
		bottom: 190px;
		/* Adjust as needed */
		left: 50px;
		/* Adjust to match desktop layout */
		width: 60px;
		/* Ensures fixed width */
		height: auto;
		/* Keeps aspect ratio */
	}

	.coat-of-arms-img-mobile {
		display: none !important;
	}

	.mobile {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.pc {
		display: none !important;
	}

	.svg-coat-of-arms {
		display: none
	}

	.cover {
		position: relative;
		width: 100%;
		height: 70vh !important;
		/* Full height */
		background: var(--cover-image-mobile) no-repeat center calc(10%)/cover;
		/* Move up slightly */
		display: flex;
		align-items: flex-end;
		/* Moves text to bottom */
		justify-content: flex-start;
		/* Moves text to left */
		text-align: left;
		color: white;
		padding: 10px !important;
		/* Adds space from edges */
	}

	/* Fix Text Size */
	.cover h1 {
		font-size: 1.8em !important;
		/* Ensure smaller size */
		line-height: 1.2 !important;
		word-wrap: break-word;
		/* Prevent overflow */
		text-align: leftj !important;
	}

	.cover h2 {
		font-size: 1.2em !important;
		text-align: left !important;
	}

	.cover {
		background-position: center top !important;
		/* Center the image */
		background-size: auto;
		/* Prevents excessive zoom */
	}

	.cover::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.3);
		/* Light overlay for readability */
	}
}


.cover {
	position: relative;
	width: 100%;
	height: 100vh;
	/* Full height */
	background: var(--cover-image-desktop) no-repeat center calc(10%)/cover;
	/* Move up slightly */
	display: flex;
	align-items: flex-end;
	/* Moves text to bottom */
	justify-content: flex-start;
	/* Moves text to left */
	text-align: left;
	color: white;
	padding: 50px;
	/* Adds space from edges */
}

.cover::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.18);
	/* Light overall overlay for readability */
}

/* Bottom-up dark gradient scrim so the bottom-left title stays legible over the photo */
.cover::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 60%;
	background: linear-gradient(to top,
		rgba(0, 0, 0, 0.72) 0%,
		rgba(0, 0, 0, 0.45) 35%,
		rgba(0, 0, 0, 0) 100%);
	pointer-events: none;
	z-index: 1;
}

.cover-content {
	position: relative;
	z-index: 2;
	text-align: left;
	max-width: 100%;
}

.cover h1 {
	font-family: 'Playfair Display', serif !important;
	font-size: 2.8em;
	/* Smaller size */
	font-weight: bold;
	margin-bottom: 5px;
}

.cover h2 {
	font-family: 'Playfair Display', serif !important;
	font-size: 1.5em;
	/* More subtle */
	font-style: italic;
	font-weight: 300;
}

@media (max-width: 768px) {
	.cover-content {
		position: relative;
		z-index: 2;
		text-align: left;
	}

	.content {
		display: flex;
		flex-direction: column;
	}

	.details .section:first-child {
		/* Targets the Biography section */
		order: 1;
	}

	.coat-of-arms {
		/* Moves Coat of Arms immediately after Biography */
		display: block;
		margin-top: 20px;
		/* Adds spacing for better visual separation */
		text-align: center;
	}

	.details .section:nth-child(2) {
		/* Targets "Heir" section */
		order: 3;
	}

	.details .section:nth-child(3) {
		/* Ensures all other sections follow properly */
		order: 4;
	}
}

/* Phone refinements (was a malformed nested block; rewritten as valid CSS) */
@media (max-width: 480px) {
	.cover {
		height: 68vh !important;
		padding: 16px !important;
	}

	.cover h1 {
		font-size: 1.6em !important;
	}

	.cover h2 {
		font-size: 1.1em !important;
	}
}

.logo {
	position: absolute;
	top: 20px;
	right: 30px;
	width: 360px;
	/* Adjust size as needed */
	height: auto;
	opacity: 0.9;
}

/* Prevent it from covering the face on mobile */
@media (max-width: 768px) {
	.logo {
		width: 180px;
		/* Smaller on mobile */
		right: 15px;
		top: 15px;
	}
}

/* Seal + "Baronage of Scotland / Association" wordmark lockup (cover, top-right) */
.brand-mark {
	position: absolute;
	top: 20px;
	right: 30px;
	/* Never let the lockup run off the right edge; cap its width and let it shrink */
	max-width: calc(100% - 60px);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 14px;
	text-decoration: none;
	min-width: 0;
}
.brand-mark .brand-seal {
	height: clamp(72px, 9vw, 104px);
	width: auto;
	flex-shrink: 0;
	object-fit: contain;
	opacity: 0.95;
}
.brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.05;
	min-width: 0;
}
.brand-text .brand-name {
	font-family: 'Arapey', serif;
	font-size: clamp(1.15rem, 2.4vw, 1.75rem);
	color: #faf6ec;
	letter-spacing: 0.01em;
	white-space: nowrap;
}
.brand-text .brand-sub {
	margin-top: 0.4rem;
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: clamp(0.5rem, 0.9vw, 0.62rem);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.34em;
	color: #c9a24b;
	white-space: nowrap;
}
@media (max-width: 768px) {
	.brand-mark { top: 15px; right: 15px; gap: 9px; max-width: calc(100% - 30px); }
	.brand-mark .brand-seal { height: 84px; }
	.brand-text { display: none; }
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Arapey', serif !important;
	font-size: 17px;
	font-weight: 400;
	line-height: 1.8;
	background-color: #f9f9f9;
	margin: 0;
	padding: 0;
	color: #000;
}

/* Ensure bold text looks properly thick */
strong,
b {
	font-family: Arial, sans-serif !important;
	font-weight: 700 !important;
	letter-spacing: -0.3px;
	color: #000;
}

/* Adjust headings for clarity */
h1 {
	font-family: 'Arapey', serif !important;
	font-size: 2.2em;
	font-weight: 700;
}

h2 {
	font-family: 'Arapey', serif !important;
	font-size: 1.8em;
	font-weight: 600;
}

h3 {
	font-family: 'Arapey', serif !important;
	font-size: 1.5em;
	font-weight: 600;
}

/* Adjust font size for mobile */
@media (max-width: 768px) {
	body {
		font-size: 16px;
	}
}

.container {
	max-width: 1200px;
	margin: 20px auto;
	padding: 15px;
	background: #fff;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	border-radius: 8px;
}

.header {
	text-align: center;
	margin-bottom: 20px;
}

.header h1 {
	font-size: 2.5em;
	margin: 10px 0;
}

.header h2 {
	font-size: 1.5em;
	font-weight: 400;
	color: #555;
}

.header img {
	max-width: 150px;
	border-radius: 50%;
	margin: 15px 0;
}

.content {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 20px;
}

.coat-of-arms {
	text-align: center;
}

.coat-of-arms p {
	font-size: 14px;
	color: #333;
	margin-bottom: 10px;
	/* Fix unnecessary   */
}

@media (min-width: 768px) {
	.coat-of-arms-img-pc {
		max-width: 110px;
		/* Adjust size as needed */
		height: auto;
		display: block;
		margin: 0 auto;
		gap: 0px !important;
	}
}

.section {
	margin-bottom: 20px;
}

.section h3 {
	font-size: 1.8em;
	border-bottom: 2px solid #ddd;
	padding-bottom: 5px;
	margin-bottom: 10px;
	color: #333;
}

.lineage ul,
.title-holders ul {
	list-style: none;
	padding: 0;
}

.lineage ul li,
.title-holders ul li {
	padding: 5px 0;
	border-bottom: 1px solid #eee;
}

@media (max-width: 768px) {
	.content {
		display: flex;
		flex-direction: column-reverse;
		/* Moves left column after details */
	}

	.coat-of-arms-img-mobile {
		width: 55px;
		height: min;
		flex-shrink: 0;
	}

	.coat-of-arms-img-pc {
		display: none !important;
	}
}

.coat-of-arms {
	max-width: 600px;
	margin: 0rem auto;
	padding: 0 1.5rem;
	display: flex;
	align-items: start;
	gap: 0rem;
	background-color: white;
	flex-direction: column;
}

.coat-of-arms>.section {
	color: #374151;
	flex-grow: 1;
}

.coat-of-arms>.section h3 {
	margin: 0 0 0.75rem 0;
	font-size: 1.25rem;
	font-weight: 600;
}

.coat-of-arms>.section p {
	margin: 0.5rem 0;
	font-size: 0.875rem;
	line-height: 1.5;
}

small {
	display: block;
}

i {
	color: #4B5563;
}

@media (max-width: 480px) {
	.coat-of-arms {
		flex-direction: column;
		text-align: center;
		gap: 1rem;
	}

	.coat-of-arms-img-mobile {
		width: 55px;
	}
}

/* ==========================================================================
   Polish: page load-in + scroll-reveal animations
   (Reusable; honours prefers-reduced-motion. Page JS toggles .is-visible.)
   ========================================================================== */

/* Prevent any horizontal overflow on small screens.
   Use clip (not hidden): hidden forces overflow-y to `auto`, creating a scroll container
   that breaks the sticky gold banner. clip prevents horizontal scroll without that side effect.
   (hidden kept first as a fallback for browsers that don't support overflow:clip.) */
html, body {
	overflow-x: hidden;
	overflow-x: clip;
}

/* Gentle hero load-in on first paint */
.cover {
	animation: cover-in 1.1s ease-out both;
}
/* Hero loads FIRST: the cover title + overlays appear only AFTER the cover image has loaded.
   The page head-script adds .hero-pending immediately, then swaps to .hero-ready once the image is in.
   (If JS is off, no class is added and everything shows normally.) */
html.hero-pending .cover-content,
html.hero-pending .top-links,
html.hero-pending .brand-mark,
html.hero-pending .svg-coat-of-arms { opacity: 0; }
html.hero-ready .cover-content { animation: cover-content-in 1.2s ease-out 0.1s both; }
html.hero-ready .top-links,
html.hero-ready .brand-mark,
html.hero-ready .svg-coat-of-arms { opacity: 1; transition: opacity 0.6s ease; }

/* Slim gold loading bar shown while the hero image downloads */
.hero-loader { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 99999; overflow: hidden; opacity: 0; transition: opacity 0.35s ease; pointer-events: none; }
html.hero-pending .hero-loader { opacity: 1; }
.hero-loader::before { content: ""; position: absolute; top: 0; left: -40%; height: 100%; width: 40%; background: linear-gradient(90deg, transparent, #c9a24b 50%, transparent); animation: hero-load 1.1s ease-in-out infinite; }
@keyframes hero-load { 0% { left: -40%; } 100% { left: 100%; } }

/* Full-screen "please wait" loading overlay while the hero/background image downloads.
   Shown only while .hero-pending (JS-set); fades out on .hero-ready; absent if JS is off. */
.hero-loading { position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: #faf6ec; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.55s ease, visibility 0.55s ease; }
html.hero-pending .hero-loading { opacity: 1; visibility: visible; pointer-events: auto; }
html.hero-pending { overflow: hidden; }
.hero-spinner { width: 56px; height: 56px; border: 4px solid rgba(147,111,36,0.22); border-top-color: #936f24; border-radius: 50%; animation: hero-spin 0.9s linear infinite; }
@keyframes hero-spin { to { transform: rotate(360deg); } }
.hero-loading-text { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 1.55rem; color: #131e3a; text-align: center; margin: 0; line-height: 1.45; }
.hero-loading-text span { display: block; margin-top: 8px; font-family: 'Quicksand', system-ui, sans-serif; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; color: #936f24; }
@keyframes cover-in {
	from { opacity: 0; transform: scale(1.03); }
	to   { opacity: 1; transform: scale(1); }
}
@keyframes cover-content-in {
	from { opacity: 0; transform: translateY(18px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* (Body scroll-reveal removed — the dedicated-page body is just text and should be present on scroll.) */

/* Disable hero animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
	.cover { animation: none !important; }
	html.hero-pending .cover-content,
	html.hero-pending .top-links,
	html.hero-pending .brand-mark,
	html.hero-pending .svg-coat-of-arms { opacity: 0; }
	html.hero-ready .cover-content,
	html.hero-ready .top-links,
	html.hero-ready .brand-mark,
	html.hero-ready .svg-coat-of-arms {
		animation: none !important;
		transition: none !important;
		opacity: 1 !important;
	}
	.hero-loader::before { animation: none; left: 0; width: 100%; }
	.reveal {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}

/* ==========================================================================
   "Particulars" card — PREVIEW, used on the Baron of Leslie page only.
   Self-contained: scoped entirely under .particulars so it is easy to revert.
   ========================================================================== */
.particulars {
	background-color: #faf6ec;
	border-top: 3px solid #c9a24b;
	border-radius: 4px;
	padding: 1.4rem 1.6rem 1.1rem;
	margin-bottom: 20px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.particulars h3 {
	font-family: 'Playfair Display', serif;
	font-size: 1.05rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: #936f24;
	border-bottom: 1px solid rgba(201, 162, 75, 0.35);
	padding-bottom: 0.55rem;
	margin: 0 0 0.9rem;
}
.particulars dl {
	margin: 0;
	display: grid;
	grid-template-columns: minmax(7rem, 9rem) 1fr;
	column-gap: 1.4rem;
	row-gap: 0.85rem;
	align-items: baseline;
}
.particulars dt {
	font-family: 'Helvetica Neue', Arial, sans-serif;
	font-size: 0.68rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	color: #936f24;
	padding-top: 0.15rem;
}
.particulars dd {
	margin: 0;
	font-family: 'Arapey', serif;
	font-size: 1.02rem;
	line-height: 1.55;
	color: #1a1a1a;
}
.particulars dd i {
	color: #5b4a1f;
}
@media (max-width: 520px) {
	.particulars dl {
		grid-template-columns: 1fr;
		row-gap: 0.4rem;
	}
	.particulars dt {
		padding-top: 0.6rem;
	}
	.particulars dt:first-child {
		padding-top: 0;
	}
}