/* 
Theme Name: FirstPrinciplesSolutions
Text Domain: FirstPrinciplesSolutions
Version: 1.1
Description: Minimal, classic WordPress theme
Author: Jonathan Moore
Author URI: https://1stprinciplessolutions.com
*/

/** Table of Contents 
    0. Variables
    1. Typography
    2. Navigation Styles
    3. Layout
    4. Section-specific styling
    5. Utility Classes
    6. Icons
    7. Buttons

*/

/* 0. Variables */
:root {
    --color-brand-blue: #003765;
    --color-brand-blue-alt: #005499;

    --color-brand-red: #BF050B;
    --color-brand-red-alt: #d53f44;

    --color-brand-yellow: #F7F064;
    --color-brand-yellow-alt: #f7f4b6;

    --color-neutral-light: #FEFEFF;

    --color-neutral-dark: #011A32;

    --font-serif: libre baskerville,serif;
    --font-sans-serif: helvetica-w01-roman,helvetica-w02-roman,helvetica-lt-w10-roman,sans-serif;

	--size-content-width-desktop: 1130px;

    --spacing-default-section: 2.5rem;

    --animiation-speed-normal: 300;
    
    font-size: 16px;
    font-family: var(--font-sans-serif);
}

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}


/* 1. Typography */
h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
    font-family: var(--font-serif);
    font-style: italic;
}

h1,
.h1 {
    font-size: 2.5rem;
    font-style: normal;
}

h2,
.h2 {
    font-size: 2rem;
}

h3,
.h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

h4,
.h4 {
    margin-top: 0;
    font-size: 1.25rem;
}

h5,
.h5,
h6,
.h6 {
    margin-top: 0;
    font-size: 1rem;
}

a,
a:visited {
    color: var(--color-neutral-dark);
    transition: all var(--animiation-speed-normal) ease-in-out;
}

a:hover,
a:active {
    color: var(--color-brand-yellow);
}

ul {
    padding-left: 2rem;
}

p:last-of-type {
	margin-bottom: 0;
}


/* 2. Navigation Styles */
header {
    background-color: var(--color-brand-red);
}

#nav-image {
    max-width: 1130px;
    margin: 0 auto -3px;

    & img {
        max-width: 100%;
    }
}

header nav {
    border-top: solid 2px var(--color-brand-yellow);
    border-bottom: solid 2px var(--color-brand-yellow);
}

nav li {
    display: block;
    height: 100%;
}

nav li a {
    display: flex;
	justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

#main-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--size-content-width-desktop);
    height: 35px;
    margin: 0 auto;

    & > .menu-item {
        transition: all var(--animiation-speed-normal) ease-in-out;

        &:hover {
            position: relative;
            left: -.25rem;
            padding: 0 .5rem;
            margin-right: -1rem;
            background-color: var(--color-brand-blue-alt);
        }
    }
}

#main-navigation .menu-item a {
    color: var(--color-neutral-light);
    text-decoration: none;
}

#main-navigation .menu-item.current-menu-item > a,
#main-navigation a:hover {
    color: var(--color-brand-yellow);
}

.menu-item-has-children {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.menu-item-has-children::after {
    content: "\f347";
    font-family: dashicons;
    color: var(--color-neutral-light);
    transition: all 300ms ease-in-out;
}

.sub-menu {
    display: none;
    position: absolute;
    top: 35px; /* nav height + border */
    left: -1rem;
    z-index: 999999;
    padding: .5rem 1rem;
    background-color: var(--color-brand-blue-alt);
    border-bottom: solid 2px var(--color-brand-yellow);
    border-left: solid 2px var(--color-brand-yellow);
    border-right: solid 2px var(--color-brand-yellow);
}

.sub-menu li {
    white-space: nowrap;
}

.sub-menu li:not(:last-of-type) {
    margin-bottom: .5rem;
}

#mobile-menu-toggle {
    display: none;
    color: var(--color-neutral-light);
    font-size: 2rem;
}

@media screen and (max-width: 1000px) {
    nav {
        padding: .5rem 0;
        text-align: center;
    }

    #mobile-menu-toggle {
        display: inline;
    }

    #main-navigation {
        display: none;
        flex-direction: column;
        align-items: initial;
        height: 0;
        padding: 1rem;
        gap: 1rem;
        transition: all 300ms ease-in-out;

        &.open {
            display: flex;
            height: fit-content;
        }

        & .menu-item {
            flex-wrap: wrap;

            &:not(:last-of-type) {
                border-bottom: solid 1px var(--color-neutral-light);
            }

            &:hover {
                position: relative;
                left: 0;
                padding: 0;
                margin-right: 0;
                background-color: unset;
            }

            &.open::after {
				position: absolute;
				top: 15px;
				right: 0;
                transform: rotate(180deg);
                transition: all 300ms ease-in-out;
            }

            &.menu-item-has-children {
                justify-content: space-between;
            }
			

        }



        
        & a {
            width: fit-content;
            padding: 1rem;
        }

        & .sub-menu {
            position: initial;
            width: 100%;
        }
    }
}


