/* Tutorials pages. Colours, radius and width come from the theme's variables (var(--ink) etc.),
   with the same values as fallbacks so it also looks right under another theme. */
.tut-scope {
	--t-ink: var(--ink, #0d2436); --t-ink2: var(--ink-2, #2a4256); --t-muted: var(--muted, #557084);
	--t-line: var(--line, #cfe5ea); --t-line2: var(--line-2, #b4d2db);
	--t-blue: var(--blue, #0077be); --t-blue-ink: var(--blue-ink, #005f98); --t-focus: var(--dodger, #1e90ff);
	--t-sand: var(--sand, #e0ffff); --t-mist: var(--mist, #f0fcfc);
	--t-r: var(--r, 16px); --t-rsm: var(--r-sm, 10px);
	--t-star: #e8a317;
	--t-wrap: var(--wrap, 1120px); --t-gutter: var(--gutter, 20px);
	color: var(--t-ink);
}
.tut-wrap { width: 100%; max-width: var(--t-wrap); margin-inline: auto; padding-inline: var(--t-gutter); }

/* Header band */
.tut-head { background: var(--t-sand); padding-block: clamp(32px, 5vw, 56px); }
.tut-head .eyebrow { text-decoration: none; }
.tut-head h1 { margin: 0 0 12px; font-size: clamp(2rem, 3.6vw, 3.1rem); max-width: 24ch; overflow-wrap: anywhere; }
.tut-meta { margin: 0; color: var(--t-muted); font-size: .92rem; }
.tut-meta span[aria-hidden] { margin-inline: 6px; opacity: .6; }
.tut-head .tut-meta { font-size: 1rem; }

/* One tutorial */
.tut-hero { margin: 32px auto 0; max-width: 960px; }
.tut-hero img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--t-r); }
.tut-body { max-width: 760px; margin: 36px auto 0; overflow-wrap: anywhere; } /* a long web address or word wraps instead of widening the page */
.tut-body--builder { max-width: none; margin-top: 0; }
.tut-body img { max-width: 100%; height: auto; border-radius: var(--t-rsm); margin-inline: auto; }
.tut-body pre { max-width: 100%; overflow-x: auto; }
.tut-body hr { height: 0; margin: 2.2em auto; border: 0; border-top: 1px solid var(--t-line2); }
.tut-body > * + * { margin-top: 1em; }
.tut-body--builder > * + * { margin-top: 0; }

/* Tables made from the "| a | b |" lines (the div lets a wide table scroll on a phone) */
.tut-table { overflow-x: auto; }
.tut-table table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: .95rem; color: var(--t-ink2); }
.tut-table th, .tut-table td { padding: 10px 14px; border: 1px solid var(--t-line); text-align: left; vertical-align: top; }
.tut-table th { background: var(--t-mist); color: var(--t-ink); font-weight: 600; }
.tut-table td:first-child { color: var(--t-ink); font-weight: 500; }

/* Rating + share bar */
.tut-actions {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px;
	max-width: 760px; margin: 40px auto 88px; padding: 20px 24px;
	border: 1px solid var(--t-line); border-radius: var(--t-r); background: var(--t-mist);
}
.tut-rate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.tut-rate__label { font-weight: 600; }
.tut-rate__stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.tut-rate__stars button {
	padding: 0 2px; border: 0; background: none; cursor: pointer; border-radius: 6px;
	font: 400 1.9rem/1.2 system-ui, sans-serif; color: var(--t-line2);
}
.tut-rate__stars button:focus-visible { outline: 2px solid var(--t-focus); outline-offset: 2px; }
.tut-rate:not(.is-done) .tut-rate__stars button:hover,
.tut-rate:not(.is-done) .tut-rate__stars button:hover ~ button,
.tut-rate__stars button.is-on { color: var(--t-star); }
.tut-rate.is-done .tut-rate__stars button { cursor: default; }
.tut-rate__summary { flex-basis: 100%; display: flex; align-items: center; gap: 8px; color: var(--t-muted); font-size: .9rem; }
.tut-rate__msg { flex-basis: 100%; min-height: 1.4em; font-size: .9rem; color: var(--t-blue-ink); }
.tut-rate__msg:empty { display: none; }

/* Read-only stars: a grey row with a gold row on top, clipped to --pct of the width */
.tut-stars { position: relative; display: inline-block; font: 400 1.05rem/1 system-ui, sans-serif; letter-spacing: .08em; color: var(--t-line2); }
.tut-stars::before, .tut-stars::after { content: "★★★★★"; }
.tut-stars::after { position: absolute; left: 0; top: 0; width: var(--pct, 0%); overflow: hidden; white-space: nowrap; color: var(--t-star); }

.tut-btn {
	display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px;
	border: 0; border-radius: var(--t-rsm); background: var(--t-blue); color: #fff; cursor: pointer;
	font: 600 .95rem/1 var(--body, system-ui, sans-serif); transition: background-color .2s;
}
.tut-btn:hover { background: var(--t-blue-ink); }
.tut-btn:focus-visible { outline: 2px solid var(--t-focus); outline-offset: 3px; }

/* Main page: card grid */
.tut-list { padding-block: 48px 88px; }
.tut-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 28px; } /* every row as tall as the tallest */
.tut-card {
	position: relative; display: flex; flex-direction: column; overflow: hidden;
	background: #fff; border: 1px solid var(--t-line); border-radius: var(--t-r);
	transition: box-shadow .3s, transform .3s, border-color .3s;
}
.tut-card:hover { transform: translateY(-3px); border-color: var(--t-line2); box-shadow: 0 1px 2px rgba(13, 36, 54, .05), 0 12px 32px -16px rgba(13, 36, 54, .28); }
/* Every card is the same size: the picture box is a fixed 16:10 and the photo is cropped to fill it (taken out of
   the flow, so a tall or square photo can't stretch the box), and long titles and text are cut to fixed line counts. */
