/*
Theme Name: Burses child theme
Template: u3a-siteworks-theme
Author: Local u3a
Description: Child theme of the u3a SiteWorks theme. Inherits all of its templates, template parts, fonts, styles and settings; holds the Local u3a changes so that they survive SiteWorks theme updates. Do not delete.
Version: 1.1.10
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: burses-child-theme
*/

/*
 * Local u3a changes to the SiteWorks theme.  Loaded after the SiteWorks style.css (see functions.php), so these win.
 *
 * Yellow: SiteWorks uses #ffc700; Local u3a uses #FEC92D, as on the test site.  The same colour is set for the
 * "u3a Button Text" palette entry in theme.json.
 */
:root {
	--mainyellow: #FEC92D;
}

/*
 * Keep the footer at the bottom of the window on short pages (from the dev site's Site Editor custom CSS).
 */
.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* let the main content expand, even when Ultimate Member replaces it */
.wp-site-blocks > main,
.wp-site-blocks > .wp-block-group {
	flex: 1 0 auto;
}

footer {
	margin-top: auto;
}

/*
 * General look, from the dev site's custom CSS (the "WP Add Custom CSS" plugin there).  The rest of that CSS is for
 * features not on this site yet (groups, policies, events, comments, member directory) and comes across with them.
 */
:root {
	--primary-blue: #005ab8;
	--accent-green: #9EBD73;
	--nav-green: #67853F;
}

/*
 * Side gap: SiteWorks indents paragraphs by 10px each side (theme.json), but forms, buttons and plugin output don't get
 * that indent, so they would sit out of line with the text (and touch the screen edges on phones).  Everything listed
 * here gets the same gap.  To line up something new, add it to the list; to change the gap, change --u3a-side-gap
 * (the burses-u3a plugin's groups and events lists use it too).
 */
:root {
	--u3a-side-gap: 10px;
}

.entry-content .fluentform,         /* Fluent Forms, e.g. Contact Us */
.um.um-login,                       /* Ultimate Member: Log In */
.um.um-password,                    /* password reset */
.um.um-account,                     /* account */
.um.um-register,                    /* registration */
.hutton-welcome-buttons,            /* Welcome page buttons */
.hutton-apply-button {              /* Join Us: Apply to join */
	padding-left: var(--u3a-side-gap);
	padding-right: var(--u3a-side-gap);
	box-sizing: border-box;
}

.entry-content img {
	display: block;
	margin-bottom: 1em;
	max-width: 100%;
	height: auto;
}

/*
 * A link styled as a button (class wp-element-button, used by plugins) is inline, so its padding overlapped the text
 * above it.  inline-block makes the padding take up room.
 */
a.wp-element-button {
	display: inline-block;
}

/* links: no underlines anywhere */
a,
a:link,
a:visited,
a:hover,
a:active,
a:focus {
	text-decoration: none;
	font-weight: 400;
}

/* buttons: round, blue, green on hover */
a.button,
.wp-element-button,
.wp-block-button__link,
.um .um-button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
	border-radius: 999px;
	background-color: var(--primary-blue);
	border: 1px solid var(--primary-blue);
	color: #ffffff;
	text-decoration: none;
}

a.button:hover,
.wp-element-button:hover,
.wp-block-button__link:hover,
.um .um-button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
	background-color: var(--accent-green);
	border-color: var(--accent-green);
	color: #000000;
}

/* Ultimate Member buttons (its own styles need !important to override) */
.um .um-button,
.um a.um-button,
.um input.um-button,
.um .um-form input.um-button,
.um .um-form input[type="submit"].um-button,
.um .um-form input[type="button"].um-button {
	border-radius: 999px !important;
	background-color: var(--primary-blue) !important;
	border: 1px solid var(--primary-blue) !important;
	color: #ffffff !important;
	text-decoration: none !important;
}