/* 3. Layout */
.page-template-default {
    & main > * {
        padding-top: var(--spacing-default-section);
        padding-bottom: var(--spacing-default-section);
    }
}

.flex-layout {
    --size-content-width-desktop: min(1130px, 100%);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: var(--spacing-default-section);
	padding-bottom: var(--spacing-default-section);
	
	& > * {
		box-sizing: border-box;
	}

    & h2 {
        flex: 0 1 100%;
    }

    & .left-half {
        order: 1;
    }
    
    & .right-half {
        order: 2;
    }
}

.quarters-layout {
    &.three-one {
        & .left-half {
            flex: 3;
            max-width: calc((var(--size-content-width-desktop) / 4) * 3);
        }
        
        & .right-half {
            flex: 1;
            max-width: calc((var(--size-content-width-desktop) / 4) * 1);
        }
    }

    &.one-three {
        & .left-half {
            flex: 1;
            max-width: calc((var(--size-content-width-desktop) / 4) * 1);
        }
        
        & .right-half {
            flex: 3;
            max-width: calc((var(--size-content-width-desktop) / 4) * 3);
        }
    }
}

.halves-layout {
    & > * {
        flex: 0 1 calc((var(--size-content-width-desktop) / 2) - 0.5rem);
        max-width: calc((var(--size-content-width-desktop) / 2) - 0.5rem);
        box-sizing: border-box;
    }
}

.thirds-layout {
    & > * {
        flex: 1;
        max-width: calc((var(--size-content-width-desktop) / 3) * 1);
    }

    &.two-one {
        & .left-half {
            flex: 2;
            max-width: calc((var(--size-content-width-desktop) / 3) * 2);
        }
        
        & .right-half {
            flex: 1;
            max-width: calc((var(--size-content-width-desktop) / 3) * 1);
        }
    }
}

.single-post {
    & .flex-layout {
		padding: 0;
		
		& section {
			max-width: var(--size-content-width-desktop);
			margin: 0 auto;
			padding: var(--spacing-default-section) 2rem;
		}
    }
}

.announcement-image {
	display: block;
	margin: 0 auto 1rem;
}

@media screen and (max-width: 1000px) {
	main > .flex-layout {
		gap: 1rem;
		padding-top: 0;
		padding-bottom: var(--spacing-default-section);
		margin-bottom: var(--spacing-default-section);
		
		& .flex-layout {
			padding: 0;
		}
	}

    .flex-layout {
        flex-direction: column;
        align-items: center;
		gap: 2rem;

        & > * {
            width: 100%;
            max-width: 100% !important;
        }

        & aside img,
        & .right-half img,
        & .left-half img,
        & .right-half > figure,
        & .left-half > figure {
        	display: block;
            margin: 1rem auto;
        }

        & .button.image img {
            width: 100% !important;
        }
    }
}

@media screen and (max-width: 1000px) {
    body > *:not(header, main) {
        padding: 1rem;
    }
	
	.page-template-default {
		& main > * {
			padding: var(--spacing-default-section) 2rem;
		}
	}
}

/* 4. Section-specific styling */
/* 4.0 Universal Sections */


/* 4.1 Content with Update Board */
.event-updates {
    height: fit-content;
    text-align: center;
    border: solid 1px var(--color-brand-blue);
    border-radius: 3rem;
    overflow: hidden;

    & a {
        color: var(--color-brand-blue);
    }

    & h2 {
        padding: .25rem 0;
        background-color: var(--color-brand-blue);
        color: var(--color-neutral-light);
    }

    & h2:first-of-type {
        margin-top: 0;
    }
}

.event-update {
    margin: 0 1.5rem 1rem;
}

.event-update a {
    display: flex;
    align-items: center;
    gap: 1rem;
	margin-bottom: 1rem;
}

.event-update div {
    flex: 1;
	text-align: center;
}

.event-update p {
    margin: 0;
    flex: 3;
    text-align: left;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;

    & a {
        text-decoration: none;
    }
}


