/* Inline icons in text, headings and table cells. */
img.gtam-guide-icon { display: inline-block; width: 1.75em; height: 1.75em; object-fit: contain; vertical-align: middle; margin: 0 .45em 0 0; }
img.gtam-guide-icon.is-dark { background: #24492a; border-radius: 6px; padding: 3px; box-sizing: border-box; }

/* Image beside text: character cards and collectible intros. */
.gtam-char-card, .gtam-intro-art { display: flex; gap: var(--wp--preset--spacing--40, 1rem); align-items: flex-start; margin-block: var(--wp--preset--spacing--40, 1rem); }
.gtam-char-card > .wp-block-image, .gtam-intro-art > .wp-block-image { flex: 0 0 auto; width: 9rem; margin: 0; }
.gtam-intro-art > .wp-block-image { width: 5rem; }
.gtam-char-card > .wp-block-image img, .gtam-intro-art > .wp-block-image img { display: block; width: 100%; height: auto; border-radius: var(--wp--custom--radius--sm, 4px); }
.gtam-char-card > .wp-block-group, .gtam-intro-art > .wp-block-group { flex: 1 1 0; min-width: 0; margin: 0; }
.gtam-char-card h3 { margin-top: 0; }
@media (max-width: 34rem) {
	.gtam-char-card { flex-direction: column; align-items: stretch; }
	.gtam-char-card > .wp-block-image { width: 100%; max-width: 16rem; }
	.gtam-intro-art > .wp-block-image { width: 3.5rem; }
}

/* Long tables scroll inside their own box on narrow screens. */
.wp-block-table { overflow-x: auto; }
.wp-block-table table { width: 100%; }
.gtam-facts-table th { text-align: left; width: 34%; }
.gtam-table-wrap .wp-block-table { margin: 0; }

/* Several screenshots to a row of a location table. */
.gtam-col-shot .gtam-shots { display: flex; flex-wrap: wrap; gap: .4rem; }
.gtam-col-shot .gtam-shots img { cursor: zoom-in; }
@media (max-width: 781px) {
	.wp-block-gtam-collectible-table.is-cards .gtam-col-shot .gtam-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); }
}

/* Sortable vehicle database. */
#veh-table td:first-child img { display: block; width: 6rem; max-width: none; height: auto; border-radius: var(--wp--custom--radius--sm, 4px); }
.veh-filter input, .veh-filter select { padding: .45rem .6rem; border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--sm, 4px); background: var(--wp--preset--color--paper-2); color: var(--wp--preset--color--text); font: inherit; }

#veh-table { width: 100%; border-collapse: collapse; }
#veh-table th, #veh-table td { padding: .5rem .6rem; border: 1px solid var(--wp--preset--color--line); text-align: left; }
#veh-table thead th { border-bottom: 3px solid var(--wp--preset--color--text); }

/* Screenshot rows always end flush: three across from tablet up, and a short last row widens to fill. */
@media (min-width: 600px) {
	.wp-block-gtam-screenshot-set.is-layout-3 > *, .wp-block-gtam-screenshot-set.is-layout-3p3 > * { grid-column: span 2; }
	.wp-block-gtam-screenshot-set.is-layout-3p3 > :last-child:nth-child(3n+1) { grid-column: span 6; }
	.wp-block-gtam-screenshot-set.is-layout-3p3 > :last-child:nth-child(3n+2), .wp-block-gtam-screenshot-set.is-layout-3p3 > :nth-last-child(2):nth-child(3n+1) { grid-column: span 3; }
}

