/* Story map and timeline. Colours come from the theme palette. */
.hf-story-map { scroll-margin-top: 1rem; }
.hf-map-views { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; margin: 0 0 .75rem; padding: 0; }
.hf-map-views legend { font-weight: 600; margin-bottom: .4rem; }
.hf-map-views label { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border: 1px solid var(--wp--preset--color--secondary); border-radius: 999px; cursor: pointer; background: var(--wp--preset--color--base); }
.hf-map-views label:has(input:checked) { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base); border-color: var(--wp--preset--color--primary); }
.hf-map-views input { accent-color: var(--wp--preset--color--accent); }
.hf-map-fade { margin: 0 0 .75rem; font-size: .9em; }
.hf-map-fade input { vertical-align: middle; width: min(16rem, 100%); accent-color: var(--wp--preset--color--primary); }
.hf-map { isolation: isolate; aspect-ratio: 11 / 8; max-height: 75vh; min-height: 300px; width: 100%; border-radius: 6px; border: 1px solid var(--wp--preset--color--tint); background: var(--wp--preset--color--tint); }
.hf-map .leaflet-popup-content p { margin: .4em 0 0; }
.hf-map-caption { font-size: .85em; margin-top: .5rem; }
.hf-story-map noscript img { max-width: 100%; height: auto; }

/* Sticks below the WordPress admin bar when logged in (WordPress sets the variable), at the very top otherwise. */
.hf-eras { position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 500; background: var(--wp--preset--color--base); border-bottom: 1px solid var(--wp--preset--color--tint); box-shadow: 0 6px 8px -8px rgb(0 0 0 / 25%); margin-bottom: 1.5rem; }
@media (max-width: 600px) { .hf-eras { top: 0; } } /* the admin bar scrolls away on phones */
.hf-eras ol { display: flex; gap: .25rem; overflow-x: auto; list-style: none; margin: 0; padding: .5rem 0; scrollbar-width: thin; scroll-behavior: smooth; }
.hf-eras a { display: block; white-space: nowrap; padding: .4rem .75rem; border-radius: 6px; text-decoration: none; line-height: 1.2; border-bottom: 3px solid transparent; }
.hf-eras a:hover, .hf-eras a:focus-visible { background: var(--wp--preset--color--tint); }
.hf-eras a[aria-current="true"] { background: var(--wp--preset--color--tint); border-bottom-color: var(--wp--preset--color--accent); font-weight: 600; }
.hf-eras small { display: block; font-size: .75em; color: var(--wp--preset--color--secondary); }

.hf-timeline, .hf-timeline ol { list-style: none; margin: 0; padding: 0; }
.hf-era { scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 5rem); margin-bottom: 2rem; }
.hf-era > h3 small { font-family: var(--wp--preset--font-family--fira-sans); font-size: .6em; font-weight: 400; color: var(--wp--preset--color--secondary); margin-left: .4rem; }
.hf-event { position: relative; scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 5rem); padding: 0 0 1.5rem 1.75rem; border-left: 3px solid var(--wp--preset--color--tint); margin-left: .5rem; }
.hf-event::before { content: ""; position: absolute; left: -.6rem; top: .2rem; width: .9rem; height: .9rem; border-radius: 50%; background: var(--wp--preset--color--accent); border: 2px solid var(--wp--preset--color--base); }
.hf-event-date { margin: 0; font-size: .85em; font-weight: 600; color: var(--wp--preset--color--secondary); }
.hf-event h4 { margin: .15rem 0 .5rem; font-size: 1.25em; }
.hf-event-text { max-width: 40rem; } /* keeps lines a readable length in the wide layout */
/* When the timeline is wide enough for two full-size thumbnails beside the text, pictures move alongside it. */
.hf-timeline { container-type: inline-size; }
@container (min-width: 64rem) {
	.hf-event:has(.hf-event-images) { display: grid; grid-template-columns: minmax(0, 40rem) minmax(26rem, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "text images" "map images"; column-gap: 2rem; align-items: start; }
	.hf-event-text { grid-area: text; }
	.hf-event:has(.hf-event-images) .hf-event-images { grid-area: images; margin: .2rem 0 0; }
	.hf-event-map { grid-area: map; }
}
.hf-event-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .75rem; margin: .75rem 0; }
.hf-event-images figure { margin: 0; }
.hf-event-images img { width: 100%; height: 190px; object-fit: cover; border-radius: 6px; display: block; }
.hf-zoom { display: block; cursor: zoom-in; border-radius: 6px; }
.hf-zoom img { transition: transform .2s ease, box-shadow .2s ease; }
.hf-zoom:hover img, .hf-zoom:focus-visible img { transform: scale(1.03); box-shadow: 0 4px 14px rgb(0 0 0 / 20%); }
.hf-lightbox { max-width: min(96vw, 1400px); max-height: 96vh; padding: 0; border: 0; border-radius: 8px; background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.hf-lightbox::backdrop { background: rgb(0 0 0 / 80%); }
.hf-lightbox figure { margin: 0; }
.hf-lightbox img { display: block; max-width: 100%; max-height: calc(96vh - 4rem); width: auto; height: auto; margin: 0 auto; }
.hf-lightbox figcaption { padding: .6rem 1rem; font-size: .9em; }
.hf-lightbox-close { position: absolute; top: .4rem; right: .4rem; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; background: rgb(0 0 0 / 55%); color: #fff; }
.hf-event-images figcaption { font-size: .8em; margin-top: .3rem; line-height: 1.35; }
.hf-credit { color: var(--wp--preset--color--secondary); font-style: italic; }
.hf-to-come { font-size: .9em; padding: .6rem .8rem; border: 1px dashed var(--wp--preset--color--secondary); border-radius: 6px; color: var(--wp--preset--color--secondary); }
.hf-show-on-map { font: inherit; font-size: .9em; padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--wp--preset--color--primary); background: transparent; color: var(--wp--preset--color--primary); cursor: pointer; }
.hf-show-on-map:hover, .hf-show-on-map:focus-visible { background: var(--wp--preset--color--primary); color: var(--wp--preset--color--base); }
