/* Small compatibility fixes; archived styles remain the source of the desktop layout. */
#main img { max-width: 100%; height: auto; }
#main iframe { max-width: 100%; }
#main .restored-slideshow { position: relative; overflow: hidden; max-width: 650px; aspect-ratio: 650 / 225; margin: 0 auto; }
.restored-slideshow figure { position: absolute; inset: 0; margin: 0; opacity: 0; visibility: hidden; transition: opacity .65s; }
.restored-slideshow figure.is-active { opacity: 1; visibility: visible; }
#main .restored-slideshow img { position: static !important; display: block; width: 100%; height: 100%; object-fit: cover; }
.restored-slideshow figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px; background: #0008; color: white; text-align: left; }
.restored-slideshow button { position: absolute; top: 40%; padding: 8px 11px; border: 0; background: #0008; color: white; cursor: pointer; z-index: 2; }
.restored-slideshow .slide-prev { left: 0; }
.restored-slideshow .slide-next { right: 0; }
.restored-slideshow .slide-pause { right: 4px; top: 4px; font-size: 11px; padding: 4px 7px; }
.restored-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.restored-gallery a { display: block; }
.restored-gallery img { width: 100%; }
.restored-lightbox { position: fixed; inset: 0; width: min(94vw, 1100px); max-width: 94vw; max-height: 94vh; margin: auto; padding: 38px 12px 12px; border: 0; border-radius: 4px; background: #19262c; color: white; text-align: center; }
.restored-lightbox::backdrop { background: #000c; }
.restored-lightbox img { display: block; max-width: 100%; max-height: 76vh; margin: auto; object-fit: contain; }
.restored-lightbox button { background: #fff; color: #19262c; padding: 6px 12px; border: 0; cursor: pointer; }
.restored-lightbox .lightbox-close { position: absolute; top: 5px; right: 5px; }
.restored-lightbox figcaption { margin-top: 10px; }
.missing-asset { display: inline-block; font-size: .9em; padding: 4px; color: #555; border: 1px solid #ccc; }
.missing-download { color: #666; }
.restored-print { float: right; }
#primary-nav .menu-toggle { display: none; }
@media (max-width: 760px) {
    div#pagewrapper { min-width: 0; width: 100%; }
    div#header { position: relative; }
    div#header h1 { background: none; }
    div#header h1 a { background-size: contain; background-position: left center; }
    div#header h2 { position: absolute; right: 8px; bottom: 3px; margin: 0; font-size: 12px; }
    div#content { display: flex; flex-direction: column; }
    div#content > .back1 { order: 0; }
    div#content > #sidebar { order: 1; }
    div#content > .clear { order: 2; }
    div#search { float: none; width: auto; padding: 10px; }
    div#sidebar { float: none; width: auto; margin: 12px; }
    #sidebar #news { display: none; }
    div.back1, div.back2, div.back3 { margin: 0; padding: 0; background: none; }
    div#main { margin: 0; padding: 12px; }
    #main table { max-width: 100%; }
    #main > div { max-width: 100%; box-sizing: border-box; }
    #menuwrapper { overflow: visible; }
    #primary-nav { display: flex; flex-wrap: wrap; }
    #primary-nav > li { float: none; }
    #primary-nav li { position: relative; max-width: 100%; }
    #primary-nav li.menuparent > a { padding-right: 40px; }
    #primary-nav .menu-toggle { display: block; position: absolute; top: 0; right: 0; width: 36px; height: 36px; background: transparent; color: inherit; border: 0; font-size: 22px; cursor: pointer; }
    #primary-nav ul { position: static !important; width: 100%; float: none; padding: 0; }
    #primary-nav ul li { float: none; width: 100%; }
    #primary-nav li:not(.is-expanded) > ul { display: none !important; }
    #primary-nav li.is-expanded > ul { display: block !important; visibility: visible !important; }
}
@media print {
    #menu_vert, #sidebar, #search, #header, .breadcrumbs, #footer, .noprint, .restored-print { display: none !important; }
    #pagewrapper, #main, .back1, .back2, .back3 { width: auto !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; background: none !important; }
}
@media (prefers-reduced-motion: reduce) { .restored-slideshow figure { transition: none; } }
