/**
 * Modern footer layout (pageFooter markup .ak-footer + bottom bar in footer.tpl)
 * Selectors are scoped under .ak-footer-shell and use !important because the
 * generated dynamic-custom.css forces footer colors/sizes with !important.
 */

.pkp_structure_footer_wrapper .ak-footer-shell {
	--ak-gold: #d4a53c;
	--ak-gold-light: #f3d890;
	--ak-text: rgba(255, 255, 255, 0.86);
	--ak-muted: rgba(255, 255, 255, 0.6);
	--ak-line: rgba(255, 255, 255, 0.14);

	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto;
	column-gap: 40px;
	row-gap: 0;
	max-width: none !important;
	padding: 56px 48px 0 !important;
	border-top: 3px solid var(--ak-gold) !important;
	background-image:
		linear-gradient(180deg, rgb(var(--ak-footer-rgb) / 0.93) 0%, rgb(var(--ak-footer-dark-rgb) / 0.96) 100%),
		url('../images/footer-bg.jpg') !important;
	background-size: cover !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
	font-size: 15px !important;
	line-height: 1.7 !important;
	color: var(--ak-text) !important;
}

/* Clearfix pseudo-elements would become grid items and push the content down a row */
.pkp_structure_footer_wrapper .ak-footer-shell::before,
.pkp_structure_footer_wrapper .ak-footer-shell::after {
	content: none !important;
	display: none !important;
}

/* The theme adds a second dark layer on the wrapper; the shell already has its own */
.pkp_structure_footer_wrapper:has(.ak-footer-shell)::before {
	display: none !important;
}

/* Plain Page Footer content: keep it in the left column next to the OJS/PKP logo */
.ak-footer-shell .pkp_footer_content {
	grid-column: 1;
	grid-row: 1;
}

/* Structured footer (.ak-footer markup): let the columns and license row sit directly on the footer grid */
.ak-footer-shell .pkp_footer_content:has(> .ak-footer) {
	display: contents !important;
}

.ak-footer-shell .ak-footer {
	grid-column: 1;
	grid-row: 1;
}

.ak-footer-shell .pkp_footer_content,
.ak-footer-shell .pkp_brand_footer {
	float: none !important;
	width: auto !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* ---------- Columns ---------- */
.ak-footer-shell .ak-footer {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.1fr);
	gap: 40px;
	align-items: start;
}

.ak-footer-shell .ak-footer h4 {
	margin: 0 0 16px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ak-gold) !important;
}

.ak-footer-shell .ak-footer p,
.ak-footer-shell .ak-footer li,
.ak-footer-shell .ak-footer span,
.ak-footer-shell .ak-footer div {
	font-size: 15px !important;
	line-height: 1.7 !important;
	color: var(--ak-text) !important;
}

.ak-footer-shell .ak-footer p {
	margin: 0 0 10px !important;
}

.ak-footer-shell .ak-footer .ak-journal-name {
	margin-bottom: 12px !important;
	font-size: 18px !important;
	font-weight: 700;
	line-height: 1.4 !important;
}

.ak-footer-shell .ak-footer .ak-journal-name a {
	font-size: 18px !important;
	color: #ffffff !important;
}

.ak-footer-shell .ak-footer .ak-issn {
	color: var(--ak-muted) !important;
	font-size: 14px !important;
}

.ak-footer-shell .ak-footer a,
.ak-footer-shell .ak-footer a:link,
.ak-footer-shell .ak-footer a:visited,
.ak-footer-shell .ak-license a {
	font-size: inherit !important;
	color: #ffffff !important;
	text-decoration: none !important;
	border-bottom: 1px solid rgba(212, 165, 60, 0.45);
	transform: none !important;
	transition: color 0.2s ease, border-color 0.2s ease !important;
}

