/*!
Theme Name: hypermuseum
Theme URI: https://hypermuseum.org/
Author: Christoph Balzar
Description: virtual exhibitions between real museums.
Version: 0.5.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: hypermuseum
*/

*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; }

:root {
	--bg: #ffffff;
	--fg: #202122;
	--rule: #c8ccd1;
	--accent: #0645ad;
	--accent-hover: #3366cc;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: sans-serif;
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Uniform typography ------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
	font-family: inherit;
	font-size: 1em;
	font-weight: 700;
	line-height: inherit;
	margin: 1.1em 0 0.4em;
}

p { margin: 0 0 0.9em; }
strong, b { font-weight: 700; }
em, i { font-style: italic; }

a, a:link, a:visited {
	color: var(--accent);
	font-weight: 700;
	text-decoration: none;
}
a:hover, a:focus {
	color: var(--accent-hover);
	text-decoration: underline;
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 1.5em 0; }

/* Page frame --------------------------------------------------------- */

#page {
	max-width: 980px;
	margin: 0 auto;
	padding: 0 1.25rem;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Header ------------------------------------------------------------- */

.site-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 1.25rem 0 0.75rem;
	gap: 1rem;
	flex-wrap: nowrap;
}

.site-title {
	font-size: 1em;
	font-weight: 700;
	margin: 0;
	line-height: inherit;
	white-space: nowrap;
}

.site-title a,
.site-title a:link,
.site-title a:visited,
.site-title a:hover {
	color: var(--fg);
	font-weight: 700;
	text-decoration: none;
}

.site-taglines {
	font-weight: 700;
	line-height: 1.55;
	min-height: 1.55em;
	text-align: right;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex-shrink: 1;
	min-width: 0;
}

.site-taglines .tagline-display {
	display: inline-block;
	line-height: 1.55;
	min-height: 1.55em;
}

.site-taglines .tagline-data { display: none; }

/* Content grid ------------------------------------------------------- */

.site-content {
	display: grid;
	grid-template-columns: 1fr 11rem;
	gap: 2.5rem;
	margin-top: 0.5rem;
	flex: 1;
	align-items: start;
}

.main-content { min-width: 0; }
.sidebar { min-width: 0; }

/* Align title and sidebar section to the same baseline.
   The first element in main-content gets no top margin, so it lines up
   with the first sidebar section, which also starts at the top. */
.main-content > article > .room-header,
.main-content > article > .room-header > h1,
.main-content > article > .room-header > .room-meta,
.main-content > article > .room-header > h1:first-child,
.main-content > .room-header,
.main-content > h1:first-child,
.main-content > h2:first-child,
.main-content > h3:first-child {
	margin-top: 0;
}

/* Sidebar ------------------------------------------------------------ */

.sidebar-section { margin-bottom: 1.4rem; }
.sidebar-section:last-child { margin-bottom: 0; }

.sidebar .section-label {
	font-weight: 700;
	margin-bottom: 0.3rem;
	color: var(--fg);
	display: block;
}

a.section-label,
a.section-label:link,
a.section-label:visited {
	color: var(--fg);
	text-decoration: none;
	font-weight: 700;
}

a.section-label:hover {
	color: var(--accent-hover);
	text-decoration: underline;
}

.sidebar nav ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.sidebar nav li { margin: 0.1rem 0; }

.sidebar .is-current > a,
.sidebar .is-current > a:visited {
	color: var(--fg);
	font-weight: 700;
	text-decoration: underline;
}

/* Front page: goto-room grid ----------------------------------------- */

.room-grid {
	grid-column: 1 / -1;
	margin: 2rem 0 1rem;
}

.room-grid h2 {
	font-size: 1em;
	font-weight: 700;
	margin: 0 0 0.6rem;
}

.room-grid .grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 0.15rem 0.8rem;
	max-width: 40rem;
}

.room-grid .grid .cell {
	padding: 0.1rem 0;
	min-height: 1.4em;
}

.room-grid .grid .cell a {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

/* Single Raum -------------------------------------------------------- */

.room-header { margin-bottom: 1rem; }
.room-header .room-meta { margin-bottom: 0.3rem; }
.room-header h1 { margin: 0; }

.room-meta span + span::before { content: " · "; }

.room-content img,
.room-content iframe {
	max-width: 100%;
	height: auto;
	display: block;
	margin: 1rem 0;
	cursor: zoom-in;
}

/* Full-width images (Gutenberg alignfull / classic alignfull) --------- */

.alignfull,
.room-content .alignfull,
.room-content figure.alignfull {
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	width: 100vw;
	max-width: none;
}

.alignwide,
.room-content .alignwide {
	margin-left: calc(-15vw + 0%);
	margin-right: calc(-15vw + 0%);
	max-width: none;
}

.alignfull img,
.alignwide img {
	width: 100%;
	max-width: 100%;
	height: auto;
}

@media (max-width: 1000px) {
	.alignwide,
	.room-content .alignwide {
		margin-left: 0;
		margin-right: 0;
	}
}

.room-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 2.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--rule);
	gap: 1rem;
}

/* Image lightbox ----------------------------------------------------- */

.image-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(255, 255, 255, 0.985);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	cursor: zoom-out;
	padding: 1rem;
	animation: hm-fade-in 0.15s ease-out;
}

.image-lightbox img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

@keyframes hm-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Footer ------------------------------------------------------------- */

.site-footer {
	padding: 1.5rem 0 1rem;
	margin-top: 2rem;
	border-top: 1px solid var(--rule);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
}

.site-footer nav {
	display: flex;
	gap: 1.2rem;
}

/* Accessibility ------------------------------------------------------ */

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 100000;
	background: var(--fg);
	color: var(--bg);
	padding: 0.5em 1em;
}

.skip-link:focus { left: 1em; top: 1em; }

/* Mobile ------------------------------------------------------------- */

@media (max-width: 760px) {
	#page { padding: 0 1rem; }
	.site-header {
		padding: 1rem 0 0.6rem;
		gap: 0.6rem;
	}
	.site-content {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}
	.sidebar {
		order: 2;
		border-top: 1px solid var(--rule);
		padding-top: 1rem;
	}
	.room-grid .grid {
		grid-template-columns: repeat(4, 1fr);
	}
	.alignfull,
	.room-content .alignfull {
		margin-left: -1rem;
		margin-right: -1rem;
		width: calc(100% + 2rem);
	}
}

@media (max-width: 380px) {
	#page { padding: 0 0.8rem; }
	body { font-size: 14px; }
	.alignfull,
	.room-content .alignfull {
		margin-left: -0.8rem;
		margin-right: -0.8rem;
		width: calc(100% + 1.6rem);
	}
}
