/*
 * The six D68 pages (task pages1124 · DESIGN-SPEC §11): Museums and Partnership · Index · 5.1 Museum Passport ·
 * 5.2 Card-and-Art Game · 5.3 How BIG? How small? · 5.5 Shared Histories. Desktop = Figma 1440 (container 1120 at x=160,
 * content starts y=150 under the header, vertical gap 50). Komet weights follow the PostScript names: Figma 500 → 400,
 * 600 → 500, 700 → 700, 800 → 800, 400 → 300 (tokens.css).
 * Tablet 768–1023: same layout, fluid. Mobile ≤767: columns stack, grids go 2 / 1 per row, nothing scrolls sideways (D5).
 */

.sh-p1124 {
	--sh-p1124-gap: 50px;
	--sh-p1124-teal: #00a7ad;     /* Figma #00A7AD: download links 5.3 / 5.5 */
	--sh-p1124-card-line: #8e775a; /* 5.2 row border */
	display: flex;
	flex-direction: column;
	gap: var(--sh-p1124-gap);
	padding-bottom: 10px;         /* footer.php adds 40 above its logos: Figma gap 50 */
}

:where(.sh-p1124) img {
	display: block;
	max-width: 100%;
	height: auto;
}

.sh-p1124__title {
	margin: 0;
	font: var(--sh-type-page-title); /* Komet 800 36/45 */
	color: var(--sh-color-neutral-900);
}

.sh-p1124__copy {
	font: var(--sh-type-body-home); /* Komet 500 18/22 */
	color: var(--sh-color-black);
	text-align: justify;
}

.sh-p1124__copy p {
	margin: 0;
}

.sh-p1124__copy p + p {
	margin-top: 22px;
}

/* D78: run in Komet Regular SC Italic (5.1 "Along Animal Trails" · 5.2 "The Spirit" / "The Form" / "The Soul") */
.sh-p1124__copy em.sh-sc {
	font-style: italic;
	font-variant: small-caps;
}

/* ---- Back after the footer (inc/pages-1124.php): footer.php leaves 135 below its logos, Figma/§11.0 uses 110 ---- */
.sh-p1124-back {
	margin-top: -25px;
	padding-bottom: 75px;
}

/* ==== Museums and Partnership ======================================================================= */
.sh-mp {
	gap: 40px;
	padding-top: 40px;
	padding-bottom: 45px;
}

.sh-pg1124--museums .sh-footer {
	display: none; /* row 1 of the Figma frame is the footer */
}

.sh-mp__support {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: center;
	gap: var(--sh-footer-gap);
	padding-block: var(--sh-footer-pad-block);
}

.sh-mp__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 35px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* D70(1): the second logo row (Figma row 3 · the slot after the grey box is now the National Museum Bangkok logo) has a 32 gap, the others 35. */
.sh-mp__row--2 {
	gap: 32px;
}

.sh-mp__cell {
	height: 144px;
}

.sh-mp__logo {
	width: auto;
	height: 144px;
	max-width: 100%;
	object-fit: contain;
}

.sh-mp__cell--placeholder {
	width: 237px;
	max-width: 100%;
	background: rgba(0, 0, 0, 0.2); /* Figma fill #000000 @20% */
}

.sh-mp__credits {
	font: var(--sh-type-collection); /* Komet 500 20/25 */
	color: var(--sh-color-neutral-900);
	text-align: center;
}

.sh-mp__credits strong,
.sh-mp__credits b {
	font: var(--sh-type-collection-bold);
}

.sh-mp__group {
	margin: 0 0 25px;
}

/* ==== Index ========================================================================================= */
.sh-index {
	gap: 10px;
	padding-top: 40px;
	padding-bottom: 48px;
}

.sh-index__title {
	margin: 0;
	font: 700 34px/42.5px var(--sh-font-komet); /* Figma Komet 700 34/42.5 */
	color: var(--sh-color-neutral-900);
}