.ak-footer-shell .ak-footer a:hover,
.ak-footer-shell .ak-footer a:focus,
.ak-footer-shell .ak-license a:hover,
.ak-footer-shell .ak-license a:focus {
	color: var(--ak-gold-light) !important;
	border-bottom-color: var(--ak-gold-light);
	opacity: 1 !important;
	transform: none !important;
}

/* Contact list with Font Awesome icons (added via CSS so the editor can't strip them) */
.ak-footer-shell .ak-contact {
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}

.ak-footer-shell .ak-contact li {
	position: relative;
	margin: 0 0 12px !important;
	padding-left: 28px !important;
}

.ak-footer-shell .ak-contact li::before {
	position: absolute;
	left: 0;
	top: 1px;
	width: 18px;
	text-align: center;
	font-family: "Font Awesome 6 Free", "FontAwesome";
	font-weight: 900;
	color: var(--ak-gold);
}

.ak-footer-shell .ak-contact .ak-address::before { content: "\f3c5"; }
.ak-footer-shell .ak-contact .ak-email::before { content: "\f0e0"; }
.ak-footer-shell .ak-contact .ak-principal::before { content: "\f19c"; }
.ak-footer-shell .ak-contact .ak-phone::before { content: "\f095"; }

.ak-footer-shell .ak-contact .ak-label {
	display: block;
	font-size: 12px !important;
	line-height: 1.4 !important;
	letter-spacing: 0.04em;
	color: var(--ak-muted) !important;
}

/* Map */
.ak-footer-shell .ak-map-frame {
	overflow: hidden;
	border-radius: 10px;
	border: 1px solid var(--ak-line);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	line-height: 0 !important;
}

.ak-footer-shell .ak-map-frame iframe {
	display: block;
	width: 100% !important;
	height: 200px !important;
	border: 0;
	filter: grayscale(0.25) contrast(1.05);
}

/* License row (full width, centered) */
.ak-footer-shell .ak-license {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 14px;
	margin-top: 36px !important;
	padding-top: 24px !important;
	border-top: 1px solid var(--ak-line);
}

.ak-footer-shell .ak-license p {
	margin: 0 !important;
	font-size: 13px !important;
	line-height: 1.6 !important;
	color: var(--ak-muted) !important;
}

.ak-footer-shell .ak-license a {
	font-size: 13px !important;
}

.ak-footer-shell .ak-license a.ak-cc-badge {
	flex-shrink: 0;
	border-bottom: 0 !important;
	line-height: 0 !important;
}

.ak-footer-shell .ak-license img {
	display: block;
	height: 31px;
	width: auto;
}

/* ---------- OJS / PKP brand ---------- */
.ak-footer-shell .pkp_brand_footer {
	grid-column: 2;
	grid-row: 1;
	align-self: start;
	justify-self: end;
}

.ak-footer-shell .pkp_brand_footer a {
	border: 0 !important;
}

.ak-footer-shell .pkp_brand_footer img {
	display: block;
	width: 150px;
	max-width: 100%;
	opacity: 0.55;
	filter: brightness(0) invert(1);
	transition: opacity 0.2s ease;
}

.ak-footer-shell .pkp_brand_footer a:hover img {
	opacity: 0.9;
}

/* ---------- Bottom bar ---------- */
.ak-footer-shell .ak-footer-bottom {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	margin-top: 32px;
	padding: 20px 0 24px !important;
	border-top: 1px solid var(--ak-line);
}

.ak-footer-shell .ak-footer-bottom p {
	margin: 0 !important;
	font-size: 13px !important;
	line-height: 1.6 !important;
	color: var(--ak-muted) !important;
}

