/**
 * Favania Footer Styles
 * Pixel-perfect matching with React version
 * Fixed to work with WordPress rendered HTML
 */

/* Main Footer Container */
footer .wp-block-group,
.wp-block-group.has-base-background-color {
	background-color: #1a1a1a !important;
}

/* Contact Cards - Equal Height */
.wp-block-columns:has(.wp-block-group[style*="border-radius:1rem"]) .wp-block-column {
	display: flex;
}

.wp-block-columns:has(.wp-block-group[style*="border-radius:1rem"]) .wp-block-column > .wp-block-group {
	flex: 1;
	display: flex;
	align-items: center;
	min-height: 100px;
	transition: all 0.3s ease;
}

/* Contact Cards Hover Effect - FIXED */
.wp-block-group[style*="border-radius:1rem"]:hover {
	background: rgba(255, 255, 255, 0.0) !important;
	border-color: rgba(204, 255, 243, 0.2) !important;
	transform: translateY(-2px) !important;
}

/* Remove underlines from all links */
footer a {
	text-decoration: none !important;
	border-bottom: none !important;
	box-shadow: none !important;
}

/* Link hover effect */
footer a:hover {
	color: #ccfff3 !important;
}

/* RTL Support */
footer [dir="rtl"] {
	direction: rtl;
	text-align: right;
}

/* ========================================
   CRITICAL FIX: Bottom Row Layout
   ======================================== */

/* Bottom Row Container - Force flex-row and space-between */
footer .wp-block-group.is-content-justification-space-between {
	display: flex !important;
	flex-direction: row !important;
	justify-content: space-between !important;
	align-items: center !important;
	flex-wrap: wrap !important;
}

/* Copyright Section - RIGHT aligned (Order 1) */
footer .wp-block-group.is-content-justification-space-between > .wp-block-group[dir="rtl"] {
	order: 1 !important;
	flex: 0 1 auto !important;
}

/* Social Icons Section - LEFT aligned (Order 2) */
footer .wp-block-group.is-content-justification-space-between > .wp-block-group.is-nowrap:has(a[style*="border-radius:50%"]) {
	order: 2 !important;
	flex: 0 1 auto !important;
	justify-content: flex-start !important;
}

/* Social Icons Hover */
footer a[style*="border-radius:50%"] {
	transition: all 0.3s ease;
}

footer a[style*="border-radius:50%"]:hover {
	background: rgba(255, 255, 255, 0.1) !important;
	border-color: rgba(204, 255, 243, 0.3) !important;
	transform: translateY(-2px) !important;
}

footer a[style*="border-radius:50%"]:hover svg {
	stroke: #ccfff3 !important;
}

/* ========================================
   Separator Lines - Remove extra borders
   ======================================== */
   
footer .wp-block-separator {
	opacity: 1 !important;
	border: none !important;
	border-top: none !important;
	border-bottom: none !important;
	background: rgba(255, 255, 255, 0.1) !important;
	height: 1px !important;
	margin-top: 2rem !important;
	margin-bottom: 2rem !important;
}

/* ========================================
   Oben Origin Credit Section
   ======================================== */

/* Oben Origin Container - Center aligned */
footer .oben-origin-credit {
	display: flex !important;
	flex-direction: row !important;
	justify-content: center !important;
	align-items: center !important;
	gap: 1rem !important;
	margin-top: 1.5rem !important;
	padding-top: 0.75rem !important;
	padding-bottom: 0.75rem !important;
}

/* Logo link - Order 2 (right in visual) */
footer .oben-origin-credit .oben-logo-link {
	order: 2 !important;
	transition: opacity 0.3s ease;
}

footer .oben-origin-credit .oben-logo-link:hover {
	opacity: 0.8 !important;
}

/* Text - Order 1 (left in visual) */
footer .oben-origin-credit > p {
	order: 1 !important;
	margin: 0 !important;
}

/* Icon Animations */
@keyframes oben-pulse-heart {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.2); }
}

@keyframes oben-rotate-coffee {
	0%, 100% { transform: rotate(0deg); }
	25% { transform: rotate(15deg); }
	75% { transform: rotate(-15deg); }
}

@keyframes oben-rotate-pizza {
	0%, 100% { transform: rotate(0deg); }
	25% { transform: rotate(10deg); }
	75% { transform: rotate(-10deg); }
}

/* Logo Placeholder */
footer [style*="background:rgba(204,255,243,0.1)"] {
	transition: all 0.3s ease;
}

