/*
Theme Name:   The Meadows Story (Kadence child)
Theme URI:    https://meadowshistory.com/
Description:  Kadence child theme for The Meadows Story. Layout, header, footer, colours and fonts are set in the Customizer; this file styles the family pages (trail, Family and Records panels, generation links), the Family Tree and a few small extras.
Author:       Jeff Meadows
Template:     kadence
Version:      2.1.0
Text Domain:  meadows-kadence-child
*/

/* ==========================================================
   HEADER — soft shadow so the white menu reads well on the banner
   ========================================================== */

.site-header .main-navigation .primary-menu-container > ul > li > a {
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* ==========================================================
   CONTENT EXTRAS (carried over from HOLLY)
   ========================================================== */

hr,
hr.wp-block-separator {
	clear: both;
	background-color: #ccc;
	height: 2px;
	padding: 0;
	margin: 20px 25%;
	border: 0;
	opacity: 1;
}

.kt-accordion-wrap {
	margin-bottom: 20px;
}

/* ==========================================================
   IMAGES, GALLERIES, CAPTIONS, VIDEO (carried over from HOLLY)
   ========================================================== */

.entry-content img {
	max-width: 100%;
	height: auto;
}

img.alignleft,
.wp-block-image figure.alignleft {
	float: left;
	max-width: 50%;
	margin-right: 20px;
}

img.alignright,
.wp-block-image figure.alignright {
	float: right;
	clear: right;
	max-width: 50%;
	margin-left: 20px;
}

img.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

figcaption {
	text-align: center;
	padding: 0;
}

.coblocks-gallery,
.wp-block-dgwt-justified-gallery {
	margin: 0 0 15px;
}

figcaption.coblocks-gallery--caption {
	width: calc(100% - 15px) !important;
}

.featherlight .featherlight-content .caption {
	left: 0;
	right: 0;
	padding-top: 5px;
	letter-spacing: 1px;
}

.dgwt-jg-caption__font--8,
.dgwt-jg-caption__font--10,
.dgwt-jg-caption__font--12,
.dgwt-jg-caption__font--14,
.dgwt-jg-caption__font--18,
.dgwt-jg-caption__font--24 {
	letter-spacing: 1px !important;
}

.dgwt-jg-caption__font--14 {
	font-size: 12px !important;
}

ul.census {
	padding-top: 15px !important;
	border-top: 2px solid #ccc;
	margin-top: 15px !important;
}

ul.census li a:before {
	font-family: "Font Awesome 5 Free";
	display: inline-block;
	font-style: normal;
	font-weight: 900;
	font-size: 1.2em;
	content: "\f1ea";
	margin-right: 5px;
	-webkit-font-smoothing: antialiased;
}

.video-container,
.wp-block-video {
	position: relative;
	height: 0;
	margin: 15px auto 25px;
	padding-bottom: 75%;
}

.video-container.widescreen,
.wp-block-video.widescreen {
	padding-bottom: 52.5%;
}

.video-container video,
.wp-block-video video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* ==========================================================
   FAMILY PAGES — line trail, right-hand column (portrait, Family
   panel, Records), previous/next generation (as on the Beardmore site)
   ========================================================== */

:root {
	--mh-ink: #5a6e69;
}

.entry-content .mh-family a,
.entry-content .mh-records a,
.mh-trail a {
	color: var(--mh-brown);
}
.entry-content .mh-family a:hover,
.entry-content .mh-records a:hover,
.mh-trail a:hover {
	color: var(--mh-brown-dark);
}

/* ---------- Line trail ---------- */
.mh-trail {
	font-size: 0.8rem;
	line-height: 1.7;
	color: var(--mh-muted);
	border-bottom: 1px solid var(--mh-rule);
	padding-bottom: 0.6rem;
	margin-bottom: 1.4rem;
}
.mh-trail a {
	text-decoration: none;
}
.mh-trail .mh-sep {
	margin: 0 0.35em;
	color: var(--mh-rule);
}
.mh-trail .mh-current {
	font-weight: 700;
	color: var(--mh-ink);
}
.mh-trail .mh-years,
.mh-family .mh-years,
.mh-gen-nav .mh-years {
	color: var(--mh-muted);
	font-size: 0.85em;
	white-space: nowrap;
}

/* ---------- Family and Records boxes ---------- */
.mh-family,
.mh-records {
	background: var(--mh-paper);
	border: 1px solid var(--mh-rule);
	border-top: 4px solid var(--mh-brown);
	border-radius: 4px;
	padding: 1rem 1.2rem;
	margin: 0 0 1.5rem;
	font-size: 0.9rem;
}
.mh-family h2,
.mh-records h2 {
	font-size: 1rem;
	margin: 0 0 0.6rem;
	text-transform: uppercase;
	color: var(--mh-brown);
}
.mh-family h3 {
	letter-spacing: 0.04em;
	font-size: 0.75rem;
	text-transform: uppercase;
	color: var(--mh-muted);
	margin: 0.8rem 0 0.25rem;
}
.mh-family ul,
.mh-records ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.mh-family li,
.mh-records li {
	margin: 0.15rem 0;
}
.mh-family a,
.mh-records a {
	text-decoration: none;
}
.mh-family .mh-line a {
	font-weight: 700;
}

@media (min-width: 900px) {
	.mh-family,
	.mh-records {
		float: right;
		clear: right;
		width: 260px;
		margin: 0 0 1.5rem 2rem;
	}
}

/* Records: text links that open the scan in a pop-up viewer */
.mh-records li {
	margin: 0.3rem 0;
	line-height: 1.35;
}
.mh-records .mh-rec-year {
	display: inline-block;
	min-width: 2.6em;
	color: var(--mh-muted);
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
}
.mh-records a::after {
	/* magnifier: opens the scan in the viewer (drawn, so it shows on every device) */
	content: "";
	display: inline-block;
	width: 0.8em;
	height: 0.8em;
	margin-left: 0.3em;
	vertical-align: -0.05em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='4.75' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='M10 10l4.5 4.5' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.5' cy='6.5' r='4.75' fill='none' stroke='%23000' stroke-width='1.8'/%3E%3Cpath d='M10 10l4.5 4.5' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: 0.6;
}

/* ---------- Right-hand column: opening photo above the family panel ---------- */
.mh-side .wp-block-image,
.mh-side figure.alignright {
	float: none !important;
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 0 1.2rem !important;
	text-align: center;
}
.mh-side figure.alignright figcaption {
	display: block !important;
	width: auto !important;
}
.mh-side figure.alignright a {
	display: block;
}
.mh-side figure.alignright img {
	display: block;
	margin: 0 auto;
	width: auto;
	max-width: 100%;
	height: auto;
}
.mh-side .mh-family,
.mh-side .mh-records {
	float: none;
	width: auto;
	margin: 0 0 1.5rem;
}
@media (min-width: 900px) {
	.mh-side {
		float: right;
		width: 260px;
		margin: 0 0 1.5rem 2rem;
	}
	.mh-side figure.alignright img {
		width: 100%;
	}
}
@media (max-width: 600px) and (orientation: portrait) {
	.mh-side figure.alignright img {
		width: 100% !important;
	}
}

/* ---------- Previous / next generation ---------- */
.mh-gen-nav {
	clear: both;
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	border-top: 1px solid var(--mh-rule);
	margin-top: 2.5rem;
	padding-top: 1.2rem;
}
.mh-gen-nav a {
	display: block;
	max-width: 48%;
	padding: 0.7rem 1rem;
	border: 1px solid var(--mh-rule);
	border-radius: 4px;
	text-decoration: none;
	color: var(--mh-ink);
	background: #fff;
}
.mh-gen-nav a:hover {
	border-color: var(--mh-brown);
}
.mh-gen-nav .mh-label {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--mh-brown);
}
.mh-gen-nav .mh-next {
	margin-left: auto;
	text-align: right;
}


