/*
 * Modern browser compatibility layer for the Shpyrko Research Group site.
 *
 * The original pages deliberately keep their historic markup and visual identity.
 * This file is loaded after style.css so modern layout, responsive media, keyboard
 * focus, and Word-export containment can be maintained in one reversible place.
 */

:root {
    --site-width: 780px;
    --content-width: 780px;
    --page-gray: #7f7f7f;
    --panel: #ffffff;
    --panel-muted: #eeeeee;
    --ink: #151515;
    --heading: #515151;
    --link: #0000cc;
    --link-hover: #c90000;
    --nav-active: #dce82d;
    --focus: #ffbf47;
    --content-gutter: 20px;
}

html {
    box-sizing: border-box;
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    background: var(--page-gray);
    font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
}

::selection {
    color: #ffffff;
    background: #d73500;
}

a {
    color: var(--link);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

#content a {
    border-bottom: 0 !important;
    text-decoration-line: underline;
    text-decoration-style: dotted;
}

a:hover {
    color: var(--link-hover);
}

#content a:hover {
    border-bottom: 0 !important;
    color: var(--link-hover);
    text-decoration-style: solid;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

img,
svg,
video,
canvas {
    max-width: 100%;
}

img {
    height: auto;
}

#page {
    width: 100% !important;
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 !important;
    background: var(--panel) !important;
    box-shadow: 0 0 14px rgb(0 0 0 / 28%);
    text-align: center;
}

#header {
    width: 100% !important;
    max-width: var(--site-width);
    margin: 0 auto !important;
    padding: 0 !important;
}

#title {
    width: 100%;
    min-height: 165px;
    height: 165px !important;
    margin: 0;
    padding: 28px 48px 18px 25px !important;
    color: #ffffff;
    background-color: #000000 !important;
    background-image: url("banner_new3.gif") !important;
    background-position: center top !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    text-align: left;
}

#title table {
    width: 100% !important;
    height: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
}

#title td {
    padding: 0;
    border: 0;
    vertical-align: top;
}

#title p {
    margin: 0;
}

#title a,
#title a:hover {
    color: #ffffff;
}

#title a:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

#title hr {
    height: 1px;
    margin: 0.55rem 0;
    border: 0;
    background: #ffffff;
}

#frame {
    width: 100% !important;
    max-width: var(--content-width);
    /* margin-top: 0px; */
    margin: 0 auto !important;
    padding: 0 !important;
    background: var(--panel);
    text-align: left;
}

.menu {
    display: flex !important;
    align-items: center;
    width: 100% !important;
    min-height: 80px;
    height: auto !important;
    margin: 0 !important;
    padding: 19px 18px 20px !important;
    overflow: visible !important;
    list-style: none;
    /* border-top: 1px solid #ffffff; */
    /* background: linear-gradient(#f4f4f4 0%, #d3d3d3 52%, #eeeeee 100%) !important; */
    background: linear-gradient(to bottom,
            #707070 0%,
            #a5a5a5 8%,
            #d6d6d6 35%,
            #eeeeee 100%) !important;
}

/* The historic pages place a <b> directly inside the list. Browsers retain that
 * invalid wrapper, so it participates in the flex layout explicitly. */
.menu>b {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    border-radius: 8px;
    background: linear-gradient(#333333 0%, #080808 48%, #000000 100%);
    box-shadow: 0 0 0 1px #ffffff, 0 1px 4px rgb(0 0 0 / 65%);
}

.menu li {
    display: block;
    flex: 0 0 auto;
    float: none !important;
    height: auto !important;
    margin: 0;
    padding: 0 !important;
    background: #050505 !important;
}

.menu li.last_menu {
    display: none !important;
}

.menu li a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    height: 40px !important;
    padding: 0 10px !important;
    border-right: 1px solid rgb(255 255 255 / 9%);
    color: #ffffff;
    background-color: #050505 !important;
    background-image: linear-gradient(#333333 0%, #080808 48%, #000000 100%) !important;
    background-position: 0 0 !important;
    background-repeat: repeat !important;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.1 !important;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.menu li:first-of-type,
.menu li:first-of-type a {
    border-radius: 8px 0 0 8px;
}

.menu li:has(+ li.last_menu),
.menu li:has(+ li.last_menu) a {
    border-radius: 0 8px 8px 0;
}

.menu>b>li:last-child,
.menu>b>li:last-child a {
    border-radius: 0 8px 8px 0;
}

.menu li a:hover,
.menu li a:active,
.menu li a:focus-visible {
    color: #ffffff;
    background-image: linear-gradient(#555555 0%, #171717 50%, #050505 100%) !important;
}

#frame .menu li.current_page_item a {
    color: #111111 !important;
    background-color: var(--nav-active) !important;
    background-image: linear-gradient(#f0f45b 0%, var(--nav-active) 55%, #bdca16 100%) !important;
}

#content {
    display: flow-root;
    float: none !important;
    width: 100% !important;
    max-width: 100%;
    min-width: 0;
    padding: 24px var(--content-gutter) 28px !important;
    overflow: visible !important;
    color: var(--ink);
    background: var(--panel);
    overflow-wrap: break-word;
}

#content h1,
#content h2,
#content h3,
#content h4 {
    color: var(--heading);
    line-height: 1.2;
    text-wrap: balance;
}

#content h1 {
    margin: 0.25em 0 0.75em;
    font-size: clamp(1.65rem, 4vw, 2rem);
}

#content h2 {
    margin: 0 0 0.75em;
    font-size: clamp(1.3rem, 3vw, 1.55rem);
}

