/**
 * Theme Name:			SWS Starter Theme
 * Author:				Scheidler Web Solutions
 * Theme URI:			https://scheidlerwebsolutions.com/
 * Tags:				full-site-editing, block-patterns
 * Text Domain:			sws-starter
 * Requires at least:	6.4
 * Requires PHP:		7.4
 * Tested up to:		6.4
 * Version:				2026.04.21.01

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/* Styles intended only for the front.*/
html {
	scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}
}

body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

p:empty {
    display: none;
}

/* ALIGNMENTS */
.alignleft {
    display: inline;
    float: left;
    margin-right: 1.5em
}

.alignright {
    display: inline;
    float: right;
    margin-left: 1.5em
}

.aligncenter {
    clear: both;
    text-align: center;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ALERT BAR */
section#alert {
    text-align: center;
	color: #fff;
}

section#alert p {
    margin-block-start: 0;
    margin-block-end: 0;
    padding: 0.5em;
    font-weight: bold;
}


/* HEADER */
header > .wp-block-group {
    gap: 72px;
    padding: 20px;
}


/* FOOTER */
footer {
    position: relative;
    background-color: #fff; /* Footer background */
    text-align: center;
}

/* Target footer when main contains a SWS block as its last descendant */
main:has(.content-section:last-child) + footer,
main:has(.call-to-action:last-child) + footer,
main:has(.members:last-child) + footer,
main:has(.icons-row:last-child) + footer, 
main:has(.locations-map:last-child) + footer, 
main:has(.parallax-scroll:last-child) + footer { 
	margin-top: 0;
}

.footer-copyright-bar {
    padding: 1.625rem 0 1.25rem;
    gap: 14px;
}

.footer-copyright-bar .is-layout-flex {
    gap: 14px;
}

.footer-sws-bar figure.wp-block-image {
    line-height: 0; /* Fix height issue for SWS Icon in Footer */
}

footer ul {
	list-style-type: none;
}

/* NAVIGATION */
.wp-block-navigation {
    z-index: 2;
}


/* CONTACT FORM */
input.wpcf7-text {
    height: 25px;
}

input.wpcf7-submit {
    border: none;
    font-weight: bold;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    background-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--base)!important;
    padding: 10px 15px;
}


/* PHOTO GALLERY */
.foogallery-album-gallery-list .foogallery-pile {
    margin: 10px 15px 15px 35px !important;
}

.foogallery-album-gallery-list .foogallery-pile h3 {
    position: relative;
    bottom: auto;
    width: 250px;
    padding-top: 10px;
    font-family: var(--wp--preset--font-family--nunito-sans);
    font-size: 0.9em;
    line-height: 1.2em;
    opacity: 1.0;
}

.foogallery-album-gallery-list .foogallery-pile h3 span {
    padding-top: 10px;
}

.foogallery-album-gallery-list .foogallery-pile-inner a {
    text-decoration: none;
}

/*****************************************************************/
/* SWS PLUGIN BLOCKS */
/* Call To Action */
.call-to-action h2.wp-block-heading::after {
    content: '';
    display: block;
	position: relative;
    margin: 15px auto 0 auto;
    width: 120px;
    border-bottom: 4px solid var(--wp--preset--color--primary);
}

.call-to-action.has-secondary-background-color h2.wp-block-heading::after {
    border-bottom: 4px solid var(--wp--preset--color--tertiary);
}
.call-to-action.has-quaternary-background-color h2.wp-block-heading::after {
    border-bottom: 4px solid var(--wp--preset--color--tertiary);
}

/* Content Section*/
/*.content-section h2.wp-block-heading::after {
	content: "";
    display: block;
    position: relative;
    border-bottom: 3px solid var(--wp--preset--color--secondary);
    width: 70%;
}*/

.content-section .sws-content-image img {
    max-width: 500px; /* Change based on design */
	border-radius: 35px;
}

.content-section.has-contrast-background-color *, 
.content-section.has-primary-background-color *, 
.content-section.has-secondary-background-color * {
    color: var(--wp--preset--color--base);
}

.content-section.has-secondary-background-color h2.wp-block-heading {
    color: var(--wp--preset--color--contrast);
}

.content-section.has-secondary-background-color h2.wp-block-heading::before {
    border-left: 5px solid var(--wp--preset--color--contrast);
}

/* Members */
.members h2.wp-block-heading {
    color: var(--wp--preset--color--primary);
}

