/*
Theme Name: Brian Hafner Dressage
Author: Wag Websites
Author URI: https://wagwebsites.com
Description: Custom WordPress theme for Brian Hafner Dressage
Version: 2026.04.14
Text Domain: bhdwp
*/

:root {
	color-scheme: light;
	--bhdwp-ink: #16202a;
	--bhdwp-brand: #916029;
	--bhdwp-brand-dark: #57361a;
	--bhdwp-canvas: #f8f5f0;
	--bhdwp-pine: #2f4b43;
	--bhdwp-border: rgba(87, 54, 26, 0.12);
	--bhdwp-shadow: 0 20px 60px rgba(22, 32, 42, 0.08);
	--bhdwp-radius: 1.5rem;
	--wp--style--global--content-size: 760px;
	--wp--style--global--wide-size: 1240px;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--bhdwp-canvas);
	color: var(--bhdwp-ink);
	font-family: Manrope, sans-serif;
	line-height: 1.6;
}

a {
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.16em;
}

a:focus-visible,
button:focus-visible {
	outline: 3px solid var(--bhdwp-brand);
	outline-offset: 3px;
	border-radius: 0.5rem;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

.screen-reader-text {
	position: absolute;
	clip-path: inset(50%);
	width: 1px;
	height: 1px;
	overflow: hidden;
	white-space: nowrap;
	clip: rect(1px, 1px, 1px, 1px);
	word-wrap: normal;
	border: 0;
	padding: 0;
	margin: -1px;
}

.screen-reader-text:focus {
	clip-path: none;
	clip: auto;
	width: auto;
	height: auto;
	padding: 0.75rem 1rem;
	background: #ffffff;
	color: var(--bhdwp-ink);
	left: 1rem;
	top: 1rem;
	z-index: 100000;
	border-radius: 0.75rem;
	box-shadow: var(--bhdwp-shadow);
	text-decoration: none;
	margin: 0;
	font-weight: 700;
	white-space: normal;
	position: absolute;
}

.wp-caption,
.gallery-caption {
	max-width: 100%;
	color: rgba(22, 32, 42, 0.75);
	font-size: 0.95rem;
	margin-top: 0.75rem;
}

.sticky {
	position: relative;
}

.bypostauthor {
	position: relative;
}

/* Desktop nav: underline expanding from cursor entry point */
.nav-link {
	position: relative;
}
.nav-link::after {
	content: '';
	position: absolute;
	bottom: -3px;
	left: 0;
	right: 0;
	height: 2px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: var(--nav-origin, 50%) 50%;
	transition: transform 0.25s ease;
}
.nav-link:hover::after,
.nav-link:focus-visible::after,
.is-current-menu-item > .nav-link::after {
	transform: scaleX(1);
}

.bhdwp-link-hover-underline {
	text-decoration: none;
}

.bhdwp-link-hover-underline:hover .bhdwp-link-hover-underline-text,
.bhdwp-link-hover-underline:focus-visible .bhdwp-link-hover-underline-text {
	text-decoration: underline;
	text-decoration-thickness: 0.1em;
	text-underline-offset: 0.18em;
}

.bhdwp-link-hover-underline i {
	display: inline-block;
	transition: transform 0.2s ease;
}

.bhdwp-link-hover-underline:hover i,
.bhdwp-link-hover-underline:focus-visible i {
	transform: translateX(0.18em);
}

.current-menu-item > a,
.current_page_item > a,
.current-menu-ancestor > a {
	color: var(--bhdwp-brand);
}

/* Keep header nav links white when active */
.bhdwp-site-header .current-menu-item > a,
.bhdwp-site-header .current_page_item > a,
.bhdwp-site-header .current-menu-ancestor > a {
	color: #fff;
}

.bhdwp-site-header {
	position: relative;
	z-index: 20;
	border-bottom: 1px solid rgba(15, 23, 42, 0.1);
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(6px);
}

.widget ul {
	list-style: none;
	padding: 0;
	margin: 1rem 0 0;
	display: grid;
	gap: 0.75rem;
}

.widget a {
	color: #334155;
	text-decoration: none;
}

.widget a:hover,
.widget a:focus {
	color: var(--bhdwp-brand);
	text-decoration: underline;
}

.widget_search form {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
	margin-top: 1rem;
}

.widget_search input[type='search'] {
	flex: 1 1 12rem;
	border-radius: 9999px;
	border: 1px solid var(--bhdwp-border);
	padding: 0.85rem 1rem;
	background: white;
	font: inherit;
}

.widget_search button,
.wp-block-search__button {
	border: 0;
	border-radius: 9999px;
	padding: 0.85rem 1.25rem;
	background: var(--bhdwp-brand);
	color: white;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.widget_search button:hover,
.wp-block-search__button:hover {
	background: var(--bhdwp-brand-dark);
}

.post-navigation .nav-links,
.posts-navigation .nav-links,
.comment-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.post-navigation a,
.posts-navigation a,
.comment-navigation a,
.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border-radius: 9999px;
	border: 1px solid var(--bhdwp-border);
	padding: 0.8rem 1.1rem;
	background: white;
	color: var(--bhdwp-ink);
	text-decoration: none;
	font-weight: 700;
	transition: all 0.2s ease;
}

.post-navigation a:hover,
.posts-navigation a:hover,
.comment-navigation a:hover,
.page-numbers:hover,
.page-numbers.current {
	border-color: transparent;
	background: var(--bhdwp-brand);
	color: white;
}

.comments-area ol,
.comments-area ul {
	list-style: none;
	padding-left: 0;
}

.comments-area .comment-body {
	padding: 1.5rem;
	border: 1px solid var(--bhdwp-border);
	border-radius: var(--bhdwp-radius);
	background: white;
	box-shadow: var(--bhdwp-shadow);
}

.comments-area .children {
	margin-top: 1rem;
	padding-left: 1.5rem;
	border-left: 2px solid rgba(145, 96, 41, 0.15);
}

.comment-form {
	display: grid;
	gap: 1rem;
}

.comment-form input,
.comment-form textarea,
.comment-form select {
	width: 100%;
	padding: 0.95rem 1rem;
	border-radius: 1rem;
	border: 1px solid var(--bhdwp-border);
	background: white;
	font: inherit;
	color: var(--bhdwp-ink);
}

.comment-form .submit {
	border: 0;
	border-radius: 9999px;
	padding: 0.95rem 1.3rem;
	background: var(--bhdwp-pine);
	color: white;
	font-weight: 700;
	cursor: pointer;
}

.comment-form .submit:hover {
	background: #20352f;
}

.alignwide {
	margin-left: auto;
	margin-right: auto;
	max-width: var(--wp--style--global--wide-size);
}

.alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
	width: 100vw;
}