.um .um-button:hover,
.um a.um-button:hover,
.um input.um-button:hover,
.um .um-form input.um-button:hover {
	background-color: var(--accent-green) !important;
	border-color: var(--accent-green) !important;
	color: #000000 !important;
}

/* Ultimate Member secondary buttons: outlined */
.um a.um-button.um-alt,
.um input.um-button.um-alt,
.um .um-form input.um-button.um-alt {
	background: transparent !important;
	color: var(--primary-blue) !important;
	border: 1px solid var(--primary-blue) !important;
}

.um a.um-button.um-alt:hover,
.um input.um-button.um-alt:hover,
.um .um-form input.um-button.um-alt:hover {
	background-color: var(--accent-green) !important;
	border-color: var(--accent-green) !important;
	color: #000000 !important;
}

/* navigation: semi-bold, green on hover */
.wp-block-navigation a {
	font-weight: 600;
}

.wp-block-navigation a:hover,
.wp-block-navigation a:focus {
	color: var(--nav-green) !important;
	background-color: transparent !important;
}

/*
 * Phones (WordPress shows the "Menu" button below 600px): SiteWorks gives the button a grey border and the bar centres
 * it.  No border, bold, and on the right instead.
 */
@media (max-width: 599px) {
	.wp-block-group:has(> .wp-block-navigation) {
		justify-content: flex-end !important;
	}

	button.wp-block-navigation__responsive-container-open {
		border: none;
		font-weight: 700;
	}

	button.wp-block-navigation__responsive-container-open::after {
		font-weight: 700;
	}
}

/* the opened menu: a little space around the options so they don't sit against the screen edges */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding: 1rem 1.25rem;
}

/* links within the text of a page: underlined so they stand out (menus, buttons and cards stay as they are) */
.entry-content p a:link:not(.wp-element-button),
.entry-content p a:visited:not(.wp-element-button),
.entry-content li a:link:not(.wp-element-button),
.entry-content li a:visited:not(.wp-element-button) {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* ---------------------------------------------------------------- Welcome page */
/* the tagline under the menu: dark navy, semi-bold */
.hutton-tagline {
	color: #00305f;
	font-weight: 600;
}

/* the photos are left out on phones and small tablets (lazy images that aren't shown are never downloaded) */
@media (max-width: 820px) {
	.hutton-welcome-photos {
		display: none !important;
	}
}

.hutton-welcome-buttons {
	margin: 1.25em 0 1.5em;   /* side gap: see "Side gap" above */
}

.hutton-welcome-buttons .wp-block-button__link {
	margin-left: 0;
}

/* next monthly meeting: a card like the events list */
.u3a-next-meeting {
	margin: 0 0 1.5em;
	padding: 0.8em 1em 0.9em;
	background: var(--u3a-card-bg, #f6f6f6);
	border-top: 4px solid var(--wp--preset--color--custom-color-5, #9ebd73);
	border-radius: 0 0 6px 6px;
}

.u3a-next-meeting__label {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #555;
}

.entry-content .u3a-next-meeting a.u3a-next-meeting__title:link,
.entry-content .u3a-next-meeting a.u3a-next-meeting__title:visited {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--wp--preset--color--uta-header-back, #005ab8);
	text-decoration: none;
}

.u3a-next-meeting__presenter {
	color: #333;
}

.u3a-next-meeting__when {
	font-weight: 600;
}

/* ---------------------------------------------------------------- Join Us page */
/* the Apply to join button: lined up with the text */
.hutton-apply-button {
	padding-top: 1em;          /* padding, not margin: the page layout resets block margins */
	padding-bottom: 1.25em;    /* side gap: see "Side gap" above */
}

.hutton-apply-button .wp-block-button__link {
	margin-left: 0;
}

/* the handshake is left out on phones */
@media (max-width: 600px) {
	.hutton-handshake {
		display: none !important;
	}
}

/* Ultimate Member's "Forgot your password" link: bold grey, not UM's easily missed light grey */
.um a.um-link-alt {
	color: #555555 !important;
	font-weight: 700;
}