/* Footer Contact */
.footer-contact h2::after {
    content: "";
    display: block;
    border-bottom: 3px solid var(--wp--preset--color--primary);
    min-width: 100px;
    width: 100px;
    margin: 1.1rem 0;
}

.footer-contact .wp-block-column:nth-child(1) {
	text-align: left;
}

.footer-contact .wp-block-column:nth-child(2) {
	text-align: right;
}

.footer-contact ul.address {
    padding-left: 0;
}

.footer-contact ul.address li {
    line-height: 1.5rem;
	font-weight: 700;
	font-size: 1.1875rem;
}

.footer-contact ul.address li a {
    text-decoration: none;
}

.footer-contact ul.address li a:hover {
    color: var(--wp--preset--color--base);
    text-decoration: underline;
}

/* Applies to all SWS Blocks */
/* Hide empty space if a SWS Block is directly after header */
main:has(.entry-content):has(.content-section:first-child), 
main:has(.entry-content):has(.members:first-child), 
main:has(.entry-content):has(.call-to-action:first-child), 
main:has(.entry-content):has(.icons-row:first-child), 
main:has(.entry-content):has(.locations-map:first-child), 
main:has(.entry-content):has(.parallax-scroll:first-child) {
    padding-top: 0!important;
    margin-block-start: 0;
}

/* Hide empty space if a SWS block is followed by another SWS block */
.content-section ~ .content-section, 
.content-section ~ .members, 
.content-section ~ .call-to-action, 
.content-section ~ .icons-row, 
.content-section ~ .locations-map, 
.content-section ~ .parallax-scroll,
.members ~ .members, 
.members ~ .content-section, 
.members ~ .call-to-action, 
.members ~ .icons-row, 
.members ~ .locations-map,
.members ~ .parallax-scroll,
.call-to-action ~ .call-to-action, 
.call-to-action ~ .content-section, 
.call-to-action ~ .members, 
.call-to-action ~ .icons-row, 
.call-to-action ~ .locations-map, 
.call-to-action ~ .parallax-scroll,
.icons-row ~ .icons-row, 
.icons-row ~ .content-section, 
.icons-row ~ .members, 
.icons-row ~ .call-to-action, 
.icons-row ~ .locations-map, 
.icons-row ~ .parallax-scroll,
.locations-map ~ .locations-map, 
.locations-map ~ .content-section, 
.locations-map ~ .members, 
.locations-map ~ .call-to-action, 
.locations-map ~ .icons-row, 
.locations-map ~ .parallax-scroll, 
.parallax-scroll ~ .parallax-scroll, 
.parallax-scroll ~ .content-section, 
.parallax-scroll ~ .members, 
.parallax-scroll ~ .call-to-action, 
.parallax-scroll ~ .icons-row,  
.parallax-scroll ~ .locations-map {
    margin-block-start: 0;
}


@media screen and ( max-width: 600px ) {
    
    /* Change min height of cover block to make it smaller */
    .wp-block-cover {
        min-height: 300px;
    }

}

@media screen and ( max-width: 768px ) {
    .footer-sep {
        display: none;
    }

	a.privacy-policy-link {
		display: block;
	}
}