.sh-index__item {
	margin: 0;
	font: var(--sh-type-collection); /* Komet 500 20/25 */
	color: var(--sh-color-neutral-900);
	overflow-wrap: break-word;
}

.sh-index__item + .sh-index__item { margin-top: 12px; } /* space between bibliography entries · all widths */

.sh-index__link {
	color: inherit;                 /* Figma keeps #212529 */
	font-weight: var(--sh-fw-komet-bold);
	text-decoration: underline;
}

.sh-index__link:focus-visible {
	outline: 2px solid var(--sh-color-accent);
	outline-offset: 2px;
}

/* ==== 5.1 Museum Passport ============================================================================ */
.sh-pp__hero-img {
	width: 100%;
	aspect-ratio: 1120 / 585;
	object-fit: fill;
}

.sh-pp__row {
	display: grid;
	grid-template-columns: minmax(0, 549fr) minmax(0, 551fr);
	column-gap: 20px;
	align-items: start;

	min-height: 416px; /* Figma Frame 114493 [160,785 1120×416] → 10 covers start y=1251 */
}

.sh-pp__text {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding-top: 40px;
}

.sh-pp__cover {
	display: flex;
	justify-content: center;
}

.sh-pp__cover-img {
	width: auto;
	height: 384px;
	max-width: 100%;
	object-fit: contain;
}

.sh-pp__colors {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 184px));
	justify-content: space-between;
	gap: 50px 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sh-pp__color-img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}

/* ==== 5.2 Card-and-Art Game ========================================================================== */
.sh-cg__hero-img {
	width: 100%;
	aspect-ratio: 1120 / 499;
	object-fit: cover; /* D73: the picture fills the box (crops top / bottom) */
}

.sh-cg__text {
	display: flex;
	flex-direction: column;
	gap: 20px;
	max-width: 739px;

	min-height: 281px; /* Figma text block [160,699 1120×281] (incl. the hidden gif slot) → rows start y=1030 */
}

.sh-cg__rows {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.sh-cg__row {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 294px;
	margin: 0;
	padding: 20px;
	border: 2px solid var(--sh-p1124-card-line);
	border-radius: 0;
	background: transparent;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.sh-cg__row:disabled {
	cursor: default;
}

.sh-cg__row:focus-visible {
	outline: 3px solid var(--sh-color-accent);
	outline-offset: 3px;
}

.sh-cg__card {
	width: 172px;
	height: 250px;
	object-fit: fill;
	transition: transform var(--sh-duration-card) var(--sh-ease);
}

.sh-cg__card.is-flipping {
	transform: scaleX(0);
}

.sh-cg__download {
	display: flex;
	justify-content: center;
}

.sh-cg__button {
	display: inline-block;
	margin: 0;
	padding: 10px 20px;
	border: 1px solid var(--sh-color-neutral-600);
	border-radius: 30px;
	background: transparent;
	color: var(--sh-color-neutral-900);
	font: var(--sh-fw-komet-light) 24px/30px var(--sh-font-komet); /* Figma Komet 400 24/30 */
	cursor: pointer;
	transition: background-color var(--sh-duration-nav) var(--sh-ease);
}

.sh-cg__button:hover,
.sh-cg__button:focus-visible {
	background: var(--sh-color-neutral-100);
}

.sh-cg__button:focus-visible {
	outline: 3px solid var(--sh-color-accent);
	outline-offset: 3px;
}

.sh-cg__button[aria-busy="true"] {
	opacity: 0.6;
	cursor: progress;
}

.sh-cg__template {
	display: flex;
	justify-content: center;
}

.sh-cg__template-img {
	width: 600px;
	max-width: 100%;
	aspect-ratio: 600 / 852;
	object-fit: fill;
}

.sh-cg__hashtag {
	margin: 0;
	font: var(--sh-fw-komet-light) 28px/35px var(--sh-font-komet); /* Figma Komet 400 28/35 */
	color: var(--sh-color-neutral-900);
	text-align: center;
}

/* ==== 5.3 How BIG? How small? ======================================================================== */
.sh-hb {
	gap: 0;
}

.sh-hb__hero-img {
	width: 100%;
	aspect-ratio: 1120 / 705;
	object-fit: fill;
}

.sh-hb__carousel {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr) 28px;
	align-items: center;
	margin-top: var(--sh-p1124-gap);
	height: 146px; /* D72: Figma carousel 1120×146 (was 121) */
}

.sh-hb__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 57px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--sh-color-black);
	cursor: pointer;
}

