/*
Theme Name: Good Information Foundation
Author: Good Information Foundation
Author URI: https://goodinformationfoundation.org/
Description: Custom theme for the Good Information Foundation (based on Powder 2.0).
Version: 0.1.2
Update URI: false
Requires at least: 6.9
Tested up to: 6.9.4
Requires PHP: 7.4
Text Domain: gif
*/

/* Base
---------------------------------------- */

:root {
	--powder-motion-distance: 30px;
	--powder-motion-ease: ease-out;
	--powder-motion-fast: 0.25s;
	--powder-motion-slow: 0.5s;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

a,
button,
.wp-element-button {
	transition: background-color var(--powder-motion-fast) var(--powder-motion-ease),
							border-color var(--powder-motion-fast) var(--powder-motion-ease),
	            color var(--powder-motion-fast) var(--powder-motion-ease);
}

:root :where(.is-layout-flow) > h1 + h2,
:root :where(.is-layout-flow) > h2 + h3,
:root :where(.is-layout-flow) > h3 + h4,
:root :where(.is-layout-flow) > h4 + h5,
:root :where(.is-layout-flow) > h5 + h6 {
	margin-block-start: var(--wp--preset--spacing--10);
}

/* Forms
---------------------------------------- */

input,
select,
textarea {
	box-sizing: border-box;
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: var(--wp--custom--line-height--medium);
	width: 100%;
}

input:not([type="submit"]):focus,
textarea:focus {
	border-color: var(--wp--preset--color--primary);
	outline: 1px solid var(--wp--preset--color--primary);
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
	width: auto;
}

::placeholder {
	color: inherit;
	font-size: var(--wp--preset--font-size--x-small);
	opacity: 0.5;
}

/* Blocks
---------------------------------------- */

/* Group */

.is-style-fadeinup {
	opacity: 1;
	transform: none;
}

.has-motion .is-style-fadeinup {
	opacity: 0;
	transform: translateY(var(--powder-motion-distance));
}

.has-motion .is-style-fadeinup.is-inview {
	animation: fadeInUp var(--powder-motion-slow) var(--powder-motion-ease) forwards;
}

@keyframes fadeInUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.has-motion .is-style-fadeinup,
	.has-motion .is-style-fadeinup.is-inview {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}

/* Navigation */

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--30);
}

.is-style-underline-slide .wp-block-navigation-item__content {
	position: relative;
}

.is-style-underline-slide .wp-block-navigation-item:not(.is-style-button) .wp-block-navigation-item__content::after {
	background: currentColor;
	content: "";
	height: 1px;
	inset: auto 0 -2px 0;
	position: absolute;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--powder-motion-fast) var(--powder-motion-ease);
}

.is-style-underline-slide .wp-block-navigation-item:not(.is-style-button) .wp-block-navigation-item__content:is(:hover, :focus-visible)::after {
	transform: scaleX(1);
}

/* Navigation submenu */

.wp-block-navigation__submenu-container {
	min-width: 150px !important;
	padding: 10px !important;
}

.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 2px 10px !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	padding: 5px 10px 0 !important;
}

/* Separator */

.wp-block-separator {
	height: clamp(0.375rem, 0.2292rem + 0.5833vw, 0.8125rem); /* 6-13px */
	position: relative;
}

.wp-block-separator::after {
	background-image: url('./assets/images/bg-separator.webp');
	background-position: center;
	background-repeat: no-repeat;
	bottom: 0;
	content: '';
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

/* Site Sections
---------------------------------------- */

/* -- Site Header -- */

.site-header {
	box-shadow: 0 0 49px 0 #b9c0cf9c;
}

.site-header .wp-block-navigation-item.is-style-button .wp-block-navigation-item__content {
	background-color: var(--wp--preset--color--primary);
	border-radius: 9999px;
	/* padding: 0.625em 2.5em; */
	padding: 0.75em 2em;
}

.site-header .wp-block-navigation-item.is-style-button .wp-block-navigation-item__content:focus,
.site-header .wp-block-navigation-item.is-style-button .wp-block-navigation-item__content:hover {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--primary)
}

/*
body .site-header .wp-block-site-logo .custom-logo {
	transition: width 0.2s ease-in-out;
}

body.scroll-up .site-header .wp-block-site-logo .custom-logo {
	width: 60px;
}
*/

/* Utilities
---------------------------------------- */

/* Overflow */

.is-style-overflow-hidden {
	overflow: hidden;
}

/* Position */

.is-style-position-fixed {
	position: fixed;
}

.is-style-position-relative {
	position: relative;
}

/* Z-index */

.is-style-negative-zindex {
	z-index: -99;
}

.is-style-positive-zindex {
	z-index: 99;
}

/* Team Grid */

.gif-team-grid .wp-block-image img {
	width: 260px;
}

/* Theme curved top groups */

.gif-top-curve {
	--gif-curve-height: clamp(30px, -16.6667px + 9.7222vw, 100px);

  position: relative;
}

.gif-top-curve::before {
  content: '';
  display: block;
  position: absolute;
  top: calc(var(--gif-curve-height) * -0.99999);
  left: 0;
  width: 100%;
  height: var(--gif-curve-height);
  background-color: inherit;

  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3Cpath d='M0,0.5 c0.25,-0.5 0.25,-0.5 0.5,0 s0.25,0.5 0.5,0 L1,2 L0,2 Z' fill='black'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% var(--gif-curve-height);
  -webkit-mask-repeat: no-repeat;

  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none' viewBox='0 0 1 1'%3E%3Cpath d='M0,0.5 c0.25,-0.5 0.25,-0.5 0.5,0 s0.25,0.5 0.5,0 L1,2 L0,2 Z' fill='black'/%3E%3C/svg%3E");
  mask-size: 100% var(--gif-curve-height);
  mask-repeat: no-repeat;

  pointer-events: none;
  z-index: 1;
}

