@use "../../../../dev/scss/variables";

.ehp-flex-footer {
	--flex-footer-icons-alignment: row;

	&.has-preset {
		&-info-hub {
			--flex-footer-business-details-gap: var(--flex-footer-subheading-spacing);

			& .ehp-flex-footer__groups-row {
				display: grid;
				grid-template-columns: repeat(var(--flex-footer-columns), 1fr);
				row-gap: var(--flex-footer-row-gap);
				column-gap: var(--flex-footer-column-gap);
			}
		}

		&-quick-reference {
			--flex-footer-business-details-gap: var(--flex-footer-element-spacing);

			& .ehp-flex-footer__groups-row {
				align-items: var(--flex-footer-content-alignment);
				display: flex;
				flex-direction: column;
				text-align: var(--flex-footer-content-alignment);
			}

			& .ehp-flex-footer__copyright-text-container {
				display: flex;
				justify-content: var(--flex-footer-content-alignment);
			}

			& .ehp-flex-footer__group--business-details {
				align-items: var(--flex-footer-content-alignment);
				display: flex;
				flex-direction: column;
			}

			& .ehp-flex-footer__menu,
			& .ehp-flex-footer__list--contact-links,
			& .ehp-flex-footer__list--social-links {
				display: flex;
				flex-direction: row;
				flex-wrap: wrap;
				gap: var(--flex-footer-links-spacing);
				justify-content: var(--flex-footer-content-alignment);
			}

			& .ehp-flex-footer__group {
				margin-bottom: var(--flex-footer-element-spacing);
				max-width: var(--flex-footer-content-width);

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

	&.is-align-center-mobile {
		@media screen and (max-width: variables.$screen-mobile-max) {
			text-align: center;

			& .ehp-flex-footer__list-item,
			& .ehp-flex-footer__list--social-links,
			& .ehp-flex-footer__menu .menu-item,
			& .ehp-flex-footer__site-link {
				justify-content: center;
			}
		}
	}

	&__groups-row {
		padding-inline-start: var(--flex-footer-box-padding-inline-start);
		padding-inline-end: var(--flex-footer-box-padding-inline-end);
		padding-block-start: var(--flex-footer-box-padding-block-start);
		padding-block-end: calc(var(--flex-footer-box-gap) / 2);
		position: relative;
		z-index: variables.$first-layer;
	}

	&__subheading {
		color: var(--flex-footer-subheading-color);
		margin: 0 0 var(--flex-footer-subheading-spacing);
	}

	&__site-link,
	&__menu .menu-item {
		display: flex;
	}

	&__site-link-container {
		margin: 0 0 var(--flex-footer-business-details-gap);
	}

	&__site-logo,
	&__site-link img {
		width: var(--flex-footer-logo-width);

		&.has-border {
			border: var(--flex-footer-logo-border-width) solid var(--flex-footer-logo-border-color);
		}

		&.has-shape-custom {
			--ehp-shapes-border-radius-block-end: var(--flex-footer-logo-border-radius-block-end);
			--ehp-shapes-border-radius-block-start: var(--flex-footer-logo-border-radius-block-start);
			--ehp-shapes-border-radius-inline-end: var(--flex-footer-logo-border-radius-inline-end);
			--ehp-shapes-border-radius-inline-start: var(--flex-footer-logo-border-radius-inline-start);
		}
	}

	&__site-title {
		color: var(--flex-footer-site-title-color);
		margin: 0;

		.ehp-flex-footer__site-link:hover &,
		.ehp-flex-footer__site-link:focus & {
			color: var(--flex-footer-site-title-color-hover);
		}
	}

	&__description {
		color: var(--flex-footer-description-color);
		margin: 0;
		max-width: var(--flex-footer-description-max-width);
		white-space: pre-wrap;
	}

	& a.ehp-flex-footer__link {
		color: var(--flex-footer-link-color);
		display: inline-flex;
		transition: variables.$transition;

		&:hover,
		&:focus {
			color: var(--flex-footer-link-color-hover);
			transition: variables.$transition;
		}
	}

	&__menu .menu-item:last-of-type,
	&__link--contact:last-of-type {

		.ehp-flex-footer__link {
			margin-bottom: 0;
		}
	}

	& a.ehp-flex-footer__link--social {

		& svg {
			fill: var(--flex-footer-link-color);
			height: var(--flex-footer-social-icon-size);
			transition: variables.$transition;
			width: var(--flex-footer-social-icon-size);
		}

		& i {
			color: var(--flex-footer-link-color);
			font-size: var(--flex-footer-social-icon-size);
			transition: variables.$transition;
		}

		&:hover,
		&:focus {
			& svg {
				fill: var(--flex-footer-link-color-hover);
				transition: variables.$transition;
			}

			& i {
				color: var(--flex-footer-link-color-hover);
				transition: variables.$transition;
			}
		}
	}

	&__list {
		display: flex;
		flex-direction: column;
		gap: var(--flex-footer-links-spacing);
		list-style: none;
		padding: 0;
	}

	&__list--social-links {
		display: flex;
		flex-direction: var(--flex-footer-icons-alignment);
		flex-wrap: wrap;
		gap: var(--flex-footer-links-spacing);
	}

	&__list-item {
		align-items: center;
		display: flex;
	}

	&__copyright {
		padding-inline-start: var(--flex-footer-box-padding-inline-start);
		padding-inline-end: var(--flex-footer-box-padding-inline-end);
		padding-block-end: var(--flex-footer-box-padding-block-end);
		position: relative;
		z-index: variables.$first-layer;
	}

	&__copyright-wrapper {
		display: flex;
		width: 100%;
	}

	&__copyright-text-container {
		display: flex;
		justify-content: var(--flex-footer-copyright-alignment);
		padding-block-start: calc(var(--flex-footer-box-gap) / 2);
		width: 100%;
	}

	&__copyright-text {
		color: var(--flex-footer-copyright-color);
		margin-bottom: 0;
	}
}