@media (max-width: 767px) {
	.bhdwp-top-bar-inner {
		justify-content: center;
		text-align: center;
	}

	.bhdwp-top-bar-contact {
		justify-content: center;
	}

	.comments-area .children {
		padding-left: 1rem;
	}
}

.bhdwp-page-gallery {
	margin-top: 2.5rem;
	padding: 4rem 0;
	background: #ede6db;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.bhdwp-page-gallery-inner {
	max-width: 80rem;
	margin: 0 auto;
	padding: 0 1.5rem;
}

.bhdwp-page-gallery-desktop {
	display: grid;
	grid-template-columns: 2.6rem minmax(0, 1fr) 2.6rem;
	align-items: center;
	gap: 0.9rem;
}

.bhdwp-page-gallery-desktop-viewport {
	overflow: hidden;
}

.bhdwp-page-gallery-desktop-track {
	display: flex;
	gap: 0.9rem;
	transition: transform 0.35s ease;
	will-change: transform;
}

.bhdwp-page-gallery-nav {
	appearance: none;
	border: 1px solid rgba(22, 32, 42, 0.18);
	background: #fff;
	color: #0f172a;
	border-radius: 999px;
	width: 2.6rem;
	height: 2.6rem;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.85rem;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
}

.bhdwp-page-gallery-nav i,
.bhdwp-gallery-lightbox-close i,
.bhdwp-gallery-lightbox-prev i,
.bhdwp-gallery-lightbox-next i {
	line-height: 1;
	font-size: 0.95rem;
	pointer-events: none;
}

.bhdwp-page-gallery-nav:hover:not(:disabled) {
	background: #0f172a;
	color: #fff;
	border-color: #0f172a;
}

.bhdwp-page-gallery-nav:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.bhdwp-page-gallery-item {
	appearance: none;
	border: 0;
	margin: 0;
	padding: 0;
	background: transparent;
	overflow: hidden;
	border-radius: 1rem;
	cursor: zoom-in;
	position: relative;
	flex: 0 0 calc((100% - 1.8rem) / 3);
}

