/**
 * Footer styles.
 *
 * @package Hamechadesh
 */

/* ==========================================================================
   Footer — Wrapper (margin like header)
   ========================================================================== */

.hm-footer {
	padding: 10px 10px 0px 10px;
	margin-top: 30px;
}

/* ==========================================================================
   Footer — Main Section (Dark Area)
   ========================================================================== */

.hm-footer__main {
	background-color: var(--hm-color-primary);
	border-radius: var(--hm-radius-xl);
	padding-block-start: 100px;
	padding-block-end: 120px;
}

.hm-footer__content {
	display: flex;
	gap: 40px;
	align-items: stretch;
}

/* ==========================================================================
   Footer — Navigation Columns
   ========================================================================== */

.hm-footer__nav {
	display: flex;
	flex-shrink: 0;
}

.hm-footer__col {
	display: flex;
	flex-direction: column;
	gap: 66px;
	align-items: flex-start;
	width: 222px;
}

/* Menu styling — works with wp_nav_menu default output */
.hm-footer__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 66px;
}

/* Group heading (parent item) */
.hm-footer__menu > li > a,
.hm-footer__menu > li > .hm-footer__menu-heading {
	display: block;
	color: var(--hm-color-accent);
	font-family: var(--hm-font-primary);
	font-size: 22px;
	font-weight: 700;
	line-height: 22px;
	text-align: right;
	pointer-events: none;
}

.hm-footer__menu > li > a[href] {
	pointer-events: auto;
}

.hm-footer__menu > li > a:hover {
	color: var(--hm-color-accent);
}

/* Sub-menu links */
.hm-footer__menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-block-start: 20px;
}

.hm-footer__menu .sub-menu a {
	display: flex;
	color: #ffffff;
	font-family: var(--hm-font-primary);
	font-size: 20px;
	font-weight: 300;
	line-height: 22px;
	text-align: right;
	white-space: nowrap;
	transition: color var(--hm-transition-fast);
}

.hm-footer__menu .sub-menu a:hover {
	color: var(--hm-color-accent);
}

/* Red mail button */
.hm-footer__redmail-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background-color: var(--hm-color-accent);
	border-radius: 6px;
	padding: 5px 25px;
	font-size: 16px !important;
	font-weight: 300;
	color: #ffffff !important;
	pointer-events: auto;
	white-space: nowrap;
	transition: opacity var(--hm-transition-fast);
}

.hm-footer__redmail-btn:hover {
	color: #ffffff !important;
	opacity: 0.85;
}

.hm-footer__redmail-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

/* ==========================================================================
   Footer — Contact Form
   ========================================================================== */

.hm-footer__form-wrap {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.hm-footer__form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}

.hm-footer__form-row {
	display: flex;
	gap: 12px;
}

.hm-footer__form-row .hm-footer__input {
	flex: 1;
	min-width: 0;
}

