/* Ported from the Drupal mcah_theme (assets/style.css), trimmed to what the static site uses. */
@font-face {
	font-family: 'Lato';
	src: local('Lato'), url('./fonts/Lato-Regular.ttf') format('truetype');
	font-display: swap;
}
@font-face {
	font-family: 'Merriweather';
	src: local('Merriweather'), url('./fonts/Merriweather-Regular.ttf') format('truetype');
	font-display: swap;
}
@font-face {
	font-family: 'Merriweather';
	src: local('Merriweather'), url('./fonts/Merriweather-Bold.ttf') format('truetype');
	font-weight: bold;
	font-display: swap;
}

:root {
	--navy: #0b2c4f;
	--link: #2e4a68;
	--accent: #124d8d;
	--th: #144e8e;
	--muted: #666;
	--header-h: 81px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 10px); }
body { margin: 0; background: #fff; color: #222; font-family: 'Merriweather', Georgia, serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p a { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); font-family: 'Lato', sans-serif; font-weight: normal; }
li { list-style: none; }
img { max-width: 100%; height: auto; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: #fff; padding: 8px 12px; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#page { display: flex; min-height: 100vh; flex-direction: column; max-width: 1920px; margin: 0 auto; }
main { flex: 1; padding: calc(var(--header-h) + 40px) 10px 60px; width: 100%; text-align: center; }

.page-title { font-size: 3em; margin: 30px 0 10px; text-align: center; overflow-wrap: anywhere; }
@media (max-width: 720px) { .page-title { font-size: 2em; } }

/* ---- buttons/inputs (theme style) ---- */
input[type='search'], input[type='text'], button[type='submit'], .basic-page input {
	border: 3px solid var(--navy);
	font-size: 18px;
	color: var(--accent);
	background: #fff;
	padding: 5px 15px;
	margin: 5px;
	font-family: 'Merriweather', serif;
}
button[type='submit'], .basic-page input[type='submit'] { cursor: pointer; transition: all 0.3s ease; }
button[type='submit']:hover, .basic-page input[type='submit']:hover { color: #fff; background: var(--navy); }

/* ---- header ---- */
.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--header-h);
	display: flex;
	align-items: center;
	background: var(--navy);
	z-index: 100;
}
.site-header .logo { display: block; height: var(--header-h); flex: none; transition: background 0.4s; }
.site-header .logo img { height: var(--header-h); width: auto; display: block; }
.site-header nav a {
	display: block;
	font: 22px 'Lato', sans-serif;
	color: #fff;
	padding: 27px 20px;
	height: var(--header-h);
	transition: all 0.4s ease;
}
.site-header nav a:hover { background: #fff; color: var(--navy); text-decoration: none; }
.header-search { margin-left: auto; display: flex; align-items: center; padding: 0 10px; }
.header-search input { max-width: 150px; margin: 0; font-size: 18px; border-color: #fff; color: var(--navy); }
.header-search button {
	width: 35px;
	height: 35px;
	margin-left: 10px;
	border: none;
	background: transparent url('./images/search.svg') no-repeat center / contain;
	cursor: pointer;
}
@media (max-width: 760px) {
	:root { --header-h: 60px; }
	.site-header .logo img { height: 60px; }
	.site-header nav a { font-size: 16px; padding: 20px 10px; }
	.header-search input { max-width: 90px; font-size: 14px; padding: 4px 6px; }
	.header-search button { width: 28px; height: 28px; margin-left: 4px; }
}
@media (max-width: 520px) {
	.site-header nav { display: none; }
}

/* ---- footer ---- */
.site-footer { background: var(--navy); display: flex; flex-wrap: wrap; padding: 15px 0 20px; }
.site-footer div { font: 17px 'Lato', sans-serif; color: #fff; width: 320px; padding: 15px 20px 0; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ccc; }
@media (max-width: 740px) {
	.site-footer { justify-content: center; text-align: center; }
	.site-footer div { width: 100%; }
}

/* ---- basic pages (home) ---- */
.basic-page p { max-width: 1000px; margin: 30px auto; padding: 0 10px; text-align: left; line-height: 2.15em; }
.basic-page hr { height: 2px; background: var(--navy); max-width: 800px; margin: 80px auto; border: none; }
.basic-page #siteTitle { font-size: 1.5em; max-width: 1200px; margin: 40px auto 70px; }
#links div {
	display: inline-block;
	width: 30%;
	height: 20vh;
	border-radius: 3px;
	margin: 5px;
	line-height: 20vh;
	font-size: 1.5em;
	background-size: cover;
	background-position: center;
	transition: box-shadow 0.5s;
}
#links div:hover { box-shadow: 0 14px 28px rgb(0 0 0 / 25%), 0 10px 10px rgb(0 0 0 / 22%); }
#links a { color: #fff; text-shadow: 0 0 10px black; font-size: 1.5em; display: block; width: 100%; height: 100%; }
#lambayeque { background-image: url('images/lambayeque.jpg'); }
#moche { background-image: url('images/moche.jpg'); }
#chimu { background-image: url('images/chimu.jpg'); }
#casma { background-image: url('images/casma.jpg'); }
#horizon { background-image: url('images/horizon.jpg'); }
#cupisnique { background-image: url('images/cupisnique.jpg'); }
#inca { background-image: url('images/inca.jpg'); }
#recuay { background-image: url('images/recuay.jpg'); }
#colonial { background-image: url('images/colonial.jpg'); }
#wari { background-image: url('images/wari.jpg'); }
@media (max-width: 1000px) { #links div { width: 45%; } }
@media (max-width: 600px) { #links div { width: 100%; margin: 5px 0; } }

/* ---- record page ---- */
.record-image { display: inline-block; }
.record-image img { display: block; max-height: 480px; width: auto; transition: box-shadow 0.5s; }
.record-image:hover img { box-shadow: 0 14px 28px rgb(0 0 0 / 25%), 0 10px 10px rgb(0 0 0 / 22%); }
.cataloging {
	border-top: 2px solid var(--navy);
	border-bottom: 2px solid var(--navy);
	padding: 30px 0;
	max-width: 600px;
	margin: 20px auto;
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 10px 15px;
	text-align: left;
	font-size: 1.15em;
}
.cataloging dt { text-align: right; color: var(--navy); font-family: 'Lato', sans-serif; font-weight: bold; }
.cataloging dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
	.cataloging { grid-template-columns: 1fr; gap: 2px; font-size: 1em; padding: 20px 0; }
	.cataloging dt { text-align: left; margin-top: 8px; }
}

/* ---- object grid ---- */
.object-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 40px; padding: 0; max-width: 1000px; margin: 20px auto; }
.object-grid li { width: 220px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.object-grid img { display: block; max-height: 260px; width: auto; }
.no-image { display: inline-block; width: 100px; height: 100px; background: #eee; border: 1px dashed #bbb; }

/* ---- search page ---- */
.search-layout { display: flex; gap: 20px; align-items: flex-start; text-align: left; }
.search-results { flex: 1; min-width: 0; }
.search-sidebar { width: 260px; flex: none; }
@media (max-width: 900px) {
	.search-layout { flex-direction: column-reverse; }
	.search-sidebar { width: 100%; }
}
.sidebar-search h2 { margin: 0 0 5px; font-size: 1.4em; }
.sidebar-search input { width: 100%; margin: 0 0 8px; }
.sidebar-search button { margin: 0 8px 0 0; }
.sidebar-search .clear { font-size: 0.9em; }
.notice { padding: 20px 0; color: var(--muted); }
.result-count { text-align: right; }

.facet { margin: 18px 0; }
.facet summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.facet summary::-webkit-details-marker { display: none; }
.facet summary::before { content: url('./images/closed.png'); line-height: 0; }
.facet[open] summary::before { content: url('./images/open.png'); }
.facet summary h2 { margin: 0; font-size: 1.4em; }
.facet ul { padding: 0 0 0 22px; margin: 8px 0; }
.facet li a { display: block; padding: 3px 0; font-size: 0.9rem; cursor: pointer; }
.facet li a::before { content: '•'; margin-right: 5px; }
.facet li a.active { font-weight: bold; }
.facet li a.active::before { content: none; }
.facet .count { color: var(--muted); font-size: 0.85em; }
.facet-filter { width: calc(100% - 22px); margin: 8px 0 0 22px !important; font-size: 14px !important; padding: 4px 8px !important; border-width: 1px !important; }
.show-more { margin-left: 22px; background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 0.85rem; padding: 0; }
.show-more:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; }
.chips button { border: 1px solid var(--navy); background: #fff; color: var(--navy); border-radius: 14px; padding: 3px 10px; cursor: pointer; font: inherit; font-size: 0.85rem; }
.chips button:hover { background: var(--navy); color: #fff; }
.chip-facet { opacity: 0.75; }

/* ---- results table (theme style) ---- */
table.records { border-collapse: collapse; width: 100%; }
table.records th, table.records td { border: 2px solid var(--navy); }
table.records th { font-size: 1.15em; color: var(--th); padding: 10px 12px; font-family: 'Merriweather', serif; }
table.records td { padding: 8px 10px; vertical-align: top; font-size: 0.9rem; overflow-wrap: anywhere; }
table.records tr:hover { background: #eee; }
table.records td.thumb { width: 120px; text-align: center; }
table.records td.thumb img { max-width: 100px; max-height: 100px; }
@media (max-width: 700px) {
	table.records thead { display: none; }
	table.records, table.records tbody, table.records tr, table.records td { display: block; width: 100%; }
	table.records tr { display: grid; grid-template-columns: 110px 1fr; border: 2px solid var(--navy); margin-bottom: 10px; }
	table.records td { border: none; padding: 4px 8px; }
	table.records td.thumb { grid-row: span 5; width: auto; }
	table.records td:empty { display: none; }
}

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin: 20px 0 10px; }
.pager a, .pager span { padding: 2px 6px; }
.pager .current { font-weight: bold; }

/* ---- listing pages ---- */
.listing { text-align: left; max-width: 1200px; margin: 0 auto; }
.listing .page-title { margin-top: 0; }
.listing-kicker { text-align: center; margin: 0; font-family: 'Lato', sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.listing-meta { text-align: center; margin-bottom: 30px; }

/* ---- lightbox (static/theme/lightbox.js) ---- */
dialog.lb { padding: 0; border: none; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
dialog.lb::backdrop { background: rgb(0 0 0 / 85%); }
.lb-inner { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.lb-inner img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; background: #222; }
.lb-bar { display: flex; align-items: center; gap: 14px; color: #fff; font-family: 'Lato', sans-serif; flex-wrap: wrap; justify-content: center; }
.lb-bar a { color: #fff; text-decoration: underline; }
.lb-bar button { background: none; border: 2px solid #fff; color: #fff; font-size: 18px; padding: 4px 12px; cursor: pointer; }
.lb-bar button:hover { background: #fff; color: #000; }
.lb-bar button[hidden] { display: none; }
