/* ============================================================
   Footer Styles - Responsive RTL Persian Layout
   ============================================================ */

.footer {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	color: #ffffff;
	font-family: 'IRANYekanXFaNum', sans-serif;
	letter-spacing: 0;
	direction: rtl;
	text-align: right;
	background-color: #000c27;
	padding: 48px 40px 50px;
	box-sizing: border-box;
	overflow-x: hidden;
}

/* ------------------------------------------------------------
   Brand Header (Logo, Vertical Bar, Description)
   ------------------------------------------------------------ */
.footer-brand {
	width: 100%;
	max-width: 1340px;
	display: flex;
	align-items: center;
	gap: 16px;
	box-sizing: border-box;
}

.footer-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.footer-logo-link {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
}

.footer-logo .custom-logo-link {
	display: flex;
	align-items: center;
	text-decoration: none;
}

.footer-logo .custom-logo-link img {
	max-height: 58px;
	width: auto;
	height: auto;
}

.footer-subtitle {
	font-size: 32px;
	font-weight: 600;
	line-height: 1.2;
	color: #ffffff;
	white-space: nowrap;
	margin: 0;
}

.footer-subtitle .sub-text {
	color: #ffd305;
}

.footer-frame-right {
	--logo-h: 36px;
	--logo-w: calc(var(--logo-h) * 185 / 116);
	--mask-w: calc(var(--logo-h) * 413 / 116);
	--mask-left: calc(var(--logo-w) - var(--mask-w));
	position: relative;
	width: var(--logo-w);
	height: var(--logo-h);
	flex-shrink: 0;
	background: url('/wp-content/themes/ray-theme/assets/css/../images/footer/footer-frame.png') center / cover no-repeat;
	overflow: hidden;
}

.footer-mask-group {
	position: absolute;
	top: 0;
	left: var(--mask-left);
	width: var(--mask-w);
	height: 100%;
	max-width: none;
	pointer-events: none;
}

.footer-line1 {
	width: 5px;
	height: 44px;
	flex-shrink: 0;
	background-color: #ffd305;
	border-radius: 10px;
}

.footer-text-left {
	flex: 1;
	font-size: 18px;
	font-weight: 300;
	line-height: 1.7;
	text-align: justify;
	text-align-last: right;
	color: #ffffff;
	margin: 0;
}

.footer-line2 {
	width: 100%;
	max-width: 1340px;
	height: 1px;
	background-color: #ffd305;
	border: none;
	margin: 28px 0 36px 0;
	opacity: 0.85;
}

/* ------------------------------------------------------------
   Navigation Columns
   ------------------------------------------------------------ */
.footer-nav {
	position: relative;
	width: 100%;
	max-width: 1340px;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 20px;
	padding-bottom: 30px;
	box-sizing: border-box;
}

.footer-news-links,
.footer-quick-links,
.footer-featured,
.footer-tools-links,
.footer-financial {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	min-width: 0;
}

.footer-frame-top,
.footer-frame-top1,
.footer-frame-top2,
.footer-frame-top3,
.footer-frame-top4,
.footer-frame-top5 {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
	color: #ffffff;
	white-space: nowrap;
}

.footer-frame-top :is(h2, span),
.footer-frame-top1 :is(h2, span),
.footer-frame-top2 :is(h2, span),
.footer-frame-top3 :is(h2, span),
.footer-frame-top4 :is(h2, span),
.footer-frame-top5 :is(h2, span) {
	font-size: 20px;
	font-weight: 600;
	margin: 0;
	color: #ffffff;
}

.footer-frame {
	position: static;
	width: 16px;
	height: 16px;
	background-color: #ffd305;
	rotate: 45deg;
	transform: rotate(45deg);
	border-radius: 5px;
	box-shadow: inset 0px 3px 3px 0px rgba(0, 0, 0, 0.25);
	flex-shrink: 0;
}

.footer-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
	max-width: 100%;
}