#content h3,
#content h4 {
    margin: 1.5em 0 0.5em;
}

#content p {
    max-width: 76ch;
}

#content img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

#content table {
    max-width: 100% !important;
    border-spacing: 0;
}

#content th,
#content td {
    max-width: 100%;
    vertical-align: top;
}

#content iframe[src*="youtube.com"],
#content iframe[src*="youtube-nocookie.com"] {
    display: block;
    width: min(100%, 560px) !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border: 0;
}

#content pre,
#content code {
    max-width: 100%;
    overflow-x: auto;
}

#content .WordSection1,
#content [class^="WordSection"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

#content p.MsoNormal,
#content li.MsoNormal,
#content div.MsoNormal {
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

#content table[class*="Mso"],
#content img[style] {
    max-width: 100% !important;
}

.publication-feature {
    width: fit-content;
    max-width: 100%;
    margin: 2rem auto 1.5rem;
    text-align: center;
}

.publication-feature img {
    display: block;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
}

.publication-feature figcaption {
    max-width: 28ch;
    margin: 0.6rem auto 0;
    color: var(--heading);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
}

#frame>a>img,
#frame>hr+a>img {
    display: block;
    width: 100% !important;
    max-width: 780px !important;
    height: auto !important;
}

#footer {
    width: 100%;
    margin: 0 !important;
    padding: 0 0 12px !important;
    background: linear-gradient(to bottom, #ffffff, #e9e9e9) !important;
}

#footer .footer_content {
    display: block;
    width: calc(100% - 40px) !important;
    max-width: 760px;
    margin: 0 auto !important;
    padding: 12px 10px !important;
    border-top: 1px dotted #b7b7b7;
    border-bottom: 0;
    text-align: center;
}

div.figure {
    max-width: 100%;
}

.photo-archive {
    width: min(calc(100% - 32px), var(--content-width));
    margin: 24px auto;
    padding: clamp(20px, 5vw, 40px);
    color: var(--ink);
    background: var(--panel);
    box-shadow: 0 0 14px rgb(0 0 0 / 28%);
}

.photo-archive h1 {
    margin: 0.5rem 0 1.5rem;
    color: var(--heading);
    font-size: clamp(1.7rem, 5vw, 2.25rem);
    line-height: 1.2;
}

.photo-archive__back {
    color: var(--link);
    text-underline-offset: 0.16em;
}

.photo-archive__grid {
    display: grid;
    gap: 24px;
}

.photo-archive__grid img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #d3d3d3;
}

/* People page */
.site-title-copy {
    margin-left: 180px;
    color: #ffffff;
    font-family: "Times New Roman", Times, serif;
    text-shadow: 0 1px 3px #000000;
}

#title .site-title-name {
    display: inline-block;
    color: #ffffff;
    font-size: 1.5rem;
    font-variant: small-caps;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.05;
    text-decoration: none;
}

#title .site-title-affiliation {
    color: #ffffff;
    font-size: 1.08rem;
    line-height: 1.3;
    text-decoration: none;
}

