/* Checkpoint for WordPress: additions on top of screen.css.
   screen.css is the Ghost theme's, unchanged. Everything here is either new
   (search dialog, native comments, newsletter embeds) or maps a WordPress
   class onto what screen.css already does for Ghost (Gutenberg blocks). */

/* ---- Admin bar: sticky things sit under it ---- */
@media (min-width: 783px) {
	.admin-bar .masthead { top: 32px; }
	.admin-bar .hubnav { top: calc(var(--masthead-h) + 32px); }
}
@media (min-width: 783px) and (min-width: 1040px) {
	.admin-bar .rail { top: calc(var(--masthead-h) + var(--s-7) + 32px); }
}
@media (min-width: 783px) and (min-width: 1280px) {
	.admin-bar .questlog,
	.admin-bar .gamecard { top: calc(var(--masthead-h) + var(--s-8) + 32px); }
}
@media (max-width: 782px) and (min-width: 601px) {
	.admin-bar .masthead { top: 46px; }
	.admin-bar .hubnav { top: calc(var(--masthead-h) + 46px); }
}

/* ---- Search dialog (replaces Ghost's search) ---- */
.searchbox {
	width: min(640px, calc(100vw - 2 * var(--gutter)));
	margin: 12vh auto auto;
	padding: 0;
	color: var(--fg);
	background: var(--bg-raised);
	border: var(--rule) solid var(--line);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-lift), 0 0 0 1px var(--accent-edge), 0 0 60px -24px var(--accent-glow);
}
.searchbox::backdrop {
	background: #050409eb;
	backdrop-filter: blur(8px);
}
.searchbox__form {
	display: flex;
	align-items: center;
	gap: var(--s-5);
	padding: var(--s-5) var(--s-6);
}
.searchbox__form > .icon { flex: 0 0 auto; color: var(--accent-text); }
.searchbox__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: var(--s-5) 0;
	font: inherit;
	font-size: var(--t-lg);
	color: var(--fg);
	background: transparent;
	border: 0;
	outline: none;
}
.searchbox__input::placeholder { color: var(--fg-muted); }
.searchbox__input::-webkit-search-cancel-button { display: none; }
.searchbox__close {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	color: var(--fg-muted);
	background: transparent;
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}
.searchbox__close:hover { color: var(--fg); background: var(--fg-faint); }
.searchbox__close:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.searchbox__input:focus-visible { outline: none; }
.searchbox__form:focus-within { box-shadow: inset 0 0 0 1px var(--accent); border-radius: var(--radius-xl); }

/* The same bar as a form on the search results page. */
.searchbox__form--page {
	max-width: 640px;
	margin-top: var(--s-8);
	background: var(--bg-raised);
	border: var(--rule) solid var(--line);
	border-radius: var(--radius-lg);
}
.searchbox__form--page:focus-within { border-color: var(--accent); }

/* ---- Newsletter embeds (a plugin's form inside the signup box) ---- */
.signup__embed { margin-top: var(--s-6); }
.signup__embed input[type="email"],
.signup__embed input[type="text"] {
	width: 100%;
	min-height: 44px;
	padding: var(--s-4) var(--s-5);
	font: inherit;
	color: var(--fg);
	background: var(--bg-sunk);
	border: var(--rule) solid var(--line-control);
	border-radius: var(--radius);
}
.signup__embed input:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; border-color: var(--accent); }
.signup__embed button,
.signup__embed input[type="submit"] {
	min-height: 40px;
	margin-top: var(--s-4);
	padding: var(--s-4) var(--s-7);
	font-family: var(--font-hud);
	font-size: var(--t-sm);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: var(--track-hud);
	color: var(--accent-ink);
	background: var(--accent);
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}
.signup__embed label { color: var(--fg-soft); font-size: var(--t-sm); }