.column-a,
.column-b {
	display: flex;
	flex-direction: column;
	gap: 14px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	color: #ffffff;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

.column-a li,
.column-b li,
.footer-menu-list li {
	list-style: none;
	margin: 0;
	padding: 0;
	max-width: 100%;
	width: 100%;
}

.text-symbol,
.column-text-symbol-a,
.footer-menu-list a {
	margin: 0;
	white-space: nowrap;
	color: #ffffff;
	transition: color 0.2s ease;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: middle;
}

.text-symbol:hover,
.text-symbol:focus,
.column-text-symbol-a:hover,
.column-text-symbol-a:focus,
.footer-menu-list a:hover,
.footer-menu-list a:focus {
	color: #ffd305;
}

/* First item highlighted in yellow */
.column-text1,
.column-text-symbol6
/* .footer-menu-list li:first-child a */
{
	color: #ffd305;
}

/* ------------------------------------------------------------
   Show More Button & Bottom Gradient Overlay
   ------------------------------------------------------------ */
.footer-show-more {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 190px;
	align-items: flex-end;
	justify-content: center;
	background: linear-gradient(0deg, #000c27 45%, rgba(0, 12, 39, 0.92) 75%, rgba(0, 12, 39, 0) 100%);
	pointer-events: none;
	padding-bottom: 20px;
	box-sizing: border-box;
	transition: opacity 0.3s ease;
	grid-column: 1 / -1;
	order: 99;
}

.btn-footer-show-more {
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: row-reverse;
	gap: 8px;
	background-color: #000c27;
	border: 1.2px solid #ffd305;
	border-radius: 12px;
	padding: 10px 24px;
	color: #ffd305;
	font-size: 14.5px;
	font-family: inherit;
	font-weight: 500;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
	transition: all 0.2s ease;
}

.btn-footer-show-more:hover {
	background-color: #ffd305;
	color: #000c27;
}

.btn-footer-show-more:hover .btn-footer-show-more-icon-arrow-left path {
	stroke: #000c27;
}

.btn-footer-show-more:hover .btn-footer-show-more-label {
	color: #000c27;
}

.btn-footer-show-more-icon-arrow-left {
	width: 16px;
	height: 16px;
	rotate: -90deg;
	transform: rotate(-90deg);
	flex-shrink: 0;
	pointer-events: none;
	transition: transform 0.2s ease, rotate 0.2s ease;
}

.btn-footer-show-more-label {
	margin: 0;
	color: inherit;
	font-size: 14.5px;
	line-height: 1;
}

/* Expanded state: remove gradient overlay and allow collapse */
.footer-nav.is-expanded .footer-show-more {
	position: static;
	height: auto;
	background: none;
	padding-top: 16px;
	padding-bottom: 0;
	grid-column: 1 / -1;
}

.footer-nav.is-expanded .btn-footer-show-more-icon-arrow-left {
	rotate: 90deg;
	transform: rotate(90deg);
}

/* No-JS fallback: hide overlay completely so all links are directly visible */
html:not(.js) .footer-show-more {
	display: none !important;
}

html:not(.js) .footer-nav {
	max-height: none !important;
	overflow: visible !important;
}

/* ------------------------------------------------------------
   Legal Bar (Copyright & Bottom Links)
   ------------------------------------------------------------ */
.footer-legal-bar {
	width: 100%;
	max-width: 1340px;
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: space-between;
	background-color: #ffd305;
	color: #000c27;
	padding: 14px 36px;
	border-radius: 30px;
	margin-top: 16px;
	box-sizing: border-box;
}

.footer-links {
	display: flex;
	align-items: center;
	gap: 40px;
}

.footer-links a,
.footer-text-symbol {
	margin: 0;
	font-size: 15.5px;
	font-weight: 500;
	color: #000c27;
	cursor: pointer;
	white-space: nowrap;
	text-decoration: none;
	transition: opacity 0.2s ease;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	display: inline-block;
	vertical-align: middle;
}

.footer-links a:hover,
.footer-links a:focus,
.footer-text-symbol:hover,
.footer-text-symbol:focus {
	opacity: 0.75;
}

.footer-text-symbol1 {
	margin: 0;
	font-size: 15px;
	font-weight: 500;
	color: #000c27;
	text-align: left;
}

/* ------------------------------------------------------------
   Accessibility: Focus Outlines
   ------------------------------------------------------------ */
.footer a:focus-visible,
.footer button:focus-visible {
	outline: 2px solid #ffd305;
	outline-offset: 2px;
}

.footer-legal-bar a:focus-visible {
	outline: 2px solid #000c27;
	outline-offset: 2px;
}

/* ------------------------------------------------------------
   Responsive Breakpoints
   ------------------------------------------------------------ */

/* Tablet & Intermediate Screens (769px to 1100px) */
@media screen and (max-width: 1100px) {
	.footer {
		padding: 48px 24px 40px;
	}

	.footer-subtitle {
		font-size: 26px;
	}

	.footer-frame-right {
		--logo-h: 36px;
	}

	.footer-text-left {
		font-size: 14px;
	}

	.footer-frame-top :is(h2, span),
	.footer-frame-top1 :is(h2, span),
	.footer-frame-top2 :is(h2, span),
	.footer-frame-top3 :is(h2, span),
	.footer-frame-top4 :is(h2, span),
	.footer-frame-top5 :is(h2, span) {
		font-size: 18px;
	}

	.footer-frame {
		width: 15px;
		height: 15px;
	}

	.column-a,
	.column-b {
		font-size: 14px;
		gap: 12px;
	}

	.footer-legal-bar {
		padding: 12px 24px;
		font-size: 14px;
	}

	.footer-links a,
	.footer-text-symbol,
	.footer-text-symbol1 {
		font-size: 14px;
	}
}

/* Tablet & Mobile Screens (<= 1024px): Enable Show More button and collapse nav */
@media screen and (max-width: 1024px) {
	.footer-nav {
		position: relative;
		overflow: hidden;
		max-height: 310px;
		transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: 20px;
		row-gap: 28px;
		padding-bottom: 28px;
	}

	.footer-nav.is-expanded {
		max-height: 3000px;
	}

	.footer-show-more {
		display: flex;
	}
}

/* Small Tablets / Large Phones (769px to 900px) */
@media screen and (max-width: 900px) {
	.footer-legal-bar {
		flex-direction: column;
		gap: 12px;
		text-align: center;
	}

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

/* Mobile Screens (< 768px) */
@media screen and (max-width: 768px) {
	.footer {
		padding: 36px 14px 28px;
		gap: 16px;
	}

	/* Brand Header: Logo centered on top, paragraph below */
	.footer-brand {
		flex-direction: column;
		align-items: center;
		gap: 12px;
	}

	.footer-logo {
		justify-content: center;
		gap: 10px;
	}

	.footer-subtitle {
		font-size: 24px;
	}

	.footer-frame-right {
		--logo-h: 32px;
	}

	.footer-line1 {
		display: none;
	}

	.footer-text-left {
		font-size: 13.5px;
		line-height: 1.8;
		text-align: justify;
		text-align-last: right;
		padding: 0 4px;
	}

	.footer-line2 {
		display: none;
	}

	/* Navigation Columns: 2 columns per row (<= 768px) */
	.footer-nav {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 20px;
		row-gap: 28px;
		padding-bottom: 24px;
	}

	.footer-news-links,
	.footer-quick-links,
	.footer-featured,
	.footer-tools-links,
	.footer-financial {
		grid-column: span 1;
		width: 100%;
		order: initial;
	}

	.footer-show-more {
		order: 6;
		grid-column: 1 / -1;
		height: 180px;
		padding-bottom: 22px;
		background: linear-gradient(0deg, #000c27 40%, rgba(0, 12, 39, 0.85) 70%, rgba(0, 12, 39, 0) 100%);
	}

	.footer-frame-top,
	.footer-frame-top1,
	.footer-frame-top2,
	.footer-frame-top3,
	.footer-frame-top4,
	.footer-frame-top5 {
		gap: 6px;
	}

	.footer-frame-top :is(h2, span),
	.footer-frame-top1 :is(h2, span),
	.footer-frame-top2 :is(h2, span),
	.footer-frame-top3 :is(h2, span),
	.footer-frame-top4 :is(h2, span),
	.footer-frame-top5 :is(h2, span) {
		font-size: 16px;
	}

	.footer-frame {
		width: 13px;
		height: 13px;
		border-radius: 4px;
	}

	.column-a,
	.column-b {
		gap: 12px;
		font-size: 13px;
	}

	.btn-footer-show-more {
		padding: 8px 20px;
		font-size: 13.5px;
	}

	.btn-footer-show-more-label {
		font-size: 13.5px;
	}

	/* Legal Bar: Links on top row, copyright on bottom row */
	.footer-legal-bar {
		flex-direction: column;
		align-items: center;
		gap: 10px;
		padding: 14px 16px;
		border-radius: 28px;
		margin-top: 14px;
	}

	.footer-links {
		justify-content: center;
		gap: 20px;
	}

	.footer-links a,
	.footer-text-symbol {
		font-size: 13.5px;
		font-weight: 500;
	}

	.footer-text-symbol1 {
		font-size: 11px;
		line-height: 1.7;
		text-align: center;
	}
}

/* Mobile Screens (<= 480px): 1 column per row */
@media screen and (max-width: 480px) {
	.footer-nav {
		grid-template-columns: 1fr;
		row-gap: 24px;
	}

	.footer-news-links,
	.footer-quick-links,
	.footer-featured,
	.footer-tools-links,
	.footer-financial {
		grid-column: 1 / -1;
	}
}

/* Very Small Mobile (< 360px) */
@media screen and (max-width: 360px) {
	.footer {
		padding: 30px 10px 24px;
	}

	.footer-nav {
		column-gap: 4px;
	}

	.footer-frame-top :is(h2, span),
	.footer-frame-top1 :is(h2, span),
	.footer-frame-top2 :is(h2, span),
	.footer-frame-top3 :is(h2, span),
	.footer-frame-top4 :is(h2, span),
	.footer-frame-top5 :is(h2, span) {
		font-size: 14.5px;
	}

	.footer-frame {
		width: 11px;
		height: 11px;
	}

	.column-a,
	.column-b {
		font-size: 12px;
		gap: 10px;
	}

	.footer-links {
		gap: 14px;
	}

	.footer-links a,
	.footer-text-symbol {
		font-size: 12px;
	}

	.footer-text-symbol1 {
		font-size: 10.5px;
	}
}

/* ------------------------------------------------------------
   Scroll To Top (Arrow Up)
   ------------------------------------------------------------ */
.ray-theme-back-to-top {
	position: fixed;
	bottom: 24px;
	left: 24px;
	width: 44px;
	height: 44px;
	background-color: #0d173d;
	border: 1.2px solid #ffd305;
	border-radius: 12px;
	color: #ffd305;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, visibility 0.25s;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	padding: 0;
}

.ray-theme-back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.ray-theme-back-to-top:hover {
	background-color: #ffd305;
	color: #000c27;
	border-color: #ffd305;
	box-shadow: 0 6px 20px rgba(255, 211, 5, 0.35);
	transform: translateY(-2px);
}

.ray-theme-back-to-top:active {
	transform: translateY(0);
}

.ray-theme-back-to-top:focus-visible {
	outline: 2px solid #ffd305;
	outline-offset: 3px;
}

@media screen and (max-width: 768px) {
	.ray-theme-back-to-top {
		bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		left: 16px;
		width: 40px;
		height: 40px;
	}

	body.single-brokers .ray-theme-back-to-top,
	body.single-exchanges .ray-theme-back-to-top,
	body.single-props .ray-theme-back-to-top,
	body.single-gold_platforms .ray-theme-back-to-top,
	body.single-funds .ray-theme-back-to-top {
		bottom: calc(76px + env(safe-area-inset-bottom, 0px));
	}
}