/* Honeypot — hidden from humans */
.hm-footer__honeypot {
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Shared input styles */
.hm-footer__input,
.hm-footer__select,
.hm-footer__textarea {
	width: 100%;
	background-color: #383838;
	border: none;
	border-radius: 10px;
	padding: 21px 24px;
	color: #ffffff;
	font-family: var(--hm-font-primary);
	font-size: 22px;
	font-weight: 300;
	line-height: 22px;
	text-align: right;
	outline: none;
	transition: background-color var(--hm-transition-fast);
}

.hm-footer__input:focus,
.hm-footer__select:focus,
.hm-footer__textarea:focus {
	background-color: #454545;
}

.hm-footer__input::placeholder,
.hm-footer__textarea::placeholder {
	color: rgba(255, 255, 255, 0.5);
	font-family: var(--hm-font-primary);
	font-size: 22px;
	font-weight: 300;
}

.hm-footer__input,
.hm-footer__select {
	height: 64px;
}

/* Select dropdown wrapper */
.hm-footer__select-wrap {
	position: relative;
}

.hm-footer__select {
	appearance: none;
	cursor: pointer;
	padding-inline-start: 24px;
	text-align: right;
	direction: rtl;
}

.hm-footer__select-arrow {
	position: absolute;
	inset-inline-end: 24px;
	top: 50%;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	color: #ffffff;
	pointer-events: none;
}

/* Textarea — stretches to fill remaining nav height */
.hm-footer__textarea {
	flex: 1;
	min-height: 120px;
	resize: vertical;
	text-align: right;
}

/* Terms checkbox row */
.hm-footer__terms {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	cursor: pointer;
}

.hm-footer__checkbox-wrap {
	flex-shrink: 0;
	padding-block-start: 3px;
}

.hm-footer__checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.hm-footer__checkbox-visual {
	display: block;
	width: 20px;
	height: 20px;
	background-color: #ffffff;
	border-radius: 50%;
	transition: background-color var(--hm-transition-fast), box-shadow var(--hm-transition-fast);
}

.hm-footer__checkbox:checked + .hm-footer__checkbox-visual {
	background-color: var(--hm-color-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 10L9 13L14 7' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
}

.hm-footer__checkbox:focus-visible + .hm-footer__checkbox-visual {
	box-shadow: 0 0 0 3px rgba(255, 23, 62, 0.4);
}

.hm-footer__terms-text {
	flex: 1;
	color: #ffffff;
	font-family: var(--hm-font-primary);
	font-size: 16px;
	font-weight: 300;
	line-height: 22px;
	text-align: right;
}

.hm-footer__terms-link {
	color: var(--hm-color-accent) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hm-footer__terms-link:hover {
	color: #ffffff !important;
}

/* Submit button */
.hm-footer__submit {
	position: relative;
	width: 100%;
	height: 64px;
	background-color: var(--hm-color-accent);
	border: none;
	border-radius: 10px;
	color: #ffffff;
	font-family: var(--hm-font-primary);
	font-size: 22px;
	font-weight: 700;
	line-height: 22px;
	cursor: pointer;
	transition: opacity var(--hm-transition-fast);
}

.hm-footer__submit:hover {
	opacity: 0.9;
}

.hm-footer__submit:active {
	opacity: 0.8;
}

.hm-footer__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Loading spinner */
.hm-footer__submit-loading {
	display: none;
}

.hm-footer__submit--loading .hm-footer__submit-text {
	visibility: hidden;
}

.hm-footer__submit--loading .hm-footer__submit-loading {
	display: block;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 24px;
	height: 24px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: hm-spin 0.6s linear infinite;
}

@keyframes hm-spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Form response message */
.hm-footer__form-message {
	font-family: var(--hm-font-primary);
	font-size: 16px;
	font-weight: 300;
	line-height: 22px;
	text-align: right;
	border-radius: 8px;
	padding: 0;
	transition: padding var(--hm-transition-fast), margin var(--hm-transition-fast);
}

.hm-footer__form-message:empty {
	display: none;
}

.hm-footer__form-message--success {
	display: block;
	color: #4ade80;
	padding: 12px 16px;
	background-color: rgba(74, 222, 128, 0.1);
}

.hm-footer__form-message--error {
	display: block;
	color: #f87171;
	padding: 12px 16px;
	background-color: rgba(248, 113, 113, 0.1);
}

/* ==========================================================================
   Footer — Mobile Logo (hidden on desktop)
   ========================================================================== */

.hm-footer__mobile-logo {
	display: none;
}

/* ==========================================================================
   Footer — Legal Links (hidden on desktop, shown on mobile)
   ========================================================================== */

.hm-footer__legal-links {
	display: none;
}

/* ==========================================================================
   Footer — Bottom Bar (Copyright & Credits)
   ========================================================================== */

.hm-footer__bottom {
	position: relative;
	z-index: 51;
	padding-block-start: 37px;
	padding: 30px;
	background: #f3f3f3;
}

.hm-footer__bottom-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.hm-footer__copyright,
.hm-footer__credits {
	margin: 0;
	color: var(--hm-color-primary);
	font-family: var(--hm-font-primary);
	font-size: 20px;
	font-weight: 300;
	line-height: 22px;
	white-space: nowrap;
}

/* ==========================================================================
   Responsive — Below Desktop (< 1350px)
   ========================================================================== */

@media (max-width: 1349px) {
	.hm-footer__content {
		flex-direction: column-reverse;
		gap: 48px;
	}

	.hm-footer__nav {
		width: 100%;
		flex-wrap: wrap;
		gap: 32px;
	}

	.hm-footer__col {
		width: calc(50% - 16px);
		gap: 48px;
	}

	.hm-footer__form-wrap {
		width: 100%;
	}

	.hm-footer__textarea {
		min-height: 160px;
	}
}

@media (max-width: 1023px) {
	.hm-footer__main {
		padding-block-start: 60px;
		padding-block-end: 80px;
		border-radius: var(--hm-radius-lg);
	}

	.hm-footer__nav {
		gap: 24px;
	}

	.hm-footer__col {
		gap: 40px;
	}

	.hm-footer__menu {
		gap: 40px;
	}

	.hm-footer__bottom-inner {
		flex-direction: column;
		gap: 12px;
		text-align: center;
	}
}

/* ==========================================================================
   Responsive — Mobile (up to 767px)
   Matches Figma mobile frame exactly
   ========================================================================== */

@media (max-width: 767px) {
	.hm-footer {
		padding: 10px 10px 0px 10px;
	}

	.hm-footer__main {
		padding: 40px 20px;
		border-radius: var(--hm-radius-xl);
	}

	/* Show mobile logo — inline SVG like header */
	.hm-footer__mobile-logo {
		display: flex;
		justify-content: center;
		padding-block-end: 40px;
	}

	.hm-footer__logo-link {
		display: inline-flex;
		color: #ffffff;
		text-decoration: none;
	}

	.hm-footer__logo-link svg {
		height: 25px;
		width: auto;
		fill: #ffffff;
	}

	/* Hide navigation columns */
	.hm-footer__nav {
		display: none;
	}

	/* Form takes full width, no flex stretching needed */
	.hm-footer__content {
		flex-direction: column;
		gap: 0;
	}

	.hm-footer__form-wrap {
		width: 100%;
	}

	/* Form inputs — 16px font, 16px 24px padding per Figma */
	.hm-footer__input,
	.hm-footer__select,
	.hm-footer__textarea {
		font-size: 16px;
		padding: 16px 24px;
		line-height: 22px;
	}

	.hm-footer__input::placeholder,
	.hm-footer__textarea::placeholder {
		font-size: 16px;
	}

	/* Textarea — fixed 192px height per Figma */
	.hm-footer__textarea {
		height: 192px;
		min-height: 192px;
		flex: none;
	}

	/* Submit button stays 64px height, 22px Bold per Figma */

	/* Show legal links — inside dark area, needs own horizontal padding */
	.hm-footer__legal-links {
		display: flex;
		justify-content: space-between;
		align-items: flex-start;
		padding-block-start: 21px;
	}

	.hm-footer__legal-link {
		color: #ffffff !important;
		font-family: var(--hm-font-primary);
		font-size: 16px;
		font-weight: 300;
		line-height: 22px;
		text-decoration: underline;
		text-underline-offset: 3px;
		white-space: nowrap;
	}

	.hm-footer__legal-link:hover {
		color: var(--hm-color-accent) !important;
	}

	/* Hide bottom bar on mobile */
	.hm-footer__copyright, .hm-footer__credits {
		font-size: 15px;
	}
}