/* 4.2 Image Slider */
.image-slider {
    position: relative;
    display: flex;
    justify-content: center;
    justify-self: center;
    align-items: center;
    height: 580px;
    background-color: var(--color-brand-blue);

    & img {
        position: absolute;
        opacity: 0;
        border-radius: 3rem;
        pointer-events: none;
        transition: opacity 1000ms ease-in-out;
        
        &.active {
            opacity: 1;
            pointer-events: auto;
        }
    }
}

@media screen and (max-width: 768px) {
    .image-slider {
        height: 300px;

        & img {
            height: 100%;
            width: auto;
        }
    }
}


/* 4.3 Media with Button Column */
.media-with-button-column {
    background-color: var(--color-brand-blue);

    & .button-wrapper {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .button-wrapper {
        align-items: center;
    }

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


/* 4.4 Footer */
footer {
    padding-top: var(--spacing-default-section);
    padding-bottom: var(--spacing-default-section);
    color: var(--color-neutral-light);
    text-align: center;
    background-color: var(--color-brand-red);

    & section {
        display: grid;
		grid-template-columns: 1fr 2fr 1fr;
        margin-bottom: var(--spacing-default-section);
        padding: var(--spacing-default-section);
    }
	
	& iframe {
		margin-top: 1rem;
	}
	
	& h2 {
		color: var(--color-neutral-light) !important;
	}
}

@media screen and (max-width: 1000px) {
    footer {
        & section {
            grid-template-columns: 1fr;
			gap: 2rem;
        }
    }
}


/* 4.5 Ministry Page Template */
.page-template-page-ministry {
	& .title-section {
		& .side_thumbnail {
			display: grid;
			grid-template-areas: "title title"
				"image content";
			gap: 1rem;
			padding: 1rem 1rem 2rem;

			& h1 {
				grid-area: title;
				text-align: center;
			}

			& img {
				grid-area: image;
				align-self: flex-start;
			}

			& div {
				grid-area: content;
			}
		}
		
		& .top_banner {
			padding: 1rem 1rem 2rem;
			
			& img {
				margin-bottom: 1rem;
			}
		}
	}
	
    & article {
        display: grid;
        grid-template-areas: 'title image'
        'excerpt image';
        grid-template-columns: 3fr 1fr;
        padding: 1rem;
        background-color: var(--color-neutral-light);
        border-radius: 3rem;

        &:not(:last-of-type) {
            margin-bottom: 1rem;
        }

        & h2 {
            grid-area: title;
        }

        & img {
            grid-area: image;
            justify-self: center;
            align-self: center;
        }

        & p {
            grid-area: excerpt;
        }
        
        & a {
            color: var(--color-brand-blue);
        }
    }

    & aside {
        border: solid 2px var(--color-brand-yellow);
        border-radius: 3rem;
        background-color: var(--color-neutral-light);
        overflow: hidden;
        
        & img {
            max-width: 100%;
        }

        & > *:not(img, ul) {
            padding: 0 1rem;
        }
		
		& > p:first-of-type,
		& > p:last-of-type {
			padding-top: 1rem;
			padding-bottom: 1rem;
		}

        & ul {
            padding-right: 1rem;
        }
    }
	
	& main:not(:has(aside)) {
		width: min(80%, var(--size-content-width-desktop));
	}
}

#pagination {
	margin-top: 2rem;
	padding-left: 2rem;
	
	& .current {
		color: var(--color-brand-yellow);
		font-weight: bold;
	}
	
	& a {
		color: var(--color-neutral-light);
	}
}

@media screen and (max-width: 1000px) {
	.page-template-page-ministry {
		& .title-section {
			& .top_banner {
				& img {
					max-width: 100%;
					height: auto;
				}
			}
		}
	}
	.page-template-page-ministry > .flex-layout {
		padding: 2rem;
	}
}

@media screen and (max-width: 768px) {
	.page-template-page-ministry {
		& .side_thumbnail {
			grid-template-areas: 
				"title"
				"image"
				"content" !important;
			
			& img {
				justify-self: center;
			}
		}
	}
}

.page-id-52 {
	& .top_banner img {
		padding: 1rem;
		background-color: #fff;
	}
}

.page-template-page-flexible-template,
.error404 {
    & h2 {
        color: var(--color-neutral-dark);
    }
    
    & main {
        width: min(80%, var(--size-content-width-desktop));
        justify-self: center;
		padding: 2rem;
        padding-bottom: var(--spacing-default-section);
		background-color: var(--color-neutral-light);

        & > *:first-of-type {
            padding-top: 0;
        }
    }

    & .cta_wrapper {
        justify-content: center;
    }

    & .category-wrapper {
        column-count: 2;
        column-gap: 1rem;
        
        & .teaching-series-card {
            content-visibility: auto;
            break-inside: avoid;
            margin-bottom: 1rem;
            padding: 1rem;
            background-color: white;
            border: solid 2px var(--color-brand-yellow);
            border-radius: 3rem;

            &:last-of-type {
                margin-bottom: 0;
            }

            & h3 {
                text-align: center;
            }

            & h3 a {
                color: var(--color-brand-blue);
            }

            & .iframe-wrapper {
                margin-bottom: 1rem;
                text-align: center;
                
                & .image__full {
                    background-size: contain;
                    background-repeat: no-repeat;
                }
            }

            &.featured {
                flex: 0 1 100%;
            }
        }
    }

    & .category-wrapper:has(.featured) {
        column-count: 1;
    }
}

.error404 .button-row {
	display: flex;
	justify-content: center;
	gap: 2rem;
}

@media screen and (max-width: 768px) {
    .page-template-page-flexible-template,
	.error404 {
        & main {
            width: 100%;
        }

        & .category-wrapper {
            column-count: 1;
        }
    }
}

@media screen and (max-width: 960px) {
	.error404 .button-row {
		flex-direction: column;
		align-items: center;
	}
}


/* 4.6 Flexible Heading */
.title-section {
    display: flex;
    justify-content: center;
    background-color: var(--color-brand-blue-alt);
	padding: var(--spacing-default-section) 1rem;
	
    & .bordered-heading {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: min(80%, var(--size-content-width-desktop));
        min-height: 10rem;
		box-sizing: border-box;
        padding: 1rem;
        border: solid 2px var(--color-brand-yellow);
        border-radius: 3rem;
        background-color: var(--color-brand-blue);
        color: var(--color-neutral-light);
		text-align: center;

        & .header-content {
            display: flex;
            width: 100%;
            gap: 1rem;
        }
    }
}


/* 4.7 Two Columns with Form */
.two-columns-with-form {
    padding: calc(var(--spacing-default-section) / 2);
    border: solid 2px var(--color-brand-yellow);
    border-radius: 3rem;
    background-color: var(--color-neutral-light);

    & h2 {
        color: var(--color-neutral-dark);
    }
}

/* 4.8 Main Content w/ Sidebar */
.main-content-wrapper .flex-layout {
	& > section:not(:first-of-type) {
		border-top: solid 2px var(--color-brand-yellow);
	}
	
	& section {
		background-color: var(--color-neutral-light);
		
		& h2 {
			color: var(--color-neutral-dark);
		}
	}
	
	& aside {
		padding: 1rem;
		
		& img {
			width: 100%;
		}
	}
}

/* 4.9 Content with Media */
.content-with-media {
	&:not(:last-of-type) {
		border-bottom: solid 2px var(--color-brand-blue);
	}
	
    &.align-top .flex-layout {
        align-items: flex-start;
    }
    
    &.align-middle .flex-layout {
        align-items: center;
    }

    &.align-bottom .flex-layout {
        align-items: flex-end;
    }

    & img {
        max-width: 100%;
        height: auto;
        border-radius: 3rem;
    }

    & figure {
        width: fit-content;
        text-align: center;
    }
    
    & .right-half > img,
    & .right-half > figure {
        display: block;
        margin-left: auto;
    }
}

@media screen and (max-width: 1000px) {
	.content-with-media {
		.flex-layout div:not(:has(img)) {
			order: 2 !important;
		}
		
		.flex-layout div:has(img) {
			order: 1 !important;
		}
	}
}

/* 4.10 Rich Text Section */
.rich-text-section {
/*     margin: 0 1rem;
    padding: calc(var(--spacing-default-section) / 2);
	padding-top: 1rem !important;
    border: solid 2px var(--color-brand-yellow);
    border-radius: 3rem;
    background-color: var(--color-neutral-light);

    & h2 {
        color: var(--color-neutral-dark);
    } */
}

/* 4.11 Image Gallery & Shadowbox */
.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;

    & .image-gallery__link {
        display: block;
        line-height: 0;
        border-radius: 0.5rem;
        overflow: hidden;
        transition: opacity var(--animiation-speed-normal)ms ease-in-out;

        &:hover {
            opacity: 0.9;
        }

        & img {
            display: block;
            width: 100%;
            height: auto;
        }
    }
}