/* ---- Native comments ---- */
.comments { margin-top: var(--s-12); }
.comments__app { display: grid; gap: var(--s-8); }
.comments__list,
.comments__list .children { list-style: none; margin: 0; padding: 0; }
.comments__list { display: grid; gap: var(--s-6); }
.comments__list .children { margin-top: var(--s-6); margin-left: var(--s-8); display: grid; gap: var(--s-6); padding-left: var(--s-6); border-left: var(--rule) solid var(--line); }
.comment__body {
	padding: var(--s-7) var(--s-8);
	background: var(--bg-card);
	border: var(--rule) solid var(--line-soft);
	border-radius: var(--radius-lg);
}
.comment--author > .comment__body { border-color: var(--accent-edge); }
.comment__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-4) var(--s-5); margin-bottom: var(--s-5); font-family: var(--font-hud); font-size: var(--t-xs); letter-spacing: var(--track-hud); color: var(--fg-muted); }
.comment__author { font-size: var(--t-sm); font-weight: 700; color: var(--fg); }
.comment__badge { padding: 1px var(--s-4); font-size: var(--t-2xs); font-weight: 700; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: var(--radius-pill); }
.comment__time { color: var(--fg-muted); }
.comment__time:hover { color: var(--accent-text); }
.comment__text { color: var(--fg-soft); line-height: var(--lh-read); overflow-wrap: anywhere; }
.comment__text > * + * { margin-top: var(--s-5); }
.comment__text a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.comment__pending { margin-bottom: var(--s-5); font-size: var(--t-sm); color: var(--tone-weak); }
.comment__actions { margin-top: var(--s-6); }
.comment__actions .comment-reply-link { font-family: var(--font-hud); font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track-hud); color: var(--accent-text); }
.comments__closed { color: var(--fg-muted); }

.cform { display: grid; gap: var(--s-6); }
.cform .comment-reply-title { font-family: var(--font-display); font-size: var(--t-xl); line-height: var(--lh-head); color: var(--fg); }
.cform .comment-reply-title small { margin-left: var(--s-5); font-family: var(--font-hud); font-size: var(--t-xs); }
.cform label { display: block; margin-bottom: var(--s-3); font-family: var(--font-hud); font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track-hud); color: var(--fg-muted); }
.cform input[type="text"],
.cform input[type="email"],
.cform input[type="url"],
.cform textarea {
	width: 100%;
	padding: var(--s-5) var(--s-6);
	font: inherit;
	color: var(--fg);
	background: var(--bg-sunk);
	border: var(--rule) solid var(--line-control);
	border-radius: var(--radius);
}
.cform textarea { min-height: 9rem; resize: vertical; }
.cform input:focus-visible,
.cform textarea:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 1px; border-color: var(--accent); }
.cform .comment-form-cookies-consent { display: flex; align-items: center; gap: var(--s-4); }
.cform .comment-form-cookies-consent label { margin: 0; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: var(--t-sm); }
.cform .logged-in-as,
.cform .comment-notes { margin: 0; font-size: var(--t-sm); color: var(--fg-muted); }
.cform .logged-in-as a { color: var(--accent-text); }
.cform .form-submit { margin: 0; }

/* ---- Password form ---- */
.post-password-form { display: grid; gap: var(--s-5); max-width: 28rem; }
.post-password-form input[type="password"] { width: 100%; min-height: 44px; padding: var(--s-4) var(--s-5); font: inherit; color: var(--fg); background: var(--bg-sunk); border: var(--rule) solid var(--line-control); border-radius: var(--radius); }
.post-password-form input[type="submit"] { min-height: 40px; padding: var(--s-4) var(--s-7); font-family: var(--font-hud); font-weight: 700; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: var(--radius); cursor: pointer; }

