:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
    --header-bg: #ffffff;
    --menu-bg: #dee4ea;
    --accent: #3498db;
    --border: #dee2e6;
    --card-bg: #ffffff;
    --shadow: rgba(0,0,0,0.1);
    --voyageur: blue ;
    --mountaineer: red;
    --hudson-bay: #000000; 
    --voyaneer: #000000;
    --voyageurboys: #0A6DFF;
    --voyageurgirls: #210AFF;
    --voyageurall-gender: #0AE8FF;
    --mountaineerboys: #FF0036;
    --mountaineergirls: #FF4900;
    --mountaineerall-gender: #FF00B6;
    --hudson-bayboys: #FF0036;
    --hudson-baygirls: #FF4900;
    --hudson-bayall-gender: #FF00B6;
    --voyaneerboys: #000000;
}

[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #faf6f6;
    --text-secondary: #f7f1f1;
    --header-bg: #1a1a1a;
    --menu-bg: #2d2d2d;
    --accent: #64b5f6;
    --border: #404040;
    --card-bg: #2d2d2d;
    --shadow: rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* Sticky Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    color: rgb(48, 47, 47);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 5px var(--shadow);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Hamburger Menu Button */
.menu-toggle {
    background: var(--menu-bg);
    border: none;
    color: rgb(48, 47, 47);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: background 0.3s;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: 2px solid var(--accent);
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;  /* Changed from left: -300px */
    width: 300px;
    height: 100vh;
    background: var(--menu-bg);
    transition: left 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
}

.side-menu.closed {  /* NEW - replaces .active */
    left: -300px;
}

.menu-header {
    position: sticky;  /* NEW */
    top: 0;  /* NEW */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    z-index: 10;  /* NEW */    
    box-shadow: 0 2px 5px var(--shadow);
    background: var(--menu-bg);
    color: rgb(48, 47, 47);
}

.menu-close {
    background: none;
    border: none;
    color: rgb(48, 47, 47);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.menu-close:hover,
.menu-close:focus {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    outline: 2px solid var(--accent);
}

nav ul {
    list-style: none;
    padding: 1rem 0;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;
    padding: 1rem 1.5rem;
    /*color: rgb(48, 47, 47);*/
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.3s;
}

nav ul li a:hover,
nav ul li a:focus {
    background: var(--header-bg);
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
nav ul li a.active {
    background: var(--header-bg);
    border-left: 4px solid var(--accent);
    padding-left: calc(1.5rem - 4px); /* Keeps alignment */
    font-weight: bold;
}

.menu-divider {
    padding: 1.5rem 1.5rem 0.5rem;
    color: rgb(48, 47, 47);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.menu-text-block {
    padding: 1rem 1.5rem;
    color: rgb(48, 47, 47);
    font-size: 0.875rem;
    line-height: 1.5;
    border-left: 3px solid var(--accent);
    margin: 1rem 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.menu-text-block p {
    margin-bottom: 0.5rem;
    color: rgb(48, 47, 47);
}

.menu-text-block p:last-child {
    margin-bottom: 0;
}

/* Theme Toggle */
.theme-toggle {
    padding: 1rem 1.5rem;
    margin: 0 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.theme-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgb(48, 47, 47);
    cursor: pointer;
}

.theme-toggle input[type="checkbox"] {
    width: 50px;
    height: 24px;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.theme-toggle input[type="checkbox"]:checked {
    background: var(--accent);
}

.theme-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: left 0.3s;
}

.theme-toggle input[type="checkbox"]:checked::before {
    left: 28px;
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Main Content */
main {
    margin-top: 60px;
    margin-left: 300px;  /* Added this */
    padding: 2rem;
    max-width: calc(100% - 300px);  /* CHANGED */
    width: 100%;  /* NEW */
    transition: margin-left 0.3s ease, max-width 0.3s ease;  /* UPDATED */
}

main.menu-closed {
    margin-left: auto;  /* CHANGED */
    margin-right: auto;  /* NEW */
    max-width: 1200px;  /* NEW */
}
section {
    margin-bottom: 3rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

.responsive-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.img-small {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.img-medium {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.img-large {
    max-width: 900px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.img-centered {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Flexbox Layout */
.flex {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.flex > * {
    flex: 1 1 250px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px var(--shadow);
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card p {
    margin-bottom: 0;
}

/* Lists */
.styled-list {
    list-style: none;
    padding-left: 0;
}

.styled-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.styled-list li::before {
    content: "\f061";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--accent);
}

.list-unstyled {
    list-style: none;
    padding-left: 0;
}

.list-unstyled li {
    padding: 0.5rem 0;
}

.list-unstyled-compact {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.list-unstyled-compact li {
    padding: 0;
    margin: 0;
}

/* Responsive Iframe Container */
.responsive-iframe {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.responsive-iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Collapsible Sections */
.collapsible {
    margin-bottom: 1rem;
}

.collapsible-header {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    transition: background 0.3s;
}

.collapsible-header:hover {
    background: var(--bg-secondary);
}

.collapsible-header::after {
    content: "+";
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.3s;
}

.collapsible-header.active::after {
    transform: rotate(45deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.collapsible-content-inner {
    padding: 1rem;
}

/* Tabs */
.tabs {
    margin-bottom: 2rem;
}

.tab-buttons {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.3s, border-color 0.3s;
}

.tab-button:hover {
    color: var(--accent);
}

.tab-button.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.tab-content.active {
    display: block;
}

/* Footer */
footer {
    background: var(--header-bg);
    color: white;
    padding: 2rem 2rem 1rem;
    margin-top: 3rem;
    margin-left: 300px;  /* NEW */
    transition: margin-left 0.3s ease;  /* NEW */
}

footer.menu-closed {  /* NEW */
    margin-left: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .side-menu {
        left: -300px;
    }

    .side-menu.active {
        left: 0;
    }

    .side-menu.closed {  /* NEW */
        left: -300px;
    }

    main {
        margin-left: auto;
        margin-right: auto;
        max-width: 1200px;  /* ADDED */
    }

    main.menu-closed {  /* NEW */
        margin-left: auto;
        max-width: 1200px;  /* ADDED */
    }

    footer {  /* NEW */
        margin-left: 0;
    }

    footer.menu-closed {  /* NEW */
        margin-left: 0;
    }

    header .logo {
        display: block;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    main {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .tab-buttons {
        flex-wrap: wrap;
    }

    footer {
        padding: 2rem 1rem 1rem;
    }
}

@media (max-width: 480px) {
    .side-menu {
        width: 80%;
        left: -80%;
    }

    .side-menu.active {
        left: 0;
    }

    .side-menu.closed {  /* NEW */
        left: -80%;
    }
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

.plaque {
    background-repeat: no-repeat;
    height: 300px;
    background-position: 30%;
    background-size: auto;
}

.plaque.voyageur {
    background-image: url('/images/Voyageur.png');
}

.plaque.mountaineer {
    background-image: url('/images/Mountaineer.png');
}

.plaque.hudson-bay {
    background-image: url('/images/Hudson Bay.png');
}

/*------------------- Simile Exhibit ----------------*/
.guts{
	display:none;
}

/* Hide element if the viewport width is 600px or less */
@media screen and (max-width: 1260px) {
  .noDisplayOnMobile {
    display: none;
  }
}

/*------------------- Timeline: Horizontal / Vertical lines ----------------*/
/* style for ethers */
.timeline-ether-lines{border-color:#666; border-style:dotted; position:absolute;}
.timeline-horizontal .timeline-ether-lines{border-width:0 0 0 1px; height:100%; top: 0; width: 1px;}

/*-------------------------- HIGHLIGHT DECORATORS -------------------*/
.timeline-highlight-decorator,
.timeline-highlight-point-decorator{
	position:absolute;
	overflow:hidden;
}
.timeline-horizontal .timeline-highlight-point-decorator,
.timeline-horizontal .timeline-highlight-decorator{
	width:10px;
	top:0;
   height:100%;
}

.timeline-highlight-decorator{background-color:#FFC080;}
.timeline-highlight-point-decorator{background-color:#ff5;}
/*---------------------------- LABELS -------------------------*/
.timeline-highlight-label{position:absolute;overflow:hidden;font-size:200%;font-weight:bold;color:#999;}
/*---------------- VERTICAL LABEL -------------------*/
.timeline-horizontal .timeline-highlight-label{top:0;height:100%;}
.timeline-horizontal .timeline-highlight-label td{vertical-align:middle;}
.timeline-horizontal .timeline-highlight-label-start{text-align:right;}
.timeline-horizontal .timeline-highlight-label-end{text-align:left;}

/*---------------- HORIZONTAL LABEL -------------------*/
.timeline-vertical .timeline-highlight-label{left:0;width:100%;}
.timeline-vertical .timeline-highlight-label td{vertical-align:top;}
.timeline-vertical .timeline-highlight-label-start{text-align:center;}
.timeline-vertical .timeline-highlight-label-end{text-align:center;}

/*-------------------------------- DATE LABELS --------------------------------*/
.timeline-date-label{position:absolute;border:1px solid #aaa;color:#0D0D0D;width:5em;height:1.5em;}
.timeline-date-label-em{color:#0D0D0D;}

/* horizontal */
.timeline-horizontal .timeline-date-label{padding-left:2px;}
.timeline-horizontal .timeline-date-label{border-width:0 0 0 1px;}
.timeline-horizontal .timeline-date-label-em{height:2em}

/*------------------------------- Ether.highlight -------------------------*/
.timeline-ether-highlight{position:absolute; background-color:#ECF5F6;}
.timeline-horizontal .timeline-ether-highlight{top:2px;}

/*------------------------------ EVENTS ------------------------------------*/
.timeline-event-icon, .timeline-event-label,.timeline-event-tape{
	position:absolute;
	cursor:pointer;
}

.timeline-event-icon {
	margin-right: 2px;
}

.timeline-event-label {
	margin-left: 10px;
	font-size: 1em;
	color: #0D0D0D;
}

.timeline-event-tape, .timeline-small-event-tape, .timeline-small-event-icon{
	background-color:#396;
	overflow:hidden;
}

.timeline-small-event-tape, .timeline-small-event-icon{
	position:absolute;
}

.timeline-event-tape{height:4px;}
.timeline-small-event-tape{height:2px;}
.timeline-small-event-icon{width:1px; height:6px;}

/*--------------------------------- TIMELINE-------------------------*/
.timeline-ether-bg{width:100%; height:100%;}
/**/
.timeline-band-0 .timeline-ether-bg{background-color:#eee}
.timeline-band-1 .timeline-ether-bg{background-color:#ddd}
.exhibit-toolboxWidget-popup {display: none}
/*.exhibit-legendWidget {display: none}
.timeline-band-2 .timeline-ether-bg{background-color:#98A5A6}
.timeline-band-3 .timeline-ether-bg{background-color:#aaa} */
.exhibit-resizableDivWidget-resizer {display: none}

/*--------------------------------- Exhibit tble zebra stripes-------------------------*/
tr:nth-child(even) {
  background-color: var(--menu-bg);
}

/*div.exhibit-bookmarkWidget-popup:before {
    content: " Click on the 'bookmark' icon to get a URL you can use to go directly to the current state of your filtered browsing: ";
}*/

div.exhibit-color-legend:before {
    content: "Legend: ";
}

div.exhibit-views-unplottableMessage { display: none;}

span.facet-blocks {
display: inline-block;
text-align: left;
padding:5px;
border: 1px solid rgba(68, 85, 0, 0.36);
border-radius: 6px;
vertical-align: top;
height:130px;
}

lite-youtube {
    background-color: #000;
    position: relative;
    display: block;
    contain: content;
    background-position: center center;
    background-size: cover;
    cursor: pointer;
    max-width: 720px;
}

/* gradient */
lite-youtube::before {
    content: attr(data-title);
    display: block;
    position: absolute;
    top: 0;
    /* Pixel-perfect port of YT's gradient PNG, using https://github.com/bluesmoon/pngtocss plus optimizations */
    background-image: linear-gradient(180deg, rgb(0 0 0 / 67%) 0%, rgb(0 0 0 / 54%) 14%, rgb(0 0 0 / 15%) 54%, rgb(0 0 0 / 5%) 72%, rgb(0 0 0 / 0%) 94%);
    height: 99px;
    width: 100%;
    font-family: "YouTube Noto",Roboto,Arial,Helvetica,sans-serif;
    color: hsl(0deg 0% 93.33%);
    text-shadow: 0 0 2px rgba(0,0,0,.5);
    font-size: 18px;
    padding: 25px 20px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

lite-youtube:hover::before {
    color: white;
}

/* responsive iframe with a 16:9 aspect ratio
    thanks https://css-tricks.com/responsive-iframes/
*/
lite-youtube::after {
    content: "";
    display: block;
    padding-bottom: calc(100% / (16 / 9));
}
lite-youtube > iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border: 0;
}

/* play button */
lite-youtube > .lyt-playbtn {
    display: block;
    /* Make the button element cover the whole area for a large hover/click target… */
    width: 100%;
    height: 100%;
    /* …but visually it's still the same size */
    background: no-repeat center/68px 48px;
    /* YT's actual play button svg */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>');
    position: absolute;
    cursor: pointer;
    z-index: 1;
    filter: grayscale(100%);
    transition: filter .1s cubic-bezier(0, 0, 0.2, 1);
    border: 0;
}

lite-youtube:hover > .lyt-playbtn,
lite-youtube .lyt-playbtn:focus {
    filter: none;
}

/* Post-click styles */
lite-youtube.lyt-activated {
    cursor: unset;
}
lite-youtube.lyt-activated::before,
lite-youtube.lyt-activated > .lyt-playbtn {
    opacity: 0;
    pointer-events: none;
}

.lyt-visually-hidden {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }


@media print {
  a::after{
    content: " (" attr(href) ") ";
  }
}
