/*
 * Article List Cards 1.1.0 (OJS 3.3)
 * Style: airy card, section tag on top, author chips with round flags,
 * one metadata row at the bottom. Colors and sizes are CSS custom
 * properties set on each card from the journal settings. Key colors use
 * !important because OJS themes often force their own link/button colors.
 */

.alc-card {
	--alc-accent: #0e6b5c;
	--alc-title: #14213d;
	--alc-pdf: #0e6b5c;
	--alc-title-size: 12pt;
	--alc-author-size: 9pt;
	--alc-affiliation-size: 8pt;
	--alc-meta-size: 8pt;
	--alc-side-width: 150px;
	--alc-title-weight: 700;
	--alc-title-align: start;
	--alc-line: #e8ebf0;
	--alc-muted: #667085;
	--alc-ink: #1b2330;
	--alc-tint: #eef2f6;
	--alc-tint: color-mix(in srgb, var(--alc-accent) 9%, #ffffff);

	box-sizing: border-box;
	margin: 0 0 18px;
	background: #fff;
	border: 1px solid var(--alc-line);
	border-radius: 18px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12);
	overflow: hidden;
	color: var(--alc-ink);
	line-height: 1.5;
	text-align: left;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.alc-card:hover {
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 14px 30px -12px rgba(16, 24, 40, 0.2);
	transform: translateY(-1px);
}

.alc-card *,
.alc-card *::before,
.alc-card *::after { box-sizing: border-box; }
.alc-card [hidden] { display: none !important; }
.alc-card a { text-decoration: none; }
.alc-card .alc-icon { width: 14px; height: 14px; flex: none; }

.alc-sr-only {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Layout ---- */

.alc-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "top" "main" "bottom";
}

.alc-card--has-right .alc-layout {
	grid-template-columns: minmax(0, 1fr) var(--alc-side-width);
	grid-template-areas: "top top" "main right" "bottom bottom";
}
.alc-card--has-left .alc-layout {
	grid-template-columns: var(--alc-side-width) minmax(0, 1fr);
	grid-template-areas: "top top" "left main" "bottom bottom";
}
.alc-card--has-left.alc-card--has-right .alc-layout {
	grid-template-columns: var(--alc-side-width) minmax(0, 1fr) var(--alc-side-width);
	grid-template-areas: "top top top" "left main right" "bottom bottom bottom";
}

.alc-slot--top { grid-area: top; }
.alc-slot--left { grid-area: left; }
.alc-main { grid-area: main; }
.alc-slot--right { grid-area: right; }
.alc-slot--bottom { grid-area: bottom; }

.alc-main { min-width: 0; padding: 4px 22px 18px; }
.alc-card--compact .alc-main { padding: 2px 16px 12px; }

.alc-slot--top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 14px;
	padding: 16px 22px 8px;
}

.alc-slot--bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	margin: 0 22px;
	padding: 13px 0 16px;
	border-top: 1px dashed var(--alc-line);
}

.alc-slot--bottom .alc-group--actions { margin-left: auto; }

.alc-slot--side { padding: 8px 18px 18px; }
.alc-slot--left { border-right: 1px dashed var(--alc-line); }
.alc-slot--right { border-left: 1px dashed var(--alc-line); }
.alc-slot--side .alc-group + .alc-group { margin-top: 10px; }

.alc-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }

.alc-slot--before-title,
.alc-slot--after-title,
.alc-slot--after-authors { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.alc-slot--before-title { margin: 12px 0 6px; }
.alc-slot--after-title { margin: -2px 0 10px; }
.alc-slot--after-authors { margin: 12px 0 0; }

/* ---- Issue, DOI ---- */

.alc-card a.alc-issue,
.alc-card a.alc-doi {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	max-width: 100%;
	font-size: var(--alc-meta-size);
	color: var(--alc-muted) !important;
	overflow-wrap: anywhere;
}

.alc-card a.alc-issue { font-weight: 600; letter-spacing: 0.02em; }
.alc-card a.alc-issue .alc-icon,
.alc-card a.alc-doi .alc-icon { color: var(--alc-accent); }
.alc-card a.alc-issue:hover,
.alc-card a.alc-doi:hover { color: var(--alc-accent) !important; }

/* ---- Section tag ---- */

.alc-section {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 11px;
	font-size: var(--alc-meta-size);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--alc-accent);
	background: var(--alc-tint);
	border-radius: 999px;
}