/* Shadowbox overlay */
.shadowbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: rgba(1, 26, 50, 0.92);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--animiation-speed-normal)ms ease-in-out,
                visibility var(--animiation-speed-normal)ms ease-in-out;

    &.is-open {
        opacity: 1;
        visibility: visible;
    }
}

.shadowbox__backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.shadowbox__content {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    & img {
        max-width: 100%;
        max-height: calc(100vh - 4rem);
        width: auto;
        height: auto;
        object-fit: contain;
        border-radius: 0.5rem;
    }
}

.shadowbox__close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-neutral-light);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--animiation-speed-normal)ms ease-in-out;

    &:hover,
    &:focus {
        color: var(--color-brand-yellow);
    }
}

.shadowbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--color-neutral-light);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--animiation-speed-normal)ms ease-in-out;

    &:hover,
    &:focus {
        color: var(--color-brand-yellow);
    }

    &.shadowbox__prev {
        left: -3rem;
    }

    &.shadowbox__next {
        right: -3rem;
    }
}

@media screen and (max-width: 768px) {
    .shadowbox__nav {
        &.shadowbox__prev {
            left: 0.5rem;
        }

        &.shadowbox__next {
            right: 0.5rem;
        }
    }
}

/* 5. Utility Classes */
/* 5.1 WordPress classes */
.aligncenter {
    display: block;
    max-width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
	float: left;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.wp-caption-text {
	font-style: italic;
}

/* 5.2 Standard Framework Utilities */
.bg-brand {
    background-color: var(--color-brand-blue);
}

.bg-brand-alt {
    background-color: var(--color-brand-blue-alt);
}

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

.text-light {
	color: var(--color-neutral-light);
}

.text-dark {
	color: var(--color-neutral-dark);
}

.align-top {
    align-items: flex-start;
}

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

.align-bottom {
    align-items: flex-end;
}

.mt-4 {
	margin-top: 1.5rem;
}

.my-3 {
	margin-top: 1rem;
	margin-bottom: 1rem;
}

.mb-3 {
	margin-bottom: 1rem;
}
/* 6. Icons */
.icon {
    font-family: dashicons;
    color: var(--color-brand-blue-alt);
    font-size: 3rem;
}
/* 6.1 Social Media icons */
.social-icon-fb::after {
    content: "\f304";
}

.social-icon-insta::after {
    content: "\f12d";
}


/* 7. Buttons */
.button {
    display: flex;
    justify-content: center;
    justify-self: center;
    min-width: 220px;
    max-width: 220px;
    padding: .5rem;
    border-radius: .5rem;
    transition: all var(--animiation-speed-normal) ease;
    text-decoration: none;
	text-align: center;

    &.primary {
        color: var(--color-neutral-light);
        background-color: var(--color-brand-red);

        &:hover {
            background-color: var(--color-brand-red-alt);
        }
    }

    &.secondary {
        color: var(--color-neutral-light);
        background-color: var(--color-brand-blue);

        &:hover {
            background-color: var(--color-brand-blue-alt);
        }
    }
    
    &.image {
        img {
            border-radius: inherit;
        }
    }
}

#global-cta {
	position: fixed;
	top: calc(100% - 2rem - 16px);
    left: 82%;
    z-index: 9999;
    padding: 1rem;
	border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    background-color: var(--color-brand-yellow);
    font-weight: bold;
	transition: background-color 300ms;
	
	&:hover {
		background-color: var(--color-brand-yellow-alt);
		color: var(--color-neutral-dark);
	}
}

