/*
 Theme Name: SPIDIR (Bricks child)
 Theme URI: https://spidir.org.uk/
 Description: Bricks child theme for SPIDIR. Holds what moved over from the Astra child theme.
 Author: Pechrian Digital
 Template: bricks
 Version: 1.0.0
 Text Domain: bricks
*/

/*
 * Custom CSS carried over from the Astra child theme (audit/child-theme/spidir/style.css)
 * and the Customizer (audit/custom-css/), for classes still used in content or
 * plugin output. Rules for Beaver Builder or Astra markup are rebuilt in Bricks
 * instead; see "Custom CSS to carry over" in audit/styles/README.md.
 */

/* Astra's icon font (GPL, copied from the Astra theme): the menu, close and
   arrow glyphs in the header template and the scroll-to-top arrow */
@font-face {
	font-family: "Astra";
	src: url(fonts/astra.woff) format("woff"), url(fonts/astra.ttf) format("truetype");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

/* Lightweight Social Icons' icon font (GPL, copied from the plugin): the
   Facebook and Twitter icons in the footer template */
@font-face {
	font-family: "lsi-fontello";
	src: url(fonts/lsi-fontello.woff) format("woff"), url(fonts/lsi-fontello.ttf) format("truetype");
	font-weight: normal;
	font-style: normal;
}

/* "Skip to content" link (functions.php), styled as Astra's when focused */
.spidir-skip-link.screen-reader-text:focus {
	display: block;
	top: 5px;
	left: 5px;
	z-index: 100000;
	width: auto;
	height: auto;
	margin: -1px;
	padding: 15px 23px 14px;
	border-radius: 2px;
	outline: thin dotted;
	background-color: #f1f1f1;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: normal;
	text-decoration: none;
}

/* Text shadow on hero headings (homepage) and the single event's header row
   (row class "page-header" in Beaver Themer's "Event" layout) */
.hero,
.page-header {
	text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* Course notice banner (the "Covid-19 Pandemic" Astra hook, now the notice bar) */
.banner {
	font-weight: 700;
}

.banner p {
	margin: 0;
}

.banner a,
.banner a:hover {
	text-decoration: underline;
}

/* Empty event listing on the homepage (Customizer CSS for .fl-post-grid-empty) */
.bb-posts-empty {
	text-align: center;
}

/* Beaver Builder's Posts module, feed layout (bb-plugin post-grid frontend.css),
   for listings converted by script 07. The image width and text margin come from
   each module's settings, in the module's own CSS. */
.bb-post-feed-header {
	margin-bottom: 20px;
}

.bb-post-feed-header a,
.bb-post-feed-content a {
	text-decoration: none;
}

/* body h2.fl-post-feed-title: beside the image, despite the theme's
   h1-h6 { clear: both } */
.bb-post-feed-title {
	clear: none;
}

.bb-post-feed-image-right {
	float: right;
	margin-bottom: 0;
	position: relative;
}

.bb-post-feed-image-right img {
	height: auto !important;
	width: 100% !important;
}

.bb-post-feed-content p:last-of-type {
	margin-bottom: 0;
	padding-bottom: 0;
}

@media (max-width: 680px) {
	.bb-post-feed-post:has(> .bb-post-feed-image-right) {
		margin-left: auto;
		margin-right: auto;
		max-width: 300px;
	}

	.bb-post-feed-image-right,
	.bb-post-feed-image-right img {
		float: none;
		width: 100% !important;
	}

	.bb-post-feed-image-right {
		margin-bottom: 20px;
	}

	.bb-post-feed-post .bb-post-feed-text {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
}

/* Event date and address in those listings (Beaver Themer's the-events-calendar
   post-grid.css) */
.bb-event-date {
	font-weight: bold;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bb-event-address {
	font-style: italic;
}

.bb-event-address abbr {
	border: none !important;
	text-decoration: none;
}

/* Customizer CSS for .fl-post-feed h2.fl-post-feed-title a, with the line height
   of Astra's heading link rule (.entry-content :where(h2) a) */
.bb-post-feed-title a {
	font-size: 24px;
	line-height: 1.3em;
}

/* Block editor content: the Post Content element in the "Page" template has
   Astra's entry-content class, with Astra's rules for it (main.css). The
   ::after keeps the last block's margin inside the content, as on the old site */
.entry-content {
	overflow-wrap: break-word;
}

/* Astra's .clear::before on the old entry-content: keeps the first block's
   top margin (e.g. a Gravity Form's 16px) inside the content */
.entry-content::before {
	display: table;
	content: "";
}

.entry-content::after {
	display: table;
	clear: both;
	content: "";
}

.entry-content > :last-child {
	margin-bottom: 0;
}

/* Pages Bricks doesn't render (a password-protected page before its password
   is entered; template-parts/page.php): the spidir-content class's container */
.spidir-content-wordpress {
	max-width: var(--spidir-container-width);
	margin: 4em auto;
	padding-left: var(--spidir-gutter);
	padding-right: var(--spidir-gutter);
	overflow-wrap: break-word;
}

@media (max-width: 768px) {
	.spidir-content-wordpress {
		max-width: 100%;
		margin-top: 1.5em;
		margin-bottom: 1.5em;
	}
}

/* Event categories (template-parts/page.php): Astra's archive markup around
   The Events Calendar's view. .spidir-content-wordpress is #primary, which
   floated, so it contained the row */
.spidir-events-category::before,
.spidir-events-category::after,
.spidir-events-category .ast-row::before,
.spidir-events-category .ast-row::after {
	display: table;
	content: "";
}

.spidir-events-category::after,
.spidir-events-category .ast-row::after {
	clear: both;
}

.spidir-events-category .ast-row {
	margin-left: -20px;
	margin-right: -20px;
}

.spidir-events-category .ast-article-post {
	position: relative;
	min-height: 1px;
	margin: 0;
	padding-left: 20px;
	padding-right: 20px;
}

@media (min-width: 544px) {
	.spidir-events-category .ast-article-post {
		float: left;
		width: 100%;
	}
}

.spidir-events-category .entry-header {
	margin-bottom: 1.5em;
	word-wrap: break-word;
}

.spidir-events-category .page-title {
	margin-bottom: 1em;
	color: #d7753d;
	font-weight: 400;
}

/* WordPress's password form, as Astra styled it (style.min.css), over Bricks'
   own rules for it (a flex row with the button at the end) */
#brx-content .post-password-form {
	margin: 0;
	text-align: center;
}

#brx-content .post-password-form p:last-child {
	display: block;
}

#brx-content .post-password-form p:last-child label {
	display: inline;
}

#brx-content .post-password-form input[type=submit] {
	display: inline-block;
	padding: 10px 20px;
	border-width: 0;
	border-radius: 2px;
}

