/**
 * HiGuppy blog presentation layer.
 *
 * Sits on top of the restored theme.json global styles (see higuppy-blog.php)
 * to give the Blog index, archives, and single posts a branded, on-grid look.
 * Scoped to body.hg-blog-active so shop/homepage are untouched.
 *
 * @package HiGuppy
 * @since 1.8.0
 */

body.hg-blog-active {
	--hg-blog-primary: #1747B8;
	--hg-blog-primary-dark: #0E2F86;
	--hg-blog-accent: #FF6B35;
	--hg-blog-text: #13203A;
	--hg-blog-muted: #667085;
	--hg-blog-border: #E3EBF7;
	--hg-blog-sky: #EAF6FF;
	--hg-blog-cream: #FFF6E6;
	--hg-blog-page: #f7fbff;
	--hg-blog-card-radius: 22px;
	--hg-blog-shadow: 0 18px 45px rgba(23, 71, 184, 0.10);
}

/* Float the header pill on the hero sky band (same pattern as About/Contact).
   More specific than higuppy-stability.css navy so the top reads as one surface. */
body.hg-blog-active.higuppy-site-shell,
body.hg-blog-active::before {
	background: #EAF6FF !important;
}

body.hg-blog-active.higuppy-site-shell > .wp-site-blocks,
body.hg-blog-active.higuppy-site-shell > .wp-site-blocks > .wp-block-group {
	background-color: transparent !important;
	background-image: none !important;
}

/* The old FSE breadcrumb is outside the hero; the branded breadcrumb is now
   rendered inside .hg-blog-hero above the learning-center eyebrow. */
body.hg-blog-active .et-fse-page-breadcrumbs,
body.hg-blog-active .breadcrumbs {
	display: none !important;
}

/* XStore/FSE wrappers must share the same page canvas. The footer bridge owns
   the transition to navy; the blog body itself stays light all the way down. */
html:has(body.hg-blog-active),
body.hg-blog-active,
body.hg-blog-active::before,
body.hg-blog-active.higuppy-site-shell .page-wrapper,
body.hg-blog-active.higuppy-site-shell .template-container,
body.hg-blog-active.higuppy-site-shell .template-content,
body.hg-blog-active.higuppy-site-shell .content-page,
body.hg-blog-active.higuppy-site-shell .main-content,
body.hg-blog-active.higuppy-site-shell .site-main,
body.hg-blog-active.higuppy-site-shell .wp-site-blocks,
body.hg-blog-active.higuppy-site-shell .wp-site-blocks > .wp-block-group,
body.hg-blog-active.higuppy-site-shell main {
	background: #EAF6FF !important;
}

body.hg-blog-active .wp-block-query,
body.hg-blog-active .wp-block-query-pagination,
body.hg-blog-active .hg-footer-bridge {
	background: #f7fbff !important;
}

/* Beat higuppy-stability navy body so pagination→footer has no dark strip. */
html body.hg-blog-active.higuppy-site-shell:not(:has(.hg-collections)):not(.page-id-2262),
html:has(body.hg-blog-active.higuppy-site-shell):not(:has(.hg-collections)):not(:has(body.page-id-2262)),
html body.hg-blog-active.higuppy-site-shell,
html:has(body.hg-blog-active) {
	background: #EAF6FF !important;
	background-color: #EAF6FF !important;
	background-image: none !important;
}

body.hg-blog-active .hg-footer-bridge {
	margin-top: -2px !important;
	background: #f7fbff !important;
}

body.hg-blog-active .wp-block-separator,
body.hg-blog-active footer.wp-block-template-part {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
}

body.hg-blog-active .hg-blog-hero {
	background: transparent;
	border: 0;
	box-shadow: none;
}

/* Branded blog hero. */
body.hg-blog-active .hg-blog-hero {
	margin: 0 0 clamp(16px, 3vw, 28px);
	padding: 0;
	border-bottom: 1px solid var(--hg-blog-border);
}

body.hg-blog-active .hg-blog-hero__inner {
	max-width: 1120px;
	margin: 0 auto;
	padding: clamp(12px, 2vw, 20px) clamp(16px, 4vw, 24px) clamp(18px, 2.8vw, 28px);
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
	grid-template-areas: "breadcrumb breadcrumb" "copy visual";
	align-items: center;
	gap: 10px clamp(34px, 5vw, 72px);
	box-sizing: border-box;
}

