/* ==========================================================================
   Leanstrap base styles (loaded after Bootstrap).
   Keep this file small; site-specific styles go in the child theme.
   ========================================================================== */

/* Skip link
   ------------------------------------------------------------------------ */
.skip-link:focus {
	position: fixed;
	top: .5rem;
	left: .5rem;
	z-index: 1080;
	padding: .5rem 1rem;
	background: var(--bs-body-bg);
	color: var(--bs-body-color);
	border-radius: var(--bs-border-radius);
	box-shadow: var(--bs-box-shadow);
}

/* Sections: spacing presets + custom values via CSS variables
   ------------------------------------------------------------------------ */
.section {
	position: relative;
	/* --ls-offset: header height when a transparent header overlaps the first section */
	padding-top: calc(var(--section-pt) + var(--ls-offset, 0px));
	padding-bottom: var(--section-pb);
}

.section--space-none   { --section-pt: 0px;  --section-pb: 0px; }
.section--space-sm     { --section-pt: 2rem; --section-pb: 2rem; }
.section--space-md     { --section-pt: 4rem; --section-pb: 4rem; --section-pt-mobile: 3rem; --section-pb-mobile: 3rem; }
/* Custom: values come from inline CSS variables; blank mobile values fall back to desktop. */
.section--space-custom { --section-pt: 4rem; --section-pb: 4rem; }
.section--space-lg     { --section-pt: 6rem; --section-pb: 6rem; --section-pt-mobile: 4rem; --section-pb-mobile: 4rem; }

@media (max-width: 767.98px) {
	.section {
		padding-top: calc(var(--section-pt-mobile, var(--section-pt)) + var(--ls-offset, 0px));
		padding-bottom: var(--section-pb-mobile, var(--section-pb));
	}
}

/* Dark / overlay sections pick up Bootstrap's dark color mode text */
.section[data-bs-theme] {
	color: var(--bs-body-color);
}

/* Sections: background image (real <img>, so it gets srcset + lazy loading)
   ------------------------------------------------------------------------ */
.section--bg-image {
	isolation: isolate;
	overflow: hidden;
}

.section__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.section--overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(0, 0, 0, .55);
}

/* Editor content (WordPress core classes)
   ------------------------------------------------------------------------ */
.entry-content > :last-child { margin-bottom: 0; }

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

.alignleft   { float: left;  margin: .25rem 1.5rem 1rem 0; }
.alignright  { float: right; margin: .25rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-right: auto; margin-left: auto; }

.wp-caption { max-width: 100%; }
.wp-caption-text,
.wp-element-caption {
	margin-top: .5rem;
	font-size: .875em;
	color: var(--bs-secondary-color);
}

/* Navbar logo (heights from Theme Options → Branding)
   A fixed height + width:auto lets the browser size the box from the img's
   width/height attributes before the file loads, so nothing shifts (CLS).
   ------------------------------------------------------------------------ */
.navbar-brand .custom-logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: var(--ls-logo-h, 48px);
	object-fit: contain; /* very wide logo on a narrow phone: scales down, never squashes */
	object-position: left center;
}
/* Mobile logo height: set per breakpoint in leanstrap_header_css(). */

/* Header (Theme Options → Header). Breakpoint-specific rules are inline,
   from leanstrap_header_css().
   ------------------------------------------------------------------------ */
.ls-header--light   { --ls-header-bg: var(--bs-body-bg); border-bottom: var(--bs-border-width) solid var(--bs-border-color); }
.ls-header--dark    { --ls-header-bg: var(--bs-dark); }
.ls-header--primary { --ls-header-bg: var(--bs-primary); }

.ls-navbar { background-color: var(--ls-header-bg); }

