/* Manga aisle "Rail Diagram": Manga A–Ž index and the volume line on series archives.
   A series is a coloured line (--line, set per row from inc/manga.php); each volume in stock
   is a numbered station on a fixed pitch, missing volumes are dashed track.
   Signal yellow is reserved for the station under the pointer or keyboard, nothing else.
   Loaded after jokercity.css and before preset.css. */

.jc-az,
.jc-series-line {
	--pitch: 44px;                  /* one volume, stop or gap */
	--stop: 34px;
	--track: 6px;

	--signal: #ffd400;
	--rail-font: var(--jc-p-font, inherit);
}
@media (pointer: coarse) {
	.jc-az, .jc-series-line { --stop: 38px; }
}
.jc-az { --jc-az-nav-h: 61px; }

/* Tools: series search, legend, link to the full grid -------------------- */
.jc-az__tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 32px; margin: 4px 0 16px; }
.jc-az__filter { flex: 0 1 360px; min-width: 0; margin: 0; }
.jc-az__filter label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--jc-ink-2); }
.jc-az__filter input[type="search"] {
	box-sizing: border-box; width: 100%; height: 44px; margin: 0; padding: 0 14px;
	border: 1px solid #cfd2d8; border-radius: 8px; background: var(--jc-wash); box-shadow: none;
	font: inherit; font-size: 16px; color: var(--jc-ink);
}
.jc-az__filter input[type="search"]::placeholder { color: var(--jc-muted); opacity: 1; }
.jc-az__filter input[type="search"]:focus { background: var(--jc-paper); border-color: var(--jc-ink); }

.jc-az__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-size: 14px; color: var(--jc-muted); }
.jc-az__legend-stop {
	display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
	width: 26px; height: 26px; border: 3px solid #9aa0aa; border-radius: 50%;
	font: 800 12px/1 var(--rail-font); color: var(--jc-ink); padding-top: 1px;
}
.jc-az__legend-gap { --line: #9aa0aa; display: inline-block; width: 33px; height: 3px; margin-left: 14px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 11px); }
.jc-az__all {
	display: inline-flex; align-items: center; min-height: 44px; margin-left: auto;
	font-weight: 700; color: var(--jc-ink); text-underline-offset: 4px;
}

/* Letter bar: the alphabet as a line of stops. Sticky while scrolling, sideways on phones.
   Storefront's `.site { overflow-x: hidden }` would disable sticky; the shared frame uses clip. */
.jc-az__nav {
	position: sticky; top: 0; z-index: 5;
	margin: 0 0 8px; padding: 8px 0; background: var(--jc-paper); border-bottom: 1px solid var(--jc-line);
}
.admin-bar .jc-az__nav { top: 32px; }
@media (max-width: 782px) { .admin-bar .jc-az__nav { top: 46px; } }
@media (max-width: 600px) { .admin-bar .jc-az__nav { top: 0; } }
.jc-az__nav ol {
	display: flex; list-style: none; margin: 0 0 0 calc((var(--pitch) - var(--stop)) / -2); padding: 0;
	overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
}
.jc-az__nav ol::-webkit-scrollbar { display: none; }
/* More letters off-screen: fade that edge (classes set by the index script while scrolling) */
.jc-az__nav ol.is-more-r { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), transparent); }
.jc-az__nav ol.is-more-l { -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px); mask-image: linear-gradient(90deg, transparent, #000 56px); }
.jc-az__nav ol.is-more-l.is-more-r { -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.jc-az__nav li { position: relative; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: var(--pitch); height: var(--pitch); margin: 0; }
.jc-az__nav li::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--jc-ink); }
.jc-az__nav li:first-child::before { left: 50%; }
.jc-az__nav li:last-of-type::before { right: 50%; }
.jc-az .jc-az__nav a {
	position: relative; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
	width: var(--stop); height: var(--stop); padding-top: 2px;
	border: 3px solid var(--jc-ink); border-radius: 50%; background: var(--jc-paper);
	font: 800 15px/1 var(--rail-font); color: var(--jc-ink); text-decoration: none;
}
.jc-az .jc-az__nav a:hover { background: var(--jc-wash); }
.jc-az .jc-az__nav a[aria-current] { background: var(--jc-ink); color: var(--jc-paper); }
.jc-az .jc-az__nav a:focus-visible { outline-offset: 1px; }

/* Letter groups ------------------------------------------------------------ */
.jc-az__group { margin: 0; scroll-margin-top: calc(var(--jc-az-nav-h) + 8px); }
.admin-bar .jc-az__group { scroll-margin-top: calc(var(--jc-az-nav-h) + 40px); }
.jc-az .jc-az__group h2 {
	display: flex; align-items: center; gap: 16px;
	margin: 32px 0 4px; font: 800 30px/1 var(--rail-font); color: var(--jc-ink);
}
.jc-az__group h2::after { content: ""; flex: 1; height: 2px; background: var(--jc-ink); }
.jc-az__rows, .jc-series__sub { list-style: none; margin: 0; padding: 0; }