.sh-hb__arrow:focus-visible {
	outline: 2px solid var(--sh-color-accent);
}

.sh-hb__arrow:disabled {
	opacity: 0.25; /* only a row longer than 5 · at its end */
	cursor: default;
}

.sh-hb__arrow[aria-disabled="true"] {
	cursor: default; /* nothing to scroll (5 pieces or fewer): drawn solid #000 as in Figma */
}

/* D72: a window of 5 slots (213×146 · 1064 wide) · more than 5 visible pieces: the arrows move the row one slot (--sh-hb-off) ·
   fewer than 5: the slots stand in the middle and the arrows do nothing. The 1px overlap of the slots keeps one line between them. */
.sh-hb__viewport {
	min-width: 0;
	padding-right: 1px;
	overflow: hidden;
}

html:not(.sh-js) .sh-hb__viewport {
	overflow-x: auto;
}

.sh-hb__items {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translateX(calc(var(--sh-hb-off, 0) * -20%));
	transition: transform 0.25s ease;
}

.sh-hb__items--few {
	justify-content: center;
}

.sh-hb__item {
	flex: 0 0 calc(20% + 1px);
	min-width: 0;
	margin-right: -1px;
	border: 1px solid var(--sh-color-black);
}

.sh-hb__pick {
	display: block;
	width: 100%;
	height: 144px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	overflow: hidden;
}

.sh-hb__pick:focus-visible {
	outline: 3px solid var(--sh-color-accent);
	outline-offset: -3px;
}

.sh-hb__thumb {
	width: 100%;
	height: 144px;
	object-fit: fill;
}

.sh-hb__thumb--active {
	display: none;
}

.sh-hb__pick:hover .sh-hb__thumb--active,
.sh-hb__pick:focus-visible .sh-hb__thumb--active,
.sh-hb__pick[aria-pressed="true"] .sh-hb__thumb--active {
	display: block;
}

.sh-hb__pick:hover .sh-hb__thumb:not(.sh-hb__thumb--active),
.sh-hb__pick:focus-visible .sh-hb__thumb:not(.sh-hb__thumb--active),
.sh-hb__pick[aria-pressed="true"] .sh-hb__thumb:not(.sh-hb__thumb--active) {
	display: none;
}

/* A piece with only one carousel picture keeps showing it. */
.sh-hb__pick:hover .sh-hb__thumb:only-child,
.sh-hb__pick:focus-visible .sh-hb__thumb:only-child,
.sh-hb__pick[aria-pressed="true"] .sh-hb__thumb:only-child {
	display: block;
}

.sh-hb__panel {
	margin-top: var(--sh-p1124-gap);
}

.sh-hb__panel--empty,
.sh-js .sh-hb__panel--empty.is-active {
	display: none;
}

.sh-js .sh-hb__panel {
	display: none;
}

.sh-js .sh-hb__panel.is-active:not(:empty) {
	display: block;
}

.sh-hb__pair {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sh-hb__cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 0;
}

.sh-hb__img {
	width: 100%;
	aspect-ratio: 560 / 426;
	object-fit: contain;
}

.sh-hb__download {
	display: flex;
	flex-direction: column;
	gap: 5px;
	width: 100%;
	margin: 0;
	padding-top: 0;
	font: var(--sh-type-card-title); /* Komet 800 20/25 */
	text-align: center;
}

.sh-hb__create {
	color: var(--sh-color-black);
}

.sh-hb__link {
	color: var(--sh-p1124-teal);
	text-decoration: none;
}