/* ---- Gutenberg blocks in guides, mapped onto the Ghost card styles ---- */
.prose .alignwide {
	--w: max(100%, min(100dvw - 2 * var(--gutter), 960px));
	width: var(--w);
	max-width: none;
	margin-inline: calc((100% - var(--w)) / 2);
}
.prose .alignfull { width: 100dvw; max-width: none; margin-inline: calc(50% - 50dvw); }
.prose .alignfull img { border-radius: 0; }
.prose .alignleft { float: left; margin: 0 var(--s-8) var(--s-6) 0; max-width: 50%; }
.prose .alignright { float: right; margin: 0 0 var(--s-6) var(--s-8); max-width: 50%; }
.prose .aligncenter { margin-inline: auto; }
.prose::after { content: ""; display: table; clear: both; }
@media (max-width: 620px) {
	.prose .alignleft, .prose .alignright { float: none; max-width: 100%; margin: 0 auto; }
}
.prose .wp-block-image img,
.prose .wp-block-gallery img { height: auto; max-width: 100%; }
.prose .wp-block-image figcaption,
.prose .wp-block-gallery figcaption,
.prose .wp-element-caption { margin-top: var(--s-4); font-family: var(--font-hud); font-size: var(--t-xs); color: var(--fg-muted); text-align: center; }
.prose .wp-block-gallery { gap: var(--s-5); }
.prose .wp-block-gallery img { border-radius: var(--radius); }

.prose .wp-block-pullquote { padding: var(--s-8) 0; border-block: var(--rule) solid var(--line); text-align: center; }
.prose .wp-block-pullquote blockquote { margin: 0; padding: 0; background: none; border: 0; }
.prose cite,
.prose .wp-block-quote cite { display: block; margin-top: var(--s-5); font-family: var(--font-hud); font-size: var(--t-xs); font-style: normal; color: var(--fg-muted); }

.prose .wp-block-separator,
.prose hr { border: 0; border-top: var(--rule) solid var(--line); margin-block: var(--s-10); opacity: 1; }
.prose .wp-block-code { padding: 0; background: none; border: 0; }

.prose .wp-block-table { overflow-x: auto; }
.prose .wp-block-table table { width: 100%; border-collapse: collapse; }
.prose .wp-block-table figcaption { margin-top: var(--s-4); }

.prose .wp-block-button__link,
.prose .wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: var(--s-4) var(--s-7);
	font-family: var(--font-hud);
	font-size: var(--t-sm);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: var(--track-hud);
	line-height: var(--lh-none);
	color: var(--accent-ink);
	background: var(--accent);
	border: 0;
	border-radius: var(--radius);
	text-decoration: none;
	transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.prose .wp-block-button__link:hover,
.prose .wp-element-button:hover { background: var(--accent-bright); color: var(--accent-ink); transform: translateY(-1px); }
.prose .is-style-outline > .wp-block-button__link,
.prose .wp-block-button.is-style-outline .wp-block-button__link { color: var(--fg); background: var(--fg-faint); border: var(--rule) solid var(--line-control); }

/* Details block = Ghost's toggle card, the easy way to build an FAQ. */
.prose .wp-block-details {
	padding: var(--s-6) var(--s-7);
	background: var(--bg-card);
	border: var(--rule) solid var(--line);
	border-radius: var(--radius-lg);
}
.prose .wp-block-details summary { cursor: pointer; font-weight: 700; color: var(--fg); }
.prose .wp-block-details[open] summary { margin-bottom: var(--s-5); }

/* Group block with a background: a readable callout in the dark theme. */
.prose .wp-block-group.has-background { padding: var(--s-7) var(--s-8); border-radius: var(--radius-lg); }
.prose .has-text-align-center { text-align: center; }
.prose .has-text-align-right { text-align: right; }

.prose .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); padding: var(--s-6) var(--s-7); background: var(--bg-card); border: var(--rule) solid var(--line); border-radius: var(--radius-lg); }
.prose .wp-block-file a:not(.wp-block-file__button) { color: var(--accent-text); }
.prose .wp-block-audio audio,
.prose .wp-block-video video { width: 100%; border-radius: var(--radius); }
.prose .wp-block-embed__wrapper iframe { max-width: 100%; border-radius: var(--radius); }

/* Screen reader text WordPress prints in places. */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Footer "Cookie settings" button: looks like the footer links beside it ---- */
.colophon__btn {
	display: inline-block;
	padding: var(--s-3) var(--s-2);
	margin: 0 calc(var(--s-2) * -1);
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
}
.colophon__btn:hover { color: var(--accent-text); }
.colophon__btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: var(--radius-xs); }

/* ==== Fixes, October 2026 ============================================== */