@media screen and (max-width: 1500px) {
	#global-cta {
		left: 70%;
	}
}

@media screen and (max-width: 768px) {
	#global-cta {
		left: 3.5rem;
	}
}

/* Page and Section Specific Styles */
/* Home page */
.page-id-20 {
	& .button-wrapper {
		text-align: center;
		
		& .image {
			background-color: var(--color-neutral-light);
		}
	}
}
	
@media screen and (max-width: 1000px) {
	.page-id-20 .media-with-button-column {
		margin-bottom: 0;
		
		& .video-wrapper,
		& .button-wrapper {
			text-align: center;
			align-items: center;
		}
	}
	#paypal-form-fields-container-GRVKYYMUDAZJY {
		align-items: center;
		justify-content: center;
	}
}
/* End Home Page */
/* Ministries We Support Page */
.page-id-86 {
	& .content-with-media img {
		border-radius: 0;
	}
}
/* End Ministries We Support Page */
/* Clergy & Staff Page */
.page-id-84 {
	& h2 {
		margin-bottom: 0;
	}
	
	.flex-layout {
		padding-top: calc(var(--spacing-default-section) / 2)
	}
}

@media screen and (max-width: 1000px) {
	.page-id-84 {
		& .content-with-media img {
			max-width: 60%;
		}
	}
}
/* End Clergy & Staff page */
/* New Visitor Information Page */
.page-id-376 {
	.rich-text-section:first-of-type {
		padding-bottom: var(--spacing-default-section);
		border-bottom: solid 2px var(--color-brand-blue);
	}
}
/* End New Visitor Information Page */