/* PATCH apuhaku 2026-11-20 (see ~/domains/apuhaku.fi/PATCH-NOTES.md)
   "Read more" button under article previews (JoomCCK list templates portal-eng, portal-fin, news, pelit).
   Loaded automatically by Astroid (this file is not shipped by Astroid or the template). */

.apu-readmore-wrap {
	text-align: center;
	padding: 0 10px 20px;
}

a.apu-readmore,
a.apu-readmore:link,
a.apu-readmore:visited {
	--apu-rm-bg: #5B82D6;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	box-sizing: border-box;
	height: 46px;
	max-width: 100%;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background-color: var(--apu-rm-bg);
	/* 5px blue band, then a 2px white pill-shaped inner outline */
	box-shadow: inset 0 0 0 5px var(--apu-rm-bg), inset 0 0 0 7px #fff;
	color: #fff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	vertical-align: middle;
	cursor: pointer;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

a.apu-readmore:hover,
a.apu-readmore:focus {
	--apu-rm-bg: #4A6FC0;
	color: #fff;
	text-decoration: none;
}

a.apu-readmore:focus:not(:focus-visible) { outline: none; }

a.apu-readmore:focus-visible {
	outline: 3px solid #1F3F8A;
	outline-offset: 3px;
}

.apu-readmore__icon {
	flex: none;
	width: 16px;
	height: 16px;
	transition: transform 0.2s ease;
}

a.apu-readmore:hover .apu-readmore__icon,
a.apu-readmore:focus .apu-readmore__icon {
	transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
	a.apu-readmore,
	.apu-readmore__icon { transition: none; }
}

/* PATCH apuhaku 2026-11-20 (see PATCH-NOTES.md): "Read more" button sits at the bottom edge of its card,
   so all buttons in a row line up. Scoped with :has() to cards that contain the button, i.e. only the
   list templates portal-eng, portal-fin, news and pelit (markup: .row > .col-md-4.d-flex > .single-article).
   Browsers without :has() simply keep the button directly under the text. */
.row:has(> .col-md-4 > .single-article > .apu-readmore-wrap) {
	align-items: stretch;
}

.row > .col-md-4:has(> .single-article > .apu-readmore-wrap) {
	display: flex;
}

.single-article:has(> .apu-readmore-wrap) {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.single-article > .apu-readmore-wrap {
	margin-top: auto;
	padding-bottom: 20px;
}
