/**
 * plugins/generic/paperTemplates/styles/paper-templates.css
 *
 * Paper templates block (public guidelines page) and compact notice
 * (submission start page + wizard). Logical properties keep it correct in
 * right-to-left (Kurdish, Arabic, Persian) and left-to-right pages.
 */

.ptpl,
.ptplMini {
	--ptpl-accent: #2b579a;       /* Word blue */
	--ptpl-accent-dark: #1e3f73;
	--ptpl-ink: #1f2937;
	--ptpl-muted: #5b6472;
	--ptpl-line: #d7deea;
	--ptpl-soft: #f3f6fb;
	--ptpl-card: #ffffff;
}

/* ---- Guidelines page block ---------------------------------------- */

.ptpl {
	margin: 0 0 2.5rem;
	padding: 1.5rem;
	border: 1px solid var(--ptpl-line);
	border-inline-start: 4px solid var(--ptpl-accent);
	border-radius: 8px;
	background: var(--ptpl-soft);
	color: var(--ptpl-ink);
}

.ptpl__title {
	margin: 0 0 0.35rem;
	font-size: 1.4rem;
	line-height: 1.3;
}

.ptpl__intro {
	margin: 0;
	color: var(--ptpl-muted);
	line-height: 1.6;
}

.ptpl__steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 1.1rem 0 1.25rem;
	padding: 0;
	list-style: none;
	font-size: 0.95rem;
}

.ptpl__steps li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}

.ptpl__stepNum {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background: var(--ptpl-accent);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
}

.ptpl__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
	gap: 0.9rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ptpl__item {
	margin: 0;
}

.ptpl__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
	height: 100%;
	box-sizing: border-box;
	padding: 1.1rem 1.1rem 1rem;
	border: 1px solid var(--ptpl-line);
	border-radius: 8px;
	background: var(--ptpl-card);
	color: var(--ptpl-ink);
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.ptpl__card:hover,
.ptpl__card:focus-visible {
	border-color: var(--ptpl-accent);
	box-shadow: 0 6px 18px rgba(43, 87, 154, 0.16);
	color: var(--ptpl-ink);
	text-decoration: none;
}

.ptpl__card:focus-visible {
	outline: 3px solid var(--ptpl-accent);
	outline-offset: 2px;
}

.ptpl__icon {
	color: var(--ptpl-accent);
	line-height: 0;
}

.ptpl__text {
	display: flex;
	flex-direction: column;
	align-items: flex-start; /* names in another script sit at the card start too */
	gap: 0.15rem;
}

/* Themes colour every link; keep the card text in the card colours. */
.ptpl a.ptpl__card .ptpl__native,
.ptpl a.ptpl__card .ptpl__label {
	color: var(--ptpl-ink);
}

.ptpl a.ptpl__card .ptpl__meta {
	color: var(--ptpl-muted);
}

.ptpl a.ptpl__card .ptpl__btn {
	color: #fff;
}

.ptpl__native {
	unicode-bidi: isolate;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
}

.ptpl__label {
	font-size: 0.95rem;
}

.ptpl__meta {
	color: var(--ptpl-muted);
	font-size: 0.85rem;
}

.ptpl__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: auto;
	padding: 0.5rem 0.95rem;
	border-radius: 6px;
	background: var(--ptpl-accent);
	color: #fff;
	font-weight: 600;
	font-size: 0.95rem;
}

.ptpl__card:hover .ptpl__btn,
.ptpl__card:focus-visible .ptpl__btn {
	background: var(--ptpl-accent-dark);
}

.ptpl__guide {
	margin: 1.1rem 0 0;
	font-size: 0.95rem;
}

.ptpl__guide a {
	color: var(--ptpl-accent);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.ptpl__card {
		transition: none;
	}
}

@media (max-width: 480px) {
	.ptpl {
		padding: 1.1rem;
	}
	.ptpl__steps {
		flex-direction: column;
	}
}

/* ---- Start page / wizard notice ----------------------------------- */

.ptplMini {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin: 1rem 0;
	padding: 0.9rem 1.1rem;
	border: 1px solid var(--ptpl-line);
	border-inline-start: 4px solid var(--ptpl-accent);
	border-radius: 6px;
	background: var(--ptpl-soft);
	color: var(--ptpl-ink);
	font-size: 0.9rem;
	line-height: 1.5;
}

.ptplMini__text {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	flex: 1 1 18rem;
}

.ptplMini__title {
	font-size: 1rem;
}

.ptplMini__desc {
	color: var(--ptpl-muted);
}

.ptplMini__links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.ptplMini__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.4rem 0.75rem;
	border: 1px solid var(--ptpl-accent);
	border-radius: 6px;
	background: #fff;
	color: var(--ptpl-accent);
	font-weight: 600;
	text-decoration: none;
}

.ptplMini__link:hover,
.ptplMini__link:focus-visible {
	background: var(--ptpl-accent);
	color: #fff;
	text-decoration: none;
}

.ptplMini__w {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.2rem;
	height: 1.2rem;
	border-radius: 3px;
	background: var(--ptpl-accent);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
}