.wp-block-group:has(+ .gif-top-curve) {
  padding-bottom: var(--wp--preset--spacing--120) !important;
}

.wp-block-cover.gif-home-hero:has(+ .gif-top-curve) .wp-block-cover__inner-container > .wp-block-group > .wp-block-group {
  padding-bottom: var(--wp--preset--spacing--120) !important;
}

/* Page-specific styles
---------------------------------------- */

.wp-block-cover.gif-home-hero {
	align-items: unset;
}

.wp-block-cover.gif-home-hero .wp-block-cover__inner-container > .wp-block-group,
.wp-block-cover.gif-home-hero .wp-block-cover__inner-container > .wp-block-group > .wp-block-group,
.wp-block-cover.gif-home-hero .wp-block-cover__inner-container > .wp-block-group > .wp-block-group > .wp-block-columns {
	height: 100%;
}

/* Forms (Gravity Forms)
---------------------------------------- */

body .gform_wrapper.gform-theme.gform-theme--framework {
	--gf-ctrl-label-font-size-primary: var(--wp--preset--font-size--small);
	--gf-ctrl-label-font-size-req: var(--wp--preset--font-size--x-small);
	/* --gf-ctrl-label-font-weight-primary: 700; */
	/* --gf-ctrl-padding-x: 0.5em; */
	/* --gf-ctrl-padding-y: 0.25em; */
	/* --gf-ctrl-radius: 0; */
	/* --gf-ctrl-size: var(--gf-ctrl-size-lg) !important; */
	/* --gf-ctrl-border-color-focus: var(--wp--preset--color--primary); */
	/* --gf-ctrl-outline-color-focus: var(--wp--preset--color--primary); */
	/* --gf-label-space-primary: 4px; */
	/* --gf-label-space-tertiary: 4px; */
	--gf-local-line-height: var(--wp--custom--line-height--small);
}

body .gform_wrapper.gform-theme.gform-theme--framework .gform_required_legend {
	font-size: var(--wp--preset--font-size--x-small);
}

body .gform_wrapper.gform-theme.gform-theme--framework .gform_fields {
	--gf-form-gap-y: var(--wp--preset--spacing--20);
}

body .gform_wrapper .gform_body .gform_fields .gfield .gfield_label:has(> .gfield_required) {
	display: inline-block;
}

body .gform_wrapper .gform_body .gform_fields .gfield .gfield_label > .gfield_required {
	margin-inline-start: 0.25em;
}

body .gform_wrapper .gfield--type-turnstile {
  height: 0;
  left: -9999px;
  position: absolute;
  width: 0;
}

body .gform_wrapper.gform-theme.gform-theme--framework .gform_footer {
	justify-content: center;
}

body .gform_wrapper.gform-theme.gform-theme--framework .gform_footer input[type=submit].button {
	--gf-ctrl-btn-color-primary: var(--wp--preset--color--contrast);
	--gf-ctrl-btn-color-hover-primary: var(--wp--preset--color--primary);
	--gf-ctrl-btn-bg-color-primary: var(--wp--preset--color--primary);
	--gf-ctrl-btn-bg-color-focus-primary: var(--wp--preset--color--contrast);
	--gf-ctrl-btn-bg-color-hover-primary: var(--wp--preset--color--contrast);
	--gf-ctrl-btn-border-color-focus-primary: var(--wp--preset--color--contrast);
	--gf-ctrl-btn-font-size: var(--wp--preset--font-size--x-small);
	--gf-ctrl-btn-font-weight: 500;
	--gf-ctrl-btn-line-height: var(--wp--custom--line-height--x-small);
	--gf-ctrl-btn-padding-x: 2em;
	--gf-ctrl-btn-padding-y: 0.75em;
	--gf-ctrl-btn-radius: 9999px;
	--gf-ctrl-transition: all 0.2s ease-in-out;
}

/* Media Queries
---------------------------------------- */

@media (min-width: 600px) {

	/* Header */

	.site-header {
		position: sticky;
		top: 0;
		z-index: 1000;
	}

	.scroll-reveal .site-header {
		transition: transform var(--powder-motion-slow) var(--powder-motion-ease);
	}

	.scroll-reveal body.scroll-down .site-header {
		transform: translateY(-100%);
	}

	.scroll-reveal body.scroll-up .site-header {
		transform: translateY(0);
	}

}

@media (min-width: 600px) and (prefers-reduced-motion: reduce) {

	.scroll-reveal .site-header {
		transform: none !important;
		transition: none !important;
	}

}

@media (max-width: 600px) {

	/* Utilities */

	.is-style-hidden-mobile {
		display: none !important;
	}

	.site-header .wp-block-site-logo .custom-logo {
		width: 50px;
	}

}

@media (max-width: 782px) {

	/* Columns */

	.wp-block-columns.is-style-column-reverse {
		flex-direction: column-reverse;
	}

	.wp-block-cover.gif-home-hero .wp-block-columns {
		justify-content: center;
	}

	.wp-block-cover.gif-home-hero .wp-block-columns > .wp-block-column:nth-child(2) {
		max-width: 200px;
	}

}

@media (max-width: 1150px) {

	.wp-block-cover.gif-vote .wp-block-cover__background.has-background-dim {
		opacity: 0.6;
	}

}