/* Wide and full images inside the three-column guide layout stay between the
   rails. screen.css has this rule for Ghost's kg-width classes; WordPress's
   alignwide and alignfull were missing it, so wide images slid under the
   quest log and the game card. */
@media (min-width: 1040px) {
	.guide .prose .alignwide,
	.guide .prose .alignfull { width: 100%; margin-inline: 0; }
	.guide .prose .alignfull img { border-radius: var(--radius); }
}
@media (min-width: 1280px) {
	.guide .prose .alignwide,
	.guide .prose .alignfull { width: calc(100% + 3rem); margin-inline: -1.5rem; }
}

/* The cookie button is printed with [hidden] until Zaraz is running; the
   display rule above was overriding that and showing a dead button. */
.colophon__btn[hidden] { display: none; }

/* Block tables: break between words, not inside them, and let narrow screens
   size columns by their content. */
.prose .wp-block-table td,
.prose .wp-block-table th { word-break: normal; overflow-wrap: break-word; }
@media (max-width: 640px) {
	.prose .wp-block-table table { table-layout: auto; }
	/* Room for the back-to-top button so it never sits on the last footer line. */
	.site-footer { padding-bottom: 72px; }
}

/* ---- Instant search results (wp.js) ---------------------------------- */
.searchbox__results { max-height: min(60vh, 520px); padding: var(--s-4) var(--s-5) var(--s-5); overflow-y: auto; border-top: var(--rule) solid var(--line); }
.searchbox__results[hidden] { display: none; }
.searchbox__label { margin: var(--s-4) var(--s-3) var(--s-3); font-family: var(--font-hud); font-size: var(--t-xs); font-weight: 700; letter-spacing: var(--track-hud); text-transform: uppercase; color: var(--fg-muted); }
.searchbox__games { display: flex; flex-wrap: wrap; gap: var(--s-3); padding: 0 var(--s-3); }
.searchbox__game { display: inline-flex; align-items: baseline; gap: var(--s-3); padding: var(--s-3) var(--s-5); color: var(--fg); font-weight: 700; text-decoration: none; background: var(--bg-card); border: var(--rule) solid var(--line); border-radius: var(--radius-pill); }
.searchbox__game small { font-family: var(--font-hud); font-size: var(--t-xs); font-weight: 500; letter-spacing: var(--track-hud); text-transform: uppercase; color: var(--fg-muted); }
.searchbox__list { margin: 0; padding: 0; list-style: none; }
.searchbox__hit { display: block; padding: var(--s-4) var(--s-3); color: var(--fg); font-weight: 600; line-height: var(--lh-snug); text-decoration: none; border-radius: var(--radius); }
.searchbox__all { display: block; margin-top: var(--s-4); padding: var(--s-4) var(--s-3); font-family: var(--font-hud); font-size: var(--t-sm); font-weight: 700; letter-spacing: var(--track-hud); text-transform: uppercase; color: var(--accent-text); text-decoration: none; border-top: var(--rule) solid var(--line-soft); border-radius: 0 0 var(--radius) var(--radius); }
.searchbox__hit:hover, .searchbox__hit:focus-visible, .searchbox__all:hover, .searchbox__all:focus-visible { color: var(--fg); background: var(--accent-wash); outline: none; }
.searchbox__game:hover, .searchbox__game:focus-visible { border-color: var(--accent); outline: none; }
.searchbox__empty { margin: 0; padding: var(--s-5) var(--s-3); color: var(--fg-muted); }

/* ---- "What changed" line on an updated guide (Guide options box) ------ */
.notice--update { border-color: color-mix(in srgb, var(--tone-good) 45%, transparent); background: color-mix(in srgb, var(--tone-good) 8%, var(--bg-raised)); }
.notice--update strong { color: var(--tone-good); }