/* ---------- Phone, portrait: floated photos go full width ----------
   Older floated photos use display:table with a table-caption, so the
   caption must be switched to a normal block too or it collapses to the
   width of one letter. */
@media (max-width: 600px) and (orientation: portrait) {
	.entry-content figure.alignright,
	.entry-content figure.alignleft,
	.entry-content .wp-block-image .alignright,
	.entry-content .wp-block-image .alignleft,
	.entry-content .wp-caption.alignright,
	.entry-content .wp-caption.alignleft {
		display: block !important;
		float: none !important;
		width: 100% !important; /* overrides old captions' fixed widths */
		max-width: 100% !important;
		margin: 0 0 1.2em !important;
	}
	.entry-content figure.alignright figcaption,
	.entry-content figure.alignleft figcaption,
	.entry-content .wp-caption .wp-caption-text {
		display: block !important;
		width: auto !important;
	}
	.entry-content .alignright a,
	.entry-content .alignleft a {
		display: block;
	}
	.entry-content .alignright img,
	.entry-content .alignleft img {
		width: 100% !important;
		height: auto !important;
	}
}


/* ---------- Kadence gallery beside the right-hand column ----------
   The gallery's built-in clearfix pushed it below the whole column,
   leaving a large gap under the photos. */
.entry-content .wp-block-kadence-advancedgallery::after {
	clear: none;
}