/* ---- Title ---- */

.alc-card .alc-title {
	margin: 4px 0 14px;
	padding: 0;
	font-size: var(--alc-title-size);
	font-weight: var(--alc-title-weight);
	line-height: 1.32;
	letter-spacing: -0.005em;
	text-align: var(--alc-title-align);
	color: var(--alc-title);
}

.alc-card .alc-title a { color: var(--alc-title) !important; font-weight: inherit; }
.alc-card .alc-title a:hover { color: var(--alc-accent) !important; }
.alc-subtitle { font-weight: 400; color: var(--alc-muted); }

/* ---- Authors: chips with round flags ---- */

.alc-authors { font-size: var(--alc-author-size); }
.alc-authors > .alc-icon { display: none; }

.alc-author-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.alc-card--authors-list .alc-author-list { flex-direction: column; align-items: flex-start; }

.alc-author {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	max-width: 100%;
	margin: 0;
	padding: 6px 14px 6px 7px;
	list-style: none;
	background: #f7f8fa;
	border: 1px solid var(--alc-line);
	border-radius: 999px;
}

.alc-author-country { display: inline-flex; flex: none; }

.alc-flag {
	display: block;
	width: 26px;
	height: 26px;
	object-fit: cover;
	border-radius: 50%;
	box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--alc-line);
}

.alc-flag-code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	font-size: 0.7em;
	font-weight: 700;
	color: var(--alc-muted);
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--alc-line);
}

.alc-author-text { display: flex; flex-direction: column; min-width: 0; }
.alc-author-name { font-weight: 600; line-height: 1.25; color: var(--alc-ink); }
.alc-affiliation { font-size: var(--alc-affiliation-size); line-height: 1.3; color: var(--alc-muted); }

/* ---- Metrics: one quiet row ---- */

.alc-metrics {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--alc-meta-size);
	color: var(--alc-muted);
}

.alc-metrics li { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.alc-metrics .alc-icon { color: var(--alc-accent); }
.alc-metrics strong { color: var(--alc-ink); font-weight: 700; }

.alc-slot--side .alc-metrics { flex-direction: column; flex-wrap: nowrap; gap: 8px; }

/* ---- Buttons ---- */

.alc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.alc-card a.alc-button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: var(--alc-meta-size);
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: filter 0.15s ease, background-color 0.15s ease, color 0.15s ease, gap 0.15s ease;
}

.alc-card a.alc-button--pdf {
	padding: 8px 16px;
	color: #fff !important;
	background: var(--alc-pdf) !important;
	border-radius: 999px;
	box-shadow: 0 4px 10px -4px var(--alc-pdf);
}
.alc-card a.alc-button--pdf:hover { filter: brightness(0.9); }

.alc-card a.alc-button--view,
.alc-card a.alc-button--galley {
	padding: 8px 4px;
	color: var(--alc-accent) !important;
	background: transparent !important;
}
.alc-card a.alc-button--view:hover,
.alc-card a.alc-button--galley:hover { gap: 11px; text-decoration: underline; }

.alc-card a.alc-button:focus-visible,
.alc-card .alc-title a:focus-visible { outline: 2px solid var(--alc-accent); outline-offset: 3px; border-radius: 6px; }

/* ---- Small screens ---- */

@media (max-width: 640px) {
	.alc-card--has-right .alc-layout,
	.alc-card--has-left .alc-layout,
	.alc-card--has-left.alc-card--has-right .alc-layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "top" "main" "left" "right" "bottom";
	}
	.alc-slot--right, .alc-slot--left { border: 0; border-top: 1px dashed var(--alc-line); padding-top: 12px; }
	.alc-slot--side .alc-metrics { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
	.alc-slot--bottom .alc-group--actions { margin-left: 0; }
	.alc-main, .alc-slot--top { padding-left: 16px; padding-right: 16px; }
	.alc-slot--bottom { margin: 0 16px; }
	.alc-author { border-radius: 14px; }
}

@media print {
	.alc-card { box-shadow: none; transform: none; break-inside: avoid; }
	.alc-slot--bottom .alc-actions { display: none; }
}