/* ---- Phone polish, October 2026 --------------------------------------- */
@media (max-width: 620px) {
	/* Games page filters: the label's 76px was a width for the desktop row. Stacked
	   on a phone it became 76px of height, leaving a hole above the chips. */
	.gamefilters__label { flex: 0 0 auto; }
	/* The homepage hero cut long guide titles off after four lines. */
	.hero__title { -webkit-line-clamp: 6; }
}
@media (max-width: 420px) {
	/* Keep the five share buttons on one line instead of orphaning the last. */
	.share { gap: var(--s-2); }
	.share__btn:not(.share__btn--icon) { padding-inline: var(--s-4); }
}

/* ---- Up next: same-game posts at the end of a guide -------------------- */
.upnext { margin-top: var(--s-9); padding: var(--s-6); background: var(--bg-raised); border: var(--rule) solid var(--line); border-radius: var(--radius-lg); }
.upnext__head { margin: 0 0 var(--s-5); font-family: var(--font-hud); font-size: var(--t-sm); font-weight: 700; letter-spacing: var(--track-hud); text-transform: uppercase; color: var(--game-text, var(--accent-text)); }
.upnext__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.upnext__link { display: flex; flex-direction: column; gap: var(--s-3); height: 100%; padding: var(--s-5); color: var(--fg); text-decoration: none; background: var(--bg-card); border: var(--rule) solid var(--line-soft); border-left: 3px solid var(--game, var(--accent)); border-radius: var(--radius); transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.upnext__link:hover, .upnext__link:focus-visible { border-color: var(--game, var(--accent)); transform: translateY(-2px); outline: none; }
.upnext__tags { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.upnext__title { font-weight: 700; line-height: var(--lh-snug); }

/* ---- "Checkpoint saved" resume prompt (wp.js) -------------------------- */
.spot { position: fixed; left: var(--s-6); bottom: var(--s-6); z-index: 45; display: flex; align-items: center; gap: var(--s-5); max-width: min(440px, calc(100vw - 2 * var(--s-6) - 64px)); padding: var(--s-4) var(--s-4) var(--s-4) var(--s-6); color: var(--fg); background: var(--bg-raised); border: var(--rule) solid var(--accent-edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-lift), 0 0 40px -18px var(--accent-glow); animation: spot-in var(--dur-slow) var(--ease-pop) both; }
.spot__text { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.spot__label { font-family: var(--font-hud); font-size: var(--t-xs); font-weight: 700; letter-spacing: var(--track-hud); text-transform: uppercase; color: var(--accent-text); }
.spot__where { overflow: hidden; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.spot__go { flex: 0 0 auto; }
.spot__close { flex: 0 0 auto; width: 32px; height: 32px; font-size: 20px; line-height: 1; color: var(--fg-muted); background: none; border: 0; border-radius: var(--radius); cursor: pointer; }
.spot__close:hover { color: var(--fg); background: var(--fg-faint); }
.spot__close:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
@keyframes spot-in { from { opacity: 0; transform: translateY(16px); } }
@media (prefers-reduced-motion: reduce) { .spot { animation: none; } }
@media print { .spot, .tiershot, .upnext { display: none !important; } }

/* ---- Tier list "Save as image" button ---------------------------------- */
.tiershot { margin-top: var(--s-4); }
.tiershot__btn { cursor: pointer; }

/* ---- Final sweep, October 2026 ---------------------------------------- */

/* The search page form is a grid item; without this it grew to the input's
   natural width and pushed the Search button off a phone screen. */
.searchbox__form--page { width: 100%; min-width: 0; }

@media (max-width: 620px) {
	/* Resume prompt: full width above the back-to-top button, label on one line. */
	.spot { left: var(--s-5); right: var(--s-5); bottom: 76px; max-width: none; gap: var(--s-4); padding-left: var(--s-5); }
	.spot__text { flex: 1 1 auto; }
	.spot__label { white-space: nowrap; }
}
@media (max-width: 420px) {
	.share__btn:not(.share__btn--icon) { padding-inline: var(--s-3); }
}

/* Phones zoom the whole page when a focused field has text under 16px. The sort
   menus were 14px. */
@media (max-width: 620px) {
	.libsort__select,
	.comment-form input[type="text"],
	.comment-form input[type="email"],
	.comment-form input[type="url"] { font-size: 16px; }
}