.tut-card__img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, var(--t-sand), #c7f0f0); }
.tut-card__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tut-card__body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px 22px; }
.tut-card .tut-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tut-card h2 { margin: 0; font-size: 1.28rem; line-height: 1.25; min-height: 2.5em; }
.tut-card h2, .tut-card__excerpt { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tut-card h2 { -webkit-line-clamp: 2; line-clamp: 2; }
.tut-card__excerpt { -webkit-line-clamp: 3; line-clamp: 3; line-height: 1.55; min-height: 4.65em; }
.tut-card h2 a { color: inherit; text-decoration: none; }
.tut-card h2 a::after { content: ""; position: absolute; inset: 0; } /* the whole card is the link */
.tut-card h2 a:hover { color: var(--t-blue-ink); }
.tut-card__excerpt { margin: 0; color: var(--t-ink2); font-size: .95rem; }
.tut-card__rating { display: flex; align-items: center; gap: 8px; margin: auto 0 0; padding-top: 6px; color: var(--t-muted); font-size: .86rem; }
.tut-empty { padding: 56px 24px; text-align: center; border: 1px dashed var(--t-line2); border-radius: var(--t-r); background: var(--t-mist); color: var(--t-muted); }

/* Page numbers */
.tut-pagination { margin-top: 44px; }
.tut-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tut-pagination .page-numbers {
	display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px;
	border: 1px solid var(--t-line2); border-radius: var(--t-rsm); background: #fff;
	color: var(--t-ink); font-weight: 600; text-decoration: none;
}
.tut-pagination a.page-numbers:hover, .tut-pagination .page-numbers.current { background: var(--t-ink); border-color: var(--t-ink); color: #fff; }
.tut-pagination .page-numbers.dots { border-color: transparent; background: none; }

@media (max-width: 960px) { .tut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
	.tut-grid { grid-template-columns: 1fr; }
	.tut-actions { padding: 18px; }
}