/* Small sources: shown at their real size, never stretched. */
.wp-block-gtam-screenshot-set .is-small-source img { object-fit: scale-down; background: #14161b; }
.entry-content > figure.is-natural-size, .gtam-step__body > figure.is-natural-size { text-align: center; }
.entry-content > figure.is-natural-size img, .gtam-step__body > figure.is-natural-size img { display: inline-block; width: auto; max-width: 100%; height: auto; }
.entry-content > figure.wp-block-image:not(.is-natural-size) img { width: 100%; height: auto; }

/* The footer stays at the bottom of the window on short pages. */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > .gtam-main, .wp-site-blocks > main { flex: 1 0 auto; }

/* Long unbroken text wraps instead of widening the page. */
.entry-content { overflow-wrap: break-word; }
.entry-content li, .entry-content p { overflow-wrap: anywhere; }

/* Tall art stays within the window, and photos in tables stay thumbnail-sized. */
.entry-content > figure.is-natural-size img { max-height: 80vh; }
.wp-block-table td img:not(.gtam-guide-icon) { display: block; width: 100%; max-width: 12rem; height: auto; border-radius: var(--wp--custom--radius--sm, 4px); }

/* A single small picture sits at its own size, without an empty frame around it. */
.wp-block-gtam-screenshot-set > figure.is-small-source:only-child { text-align: center; }
.wp-block-gtam-screenshot-set.has-aspect > figure.is-small-source:only-child img { display: inline-block; width: auto; max-width: 100%; aspect-ratio: auto; background: none; }

/* Map layer dots (map hub cards and topic hubs). The map app's own styles are in map.css. */
.gtam-map__dot { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; flex: none; box-sizing: border-box; border: 2px solid var(--pin, #f08a3c); border-radius: 50%; background: #14161b; overflow: hidden; }
.gtam-map__dot img { width: 72%; height: 72%; object-fit: contain; }
.gtam-map__dot img.is-drawing { filter: invert(1); }

/* Map hub. */
.wp-block-gtam-map-hub[hidden], .gtam-maphub__group[hidden], .gtam-mapcard[hidden], .gtam-maphub__find[hidden], .gtam-maphub__none[hidden] { display: none; }
.gtam-maphub__stats { margin: 0 0 var(--wp--preset--spacing--30); color: var(--wp--preset--color--text-muted); }
.gtam-maphub__find { display: grid; gap: .6rem; margin-bottom: var(--wp--preset--spacing--40); }
.gtam-maphub__find input { box-sizing: border-box; width: 100%; min-height: 48px; padding: .5rem .8rem; border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--sm, 4px); background: var(--wp--preset--color--paper-2); color: var(--wp--preset--color--text); font: inherit; }
.gtam-maphub__quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.gtam-maphub__quick button { min-height: 40px; padding: .3rem .75rem; border: 1px solid var(--wp--preset--color--line); border-radius: 999px; background: transparent; color: var(--wp--preset--color--text); font: inherit; font-size: var(--wp--preset--font-size--sm); cursor: pointer; }
.gtam-maphub__quick button:hover { background: var(--wp--preset--color--paper-2); }
.gtam-maphub__quick button:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.gtam-mapcard__jump[hidden] { display: none; }
.gtam-mapcard__jump { margin: 0; }
.gtam-mapcard__jump a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: .3rem .75rem; border-radius: var(--wp--custom--radius--sm, 4px); border-left: 4px solid var(--gtam-game-accent, var(--wp--preset--color--accent)); background: var(--wp--preset--color--text); color: var(--wp--preset--color--paper, #f4ecdc); font-weight: 600; font-size: var(--wp--preset--font-size--sm); text-decoration: none; }
.gtam-mapcard__jump a::after { content: " \2192"; white-space: pre; }
.gtam-mapcard__jump a:hover { text-decoration: underline; }
.gtam-maphub__quick button[aria-pressed="true"] { background: var(--wp--preset--color--text); border-color: var(--wp--preset--color--text); color: var(--wp--preset--color--paper, #f4ecdc); }
.gtam-maphub__none { margin: 0; font-weight: 600; }
.gtam-maphub__group { margin-top: var(--wp--preset--spacing--50); }
.gtam-maphub__group h2 { margin: 0 0 var(--wp--preset--spacing--30); }
.gtam-maphub__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: var(--wp--preset--spacing--40); }
.gtam-mapcard { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--wp--preset--color--line); border-top: 3px solid var(--gtam-game-accent, var(--wp--preset--color--accent)); border-radius: var(--wp--custom--radius--sm, 4px); background: var(--wp--preset--color--paper-2); }
.gtam-mapcard__art { display: block; background: #14161b; }
.gtam-mapcard__art img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; transition: transform .2s; }
.gtam-mapcard:hover .gtam-mapcard__art img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .gtam-mapcard__art img { transition: none; } .gtam-mapcard:hover .gtam-mapcard__art img { transform: none; } }
.gtam-mapcard__art { overflow: hidden; }
.gtam-mapcard__body { display: grid; gap: .5rem; padding: var(--wp--preset--spacing--30); }
.gtam-mapcard__body h3 { margin: 0; font-size: var(--wp--preset--font-size--xl); }
.gtam-mapcard__body h3 a { color: inherit; text-decoration: none; }
.gtam-mapcard__body h3 a:hover { text-decoration: underline; }
.gtam-mapcard__meta { margin: 0; font-size: var(--wp--preset--font-size--sm); color: var(--wp--preset--color--text-muted); }
.gtam-mapcard__layers { display: grid; gap: .1rem; margin: 0; padding: 0; list-style: none; font-size: var(--wp--preset--font-size--sm); }
.gtam-mapcard__layers a { display: flex; gap: .45rem; align-items: center; min-height: 36px; color: inherit; text-decoration: none; }
.gtam-mapcard__layers a:hover { text-decoration: underline; }
.gtam-mapcard__layers small { margin-left: auto; color: var(--wp--preset--color--text-muted); }
.gtam-mapcard__more a { color: var(--wp--preset--color--text-muted); }

/* Map hub cards: a fixed-shape preview, with the box art telling apart games that share a map. */
.gtam-mapcard__art { position: relative; aspect-ratio: 16/9; }
.gtam-mapcard__art .gtam-mapcard__map { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.gtam-mapcard__art .gtam-mapcard__cover { position: absolute; left: .6rem; bottom: .6rem; width: auto; height: 62%; aspect-ratio: auto; object-fit: contain; border-radius: 3px; box-shadow: 0 2px 10px rgb(0 0 0 / .55); transform: none !important; }
@media (min-width: 782px) { .gtam-maphub__group:first-of-type .gtam-maphub__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 781px) { .gtam-mapcard__layers li:nth-child(n+4):not(.gtam-mapcard__more) { display: none; } }
.gtam-mapcard__art .gtam-mapcard__cover { aspect-ratio: 480/592; object-fit: cover; background: #14161b; }

/* Topic hubs and game hubs share the Map Hub card. */
.wp-block-gtam-game-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: var(--wp--preset--spacing--40); margin-block: var(--wp--preset--spacing--40); }
.gtam-seccard h3 { display: flex; gap: .5rem; align-items: center; }
.gtam-seccard h3 .gtam-icon { flex: none; width: 1.25em; height: 1.25em; color: var(--gtam-game-accent, var(--wp--preset--color--accent)); }
.gtam-seccard h3 .gtam-icon svg, .gtam-mapcard__layers a .gtam-icon svg { display: block; width: 100%; height: 100%; }
.gtam-mapcard__layers a .gtam-icon { flex: none; width: 1.1em; height: 1.1em; color: var(--wp--preset--color--text-muted); }
.gtam-mapcard__art:not(:has(.gtam-mapcard__map)) { background: linear-gradient(135deg, var(--gtam-game-accent, #333), #14161b); }

/* Name lists and credits on reference pages. */
.gtam-namelist { columns: 9rem; column-gap: var(--wp--preset--spacing--40); margin: 0 0 var(--wp--preset--spacing--40); padding-left: 1.1rem; }
.gtam-namelist li { break-inside: avoid; margin-bottom: .2rem; }
.gtam-source { margin-top: var(--wp--preset--spacing--50); padding-top: var(--wp--preset--spacing--30); border-top: 1px solid var(--wp--preset--color--line); font-size: var(--wp--preset--font-size--sm); color: var(--wp--preset--color--text-muted); }

/* Hub cards show all their links on phones; the Map Hub keeps its shorter list. */
.wp-block-gtam-topic-hub .gtam-mapcard__layers li:nth-child(n+1), .wp-block-gtam-game-sections .gtam-mapcard__layers li:nth-child(n+1) { display: list-item; }