.ptplMini__link:hover .ptplMini__w,
.ptplMini__link:focus-visible .ptplMini__w {
	background: #fff;
	color: var(--ptpl-accent);
}

.ptplMini__ext {
	font-weight: 400;
	opacity: 0.8;
}

.ptplMini__guide {
	color: var(--ptpl-accent);
	font-weight: 600;
}

/* ---- "Guide for Authors" custom page ------------------------------ */

/* The block opens the page's content box; the theme's h2 rule (flex + rule
   line) is meant for the page text, not for the block title. */
.static_page_content > .ptpl {
	margin-bottom: 2rem;
}

.static_page_content .ptpl .ptpl__title {
	display: block;
	margin: 0 0 0.35rem;
	font-size: 1.4rem;
}

.static_page_content .ptpl .ptpl__title::after {
	content: none;
}

/* The guidance text of the page (stored as the page content). */
.tguide {
	--tg-accent: #1576bd;
	--tg-accent-dark: #0f5c94;
	--tg-pdf: #c0392b;
	--tg-ink: #1f2937;
	--tg-muted: #5b6472;
	--tg-line: #d7deea;
	--tg-soft: #f3f6fb;
	color: var(--tg-ink);
}

.tguide__section {
	margin: 0 0 2rem;
}

.tguide__section:last-child {
	margin-bottom: 0;
}

.tguide__lead {
	margin: -0.5rem 0 1rem;
	color: var(--tg-muted);
	line-height: 1.7;
}