@media (max-width: 420px) {
	#brx-content .post-password-form input[type=password] {
		display: block;
		margin: 10px auto;
	}
}

/* "Page with sidebar" template (Contact Us): Astra's right sidebar layout,
   .ast-container with a floated #primary (70%) and #secondary (30%) */
.spidir-sidebar-layout {
	max-width: 1240px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
}

.spidir-sidebar-layout::before,
.spidir-sidebar-layout::after,
.spidir-primary::before,
.spidir-primary::after,
.spidir-secondary::before,
.spidir-secondary::after,
.spidir-secondary .sidebar-main::before,
.spidir-secondary .sidebar-main::after {
	display: table;
	content: "";
}

.spidir-sidebar-layout::after,
.spidir-primary::after,
.spidir-secondary::after,
.spidir-secondary .sidebar-main::after {
	clear: both;
}

.spidir-primary,
.spidir-secondary {
	position: relative;
	float: left;
	width: 100%;
}

.spidir-primary {
	margin: 4em 0;
}

.spidir-secondary {
	margin: 4em 0 2.5em;
	font-size: 1rem;
	line-height: 2;
	word-break: break-word;
}

@media (min-width: 769px) {
	.spidir-primary {
		width: 70%;
		border-right: 1px solid #ddd;
	}

	.spidir-secondary {
		width: 30%;
		border-left: 1px solid #ddd;
		margin-left: -1px;
	}
}

@media (max-width: 992px) {
	.spidir-primary {
		padding-right: 30px;
	}
}

@media (max-width: 993px) {
	.spidir-secondary {
		padding-left: 30px;
	}
}

@media (min-width: 993px) {
	.spidir-primary {
		padding-right: 60px;
	}

	.spidir-secondary {
		padding-left: 60px;
	}
}