.sh-hb__link:hover,
.sh-hb__link:focus-visible {
	text-decoration: underline;
}

.sh-hb__band {
	margin-top: var(--sh-p1124-gap);
}

.sh-hb__band-img {
	width: 100%;
	max-height: 228px;
	object-fit: contain;
}

/* ==== 5.5 Shared Histories =========================================================================== */
.sh-sh {
	gap: 40px;
	padding-top: 40px;
}

.sh-sh__title {
	margin: 0;
	padding-bottom: 40px; /* Frame 12683 [160,150 1120×125] pad 40/40 → grid at y=315 */
	font: var(--sh-type-page-title); /* Komet 800 36/45 */
	letter-spacing: 1.44px;          /* Figma 4% */
	color: #413b2d;
	text-align: center;
}

.sh-sh__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 250px));
	justify-content: space-between;
	gap: 50px 40px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sh-sh__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.sh-sh__img {
	width: 100%;
	aspect-ratio: 250 / 354;
	object-fit: cover;
}

.sh-sh__link {
	font: var(--sh-fw-komet-medium) 20px/25px var(--sh-font-komet); /* Figma Komet 600 20/25 */
	color: var(--sh-p1124-teal);
	text-decoration: underline;
}

.sh-sh__link:focus-visible {
	outline: 2px solid var(--sh-color-accent);
	outline-offset: 2px;
}

/* ==== Tablet (768–1023) ==================================================================================== */
@media (max-width: 1023px) {
	.sh-mp__logo {
		height: auto;
		max-height: 144px;
		max-width: 100%;
	}

	.sh-mp__cell {
		height: auto;
		max-width: 100%;
	}

	.sh-mp__cell--placeholder {
		height: 144px;
	}

	.sh-pp__cover-img {
		height: auto;
		max-height: 384px;
	}

	.sh-hb__pick,
	.sh-hb__thumb {
		height: auto;
		aspect-ratio: 213 / 146;
	}

	.sh-hb__carousel {
		height: auto;
	}
}

/* ==== Mobile (≤767) ======================================================================================== */
@media (max-width: 767px) {
	.sh-p1124 {
		--sh-p1124-gap: 30px;
	}

	.sh-cg__text,
	.sh-pp__row {
		min-height: 0;
	}

	.sh-p1124__title {
		font-size: 28px;
		line-height: 35px;
	}

	.sh-index__title {
		font-size: 28px;
		line-height: 35px;
	}

	.sh-mp__row {
		gap: 20px;
	}

	.sh-pp__row {
		grid-template-columns: minmax(0, 1fr);
	}

	.sh-pp__text {
		padding-top: 0;
	}

	.sh-pp__colors {
		grid-template-columns: repeat(2, minmax(0, 184px));
		gap: 20px 0;
	}

	.sh-cg__row {
		min-height: 0;
		padding: 15px;
	}

	.sh-cg__card {
		width: 129px;
		height: 188px;
	}

	.sh-cg__button {
		font-size: 20px;
		line-height: 26px;
	}

	.sh-cg__hashtag {
		font-size: 22px;
		line-height: 28px;
	}

	/* Phone: no room for 5 slots in a row — all the pieces wrap 3 per row (nothing to scroll → no arrows). */
	.sh-hb__carousel {
		grid-template-columns: minmax(0, 1fr);
	}

	.sh-hb__arrow {
		display: none;
	}

	.sh-hb__viewport {
		padding-bottom: 1px;
	}

	.sh-hb__items {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		transform: none;
	}

	.sh-hb__item {
		margin-bottom: -1px;
	}

	.sh-hb__pair {
		grid-template-columns: minmax(0, 1fr);
	}

	.sh-hb__download {
		font-size: 18px;
		line-height: 23px;
	}

	.sh-sh__grid {
		grid-template-columns: repeat(2, minmax(0, 250px));
		gap: 30px 20px;
	}

	.sh-sh__title {
		font-size: 28px;
		line-height: 35px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sh-cg__card,
	.sh-hb__items {
		transition: none;
	}
}