/* The authors' guide (PDF) */
.tguide a.tguide__doc {
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: 38rem;
	padding: 1rem 1.1rem;
	border: 1px solid var(--tg-line);
	border-inline-start: 4px solid var(--tg-pdf);
	border-radius: 8px;
	background: #fff;
	color: var(--tg-ink);
	text-decoration: none;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.tguide a.tguide__doc:hover,
.tguide a.tguide__doc:focus-visible {
	border-color: var(--tg-pdf);
	box-shadow: 0 6px 18px rgba(192, 57, 43, 0.14);
	color: var(--tg-ink);
	text-decoration: none;
}

.tguide__badge {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3.5rem;
	border-radius: 6px;
	background: var(--tg-pdf);
	color: #fff;
	font: 700 0.85rem/1 Arial, sans-serif;
	letter-spacing: 0.04em;
}

.tguide__docText {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	flex: 1 1 auto;
	min-width: 0;
}

.tguide__docTitle {
	font-weight: 700;
	font-size: 1.1rem;
	line-height: 1.4;
}

.tguide__docMeta {
	color: var(--tg-muted);
	font-size: 0.9rem;
}

.tguide__go {
	flex: none;
	padding: 0.5rem 0.9rem;
	border-radius: 6px;
	background: var(--tg-pdf);
	color: #fff;
	font-weight: 700;
	font-size: 0.9rem;
	white-space: nowrap;
}

/* Tutorial videos */
.tguide__videos {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0.8rem;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: tg-video;
}

.tguide__videos li {
	margin: 0;
	counter-increment: tg-video;
}

.tguide__videos a {
	display: flex;
	align-items: flex-start;
	gap: 0.8rem;
	height: 100%;
	box-sizing: border-box;
	padding: 0.95rem 1rem;
	border: 1px solid var(--tg-line);
	border-radius: 8px;
	background: var(--tg-soft);
	color: var(--tg-ink);
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.tguide__videos a:hover,
.tguide__videos a:focus-visible {
	border-color: var(--tg-accent);
	background: #fff;
	box-shadow: 0 6px 18px rgba(21, 118, 189, 0.14);
	color: var(--tg-ink);
	text-decoration: none;
}

/* Numbered play badge */
.tguide__videos a::before {
	content: counter(tg-video);
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	background: var(--tg-accent);
	color: #fff;
	font-weight: 700;
}

.tguide__vText {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.tguide__vTitle {
	font-weight: 700;
	line-height: 1.4;
}

.tguide__vSub {
	color: var(--tg-muted);
	font-size: 0.9rem;
	line-height: 1.5;
	unicode-bidi: isolate;
}

.tguide__vWatch {
	margin-top: 0.25rem;
	color: var(--tg-accent-dark);
	font-size: 0.85rem;
	font-weight: 700;
}

@media (max-width: 480px) {
	.tguide a.tguide__doc {
		flex-wrap: wrap;
	}

	.tguide__go {
		width: 100%;
		text-align: center;
	}
}

/* ---- Guide text: contents, tables, lists, examples ----------------- */

.tguide__section {
	scroll-margin-top: 1rem;
}

.tguide h3 {
	margin: 1.4rem 0 0.6rem;
	color: var(--tg-ink);
	font-size: 1.05rem;
}

.tguide p {
	line-height: 1.8;
}

/* Contents: one chip per section */
.tguide__toc {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 0 0 2rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--tg-line);
	border-radius: 8px;
	background: var(--tg-soft);
	list-style: none;
}

.tguide__toc li {
	margin: 0;
}

.tguide .tguide__toc a {
	display: inline-block;
	padding: 0.35rem 0.8rem;
	border: 1px solid var(--tg-line);
	border-radius: 999px;
	background: #fff;
	color: var(--tg-accent-dark);
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
}

.tguide .tguide__toc a:hover,
.tguide .tguide__toc a:focus-visible {
	border-color: var(--tg-accent);
	background: var(--tg-accent);
	color: #fff;
}

/* Tables (page setup, fonts) */
.tguide__tableWrap {
	overflow-x: auto;
	margin: 0 0 1rem;
}

.tguide__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.tguide__table th,
.tguide__table td {
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--tg-line);
	text-align: start;
	vertical-align: top;
	line-height: 1.6;
}

.tguide__table thead th {
	background: var(--tg-accent);
	border-color: var(--tg-accent);
	color: #fff;
}

.tguide__table tbody th {
	width: 34%;
	background: var(--tg-soft);
	font-weight: 700;
}

.tguide__table tbody tr:nth-child(even) td {
	background: #fafbfd;
}

/* Checklist */
.tguide__check {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 0.5rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tguide__check li {
	position: relative;
	margin: 0;
	padding-inline-start: 2rem;
	line-height: 1.7;
}

.tguide__check li::before {
	content: "✓";
	position: absolute;
	inset-inline-start: 0;
	top: 0.1rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 50%;
	background: #1f8a4c;
	color: #fff;
	font-size: 0.8rem;
	font-weight: 700;
}

/* Plain bullet lists */
.tguide__list {
	margin: 0 0 1rem;
	padding-inline-start: 1.3rem;
}

.tguide__list li {
	margin: 0 0 0.4rem;
	line-height: 1.75;
}

/* Numbered steps (structure, review) */
.tguide__steps {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: tg-step;
}

.tguide__steps li {
	position: relative;
	margin: 0 0 0.6rem;
	padding: 0.7rem 1rem;
	padding-inline-start: 3.2rem;
	border: 1px solid var(--tg-line);
	border-radius: 8px;
	background: #fff;
	line-height: 1.7;
	counter-increment: tg-step;
}

.tguide__steps li::before {
	content: counter(tg-step);
	position: absolute;
	inset-inline-start: 0.8rem;
	top: 0.7rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7rem;
	height: 1.7rem;
	border-radius: 50%;
	background: var(--tg-accent);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 700;
}

.tguide__steps strong {
	color: var(--tg-ink);
}

/* Notes and examples */
.tguide__note {
	margin: 0.8rem 0 1rem;
	padding: 0.8rem 1rem;
	border-inline-start: 4px solid #f59e0b;
	border-radius: 6px;
	background: #fff8e6;
	line-height: 1.75;
}

.tguide__ex {
	margin: 0.6rem 0 1rem;
	padding: 0;
	list-style: none;
}

.tguide__ex li {
	margin: 0 0 0.5rem;
	padding: 0.7rem 1rem;
	border: 1px dashed var(--tg-line);
	border-radius: 6px;
	background: var(--tg-soft);
	line-height: 1.7;
}

.tguide__exLabel {
	display: inline-block;
	margin-inline-end: 0.4rem;
	padding: 0.05rem 0.5rem;
	border-radius: 4px;
	background: var(--tg-accent);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
}

.tguide__ex [dir="ltr"],
.tguide__ex [dir="rtl"] {
	unicode-bidi: isolate;
}

/* Contact line */
.tguide__contact {
	margin: 1.5rem 0 0;
	padding: 0.9rem 1rem;
	border-radius: 8px;
	background: var(--tg-soft);
	text-align: center;
	font-weight: 700;
}

.tguide__contact a {
	color: var(--tg-accent-dark);
	unicode-bidi: isolate;
}

/* ---- The guidance on the "Submissions" page (about/submissions) ---- */
.tguide__intro {
	margin: 0 0 1.5rem;
	font-size: 1.05rem;
	line-height: 1.75;
}

/* Guide page + PDF cards side by side */
.tguide__docs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
	gap: 0.8rem;
}

.tguide__docs a.tguide__doc {
	max-width: none;
}

/* The web-page guide card: the journal blue instead of the PDF red */
.tguide a.tguide__doc--page {
	border-inline-start-color: var(--tg-accent);
}

.tguide a.tguide__doc--page:hover,
.tguide a.tguide__doc--page:focus-visible {
	border-color: var(--tg-accent);
	box-shadow: 0 6px 18px rgba(21, 118, 189, 0.14);
}

.tguide__doc--page .tguide__badge,
.tguide__doc--page .tguide__go {
	background: var(--tg-accent);
}

.tguide__doc--page .tguide__badge {
	font: 700 1.5rem/1 Georgia, 'Times New Roman', serif;
}

/* The theme gives every list on the Submissions page an indent and a
   bottom margin; the guide lists draw their own markers and spacing. */
.page_submissions .tguide ol.tguide__steps,
.page_submissions .tguide ol.tguide__videos {
	padding: 0;
}

.page_submissions .tguide ol.tguide__videos li {
	margin: 0;
}

.page_submissions .tguide ol.tguide__steps li {
	margin: 0 0 0.6rem;
}

.page_submissions .tguide h3 {
	font-size: 1.15rem;
}