footer [style*="background:rgba(204,255,243,0.1)"]:hover {
	background: rgba(204, 255, 243, 0.2) !important;
}

/* Menu columns spacing */
footer .wp-block-columns[dir="rtl"] .wp-block-column {
	text-align: right;
}

/* Contact Card Icons - Maintain size */
footer [style*="width:48px;height:48px"] {
	flex-shrink: 0 !important;
}

/* =====================================
   CRITICAL FIX: Icon-Text Gap in Contact Cards
   فاصله بین آیکون و متن
   ===================================== */

/* Contact Cards Container - Add gap between icon and text */
.wp-block-group[style*="border-radius:1rem"] {
	gap: 0.5rem !important; /* 8px فاصله بین آیکون و متن */
}

/* اطمینان از اینکه gap در همه حالات اعمال میشه */
footer .wp-block-group.has-border-color[style*="border-radius:1rem"] {
	gap: 0.5rem !important;
	display: flex !important;
}

/* Icon container - No additional margin needed */
footer .wp-block-group[style*="border-radius:1rem"] > .wp-block-group:first-child {
	margin: 0 !important;
}

/* Text container - No additional margin needed */
footer .wp-block-group[style*="border-radius:1rem"] > .wp-block-group:last-child {
	margin: 0 !important;
}

/* Typography */
footer h3 {
	font-weight: 600;
}

footer h4 {
	font-weight: 600;
	margin-bottom: 0.5rem;
}

/* Links in menus */
footer .wp-block-paragraph:has(a) {
	margin-bottom: 0.875rem;
}

footer .wp-block-paragraph:last-child {
	margin-bottom: 0;
}

/* Copyright symbol and year */
footer .wp-block-group:has(> p[style*="font-size:1.5rem"]) p {
	margin: 0;
	line-height: 1;
}

/* Ensure icons stay centered */
footer [style*="display:flex;align-items:center;justify-content:center"] {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

/* Phone number LTR */
footer p[dir="ltr"] {
	direction: ltr !important;
	text-align: left !important;
}

/* But keep the container RTL */
footer .wp-block-group[dir="rtl"] p[dir="ltr"] {
	text-align: right !important;
}

/* ========================================
   Responsive Design
   ======================================== */
   
@media (max-width: 768px) {
	/* Contact Cards */
	.wp-block-group[style*="border-radius:1rem"] {
		flex-direction: row !important;
		padding: 1rem !important;
	}
	
	/* All Columns Stack */
	footer .wp-block-columns {
		flex-direction: column !important;
	}
	
	/* Social Icons smaller */
	footer a[style*="border-radius:50%"] {
		width: 36px !important;
		height: 36px !important;
	}
	
	/* Bottom Row: Stack vertically */
	footer .wp-block-group.is-content-justification-space-between {
		flex-direction: column !important;
		gap: 1.5rem !important;
		align-items: center !important;
	}
	
	/* Copyright on top, centered */
	footer .wp-block-group.is-content-justification-space-between > .wp-block-group[dir="rtl"] {
		order: 1 !important;
		text-align: center !important;
	}
	
	/* Social Icons below, centered */
	footer .wp-block-group.is-content-justification-space-between > .wp-block-group.is-nowrap:has(a[style*="border-radius:50%"]) {
		order: 2 !important;
		justify-content: center !important;
	}
	
	/* Oben Origin: Stack */
	footer .oben-origin-credit {
		flex-direction: column !important;
		gap: 0.75rem !important;
	}
	
	footer .oben-origin-credit p {
		font-size: 0.75rem !important;
		text-align: center !important;
	}
	
	footer .oben-origin-credit .oben-logo-link img {
		width: 32px !important;
		height: 27px !important;
	}
}

/* ========================================
   WordPress Block Editor Compatibility
   ======================================== */

/* Remove WordPress default margins that might interfere */
footer .wp-block-group.is-layout-flex {
	gap: inherit !important;
}

/* Ensure our flex rules take precedence */
footer .wp-block-group.is-content-justification-space-between.is-layout-flex {
	display: flex !important;
	flex-direction: row !important;
	justify-content: space-between !important;
}

/* Ensure vertical groups inside don't break layout */
footer .wp-block-group.is-vertical {
	display: flex !important;
	flex-direction: column !important;
}

/* Ensure nowrap groups stay inline */
footer .wp-block-group.is-nowrap {
	flex-wrap: nowrap !important;
}