/* ---------- Portrait thumbnails in the family tree ---------- */
.mh-card-has-thumb {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}
.mh-card-thumb {
	flex: none;
	width: 42px;
	height: 42px;
	object-fit: cover;
	object-position: center 20%;
	border-radius: 50%;
	border: 1px solid var(--mh-rule);
}

/* ==========================================================
   FAMILY TREE (descendant chart, as on the Beardmore site)
   ========================================================== */

:root {
	--mh-brown: #7b4320;
	--mh-brown-dark: #5e3218;
	--mh-paper: #faf6f0;
	--mh-rule: #e4d9cc;
	--mh-muted: #7a8582;
}

.mh-tree-wrap { margin: 1rem 0 2rem; }

.mh-tree-tools { margin: 0 10px 1rem; }

.mh-tree-tools button {
	font: inherit;
	font-size: 0.8rem;
	padding: 0.35rem 0.8rem;
	border: 1px solid var(--mh-rule);
	border-radius: 4px;
	background: var(--mh-paper);
	color: var(--mh-brown);
	cursor: pointer;
	box-shadow: none;
}

.mh-tree-tools button:hover { border-color: var(--mh-brown); background: var(--mh-paper); color: var(--mh-brown); }

.entry-content .mh-tree,
.entry-content .mh-tree ul { list-style: none; margin: 0; padding: 0; }

.entry-content .mh-tree { margin: 0 10px; }

.entry-content .mh-tree ul {
	margin-left: 1.1rem;
	padding-left: 1.1rem;
	border-left: 1px solid var(--mh-rule);
}

.entry-content .mh-tree li { position: relative; margin: 0.35rem 0; padding: 0; list-style: none; }

.mh-tree ul > li::before {
	content: "";
	position: absolute;
	left: -1.1rem;
	top: 1.15rem;
	width: 0.9rem;
	border-top: 1px solid var(--mh-rule);
}

.mh-tree details > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}

.mh-tree details > summary::-webkit-details-marker { display: none; }

.mh-tree details > summary::before {
	content: "+";
	flex: 0 0 auto;
	width: 1.2rem;
	height: 1.2rem;
	margin-top: 0.55rem;
	border: 1px solid var(--mh-rule);
	border-radius: 3px;
	background: #fff;
	color: var(--mh-brown);
	font-size: 0.85rem;
	line-height: 1.1rem;
	text-align: center;
}

.mh-tree details[open] > summary::before { content: "–"; }

.mh-tree li > .mh-card { margin-left: 1.7rem; }

.mh-card {
	display: inline-block;
	max-width: 100%;
	padding: 0.45rem 0.8rem;
	background: #fff;
	border: 1px solid var(--mh-rule);
	border-radius: 4px;
	font-size: 0.9rem;
	line-height: 1.45;
}

.mh-card-line { border-left: 4px solid var(--mh-brown); background: var(--mh-paper); }
.mh-card-line .mh-card-name,
.entry-content .mh-card-line .mh-card-name a { font-weight: 700; }

.entry-content .mh-card a { color: var(--mh-brown); }
.entry-content .mh-card a:hover { color: var(--mh-brown-dark); text-decoration: underline; }

.mh-card-years { color: var(--mh-muted); font-size: 0.85em; white-space: nowrap; }

.mh-card-spouse { display: block; font-size: 0.85em; color: var(--mh-muted); }

.mh-card-count {
	margin-top: 0.6rem;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--mh-muted);
	white-space: nowrap;
}

.entry-content a.mh-card-tag,
.mh-card-tag {
	display: inline-block;
	margin-left: 0.35em;
	padding: 0 0.45em;
	border-radius: 3px;
	background: var(--mh-brown);
	color: #fff;
	font-size: 0.65rem;
	line-height: 1.5;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	vertical-align: 0.15em;
	text-decoration: none;
}

.entry-content a.mh-card-tag:hover { background: var(--mh-brown-dark); color: #fff; text-decoration: none; }

.mh-card-painter { border-color: #d9b48f; }

.mh-tree-note { margin: 1.5rem 10px 0; font-size: 0.8rem; font-style: italic; color: var(--mh-muted); }

@media (max-width: 600px) {
	.mh-tree-scroll { overflow-x: auto; padding-bottom: 0.5rem; }
	.mh-tree { width: max-content; min-width: 100%; }
	.mh-card { min-width: 10.5rem; max-width: 15rem; }
	.entry-content .mh-tree ul { margin-left: 0.55rem; padding-left: 0.55rem; }
	.mh-tree ul > li::before { left: -0.55rem; width: 0.45rem; }
	.mh-tree details > summary { gap: 0.3rem; }
	.mh-tree li > .mh-card { margin-left: 1.5rem; }
	.mh-card-count { display: none; }
}