.bhdwp-page-gallery-item::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.25));
	opacity: 0;
	transition: opacity 0.2s ease;
}

.bhdwp-page-gallery-item:hover::after,
.bhdwp-page-gallery-item:focus-visible::after {
	opacity: 1;
}

.bhdwp-page-gallery-image {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.bhdwp-page-gallery-item:hover .bhdwp-page-gallery-image,
.bhdwp-page-gallery-item:focus-visible .bhdwp-page-gallery-image {
	transform: scale(1.03);
}

.bhdwp-page-gallery-mobile {
	display: none;
}

.bhdwp-page-gallery-mobile-track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	gap: 0;
	border-radius: 1rem;
	scrollbar-width: none;
}

.bhdwp-page-gallery-mobile-track::-webkit-scrollbar {
	display: none;
}

.bhdwp-page-gallery-mobile-item {
	min-width: 100%;
	margin: 0;
	scroll-snap-align: center;
	position: relative;
	background: #fff;
}

.bhdwp-page-gallery-mobile-image {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.bhdwp-page-gallery-mobile-meta {
	margin: 0;
	padding: 0.85rem 1rem 0.95rem;
	text-align: center;
	background: #fff;
}

.bhdwp-page-gallery-mobile-title {
	margin: 0;
	font-family: 'Cormorant Garamond', serif;
	font-size: 1.15rem;
	line-height: 1.3;
	color: var(--bhdwp-ink);
}

.bhdwp-page-gallery-mobile-counter {
	margin: 0.2rem 0 0;
	font-size: 0.82rem;
	letter-spacing: 0.03em;
	color: rgba(22, 32, 42, 0.58);
}

.bhdwp-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: 1.5rem;
}

.bhdwp-gallery-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 23, 0.9);
}

.bhdwp-gallery-lightbox-dialog {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: auto minmax(260px, 1fr) auto;
	align-items: center;
	gap: 0.85rem;
	width: min(1200px, 100%);
	max-height: 100%;
}

.bhdwp-gallery-lightbox-close,
.bhdwp-gallery-lightbox-prev,
.bhdwp-gallery-lightbox-next {
	appearance: none;
	border: 0;
	padding: 0;
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bhdwp-gallery-lightbox-close {
	background: rgba(255, 255, 255, 0.24);
}

.bhdwp-gallery-lightbox-close:hover,
.bhdwp-gallery-lightbox-prev:hover,
.bhdwp-gallery-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.3);
}

.bhdwp-gallery-lightbox-prev:disabled,
.bhdwp-gallery-lightbox-next:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	background: rgba(255, 255, 255, 0.18);
}

.bhdwp-gallery-lightbox-close:focus-visible,
.bhdwp-gallery-lightbox-prev:focus-visible,
.bhdwp-gallery-lightbox-next:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.85);
	outline-offset: 2px;
	background: rgba(255, 255, 255, 0.32);
}

.bhdwp-gallery-lightbox-figure {
	margin: 0;
	padding: 0;
	max-height: calc(100vh - 5rem);
	display: grid;
	gap: 0.55rem;
	justify-items: center;
}

.bhdwp-gallery-lightbox-header {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.8rem;
}

.bhdwp-gallery-lightbox-title {
	margin: 0;
	text-align: left;
	font-family: 'Cormorant Garamond', serif;
	font-size: clamp(1.45rem, 2.2vw, 2rem);
	line-height: 1.15;
	color: #fff;
}

.bhdwp-gallery-lightbox-image {
	max-width: 100%;
	max-height: calc(100vh - 8rem);
	width: auto;
	height: auto;
	border-radius: 0.75rem;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.bhdwp-gallery-lightbox-caption {
	max-width: 80ch;
	text-align: center;
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.95rem;
}

body.bhdwp-lightbox-open {
	overflow: hidden;
}

@media (min-width: 1024px) {
	.bhdwp-page-gallery {
		margin-top: 1.75rem;
		padding: 2.5rem 0;
	}
}

@media (max-width: 1023px) {
	.bhdwp-page-gallery {
		margin-top: 1.75rem;
		padding: 1.5rem 0;
	}

	.bhdwp-page-gallery-desktop,
	.bhdwp-gallery-lightbox {
		display: none;
	}

	.bhdwp-page-gallery-mobile {
		display: block;
	}
}