.menu--modern::after {
    align-self: stretch;
    flex: 1 1 auto;
    min-width: 20px;
    min-height: 40px;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(#333333 0%, #080808 48%, #000000 100%);
    box-shadow: 1px 0 0 #ffffff, 1px 1px 4px rgb(0 0 0 / 55%);
    content: "";
}

.people-page {
    padding-bottom: 40px !important;
}

.people-intro {
    max-width: 680px;
    margin: 0 auto 28px;
    text-align: center;
}

.people-intro h1 {
    margin-bottom: 0.45em !important;
    font-size: clamp(2rem, 5vw, 2.65rem) !important;
}

.people-intro>p:not(.people-kicker):not(.roster-note) {
    margin-right: auto;
    margin-left: auto;
    color: #3f3f3f;
    font-size: 1.06rem;
}

.people-kicker {
    max-width: none !important;
    margin: 0 0 0.35rem !important;
    color: #667000;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.roster-note {
    max-width: 680px !important;
    margin: 1.4rem auto 0 !important;
    padding: 12px 15px;
    border-left: 4px solid var(--nav-active);
    color: #393900;
    background: #f8f8df;
    font-size: 0.86rem;
    line-height: 1.45;
    text-align: left;
}

.people-group-photo {
    margin: 0 0 42px;
    padding: 12px;
    border: 1px solid #d4d4d4;
    background: #f3f3f3;
}

#content .people-group-photo img {
    display: block;
    width: 100% !important;
}

.people-group-photo figcaption {
    max-width: 72ch;
    margin: 10px auto 0;
    color: #4d4d4d;
    font-size: 0.82rem;
    line-height: 1.45;
    text-align: center;
}

.people-section {
    margin-top: 42px;
}

.people-section-heading {
    margin-bottom: 22px;
    padding-bottom: 11px;
    border-bottom: 1px solid #c8c8c8;
}

.people-section-heading h2 {
    margin: 0 !important;
}

.people-section-heading>p:last-child:not(.people-kicker) {
    margin-bottom: 0;
    color: #646464;
}

.people-subsection {
    margin-top: 30px;
}

.people-subsection h3,
.alumni-group h3 {
    margin: 0 0 13px !important;
    color: #2d2d2d;
    font-size: 1.05rem;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.person-card {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    min-width: 0;
    min-height: 185px;
    overflow: hidden;
    border: 1px solid #d5d5d5;
    border-top: 3px solid #cdd923;
    background: #f7f7f7;
    box-shadow: 0 2px 7px rgb(0 0 0 / 8%);
}

.person-card--lead {
    grid-column: 1 / -1;
    grid-template-columns: 160px minmax(0, 1fr);
    min-height: 220px;
}

#content .person-card__portrait {
    width: 118px !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 185px;
    object-fit: cover;
    object-position: center top;
}

#content .person-card--lead .person-card__portrait {
    width: 160px !important;
    min-height: 220px;
}

.person-card__body {
    min-width: 0;
    padding: 13px 14px 15px;
}

.person-card__body h4 {
    margin: 0.15rem 0 0.45rem !important;
    color: #222222 !important;
    font-size: 1.08rem;
}

.person-card__body h4 a {
    color: #222222;
    text-decoration-color: #969696;
}

.person-card__role {
    max-width: none !important;
    margin: 0 !important;
    color: #697200;
    font-size: 0.67rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    line-height: 1.3;
    text-transform: uppercase;
}

.person-card__details,
.person-card__research,
.person-card__links {
    max-width: none !important;
    margin: 0.45rem 0 0 !important;
    color: #4b4b4b;
    font-size: 0.79rem;
    line-height: 1.45;
}

.person-card__research {
    color: #292929;
}

.alumni-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 28px;
}

.alumni-group {
    min-width: 0;
}

.alumni-list {
    margin: 0 !important;
    padding: 0 !important;
    border-top: 1px solid #dedede;
    list-style: none !important;
}

#content .alumni-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0 !important;
    border-bottom: 1px solid #e4e4e4;
    background: none !important;
    font-size: 0.86rem;
    line-height: 1.35;
}

.alumni-list li span {
    flex: 0 0 auto;
    color: #707070;
    font-size: 0.76rem;
    text-align: right;
}

.alumni-group:nth-child(3) {
    grid-column: 1 / -1;
}

.alumni-list--columns {
    columns: 2;
    column-gap: 28px;
}

#content .alumni-list--columns li {
    break-inside: avoid;
}

.people-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 42px;
    padding: 20px 22px;
    border-left: 5px solid var(--nav-active);
    background: #ededed;
}

.people-contact h2 {
    margin: 0 0 0.25rem !important;
}