@media screen and ( max-width: 921px ) {
    
    /* NAVIGATION */
	header > .wp-block-group {
		align-items: start;
        gap: unset;
		justify-content: center;
	}

	/* Change icon from 2 lines to 3 lines in WP Editor */
	.wp-block-navigation__responsive-container-close, 
	.wp-block-navigation__responsive-container-open {
		background: var(--wp--preset--color--primary);
		padding: 5px;
		border-radius: 5px;
		color: var(--wp--preset--color--base);
		position: fixed;
		top: 10px;
		right: 10px;
        box-shadow: 0 0 0.50em 0.15em rgba(40, 59, 146, 0.25);
	}
	.wp-block-navigation__responsive-container-close svg, 
	.wp-block-navigation__responsive-container-open svg {
		height: 35px;
		width: 35px;
	}

	/* Mobile navigation menu block when open */
	.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open {
		animation: overlay-menu__fade-in-animation 0.5s ease-out;
		animation-fill-mode: forwards;
        left: unset;
		margin: 0;
		padding: 0;
		height: 100%;
		transition: transform 0.5s;
		overflow: auto;
		display: block;
		width: 75%;
		max-width: 350px;
		min-width: 320px;
		background-color: var(--wp--preset--color--light-gray);
		transform: translateX(-100%);
        z-index: 9998;
	}
	
	/* Adjust width mobile navigation shows from default of 600 to 921 */
	.wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}
	.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
	
	/* Add padding to each link */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item {
		width: 100%;
		overflow: hidden;
	}
	
	/* Remove spacing beween main links */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list {
		gap: 0;
		width: 100%;
	}
	
	/* Add site logo before navigation links */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container::before {
		content: "";
		max-width: 100%;
		display: block;
		margin: auto auto 20px;
		height: 150px; /* Adjust based on logo size */
		width: 250px; /* Adjust based on logo size */
		background-image: url(/wp-content/themes/sws-starter/logo_admin_sws.png);
		background-size: contain;
		background-repeat: no-repeat;
	}
	
	/* Submenu Block */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container {
		padding: 0;
		width: 100%;
	}
	
	/* a tags */
	.wp-block-navigation a:where(:not(.wp-element-button)) {
		width: 100%;
		font-weight: 400;
	}
    
	/* set link color */
	.wp-block-navigation .wp-block-navigation-item__content.wp-block-navigation-item__content {
		color: var(--wp--preset--color--contrast);
	}
	
	/* link hover and current page */
	.wp-block-navigation a:where(:not(.wp-element-button)):hover, 
	.wp-block-navigation-item.current-menu-item > a:first-child {
		text-decoration: none;
		background-color: var(--wp--preset--color--primary);
		color: var(--wp--preset--color--base)!important;
	}
	
	/* padding for all links */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
		padding: 4px 13px;
		padding-top: 4px!important;
		padding-bottom: 4px!important;
		width: calc(100% - 26px);
	}
	
	/* more padding for submenu links */
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
		padding-left: 30px;
		width: calc(100% - 40px);
	}
    
    /* add extra margin on top when admin-bar is present */
    .admin-bar .wp-block-navigation__responsive-container-close, 
	.admin-bar .wp-block-navigation__responsive-container-open {
        margin-top: 46px !important;
    }

	/* add extra margin right to alert for menu button */
	section#alert p {
		margin-right: 55px;
	}
	
}

@media screen and ( min-width: 922px ) {
    
    /* NAVIGATION */
    .wp-block-navigation {
        row-gap: 12px;
    }
    
    /* Make last link white background, gold text, round corners */
	.wp-block-navigation ul:first-child > li:last-child a {
		background-color: var(--wp--preset--color--secondary);
		color: var(--wp--preset--color--base)!important;
		font-weight: 700;
		font-style: italic;
		padding: 0.2rem 1.0rem;
		border-radius: 30px;
	}
    
	.wp-block-navigation li:where(:not(.wp-element-button)):hover {
		transition: all .3s ease;
		transform: scale(1.1);
        z-index: 3;
	}
    
    .wp-block-navigation li:where(:not(.wp-element-button)):not(:hover) {
		/* z-index fix for dropdown not covering other links in nav */
		animation: z-index-fix 0.1s;
	}

	.wp-block-navigation a:where(:not(.wp-element-button)):hover {
		text-decoration: none;
	}

	.wp-block-navigation li.wp-block-navigation-submenu ul li:where(:not(.wp-element-button)) {
		line-height: 1.2;
		padding: 0.6rem 0;
	}

	.wp-block-navigation li.wp-block-navigation-submenu ul li:where(:not(.wp-element-button)):hover {
		transform: none;
		background-color: var(--wp--preset--color--light-gray);
        color: var(--wp--preset--color--base);
	}

	.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container, .wp-block-navigation .has-child:not(.open-on-click):hover>.wp-block-navigation__submenu-container, .wp-block-navigation .has-child:not(.open-on-click):not(.open-on-hover-click):focus-within>.wp-block-navigation__submenu-container {
		border-top: 2px solid var(--wp--preset--color--primary);
        min-width: 260px;
	}
    
    .wp-block-navigation .wp-block-page-list {
		row-gap: 10px;
	}
}

@media screen and ( max-width: 900px ) {
    footer .footer-copyright-bar {
        row-gap: 5px;
    }
    
    footer .footer-copyright-bar .is-layout-flex{
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0;
    }    
    
    footer .footer-divider {
        flex-basis: 100%;
        height: 0;
        line-height: 0;
        color: transparent;
    }
    
    footer .footer-copyright-bar * {
        text-align: center;
    }

	.footer-contact h2::after {
		margin: 1.1rem auto;
	}

	.footer-contact .wp-block-column:nth-child(1) {
		text-align: center;
	}

	.footer-contact .wp-block-column:nth-child(2) {
		text-align: center;
	}
}

@keyframes z-index-fix {
	0%, 100% {
		z-index: 1;
	}
}