.ak-footer-shell .ak-footer-bottom a.ak-credit-name,
.ak-footer-shell .ak-footer-bottom a.ak-credit-name:link,
.ak-footer-shell .ak-footer-bottom a.ak-credit-name:visited {
	font-size: 13px !important;
	font-weight: 600;
	text-decoration: none !important;
	/* subtle gold shine sweeping across the text, then pausing */
	background-color: transparent !important;
	background-image: linear-gradient(110deg,
		#d4a53c 0%,
		#d4a53c 38%,
		#f3d890 46%,
		#fff4d6 50%,
		#f3d890 54%,
		#d4a53c 62%,
		#d4a53c 100%) !important;
	background-size: 300% 100% !important;
	background-repeat: no-repeat !important;
	background-position: 100% 0;
	will-change: background-position;
	-webkit-background-clip: text !important;
	background-clip: text !important;
	color: transparent !important;
	-webkit-text-fill-color: transparent;
	animation: ak-shine 3s cubic-bezier(0.45, 0, 0.25, 1) infinite;
	transform: none !important;
	transition: filter 0.3s ease !important;
}

.ak-footer-shell .ak-footer-bottom a.ak-credit-name:hover,
.ak-footer-shell .ak-footer-bottom a.ak-credit-name:focus {
	filter: brightness(1.15);
	opacity: 1 !important;
}

.ak-footer-shell .ak-footer-bottom a.ak-credit-name:focus-visible {
	outline: 2px solid var(--ak-gold);
	outline-offset: 3px;
	border-radius: 2px;
}

@keyframes ak-shine {
	0% { background-position: 100% 0; }
	70% { background-position: 0% 0; }
	100% { background-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.ak-footer-shell .ak-footer-bottom a.ak-credit-name {
		animation: none;
	}
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.ak-footer-shell .ak-footer {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
	.ak-footer-shell .ak-footer .ak-col-map {
		grid-column: 1 / -1;
	}
}

@media (max-width: 767px) {
	.pkp_structure_footer_wrapper .ak-footer-shell {
		grid-template-columns: minmax(0, 1fr);
		padding: 40px 16px 0 !important;
	}
	.ak-footer-shell .ak-footer {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}
	.ak-footer-shell .pkp_brand_footer {
		grid-column: 1;
		grid-row: 2;
		justify-self: start;
		margin-top: 32px !important;
	}
	.ak-footer-shell .pkp_brand_footer img {
		width: 120px;
	}
	.ak-footer-shell .ak-license {
		flex-direction: column;
		align-items: center;
	}
	.ak-footer-shell .ak-footer-bottom {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ---------- Floating "back to top" button ---------- */
.ak-to-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 900;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--ak-primary) !important;
	color: #ffffff !important;
	box-shadow: 0 6px 18px rgb(var(--ak-primary-dark-rgb) / 0.35);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.9);
	transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.ak-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

.ak-to-top:hover,
.ak-to-top:focus-visible {
	background: var(--ak-primary-dark) !important;
	box-shadow: 0 10px 24px rgb(var(--ak-primary-dark-rgb) / 0.45);
	transform: translateY(-3px) scale(1);
}

.ak-to-top:focus-visible {
	outline: 3px solid #f3d890;
	outline-offset: 3px;
}

.ak-to-top-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.ak-to-top-track,
.ak-to-top-progress {
	fill: none;
	stroke-width: 3;
}

.ak-to-top-track {
	stroke: rgba(255, 255, 255, 0.15);
}

.ak-to-top-progress {
	stroke: #d4a53c;
	stroke-linecap: round;
	transition: stroke-dashoffset 0.1s linear;
}

.ak-to-top-arrow {
	position: relative;
	width: 22px;
	height: 22px;
	fill: currentColor;
	transition: transform 0.2s ease;
}

.ak-to-top:hover .ak-to-top-arrow {
	transform: translateY(-2px);
}

@media (max-width: 767px) {
	.ak-to-top {
		right: 16px;
		bottom: 16px;
		width: 46px;
		height: 46px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ak-to-top,
	.ak-to-top-arrow,
	.ak-to-top-progress {
		transition: none;
	}
}

@media print {
	.ak-to-top {
		display: none !important;
	}
}