@media (max-width: 768px) {
	.spidir-sidebar-layout {
		max-width: 100%;
	}

	.spidir-primary {
		margin-top: 1.5em;
		margin-bottom: 1.5em;
		padding-left: 0;
		padding-right: 0;
	}

	.spidir-secondary {
		padding-top: 0;
		padding-left: 0;
	}
}

/* Astra's widget styles in the sidebar */
.spidir-secondary .widget {
	margin: 0 0 2.8em;
}

.spidir-secondary .widget:last-child {
	margin-bottom: 0;
}

.spidir-secondary .widget-title {
	margin-bottom: 1em;
	color: #231f20;
	font-family: Roboto, sans-serif;
	font-size: 1.375rem;
	font-weight: 400;
	line-height: 1.23em;
}

/* Outside .entry-content, Astra's paragraphs have a 1.75em margin */
.spidir-secondary p {
	margin-bottom: 1.75em;
}

/* Astra's rules for the blocks used in posts and pages (style.min.css and its
   dynamic CSS) */
.wp-block-separator {
	max-width: 100px;
}

.wp-block-separator.is-style-wide,
.wp-block-separator.is-style-dots {
	max-width: none;
}

.wp-block-separator:not(.is-style-wide):not(.is-style-dots) {
	margin: 20px auto;
}

.wp-block-image.aligncenter,
.wp-block-table.aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.entry-content .has-2-columns .wp-block-column:first-child {
	padding-right: 10px;
}

.entry-content .has-2-columns .wp-block-column:last-child {
	padding-left: 10px;
}

@media (max-width: 782px) {
	.entry-content .wp-block-columns .wp-block-column {
		flex-basis: 100%;
		margin-left: 0;
	}

	.entry-content .has-2-columns .wp-block-column:first-child {
		padding-right: 0;
	}

	.entry-content .has-2-columns .wp-block-column:last-child {
		padding-left: 0;
	}
}

/* Utilities used in page and event content */
.hidden {
	display: none;
}

.font-bold {
	font-weight: 700;
}

.align-center {
	text-align: center;
}

.notification {
	padding: 20px 20px;
	margin-bottom: 20px;
}

.is-warning {
	background-color: #ffdd57;
}

.stop-press {
	background-color: #eee;
	padding: 30px;
}

/* Block editor buttons in posts and pages */
.wp-block-button__link.has-background {
	border-radius: 3px;
}

/* File block download button (24 posts and pages) */
.wp-block-file a.wp-block-file__button {
	background-color: #d7753d;
	border-radius: 3px;
}

/* The Events Calendar */
#tribe-events-content .tribe-block__event-website a {
	background-color: #d7753d;
	border-radius: 3px;
}

h4.tribe-event-title a {
	color: #5ba95b;
}

/* TablePress */
.tablepress tbody td {
	border: none;
}

.tablepress .odd td {
	background-color: #f3f9ed;
	border: none;
}

/* Gravity Forms: Astra's compatibility CSS (astra/assets/css/minified/
   compatibility/gravity-forms.min.css), with --ast-border-color's value */
.gform_wrapper form {
	position: relative;
}

.gform_wrapper .ui-datepicker-header select {
	padding: inherit;
}

.gform_wrapper .gform_body .gfield_checkbox li > label {
	margin-top: 4px;
}

.gform_wrapper input:not([type=submit]):focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus {
	background-color: #fff;
	border-color: #ddd;
	outline: 0;
	box-shadow: none;
}

.ui-datepicker-header select {
	padding: 0;
}

@media (max-width: 768px) {
	.gform_wrapper.gf_browser_chrome form > .gform_body {
		width: 100%;
	}
}

/* Gravity Forms' own textarea line height, which Bricks overrides with
   textarea { line-height: inherit !important } */
.gform_legacy_markup_wrapper textarea {
	line-height: 1.5 !important;
}

.gform-theme--framework textarea {
	line-height: var(--gf-local-line-height) !important;
}

.gform_wrapper .optin {
	font-weight: 700;
}

.gform_wrapper .optin label {
	position: relative;
	top: 3px;
}

.gform_confirmation_wrapper {
	padding: 40px;
	font-weight: 600;
}

/* Keeps the submit button orange on focus (Astra forced it white) */
.gform_wrapper input[type=button]:focus {
	color: #fff !important;
	background-color: #d7753d !important;
}
