@version(2)
{{-- 푸터: 본문 콘텐츠 폭(hr-inner)에 맞춰 좌측 정렬 컬럼 구조 --}}
{{-- 아래는 전폭 다크 카피라이트 바 + 3px 포인트색 마감선 (XEDITION 계보) --}}
<footer class="hr-footer">
	<div class="hr-inner hr-footer-inner">
		<div class="hr-footer-grid">
			<div class="hr-footer-brand-col">
				<div class="hr-footer-brand">{{ $hr->logo_text ?: ($site_title ?? '') }}</div>
				@if (!empty($hr->footer_about))
				<p class="hr-footer-about">{!! nl2br(escape($hr->footer_about)) !!}</p>
				@endif
			</div>

			@if (!empty($footer_menu->list))
			<nav class="hr-footer-menu" aria-label="{{ $lang->hr_footer_menu }}">
				<span class="hr-footer-menu-title">{{ $lang->hr_footer_menu }}</span>
				<ul>
					@foreach ($footer_menu->list as $hr_f)
					<li><a href="{{ $hr_f['href'] }}" @if (($hr_f['open_window'] ?? '') === 'Y') target="_blank" rel="noopener" @endif>{{ $hr_f['text'] }}</a></li>
					@endforeach
				</ul>
			</nav>
			@endif
		</div>

		@if (count($hr_footer_info))
		<div class="hr-footer-info">
			@foreach ($hr_footer_info as $hr_line)
			<span>{{ $hr_line }}</span>
			@endforeach
		</div>
		@endif
	</div>

	<div class="hr-footer-bar">
		<div class="hr-inner hr-footer-bottom">
			<span>{{ $hr->copyright ?: ('© ' . ($site_title ?? '')) }}</span>
			{{-- 모바일 위치 옵션이 '푸터'일 때만 보이는 다크모드·언어 컨트롤 --}}
			@php
			$hr_ft_langs = \Context::get('lang_supported');
			$hr_ft_langs = is_array($hr_ft_langs) ? $hr_ft_langs : [];
			$hr_ft_lang_now = \Context::getLangType();
			$hr_ft_uri = (string)($_SERVER['REQUEST_URI'] ?? '/');
			$hr_ft_uri = preg_replace('/([?&])l=[^&]*/', '$1', $hr_ft_uri);
			$hr_ft_uri = preg_replace('/[?&]+$/', '', $hr_ft_uri);
			$hr_ft_uri = str_replace('&&', '&', $hr_ft_uri);
			$hr_ft_sep = strpos($hr_ft_uri, '?') === false ? '?' : '&';
			@endphp
			<div class="hr-foot-tools">
				@if (($hr->color_scheme ?? 'auto') === 'auto' && ($hr->mobile_theme_pos ?? 'drawer') === 'footer')
				<button type="button" class="hr-foot-theme" data-hr-theme-toggle aria-label="{{ $lang->hr_theme_toggle }}">
					<svg class="hr-ico-sun" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 7a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm0-6 1 3h-2l1-3zm0 19 1 3h-2l1-3zM2 12l3-1v2l-3-1zm17-1 3 1-3 1v-2zM4.2 4.2l2.6 1.6-1 1-1.6-2.6zm13 13 2.6 1.6-1.6-2.6-1 1zm2.6-13-1.6 2.6-1-1 2.6-1.6zM4.2 19.8l1.6-2.6 1 1-2.6 1.6z"/></svg>
					<svg class="hr-ico-moon" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.3 13.8A8.5 8.5 0 0 1 10.2 3.7 8.5 8.5 0 1 0 20.3 13.8z"/></svg>
				</button>
				@endif
				@if (count($hr_ft_langs) > 1 && ($hr->mobile_lang_pos ?? 'drawer') === 'footer')
				<select class="hr-foot-lang" data-hr-lang-nav aria-label="{{ $lang->hr_lang_select }}">
					@foreach ($hr_ft_langs as $hr_ft_code => $hr_ft_name)
					<option value="{{ $hr_ft_uri }}{{ $hr_ft_sep }}l={{ $hr_ft_code }}" @if ($hr_ft_code === $hr_ft_lang_now) selected @endif>{{ $hr_ft_name }}</option>
					@endforeach
				</select>
				@endif
			</div>
			<a class="hr-top-btn" href="#hr_header">
				<svg viewBox="0 0 24 24" aria-hidden="true"><path d="m12 8 7 7H5z"/></svg> {{ $lang->hr_to_top }}
			</a>
		</div>
	</div>
</footer>