body.hg-blog-active .hg-blog-breadcrumb {
	grid-area: breadcrumb;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: var(--hg-blog-muted);
	font-size: var(--hg-font-size-body);
	font-weight: var(--hg-font-weight-ui);
}

body.hg-blog-active .hg-blog-breadcrumb a {
	color: var(--hg-blog-accent);
	text-decoration: none;
}

body.hg-blog-active .hg-blog-hero__copy {
	grid-area: copy;
	max-width: 600px;
	text-align: left;
}

body.hg-blog-active .hg-blog-hero__eyebrow {
	margin: 0 0 12px;
	color: var(--hg-blog-accent);
	font-size: var(--hg-font-size-body);
	font-weight: var(--hg-font-weight-ui);
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

body.hg-blog-active .hg-blog-hero__title {
	margin: 0 0 16px;
	max-width: 20ch;
	color: var(--hg-blog-primary-dark);
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1.15;
	font-weight: var(--hg-font-weight-ui);
}

body.hg-blog-active .hg-blog-hero__lead {
	margin: 0 0 22px;
	max-width: 62ch;
	color: var(--hg-blog-text);
	font-size: clamp(1rem, 1.6vw, 1.15rem);
	line-height: 1.65;
}

body.hg-blog-active .hg-blog-topics {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
}

body.hg-blog-active .hg-blog-topics a {
	display: inline-flex;
	align-items: center;
	min-height: 34px;
	padding: 7px 13px;
	border: 1px solid var(--hg-blog-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.72);
	color: var(--hg-blog-primary-dark);
	font-size: var(--hg-font-size-body);
	font-weight: var(--hg-font-weight-ui);
	text-decoration: none;
	box-shadow: 0 6px 18px rgba(23, 71, 184, 0.06);
}

body.hg-blog-active .hg-blog-topics a::after {
	content: "->";
	margin-left: 7px;
	color: var(--hg-blog-accent);
}

body.hg-blog-active .hg-blog-hero__visual {
	grid-area: visual;
	position: relative;
	min-height: 270px;
	border: 1px solid rgba(21, 191, 208, 0.28);
	border-radius: 24px;
	overflow: hidden;
	background: radial-gradient(circle at 76% 28%, rgba(255, 255, 255, 0.72), transparent 22%), linear-gradient(180deg, #EAF6FF 0%, #CFEFF7 62%, #B7E3E9 100%);
	box-shadow: 0 18px 42px rgba(23, 71, 184, 0.12), inset 0 2px 14px rgba(255, 255, 255, 0.7);
}

body.hg-blog-active .hg-blog-hero__visual::before {
	content: "";
	position: absolute;
	left: -8%;
	right: -8%;
	bottom: -18%;
	height: 42%;
	border-radius: 50% 50% 0 0;
	background: linear-gradient(180deg, rgba(196, 238, 224, 0.4), rgba(48, 157, 148, 0.28));
}

body.hg-blog-active .hg-aquarium__scene {
	position: absolute;
	z-index: 1;
	inset: -2%;
	width: 104%;
	height: 104%;
	max-width: none;
	object-fit: cover;
	transform-origin: center;
	animation: hg-blog-aquarium-drift 14s ease-in-out infinite alternate;
}

@keyframes hg-blog-aquarium-drift {
	from { transform: scale(1.015) translate3d(-.5%, .3%, 0); }
	to { transform: scale(1.055) translate3d(.8%, -.5%, 0); }
}

body.hg-blog-active .hg-aquarium__gravel {
	position: absolute;
	z-index: 1;
	inset: auto 0 0;
	height: 23%;
	background: radial-gradient(circle at 12px 6px, #f6dc9a 0 3px, transparent 3.5px) 0 0 / 24px 16px, linear-gradient(180deg, #d7b969, #8c683d);
}

body.hg-blog-active .hg-aquarium__bubbles span { position: absolute; z-index: 2; bottom: 20%; width: 9px; height: 9px; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; box-shadow: inset 2px 2px 2px rgba(255,255,255,.45); animation: hg-blog-bubble-rise 5.8s linear infinite; }
body.hg-blog-active .hg-aquarium__bubbles span:nth-child(1) { left: 14%; animation-delay: -.8s; } body.hg-blog-active .hg-aquarium__bubbles span:nth-child(2) { left: 29%; width: 6px; height: 6px; animation-delay: -3.4s; } body.hg-blog-active .hg-aquarium__bubbles span:nth-child(3) { left: 57%; width: 12px; height: 12px; animation-delay: -1.9s; } body.hg-blog-active .hg-aquarium__bubbles span:nth-child(4) { right: 18%; width: 7px; height: 7px; animation-delay: -4.4s; } body.hg-blog-active .hg-aquarium__bubbles span:nth-child(5) { right: 34%; animation-delay: -2.7s; }
body.hg-blog-active .hg-aquarium__plant { position: absolute; z-index: 2; bottom: 17%; width: 54px; height: 115px; transform-origin: bottom center; animation: hg-blog-plant-sway 4.2s ease-in-out infinite alternate; } body.hg-blog-active .hg-aquarium__plant--left { left: 9%; } body.hg-blog-active .hg-aquarium__plant--right { right: 9%; transform: scale(.78); animation-delay: -1.4s; }
body.hg-blog-active .hg-aquarium__plant i { position: absolute; bottom: 0; left: 23px; width: 12px; height: 94px; border-radius: 100% 0 100% 0; background: linear-gradient(90deg,#0b6b62,#53b770); transform-origin: bottom center; } body.hg-blog-active .hg-aquarium__plant i:nth-child(1) { transform: rotate(-31deg); } body.hg-blog-active .hg-aquarium__plant i:nth-child(2) { transform: rotate(2deg); height: 110px; } body.hg-blog-active .hg-aquarium__plant i:nth-child(3) { transform: rotate(31deg); height: 82px; }
body.hg-blog-active .hg-aquarium__fish { position: absolute; z-index: 3; display: block; border-radius: 50%; background: linear-gradient(135deg,#f8ba42,#ff6b35 55%,#d72c5e); box-shadow: inset -12px -7px 0 rgba(136,23,65,.28),0 10px 14px rgba(0,62,80,.28); animation: hg-blog-fish-swim 8s ease-in-out infinite; } body.hg-blog-active .hg-aquarium__fish::before { content:""; position:absolute; left:-25px; top:5px; border-style:solid; border-width:21px 27px 21px 0; border-color:transparent #f05b3e transparent transparent; } body.hg-blog-active .hg-aquarium__fish::after { content:""; position:absolute; right:12px; top:14px; width:7px; height:7px; border:2px solid #fff; border-radius:50%; background:#102d3b; }
body.hg-blog-active .hg-aquarium__fish--one { left: 22%; top: 29%; width: 112px; height: 52px; } body.hg-blog-active .hg-aquarium__fish--two { right:19%; top:53%; width:78px; height:36px; transform:scaleX(-1); animation-name:hg-blog-fish-swim-reverse; animation-delay:-3s; } body.hg-blog-active .hg-aquarium__fish--two::before { left:auto; right:-25px; transform:scaleX(-1); } body.hg-blog-active .hg-aquarium__fish--two::after { left:12px; right:auto; top:8px; }
@keyframes hg-blog-bubble-rise { to { transform: translateY(-205px); opacity: 0; } } @keyframes hg-blog-plant-sway { to { transform: rotate(5deg); } } @keyframes hg-blog-fish-swim { 50% { transform: translate(42px,-12px) rotate(-3deg); } } @keyframes hg-blog-fish-swim-reverse { 50% { transform: translate(-32px,10px) scaleX(-1) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { body.hg-blog-active .hg-aquarium * { animation: none !important; } }

/* Constrain and center the blog/archive content column. */
body.hg-blog-active .wp-block-query {
	max-width: 1170px;
	margin-left: auto;
	margin-right: auto;
	padding-left: clamp(16px, 4vw, 24px);
	padding-right: clamp(16px, 4vw, 24px);
	box-sizing: border-box;
}

/* Post grid — reliable responsive columns regardless of container CSS state. */
body.hg-blog-active .wp-block-post-template.is-layout-grid,
body.hg-blog-active ul.wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 1024px) {
	body.hg-blog-active .wp-block-post-template.is-layout-grid,
	body.hg-blog-active ul.wp-block-post-template {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px;
	}
}

@media (max-width: 640px) {
	body.hg-blog-active .wp-block-post-template.is-layout-grid,
	body.hg-blog-active ul.wp-block-post-template {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}
}

/* Post card. */
body.hg-blog-active .wp-block-post-template > li.wp-block-post {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--hg-blog-border);
	border-radius: var(--hg-blog-card-radius);
	overflow: hidden;
	box-shadow: var(--hg-blog-shadow);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body.hg-blog-active .wp-block-post-template > li.wp-block-post:hover {
	transform: translateY(-4px);
	box-shadow: 0 26px 60px rgba(23, 71, 184, 0.16);
}

/* Featured image. */
body.hg-blog-active .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
}

body.hg-blog-active .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 210px;
	object-fit: cover;
	transition: transform 0.35s ease;
}

body.hg-blog-active .wp-block-post-template > li.wp-block-post:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

/* Text body of card. */
body.hg-blog-active .wp-block-post-title {
	margin: 18px 20px 8px;
	font-size: 1.2rem;
	line-height: 1.35;
	font-weight: var(--hg-font-weight-ui);
}

body.hg-blog-active .wp-block-post-title a {
	color: #176b58 !important;
	font-weight: var(--hg-font-weight-ui);
	text-decoration: none;
}

body.hg-blog-active .wp-block-post-title a:hover {
	color: var(--hg-blog-accent);
}

body.hg-blog-active .wp-block-post-excerpt {
	margin: 0 20px 16px;
	color: var(--hg-blog-muted);
	font-size: var(--hg-font-size-body);
	font-weight: var(--hg-font-weight-body);
	line-height: 1.6;
}

body.hg-blog-active .wp-block-post-excerpt__excerpt {
	margin: 0;
	font-weight: var(--hg-font-weight-body);
}

/* Hide legacy CTA if any leftover markup still renders above the date. */
body.hg-blog-active .hg-blog-card__cta {
	display: none !important;
}

/* Meta row: date left, Read More right. */
body.hg-blog-active .wp-block-post-template > li.wp-block-post > .wp-block-group:last-child {
	margin: auto 20px 18px;
	padding-top: 12px;
	border-top: 1px solid var(--hg-blog-border);
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	color: var(--hg-blog-muted);
	font-size: var(--hg-font-size-body);
}

body.hg-blog-active .hg-blog-card__meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-width: 0;
}

body.hg-blog-active .hg-blog-card__meta-row .wp-block-post-date {
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
}

body.hg-blog-active .hg-blog-card__read-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex: 0 0 auto;
	min-height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	background: var(--hg-blog-accent);
	color: #fff !important;
	font-size: var(--hg-font-size-body);
	font-weight: var(--hg-font-weight-ui);
	line-height: 1;
	letter-spacing: 0.01em;
	text-decoration: none;
	box-shadow: 0 8px 18px rgba(255, 107, 53, 0.22);
	transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

body.hg-blog-active .hg-blog-card__read-more-arrow {
	font-size: var(--hg-font-size-body);
	line-height: 1;
	transform: translateY(-0.5px);
}

body.hg-blog-active .hg-blog-card__read-more:hover,
body.hg-blog-active .hg-blog-card__read-more:focus-visible {
	background: #e9532d;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 12px 24px rgba(255, 107, 53, 0.28);
}

body.hg-blog-active .wp-block-post-template > li.wp-block-post > .wp-block-group:last-child > :not(.wp-block-post-date):not(.hg-blog-card__meta-row),
body.hg-blog-active .wp-block-post-author,
body.hg-blog-active .wp-block-post-author-name,
body.hg-blog-active .wp-block-avatar {
	display: none !important;
}

body.hg-blog-active .wp-block-post-date time {
	color: var(--hg-blog-muted);
	font-size: var(--hg-font-size-body);
}

/* Pagination — pill controls. */
body.hg-blog-active .wp-block-query-pagination {
	max-width: 1170px;
	margin: 40px auto 8px;
	padding: 14px clamp(16px, 4vw, 24px);
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 10px !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box;
}

body.hg-blog-active .wp-block-query-pagination-numbers {
	display: inline-flex !important;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px !important;
}

body.hg-blog-active .wp-block-query-pagination a,
body.hg-blog-active .wp-block-query-pagination .page-numbers {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 42px !important;
	min-height: 42px !important;
	padding: 0 14px !important;
	border: 1px solid rgba(23, 71, 184, 0.14) !important;
	border-radius: 999px !important;
	background: #ffffff !important;
	color: var(--hg-blog-primary-dark) !important;
	font-size: var(--hg-font-size-body);
	font-weight: var(--hg-font-weight-ui);
	line-height: 1;
	text-decoration: none !important;
	box-shadow: 0 8px 20px rgba(23, 71, 184, 0.08) !important;
	transition:
		background-color 0.18s ease,
		color 0.18s ease,
		border-color 0.18s ease,
		transform 0.18s ease,
		box-shadow 0.18s ease !important;
}

body.hg-blog-active .wp-block-query-pagination a:hover,
body.hg-blog-active .wp-block-query-pagination a:focus-visible {
	background: rgba(23, 71, 184, 0.08) !important;
	border-color: rgba(23, 71, 184, 0.28) !important;
	color: #1747b8 !important;
	outline: none !important;
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(23, 71, 184, 0.14) !important;
}

body.hg-blog-active .wp-block-query-pagination a:active {
	transform: translateY(0) scale(0.97);
}

body.hg-blog-active .wp-block-query-pagination .page-numbers.current {
	background: linear-gradient(135deg, #ff8a4c 0%, #ff6b35 55%, #f05a28 100%) !important;
	border-color: transparent !important;
	color: #ffffff !important;
	box-shadow: 0 12px 28px rgba(255, 107, 53, 0.28) !important;
	pointer-events: none;
}

body.hg-blog-active .wp-block-query-pagination-previous,
body.hg-blog-active .wp-block-query-pagination-next {
	min-width: 46px !important;
	gap: 6px;
	background: linear-gradient(180deg, #ffffff 0%, #eaf6ff 100%) !important;
	border-color: rgba(23, 71, 184, 0.18) !important;
	color: #1747b8 !important;
}

body.hg-blog-active .wp-block-query-pagination-previous:hover,
body.hg-blog-active .wp-block-query-pagination-next:hover {
	background: #1747b8 !important;
	border-color: #1747b8 !important;
	color: #ffffff !important;
}

body.hg-blog-active .wp-block-query-pagination-previous-arrow,
body.hg-blog-active .wp-block-query-pagination-next-arrow {
	font-size: 1.05rem;
	line-height: 1;
}

@media (max-width: 640px) {
	body.hg-blog-active .et-fse-page-breadcrumbs,
	body.hg-blog-active .breadcrumbs {
		display: none !important;
	}

	body.hg-blog-active .hg-blog-hero {
		margin-bottom: 18px;
	}

	body.hg-blog-active .hg-blog-hero__inner {
		padding: 10px 16px 18px;
		display: grid;
		grid-template-columns: 1fr;
		grid-template-areas: "breadcrumb" "copy" "visual";
		gap: 10px;
	}

	body.hg-blog-active .hg-blog-breadcrumb {
		justify-content: center;
		margin: 0;
	}

	body.hg-blog-active .hg-blog-hero__copy {
		max-width: none;
		text-align: center;
	}

	body.hg-blog-active .hg-blog-hero__title,
	body.hg-blog-active .hg-blog-hero__lead {
		margin-left: auto;
		margin-right: auto;
	}

	body.hg-blog-active .hg-blog-topics {
		justify-content: center;
	}

	body.hg-blog-active .hg-blog-hero__visual {
		min-height: 220px;
	}

	body.hg-blog-active .hg-blog-hero__eyebrow {
		margin-bottom: 10px;
		font-size: var(--hg-font-size-body);
	}

	body.hg-blog-active .hg-blog-hero__title {
		font-size: 2.25rem;
		line-height: 1.08;
	}

	body.hg-blog-active .hg-blog-hero__lead {
		font-size: var(--hg-font-size-body);
		line-height: 1.55;
	}
}