.people-contact p {
    margin: 0 !important;
}

.people-contact__link {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid #222222;
    border-radius: 3px;
    color: #ffffff !important;
    background: #161616;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none !important;
    text-transform: uppercase;
}

.people-contact__link:hover {
    color: #111111 !important;
    background: var(--nav-active);
}

.panorama-link {
    display: block;
}

@media (max-width: 700px) {
    :root {
        --content-gutter: 16px;
    }

    body {
        background: var(--panel);
        font-size: 1rem;
    }

    #page {
        box-shadow: none;
    }

    #title {
        min-height: 150px;
        height: auto !important;
        padding: 24px 20px !important;
        background-position: center top !important;
    }

    #title table,
    #title tbody,
    #title tr {
        display: block;
        width: 100% !important;
    }

    #title td[width="90"] {
        display: none !important;
    }

    #title td {
        display: block;
        width: 100% !important;
    }

    #title td:empty {
        display: none;
    }

    .site-title-copy {
        margin-left: 0;
    }

    #title a,
    #title font {
        text-shadow: 0 1px 3px #000000;
    }

    #frame {
        width: 100% !important;
    }

    .menu {
        flex-wrap: wrap;
        align-items: stretch;
        gap: 1px;
        min-height: 0;
        padding: 8px !important;
        background: #d8d8d8 !important;
    }

    .menu>b {
        flex-wrap: wrap;
        align-items: stretch;
        gap: 1px;
        background: transparent;
        box-shadow: none;
    }

    .menu--modern::after {
        display: none;
    }

    .menu li {
        flex: 1 1 92px;
    }

    .menu li,
    .menu li a,
    .menu li:first-of-type,
    .menu li:first-of-type a,
    .menu li:has(+ li.last_menu),
    .menu li:has(+ li.last_menu) a,
    .menu>b>li:last-child,
    .menu>b>li:last-child a {
        border-radius: 4px;
    }

    .menu li a {
        min-height: 44px;
        height: 44px !important;
        padding: 0 8px !important;
        font-size: 0.75rem;
        white-space: normal;
    }

    #content {
        padding-top: 20px !important;
    }

    #content>table,
    #content>table>tbody,
    #content>table>tbody>tr,
    #content>table>tbody>tr>td,
    #content>table>tr,
    #content>table>tr>td {
        display: block !important;
        width: 100% !important;
        height: auto !important;
    }

    #content>table>tbody>tr>td,
    #content>table>tr>td {
        padding: 10px 0 !important;
    }

    #content>table>tbody>tr>td[bgcolor],
    #content>table>tr>td[bgcolor] {
        margin-top: 18px;
        padding: 16px !important;
        background: var(--panel-muted) !important;
    }

    #content table[class*="Mso"],
    #content table[style*="width"] {
        display: block !important;
        width: 100% !important;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }

    #content td,
    #content th {
        min-width: 0 !important;
    }

    div.figure {
        float: none;
        width: 100%;
        margin: 1rem 0;
    }

    #footer .footer_content {
        width: calc(100% - 32px) !important;
    }

    .people-grid,
    .alumni-grid {
        grid-template-columns: 1fr;
    }

    .person-card--lead {
        grid-column: auto;
    }

    .alumni-group:nth-child(3) {
        grid-column: auto;
    }

    .alumni-list--columns {
        columns: 1;
    }

    .people-contact {
        align-items: flex-start;
        flex-direction: column;
    }

    .photo-archive {
        width: 100%;
        margin: 0;
        box-shadow: none;
    }
}

@media (max-width: 420px) {
    #title {
        min-height: 138px;
    }

    #title font[size="5"] {
        font-size: 1.25rem;
    }

    #title font[size="4"] {
        font-size: 1rem;
    }

    .menu li {
        flex-basis: calc(50% - 1px);
    }

    .person-card,
    .person-card--lead {
        grid-template-columns: 96px minmax(0, 1fr);
        min-height: 170px;
    }

    #content .person-card__portrait,
    #content .person-card--lead .person-card__portrait {
        width: 96px !important;
        min-height: 170px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {

    body,
    #page,
    #frame,
    #content {
        width: 100% !important;
        max-width: none !important;
        color: #000000;
        background: #ffffff !important;
        box-shadow: none;
    }

    .menu,
    #footer {
        display: none !important;
    }

    a {
        color: #000000;
        text-decoration: underline;
    }
}