/* On Primary, Bootstrap's faded link colors fail contrast: use the full text color. */
.ls-header--primary {
	--bs-navbar-color: var(--ls-on-primary, #fff);
	--bs-navbar-hover-color: var(--ls-on-primary, #fff);
	--bs-navbar-active-color: var(--ls-on-primary, #fff);
	--bs-navbar-brand-color: var(--ls-on-primary, #fff);
	--bs-navbar-brand-hover-color: var(--ls-on-primary, #fff);
}

.ls-header--primary .nav-link.active,
.ls-navbar--transparent:not(.is-solid) .nav-link.active {
	text-decoration: underline;
	text-underline-offset: .4em;
}

.ls-sticky {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1030;
}

@media (max-width: 600px) {
	.admin-bar .ls-sticky { top: 0; } /* the admin bar scrolls away on phones */
}

/* Transparent: overlaps the first section; turns solid on scroll / open menu. */
.site-header--transparent {
	position: relative;
	z-index: 1030;
	margin-bottom: calc(-1 * var(--ls-header-h, 0px));
}

.site-header--transparent.ls-sticky { position: sticky; }

.ls-navbar--transparent:not(.is-solid) {
	--bs-navbar-color: #fff;
	--bs-navbar-hover-color: #fff;
	--bs-navbar-active-color: #fff;
	--bs-navbar-brand-color: #fff;
	--bs-navbar-brand-hover-color: #fff;
	background-color: transparent;
	border-bottom-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
	.ls-navbar--transparent { transition: background-color .2s ease, border-color .2s ease; }
}

.ls-navbar--transparent:not(.is-solid) .custom-logo--default,
.ls-navbar--transparent.is-solid .custom-logo--dark { display: none; }

/* Container width, so the open mobile menu lines up with the logo */
@media (min-width: 576px)  { .ls-navbar { --ls-cw: 540px; } }
@media (min-width: 768px)  { .ls-navbar { --ls-cw: 720px; } }
@media (min-width: 992px)  { .ls-navbar { --ls-cw: 960px; } }
.ls-navbar.is-fluid { --ls-cw: 100%; }

/* Icon button (search) */
.ls-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem; /* 44px touch target */
	min-height: 2.75rem;
	padding: 0;
	font-size: 1.25rem;
	color: var(--bs-navbar-color);
	background: none;
	border: 0;
	border-radius: var(--bs-border-radius);
}

.ls-icon-btn:hover { color: var(--bs-navbar-hover-color); }

.ls-icon-btn:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color);
}

/* Icons + contact details */
.ls-icon {
	flex-shrink: 0;
	width: 1em;
	height: 1em;
}

.ls-contact {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	font-style: normal;
}

address.ls-contact,
span.ls-contact { align-items: flex-start; }

address.ls-contact .ls-icon,
span.ls-contact .ls-icon { margin-top: .2em; }

/* Top bar + footer: links take the area's text color, so they always contrast.
   Text links stay underlined; contact and icon links underline on hover. */
.ls-topbar a,
.site-footer a:not(.btn) { color: inherit; }

.ls-topbar .ls-contact,
.site-footer .ls-contact,
.site-footer .footer-nav a { text-decoration: none; }

.ls-topbar .ls-contact:hover span,
.site-footer .ls-contact:hover span,
.site-footer .footer-nav a:hover { text-decoration: underline; }

/* Social icons (24px+ targets, WCAG 2.2) */
.ls-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	font-size: 1.25rem;
	color: inherit;
	border-radius: 50%;
	text-decoration: none;
}

.ls-social--sm .ls-social__link {
	width: 2rem;
	height: 2rem;
	font-size: 1rem;
}

.ls-social__link:hover { background-color: rgba(var(--bs-emphasis-color-rgb), .1); }

.ls-social__link:focus-visible {
	outline: 0;
	box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color);
}

/* Footer */
.ls-footer-menu li + li { margin-top: .5rem; }
.ls-footer-menu a { text-decoration: none; }
.ls-footer-menu a:hover,
.ls-footer-menu .current-menu-item > a { text-decoration: underline; }

.ls-footer-brand { display: inline-block; color: inherit; font-size: 1.25rem; font-weight: 500; text-decoration: none; }

.ls-footer-brand .custom-logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: var(--ls-logo-h, 48px);
	object-fit: contain; /* very wide logo on a narrow phone: scales down, never squashes */
	object-position: left center;
}

.site-footer .border-top { border-color: rgba(var(--bs-emphasis-color-rgb), .15) !important; }

/* WordPress core screen-reader text (pagination headings, etc.)
   ------------------------------------------------------------------------ */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	clip: auto;
	width: auto;
	height: auto;
	padding: .5rem 1rem;
	margin: 0;
	white-space: normal;
	background: var(--bs-body-bg);
	color: var(--bs-body-color);
	z-index: 1080;
}

/* Headings (font + weight from Theme Options → Typography)
   ------------------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
	font-family: var(--ls-heading-font-family, inherit);
	font-weight: var(--ls-heading-font-weight, 500);
}

.display-1, .display-2, .display-3,
.display-4, .display-5, .display-6 {
	font-family: var(--ls-heading-font-family, inherit);
}

/* Pagination (core markup) */
.nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}
.nav-links .page-numbers {
	padding: .375rem .75rem;
	border: var(--bs-border-width) solid var(--bs-border-color);
	border-radius: var(--bs-border-radius);
	text-decoration: none;
}
.nav-links .page-numbers.current {
	background: var(--bs-primary);
	border-color: var(--bs-primary);
	color: var(--ls-on-primary, #fff);
}
