/*
 * Rules that Weebly's shared stylesheet (sites.css) and scripts used to provide
 * for the theme in main_style.css: menus, columns, images, the blog layout.
 */

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

/* Header + navigation */
#nav-trigger { background: none; border: 0; cursor: pointer; }
.nav li { position: relative; }
.nav li.active > a { color: #4a5c53 !important; }
/* The theme's hover/focus grey (#a6a6a6) is too light; underline instead. */
.nav li a:hover, .nav li a:focus { color: #4a5c53 !important; text-decoration: underline; }
#nav .wsite-menu-wrap {
	display: none;
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	min-width: 180px;
	z-index: 20;
	text-align: center;
}
#nav li:hover > .wsite-menu-wrap,
#nav li:focus-within > .wsite-menu-wrap { display: block; }
#nav li.menu-dismissed > .wsite-menu-wrap { display: none; }
#nav .wsite-menu { border: 1px solid #f3f3f3; background: #ffffff; padding: 0; }
#nav .wsite-menu li { display: block; }
#nav .wsite-menu li a { padding: 10px 15px; white-space: nowrap; }
#navmobile .wsite-menu { padding: 0 0 0 1em !important; }
#navmobile .wsite-menu-wrap a { font-size: 1em; }

/* Content */
.wsite-section-elements h2.wsite-content-title { margin-top: 0; }
.wsite-button { display: inline-block; text-decoration: none !important; margin: 0.5em 0 1.5em; }
div.wsite-image { margin: 0 auto 1.6em; }
.wsite-image img { display: inline-block; }
.wsite-image .wsite-caption { display: block; font-style: italic; margin-top: 0.5em; line-height: 1.5; }
.wsite-video, .wsite-embed { margin: 0 auto 1.6em; }
.wsite-multicol { display: flex; gap: 30px; margin: 0 auto 1.6em; }
.wsite-multicol-col { min-width: 0; }
/*
 * Imported text is often wrapped in <font size="4"> to <font size="7"> (18px to
 * 48px), which makes whole pages (Principles, many posts) far larger than the
 * theme. Use the theme's sizes for body text and headings instead.
 */
.paragraph font[size="4"], .paragraph font[size="5"], .paragraph font[size="6"], .paragraph font[size="7"],
.wsite-content-title font[size], .blog-sidebar font[size="3"] { font-size: inherit; }
/* Weebly left empty columns in some blocks (the blog sidebar's link lists), which pushed the rest right. */
.wsite-multicol-col:not(:has(> :not(.paragraph:empty))) { display: none; }
.wsite-spacer { height: 30px; }
/* Section headings that were bold paragraph lines in the Weebly content; keep their old look. */
.content-heading { font-size: 1.1em; font-weight: bold; line-height: 1.4; color: #292f2c; margin: 0 auto 0.8em; }
hr.styled-hr { border: 0; border-top: 1px solid #dae3d9; margin: 20px 0; }
.form-replacement { border-left: 15px solid #dae3d9; padding: 1em 1.5em; margin: 0 auto 1.6em; line-height: 1.5; }
table.wsite-table, .paragraph table { border-collapse: collapse; }
.paragraph td, .paragraph th { border: 1px solid #dcdcdc; padding: 6px 10px; vertical-align: top; }
@media (max-width: 767px) {
	.wsite-multicol { display: block; }
}

/* Blog */
#blogTable { border: 0; width: 100%; table-layout: fixed; border-collapse: collapse; }
#blogTable > tbody > tr > td { vertical-align: top; }
#blogTable .blog-sidebar { padding-left: 40px; }
.blog-post { margin-bottom: 3em; }
.blog-post-separator { border-bottom: 1px solid #dae3d9; margin-top: 2em; }
.blog-date { color: #6b6b6b; margin: 0 !important; }
.blog-page-nav { overflow: hidden; margin: 2em 0; }
.blog-page-nav-previous { float: left; }
.blog-page-nav-next { float: right; }
.blog-sidebar .paragraph, .blog-sidebar p { line-height: 1.8; }
/* Comments (src/components/Comments.astro) */
.comments { margin-bottom: 3em; }
.comments-heading { font-size: 1.4em; margin: 0 0 1em; color: #292f2c; }
.comments-subheading { font-size: 1.1em; margin: 2em 0 0.8em; color: #292f2c; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment { border-left: 4px solid #dae3d9; padding: 0.2em 0 0.2em 1em; margin: 0 0 1.5em; }
.comment-meta { margin: 0 0 0.4em !important; }
.comment-author { font-weight: bold; color: #292f2c; margin-right: 0.75em; }
.comment-date { color: #6b6b6b; }
/* Comments are stored as plain text; keep the line breaks people typed. */
.comment-body { white-space: pre-line; overflow-wrap: break-word; line-height: 1.6; }
.comment-note { color: #6b6b6b; }
.comment-result { padding: 0.75em 1em; border-left: 6px solid #4a5c53; background: #ffffff; color: #292f2c; }
.comment-result-error { border-left-color: #a3262a; }
.comment-field { margin: 0 0 1em; }
.comment-field label { display: block; font-weight: bold; margin-bottom: 0.3em; color: #292f2c; }
.comment-form .wsite-form-input { display: block; width: 100%; max-width: 40em; background: #ffffff; }
.comment-form input.wsite-form-input { height: 44px !important; }
/* 1.4.11: the theme's #dcdcdc input border is under 3:1 against the page. */
.comment-form .wsite-form-input { border-color: #767676; }
.comment-form textarea.wsite-form-input { resize: vertical; min-height: 8em; }
.comment-form .blog-button { cursor: pointer; }
.comment-form .blog-button:hover { background: #4a5c53 !important; }
.comment-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* 2.5.8: the sidebar's stacked links need 24px-tall targets, also at phone sizes. */
.blog-sidebar a { display: inline-block; min-height: 24px; line-height: 24px; }

/* Footer */
.wsite-footer { text-align: right; }
.footer-links ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 1.5em; padding: 0; margin: 0; }
.footer-links li { line-height: 2; }
/* Like the header menu, the links show an underline only on hover and focus. */
.footer-links a { text-decoration: none; }
.footer-links a:hover, .footer-links a:focus { text-decoration: underline; }
.footer-social { margin: 10px 0 1em; }
.footer-social .wsite-social-item { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; margin: 0 0 0 6px; color: #5e6b63 !important; }
.footer-social .wsite-social-item:hover { color: #131916 !important; }
.footer-copyright { font-size: 0.75em; }

/* The strip on the numbered design sites (src/lib/designs.ts) saying they are previews. */
.design-banner { background: #131916; color: #ffffff; font: 13px/1.4 Arial, sans-serif; text-align: center; padding: 7px 16px; }
.design-banner p { margin: 0; line-height: 1.4; }
.design-banner a { color: #ffffff; text-decoration: underline; margin-left: 0.5em; }
.design-banner a:focus-visible { outline-color: #ffffff !important; }

/* Weebly YouTube embeds */
.wsite-youtube-container { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin: 0 auto; }
.wsite-youtube-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/*
 * Importing the StudioCMS SDK makes Astro attach the dashboard's global CSS
 * (dark color scheme, white body text, svg colors) to every page. Restore the
 * theme's values with selectors that outrank it.
 */
html:root { color-scheme: light; }
html body { color: #525252; background-color: #ecf2ee; }
html body svg { color: inherit; transition: none; }

/*
 * Accessibility (WCAG 2.2 AA)
 */

/* 1.4.3: the theme's link (#a6a6a6) and footer (#8e8e8e) greys fail contrast on white. */
a { color: #4a5c53; }
#footer-wrap { color: #6b6b6b; }
table { max-width: 100%; }
.wsite-section-elements, .blog-content { overflow-wrap: break-word; }

.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* 2.4.1: skip link, shown when focused. */
.skip-link {
	position: absolute;
	top: -100px;
	left: 16px;
	z-index: 100;
	padding: 12px 18px;
	background: #292f2c;
	color: #ffffff !important;
	font-weight: bold;
	text-decoration: none;
	border-radius: 3px;
}
.skip-link:focus { top: 12px; }
#main-wrap:focus { outline: none; }

/* 2.4.7: a clear focus indicator everywhere. */
:focus-visible { outline: 3px solid #131916 !important; outline-offset: 2px; }
.skip-link:focus-visible, .wsite-button:focus-visible { outline-color: #131916 !important; box-shadow: 0 0 0 5px #ffffff; }

/* Menu button: an SVG icon (visible in forced-colors mode) instead of the theme's image. */
#nav-trigger { color: #000000; min-width: 44px; min-height: 40px; }
#nav-trigger::before { display: none !important; }
#nav-trigger svg { display: block; margin: 0 auto; }

@media (min-width: 768px) {
	/* 2.4.11: keep focused elements clear of the fixed header. */
	html { scroll-padding-top: 140px; }
	/*
	 * 1.4.4: the header grows when text is enlarged on its own (Firefox's "Zoom
	 * text only"), so Layout.astro measures it into --header-height and the
	 * content starts below it instead of underneath.
	 */
	html.header-sized { scroll-padding-top: calc(var(--header-height) + 15px); }
	html.header-sized body #main-content { padding-top: var(--header-height); }
}
@media (min-width: 768px) and (max-width: 992px) {
	/* The theme fixes the stacked header at 120px; let it grow with its text. */
	#header-wrap, #header, body.collapse #header { height: auto !important; }
	#header { min-height: 120px; }
}
@media (min-width: 993px) and (max-width: 1060px) {
	/*
	 * The six-item menu no longer fits beside the title here, so stack them as
	 * the theme already does at 992px and below, instead of wrapping one item.
	 */
	#header-wrap, #header, body.collapse #header { height: auto !important; }
	#header { min-height: 140px; }
	body #main-content { padding-top: 140px; }
	#header { display: block; padding-top: 1.8em !important; padding-bottom: 1em !important; }
	#logo, #header-right { display: block; text-align: center; width: 100% !important; max-width: 100% !important; margin: 0 auto; }
	#header-right { padding-top: 1em !important; }
}
@media (max-width: 767px) {
	/*
	 * 1.4.10: the theme keeps the header fixed on phones but reserves only 40px
	 * for it. At 320px (400% zoom) the title wraps, the header grows, and the top
	 * of the page disappears under it, so let the header scroll with the page.
	 */
	body #header-wrap { position: relative; }
	body #main-content { padding-top: 0; }
	/* The desktop menu's links are hidden on phones; hide its landmark too. */
	#nav { display: none !important; }
	/* The theme only fades the closed menu out; keep it out of the tab order. */
	body:not(.menu-open) #navmobile { visibility: hidden; }
	#nav-trigger svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