/* One series: cover · code + name + count · its line ----------------------- */
.jc-series {
	display: grid;
	grid-template-columns: 56px minmax(0, 300px) minmax(0, 1fr);
	grid-template-areas: "cover head line";
	column-gap: 24px; align-items: center;
	margin: 0; padding: 14px 0; border-bottom: 1px solid var(--jc-line);
}
.jc-series__cover {
	grid-area: cover; display: block; width: 56px; aspect-ratio: 2 / 3;
	border-radius: 4px; overflow: hidden;
	background: color-mix(in srgb, var(--line) 14%, #fff);   /* while the cover loads: the line's plate */
}
.jc-series__cover img, .jc-series__blank { display: block; width: 100%; height: 100%; object-fit: cover; }
/* No photo: a plate tinted from the series' line, crossed by its track */
.jc-series__blank { position: relative; background: color-mix(in srgb, var(--line) 14%, #fff); }
.jc-series__blank::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--track); margin-top: calc(var(--track) / -2); background: var(--line); }
.jc-series__head {
	grid-area: head; display: grid; grid-template-columns: auto minmax(0, 1fr);
	column-gap: 12px; row-gap: 2px; align-items: center;
}
.jc-series__code {
	grid-row: span 2; display: flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; padding-top: 2px; box-sizing: border-box; border-radius: 6px;
	background: var(--line); color: #fff; font: 800 15px/1 var(--rail-font); letter-spacing: .02em;
}
.jc-az .jc-series__name {
	font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--jc-ink);
	text-decoration: none; overflow-wrap: anywhere; text-underline-offset: 3px;
}
.jc-az .jc-series__name:hover { text-decoration: underline; }
.jc-series__count { font-size: 14px; color: var(--jc-muted); }
.jc-series__line { grid-area: line; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jc-series__more { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 700; color: var(--jc-ink-2); text-underline-offset: 3px; white-space: nowrap; }
/* Several runs in one series (Dragon Ball: Super, Z, 3-in-1): one labelled line each */
.jc-line-run { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); align-items: center; column-gap: 12px; }
.jc-line-run__label { font: 800 13px/1.2 var(--rail-font); color: var(--jc-ink-2); }

/* The line ------------------------------------------------------------------ */
/* Storefront underlines content links (.entry-content a:not(.button)…); stops and names don't. */
body .site-content .jc-line__stop a:not(.button),
body .site-content .jc-series__name:not(:hover),
body .site-content .jc-az__nav a:not(.button) { text-decoration: none; }
.jc-line { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
/* Dashes repeat every 11px (6 on, 5 off): half a pitch is exactly two repeats, so a dashed stretch
   that starts on any half-pitch boundary keeps the same rhythm. Declared on the items, where the
   row's --line is known (a custom property resolves var() where it is declared). */
.jc-line > li { --dash: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 11px); }
.jc-line > li {
	position: relative; display: flex; align-items: center; justify-content: center;
	flex: 0 0 var(--pitch); height: var(--pitch); margin: 0;
}
.jc-line > li::before {                   /* track: solid between stops in stock */
	content: ""; position: absolute; left: 0; right: 0; top: 50%;
	height: var(--track); margin-top: calc(var(--track) / -2); background: var(--line);
}
/* The track ends at the first and last station, and at both ends of every wrapped row
   (is-row-start / is-row-end come from jc_manga_line_script()). */
.jc-line > .is-first::before, .jc-line > .is-row-start::before { left: 50%; }
.jc-line > .is-last::before, .jc-line > .is-row-end::before { right: 50%; }
.jc-line > .is-first.is-last::before { display: none; }
/* Missing volumes: one dashed stretch per run, n pitches long (full line colour: ≥3:1 on white,
   half the weight of the solid track). A station beside it hands over at its own centre, so the
   solid track never pokes into the gap. */
