/*
 * Something Historic Museums: front-end styles.
 *
 * Colours come from the Something Historic theme's tokens (--sh-*), so the
 * museum pages follow its light and dark modes; the fallbacks keep them
 * looking right in any other theme. The banners are always dark, like a
 * film poster. Logical properties keep Urdu (RTL) pages mirrored.
 */

.shm-page,
.shm-embed {
	--shm-bg: var(--sh-bg, #f4ecd8);
	--shm-surface: var(--sh-surface, #fbf6ea);
	--shm-surface-2: var(--sh-surface-2, #ede1c4);
	--shm-text: var(--sh-text, #2b2118);
	--shm-muted: var(--sh-muted, #6f5d4a);
	--shm-border: var(--sh-border, #dcc9a3);
	--shm-accent: var(--sh-accent, #b08d3c);
	--shm-accent-strong: var(--sh-accent-strong, #7a5a1e);
	--shm-heading: var(--sh-font-heading, "Playfair Display", Georgia, serif);
	--shm-night: #0b0907;
	--shm-gold: #e2c387;
	--shm-radius: 10px;
	--shm-gutter: clamp(16px, 4vw, 56px);
	--shm-card-w: clamp(240px, 26vw, 340px);
}

body.shm-page { overflow-x: clip; }

/* Let our pages use the full width inside GeneratePress and similar themes. */
.shm-page .site-content,
.shm-page .site-main.shm-main { padding: 0; margin: 0; }
.shm-page .site.grid-container,
.shm-page .site-content.grid-container { max-width: none; }
.shm-page .content-area.shm-content-area { width: 100%; float: none; }

.shm-wrap {
	max-width: 1480px;
	margin-inline: auto;
	padding-inline: var(--shm-gutter);
}

.shm-bleed {
	width: 100vw;
	margin-inline: calc(50% - 50vw);
}

.shm-icon { flex: none; vertical-align: -0.2em; }
html[dir="rtl"] .shm-icon--prev,
html[dir="rtl"] .shm-icon--next { transform: scaleX(-1); }

/* Billboard (the big cinematic banner) ---------------------------------- */

.shm-billboard {
	position: relative;
	display: grid;
	min-height: clamp(460px, 78vh, 780px);
	background: var(--shm-night);
	color: #fff;
	overflow: hidden;
	isolation: isolate;
}

.shm-billboard--single { min-height: clamp(440px, 72vh, 720px); }
.shm-billboard--term { min-height: clamp(300px, 46vh, 460px); }

.shm-billboard__slide {
	grid-area: 1 / 1;
	position: relative;
	display: flex;
	align-items: flex-end;
	opacity: 0;
	transition: opacity 0.9s ease;
}

.shm-billboard__slide[hidden] { display: flex; visibility: hidden; }
.shm-billboard__slide.is-active { opacity: 1; visibility: visible; z-index: 1; }

.shm-billboard__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: -2;
	transform: scale(1.06);
	transition: transform 9s ease-out;
}

.shm-billboard__slide.is-active .shm-billboard__image { transform: scale(1); }

.shm-billboard__slide::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(to top, var(--shm-bg) 0%, rgb(11 9 7 / 0%) 22%),
		linear-gradient(90deg, rgb(11 9 7 / 92%) 0%, rgb(11 9 7 / 70%) 34%, rgb(11 9 7 / 18%) 68%, rgb(11 9 7 / 0%) 100%),
		linear-gradient(to bottom, rgb(11 9 7 / 55%) 0%, rgb(11 9 7 / 0%) 26%);
}

html[dir="rtl"] .shm-billboard__slide::before {
	background:
		linear-gradient(to top, var(--shm-bg) 0%, rgb(11 9 7 / 0%) 22%),
		linear-gradient(270deg, rgb(11 9 7 / 92%) 0%, rgb(11 9 7 / 70%) 34%, rgb(11 9 7 / 18%) 68%, rgb(11 9 7 / 0%) 100%),
		linear-gradient(to bottom, rgb(11 9 7 / 55%) 0%, rgb(11 9 7 / 0%) 26%);
}

.shm-billboard.no-image .shm-billboard__slide {
	background:
		radial-gradient(ellipse at 75% 30%, rgb(226 195 135 / 28%), transparent 55%),
		linear-gradient(135deg, #1d150e, #0b0907);
}

.shm-billboard__content {
	width: 100%;
	max-width: 1480px;
	margin-inline: auto;
	padding: clamp(96px, 14vh, 160px) var(--shm-gutter) clamp(56px, 10vh, 110px);
}

.shm-billboard__content > * { max-width: 40rem; }

.shm-billboard__title {
	margin: 0 0 0.25em;
	font-family: var(--shm-heading);
	font-size: clamp(2.3rem, 5.6vw, 4.6rem);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.01em;
	color: #fff;
	text-shadow: 0 2px 24px rgb(0 0 0 / 45%);
	text-wrap: balance;
}

.shm-billboard--term .shm-billboard__title { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }

.shm-billboard__tagline {
	margin: 0 0 1rem;
	font-size: clamp(1.05rem, 1.7vw, 1.35rem);
	line-height: 1.5;
	color: rgb(255 255 255 / 88%);
	text-wrap: pretty;
}

.shm-eyebrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75em;
	margin: 0 0 0.9rem;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgb(255 255 255 / 80%);
}

.shm-eyebrow__mark {
	padding: 0.3em 0.75em;
	border-radius: 3px;
	background: var(--shm-gold);
	color: #1a130b;
	text-decoration: none;
}

a.shm-eyebrow__mark:hover,
a.shm-eyebrow__mark:focus { background: #fff; color: #1a130b; }

.shm-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin-bottom: 1.25rem;
	font-size: 0.9rem;
	color: rgb(255 255 255 / 70%);
}

.shm-crumbs a { color: rgb(255 255 255 / 85%); text-decoration: none; }
.shm-crumbs a:hover, .shm-crumbs a:focus { color: #fff; text-decoration: underline; }

.shm-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.4rem;
	margin: 0 0 1.6rem;
	font-size: 0.98rem;
	color: rgb(255 255 255 / 85%);
}

.shm-facts span { display: inline-flex; align-items: center; gap: 0.4em; }

.shm-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }

.shm-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.55em;
	padding: 0.72em 1.5em;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 1.02rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.shm-btn:hover, .shm-btn:focus-visible { transform: translateY(-1px); }

.shm-btn--primary { background: #fff; color: #120d08; }
.shm-btn--primary:hover, .shm-btn--primary:focus { background: rgb(255 255 255 / 82%); color: #120d08; }

.shm-btn--ghost { background: rgb(109 109 110 / 55%); color: #fff; backdrop-filter: blur(6px); }
.shm-btn--ghost:hover, .shm-btn--ghost:focus { background: rgb(109 109 110 / 38%); color: #fff; }

.shm-btn--solid { background: var(--shm-accent-strong); color: #fff; }
.shm-btn--solid:hover, .shm-btn--solid:focus { background: var(--shm-text); color: var(--shm-bg); }

.shm-btn--outline { border-color: var(--shm-border); background: transparent; color: var(--shm-text); }
.shm-btn--outline:hover, .shm-btn--outline:focus { border-color: var(--shm-accent); color: var(--shm-text); }

.shm-billboard__dots {
	position: absolute;
	inset-inline-end: var(--shm-gutter);
	inset-block-end: clamp(40px, 9vh, 96px);
	z-index: 2;
	display: flex;
	gap: 8px;
}

.shm-billboard .shm-billboard__dots button.shm-billboard__dot {
	width: 28px;
	height: 4px;
	padding: 0;
	border: 0;
	border-radius: 2px;
	background: rgb(255 255 255 / 35%);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.3s, width 0.3s;
}

.shm-billboard .shm-billboard__dots button.shm-billboard__dot.is-active { width: 44px; background: #fff; }
.shm-billboard .shm-billboard__dots button.shm-billboard__dot:focus-visible { outline: 2px solid var(--shm-gold); outline-offset: 3px; }

/* Intro and chips -------------------------------------------------------- */

.shm-intro {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem 2rem;
	margin: clamp(-48px, -4vh, -24px) 0 clamp(20px, 3vw, 36px);
	position: relative;
	z-index: 2;
}

.shm-intro__title {
	margin: 0;
	font-family: var(--shm-heading);
	font-size: clamp(1.8rem, 3.2vw, 2.6rem);
	color: var(--shm-text);
}

.shm-intro__text { margin: 0.2rem 0 0; max-width: 38rem; color: var(--shm-muted); }

.shm-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shm-chips--bar { margin: 1.75rem 0; }

.shm-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0.42em 1em;
	border: 1px solid var(--shm-border);
	border-radius: 999px;
	background: var(--shm-surface);
	color: var(--shm-text);
	font-size: 0.92rem;
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.shm-chip:hover, .shm-chip:focus, .shm-chip.is-current {
	border-color: var(--shm-accent);
	background: var(--shm-accent);
	color: #fff;
}

.shm-chip__count { font-size: 0.8em; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* Rows ------------------------------------------------------------------- */

.shm-row { margin-block: clamp(26px, 3.5vw, 44px); }

.shm-row__head {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.9rem;
}

.shm-row__title {
	margin: 0;
	font-family: var(--shm-heading);
	font-size: clamp(1.3rem, 2.1vw, 1.7rem);
	color: var(--shm-text);
}

.shm-row__all {
	display: inline-flex;
	flex: none;
	white-space: nowrap;
	align-items: center;
	gap: 0.2em;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--shm-accent-strong);
	text-decoration: none;
}

.shm-row__all:hover, .shm-row__all:focus { text-decoration: underline; }

.shm-row__nav { display: flex; gap: 0.4rem; margin-inline-start: auto; }

.shm-row .shm-row__nav button.shm-row__btn {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--shm-border);
	border-radius: 50%;
	background: var(--shm-surface);
	color: var(--shm-text);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.shm-row .shm-row__nav button.shm-row__btn:hover, .shm-row .shm-row__nav button.shm-row__btn:focus-visible { background: var(--shm-text); color: var(--shm-bg); }
.shm-row .shm-row__nav button.shm-row__btn[disabled] { opacity: 0.35; cursor: default; background: var(--shm-surface); color: var(--shm-text); }

.shm-row__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: var(--shm-card-w);
	gap: 14px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--shm-gutter);
	padding: 8px var(--shm-gutter) 22px;
	margin-inline: calc(-1 * var(--shm-gutter));
	scrollbar-width: none;
}

.shm-row__track::-webkit-scrollbar { display: none; }
.shm-row__track:focus-visible { outline: 2px solid var(--shm-accent); outline-offset: -2px; }
.shm-row__track > * { scroll-snap-align: start; }

/* Cards ------------------------------------------------------------------ */

.shm-card { position: relative; min-width: 0; }

.shm-card__link {
	display: block;
	height: 100%;
	border-radius: var(--shm-radius);
	background: var(--shm-surface);
	color: var(--shm-text);
	text-decoration: none;
	box-shadow: 0 1px 2px rgb(0 0 0 / 8%), 0 8px 24px rgb(0 0 0 / 10%);
	overflow: hidden;
	transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s;
}

.shm-card__link:hover,
.shm-card__link:focus-visible {
	transform: translateY(-4px) scale(1.025);
	box-shadow: 0 2px 6px rgb(0 0 0 / 12%), 0 22px 44px rgb(0 0 0 / 22%);
	color: var(--shm-text);
}

.shm-card__link:focus-visible { outline: 3px solid var(--shm-accent); outline-offset: 3px; }

.shm-card__media {
	position: relative;
	aspect-ratio: 16 / 10;
	background: #1d150e;
	overflow: hidden;
}

.shm-card__image,
.shm-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.shm-card__placeholder { background: linear-gradient(135deg, #3a2a1a, #120d08); }

.shm-card__link:hover .shm-card__image { transform: scale(1.06); }

.shm-card__badge {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-start: 10px;
	padding: 0.2em 0.65em;
	border-radius: 3px;
	background: rgb(11 9 7 / 72%);
	color: var(--shm-gold);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	backdrop-filter: blur(4px);
}

.shm-card__overlay {
	position: absolute;
	inset: auto 0 0;
	padding: 2.6rem 1rem 0.85rem;
	background: linear-gradient(to top, rgb(11 9 7 / 92%), rgb(11 9 7 / 0%));
	color: #fff;
}

.shm-card__title {
	margin: 0;
	font-family: var(--shm-heading);
	font-size: 1.12rem;
	line-height: 1.25;
	color: #fff;
}

.shm-card__place {
	display: flex;
	align-items: center;
	gap: 0.3em;
	margin: 0.25rem 0 0;
	font-size: 0.84rem;
	color: rgb(255 255 255 / 80%);
}

.shm-card__place .shm-icon { width: 15px; height: 15px; }

.shm-card__more { padding: 0.75rem 1rem 0.95rem; }

.shm-card__year {
	display: inline-block;
	margin-bottom: 0.3rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--shm-accent-strong);
}

.shm-card__tagline {
	display: -webkit-box;
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--shm-muted);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Grid ------------------------------------------------------------------- */

.shm-gridwrap { margin-block: clamp(30px, 4vw, 56px); }
.shm-gridwrap .shm-row__title { margin-bottom: 1rem; }

.shm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 20px;
	margin-bottom: clamp(30px, 4vw, 56px);
}

.shm-az { padding-top: clamp(20px, 3vw, 36px); border-top: 1px solid var(--shm-border); }

.shm-empty { padding: 3rem 0; text-align: center; color: var(--shm-muted); }

/* Single museum ---------------------------------------------------------- */

.shm-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
	gap: clamp(28px, 4vw, 64px);
	align-items: start;
	margin-top: clamp(8px, 2vw, 24px);
}

.shm-section { margin-bottom: clamp(28px, 3.5vw, 44px); }

.shm-section__title {
	display: flex;
	align-items: center;
	gap: 0.6em;
	margin: 0 0 1rem;
	font-family: var(--shm-heading);
	font-size: clamp(1.4rem, 2.3vw, 1.85rem);
	color: var(--shm-text);
}

.shm-section__title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--shm-border);
}

.shm-prose { font-size: 1.1rem; line-height: var(--sh-line-height, 1.8); color: var(--shm-text); }
.shm-prose > p:first-child::first-letter {
	float: inline-start;
	margin-inline-end: 0.08em;
	font-family: var(--shm-heading);
	font-size: 3.6em;
	line-height: 0.85;
	color: var(--shm-accent-strong);
}

.shm-highlights {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: shm-hl;
}

.shm-highlights li {
	position: relative;
	margin: 0;
	padding: 1rem 1.1rem 1rem 3.4rem;
	border: 1px solid var(--shm-border);
	border-radius: var(--shm-radius);
	background: var(--shm-surface);
	line-height: 1.5;
	counter-increment: shm-hl;
}

html[dir="rtl"] .shm-highlights li { padding: 1rem 3.4rem 1rem 1.1rem; }

.shm-highlights li::before {
	content: counter(shm-hl, decimal-leading-zero);
	position: absolute;
	inset-block-start: 0.95rem;
	inset-inline-start: 1rem;
	font-family: var(--shm-heading);
	font-size: 1.3rem;
	font-weight: 800;
	line-height: 1;
	color: var(--shm-accent);
}

.shm-empires { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--shm-muted); }

.shm-layout__side { position: sticky; inset-block-start: 100px; }

.shm-visit {
	padding: clamp(18px, 2vw, 26px);
	border: 1px solid var(--shm-border);
	border-radius: 14px;
	background: var(--shm-surface);
	box-shadow: var(--sh-shadow, 0 10px 30px rgb(43 33 24 / 10%));
}

.shm-visit__title { margin: 0 0 1rem; font-family: var(--shm-heading); font-size: 1.35rem; color: var(--shm-text); }

.shm-visit__list { margin: 0; }
.shm-visit__list > div { padding-block: 0.7rem; border-bottom: 1px solid var(--shm-border); }
.shm-visit__list > div:first-child { padding-top: 0; }

.shm-visit__list dt {
	display: flex;
	align-items: center;
	gap: 0.45em;
	margin: 0 0 0.15rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--shm-accent-strong);
}

.shm-visit__list dt .shm-icon { width: 17px; height: 17px; }
.shm-visit__list dd { margin: 0; font-size: 0.98rem; line-height: 1.55; color: var(--shm-text); }

.shm-map {
	margin-top: 1rem;
	border-radius: var(--shm-radius);
	overflow: hidden;
	border: 1px solid var(--shm-border);
	aspect-ratio: 4 / 3;
	background: var(--shm-surface-2);
}

.shm-map iframe { display: block; width: 100%; height: 100%; border: 0; }
:root[data-theme="dark"] .shm-map iframe { filter: invert(0.9) hue-rotate(180deg) brightness(0.95) contrast(0.9); }

.shm-visit__buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0 0; }
.shm-visit__buttons .shm-btn { flex: 1 1 auto; justify-content: center; font-size: 0.95rem; }

.shm-visit__note { margin: 0.9rem 0 0; font-size: 0.82rem; line-height: 1.5; color: var(--shm-muted); }

/* Embedded with the shortcodes inside normal page content. */
.shm-embed .shm-row__track { margin-inline: 0; padding-inline: 2px; scroll-padding-inline: 0; }
.shm-embed .shm-billboard { border-radius: 14px; width: auto; margin-inline: 0; }
.shm-embed .shm-wrap { padding-inline: 0; }

/* Urdu ------------------------------------------------------------------- */

html[lang|="ur"] .shm-billboard__title { line-height: 1.75; font-size: clamp(2rem, 4.8vw, 3.8rem); letter-spacing: 0; }
html[lang|="ur"] .shm-billboard__tagline,
html[lang|="ur"] .shm-intro__text { line-height: 2; }
html[lang|="ur"] .shm-card__title { line-height: 1.9; font-size: 1.05rem; }
html[lang|="ur"] .shm-card__overlay { padding-top: 3rem; }
html[lang|="ur"] .shm-card__tagline { line-height: 2; -webkit-line-clamp: 2; }
html[lang|="ur"] .shm-row__title,
html[lang|="ur"] .shm-section__title,
html[lang|="ur"] .shm-intro__title,
html[lang|="ur"] .shm-visit__title { line-height: 1.9; }
html[lang|="ur"] .shm-eyebrow,
html[lang|="ur"] .shm-card__badge,
html[lang|="ur"] .shm-card__year,
html[lang|="ur"] .shm-visit__list dt { text-transform: none; letter-spacing: 0; }
html[lang|="ur"] .shm-eyebrow,
html[lang|="ur"] .shm-visit__list dt { font-size: 0.9rem; }
html[lang|="ur"] .shm-highlights li { line-height: 2; }
html[lang|="ur"] .shm-highlights li::before { font-family: Georgia, serif; }
html[lang|="ur"] .shm-prose > p:first-child::first-letter { float: none; font-size: inherit; line-height: inherit; color: inherit; margin: 0; }
html[lang|="ur"] .shm-btn { line-height: 1.8; padding-block: 0.4em; }

/* Small screens ---------------------------------------------------------- */

@media (max-width: 960px) {
	.shm-layout { grid-template-columns: minmax(0, 1fr); }
	.shm-layout__side { position: static; }
}

@media (max-width: 640px) {
	.shm-page,
	.shm-embed { --shm-card-w: 74vw; }

	.shm-billboard { min-height: 560px; }
	.shm-billboard--single { min-height: 520px; }
	.shm-billboard--term { min-height: 320px; }

	.shm-billboard__slide::before,
	html[dir="rtl"] .shm-billboard__slide::before {
		background:
			linear-gradient(to top, var(--shm-bg) 0%, rgb(11 9 7 / 88%) 18%, rgb(11 9 7 / 55%) 55%, rgb(11 9 7 / 25%) 100%);
	}

	.shm-billboard__content { padding-bottom: 72px; }
	.shm-billboard__image { object-position: 72% center; }
	html[dir="rtl"] .shm-billboard__image { object-position: 72% center; }
	.shm-billboard__dots { inset-inline: var(--shm-gutter) auto; inset-block-end: 34px; }
	.shm-row__nav { display: none; }
	.shm-actions .shm-btn { flex: 1 1 auto; justify-content: center; }
	.shm-intro { margin-top: 0; }
	.shm-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
	.shm-billboard__slide,
	.shm-billboard__image,
	.shm-card__link,
	.shm-card__image,
	.shm-btn { transition: none; }

	.shm-billboard__image { transform: none; }
	.shm-card__link:hover, .shm-card__link:focus-visible { transform: none; }
}