.jc-line > .jc-line__gap { flex: 0 0 calc(var(--n, 1) * var(--pitch)); }
.jc-line > .jc-line__gap::before { height: 3px; margin-top: -1.5px; background: var(--dash); }
.jc-line__stop:has(+ .jc-line__gap)::before { right: 50%; }
.jc-line__gap + .jc-line__stop::before { left: 50%; }
.jc-line__stop:has(+ .jc-line__gap)::after,
.jc-line__gap + .jc-line__stop::after {
	content: ""; position: absolute; top: 50%; height: 3px; margin-top: -1.5px; background: var(--dash);
}
.jc-line__stop:has(+ .jc-line__gap)::after { left: 50%; right: 0; }
.jc-line__gap + .jc-line__stop::after { left: 0; right: 50%; background-position: 0 0; }
.jc-line__stop:has(+ .jc-line__gap).is-row-end::after,
.jc-line__gap.is-row-start + .jc-line__stop::after { display: none; }
.jc-line__gap--run span {
	position: relative; padding: 0 6px; background: var(--jc-paper);
	font-size: 12px; font-weight: 700; color: var(--jc-ink-2); font-variant-numeric: tabular-nums;
}
/* "še N izdelkov": rides at the end of the last line, never on a row of its own */
.jc-line > .jc-line__more { flex: 0 0 auto; height: auto; margin-left: 12px; }
.jc-line > .jc-line__more::before { display: none; }
.jc-line__stop a {
	position: relative; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
	width: var(--stop); height: var(--stop); padding-top: 2px;
	border: 4px solid var(--line); border-radius: 50%; background: #fff;
	font: 800 14px/1 var(--rail-font); font-variant-numeric: tabular-nums; color: var(--jc-ink);
	text-decoration: none;
	transition: background-color .15s ease-out, transform .2s cubic-bezier(.16, 1, .3, 1);
}
.jc-line__stop--wide a { font-size: 12px; letter-spacing: -.02em; }
.jc-line__stop a:hover,
.jc-line__stop a:focus-visible { background: var(--signal); color: #15171c; transform: scale(1.14); }
.jc-line__stop a:focus-visible { outline: 2px solid var(--jc-ink); outline-offset: 2px; }
.jc-line__stop a { z-index: 1; }
/* Touch target = the whole pitch, 44×44 (0.7.15, independent review measured 34×34); the circle
   keeps its size. Scaled with the circle on hover, so it never reaches a neighbour's centre. */
.jc-line__stop a::after { content: ""; position: absolute; inset: calc((var(--stop) - var(--pitch)) / 2 - 4px); border-radius: 50%; }   /* - 4px: measured inside the border */
@media (prefers-reduced-motion: reduce) {
	.jc-line__stop a { transition: none; }
	.jc-line__stop a:hover, .jc-line__stop a:focus-visible { transform: none; }
}

/* Sub-series sit under their parent, indented to the parent's name */
.jc-series__sub { grid-column: 1 / -1; margin-top: 6px; padding-left: 80px; }
.jc-series--sub { grid-template-columns: 40px minmax(0, 236px) minmax(0, 1fr); padding: 8px 0; border-bottom: 0; }
.jc-series--sub .jc-series__cover { width: 40px; }
.jc-series--sub .jc-series__code { width: 32px; height: 32px; font-size: 13px; }

/* No match / nothing in stock */
.jc-az__empty, .jc-az__none { margin: 24px 0 28px; padding: 14px 16px; border-radius: 8px; background: var(--jc-wash); color: var(--jc-ink-2); }
.jc-az__empty a, .jc-az__none a { font-weight: 700; text-underline-offset: 3px; }
.jc-az [hidden] { display: none !important; }

/* Manga archives: link to the index, and the series' own line above the grid */
.jc-manga-az { margin: 14px 0 20px; }
.jc-manga-az a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; box-sizing: border-box;
	border: 1px solid var(--jc-control-line, #c9ccd3); border-radius: 8px;
	font-weight: 700; color: var(--jc-ink); text-decoration: none;
}
.jc-manga-az a:hover { border-color: var(--jc-ink); }
.jc-series-line { margin: 14px 0 24px; padding: 0 0 18px; border-bottom: 1px solid var(--jc-line); }
.jc-series-line__title { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: var(--jc-ink-2); }

/* Phones: cover + name on top, the line full width underneath ----------------- */
@media (max-width: 767px) {
	.jc-az__tools { gap: 4px 24px; margin-bottom: 8px; }
	.jc-az__legend { display: none; }      /* the dashed gaps read on their own; keeps the first series on screen */
	.jc-az__all { margin-left: 0; }
	.jc-az .jc-az__group h2 { margin-top: 26px; font-size: 26px; }
	.jc-series {
		grid-template-columns: 44px minmax(0, 1fr);
		grid-template-areas: "cover head" "line line";
		column-gap: 14px; row-gap: 8px; padding: 14px 0 10px;
	}
	.jc-series__cover { width: 44px; }
	.jc-series__code { width: 34px; height: 34px; font-size: 13px; }
	.jc-az .jc-series__name { font-size: 16px; }
	.jc-series__sub { padding-left: 20px; }
	.jc-series--sub { grid-template-columns: 36px minmax(0, 1fr); }
	.jc-series--sub .jc-series__cover { width: 36px; }
	.jc-line-run { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
}

/* Banner lead (0.7.2, moved into the banner by jc_page_lead()): kept inside the white scrim,
   clear of the rail network's line ends. */
.jc-preset.jc-preset--manga .jc-banner__lead { max-width: min(34em, 42vw); }
@media (max-width: 767px) { .jc-preset.jc-preset--manga .jc-banner__lead { max-width: 60%; font-size: 15px; } }

/* Manga volume page: the series' line under the buy facts (loop pass 2). The volume on screen is the
   filled station; signal yellow stays reserved for pointer/keyboard focus. */
.single-product .jc-series-line--product { margin: 0 0 22px; padding: 16px 0 0; border-top: 1px solid var(--jc-line); border-bottom: 0; }
.single-product .jc-series-line--product .jc-series-line__title { font-size: 15px; font-weight: 700; color: var(--jc-ink-2); margin: 0 0 6px; }
.single-product .jc-series-line--product .jc-series-line__title a { color: var(--jc-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--line, var(--jc-line)); }
.jc-line__stop a[aria-current="page"] { background: var(--jc-ink); color: #fff; }
