/* Mobile-only overrides. Desktop keeps its original portal.css styling. */
@media (max-width: 680px) {
.home .panel {
    border: 1px solid var(--site-color-6b0c3cf731, #c7a959);
    box-shadow: 0 2px 5px var(--site-color-c11b899785, #16391c12);
    background-color: var(--site-color-56c7e24071, #fffaf0);
}
.home .research { background-color: var(--dark); }
.home .project .haveli {
    display: block;
    position: absolute;
    inset: 0 0 0 auto;
    width: 35%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    mask-image: linear-gradient(to right, transparent, var(--site-color-598b32b7d9, #000) 55%);
    -webkit-mask-image: linear-gradient(to right, transparent, var(--site-color-598b32b7d9, #000) 55%);
}
.home .project > div { padding-right: 32%; }
.compact-contact.site-footer {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 10px 8px;
    overflow-x: auto;
}
.compact-contact > * {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0 clamp(8px, 2vw, 36px);
    text-decoration: none;
    line-height: 1.3;
}
.compact-contact > * + * { border-left: 1px solid var(--site-color-edea56d7d1, #e5dbb980); }
.compact-contact .contact-item { display: inline-flex; align-items: center; gap: 8px; }
.compact-contact .contact-icon { color: var(--site-color-25bbf85cd3, #fff5d9); font-size: 1.1em; }
.compact-contact a:hover { text-decoration: underline; }
}
@media (max-width: 680px) {
    .ibis-header .nav-toggle > summary { padding: 8px 12px; font-size: 14px; }
    .ibis-header .nav-toggle[open] > nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 0;
        padding: 0 8px 6px;
    }
    .ibis-header .nav-toggle:not([open]) > nav { display: none; }
    .ibis-header .nav-toggle nav a,
    .ibis-header .nav-toggle nav a.pill {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        min-width: 0;
        min-height: 36px;
        max-width: none;
        padding: 7px 6px;
        font: 400 12px/1.25 system-ui, sans-serif !important;
        color: var(--site-color-5da7d1f5d1, #fff8e1);
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: left;
        transform: none;
    }
    .ibis-header .nav-toggle nav a + a { border-left: 1px solid var(--site-color-c6f566b9a8, #fff3); }
    .ibis-header .nav-toggle nav a:nth-child(3n + 1) { border-left: 0; }
    .ibis-header .nav-toggle nav a:nth-child(n + 4) { border-top: 1px solid var(--site-color-c6f566b9a8, #fff3); }
    .ibis-header .nav-toggle nav a[aria-current="page"] {
        box-shadow: inset 0 -2px var(--site-color-ea904113a6, #ffd45b);
    }
}
@media (max-width: 680px) {
    .hero .hero-inner {
        width: 100%;
        min-height: 166px;
        gap: 10px;
        padding: 14px 12px;
        align-items: center;
    }
    .hero .profile { flex: 0 0 70px; padding-right: 9px; }
    .hero .profile img { width: 60px; height: 76px; border-radius: 9px; }
    .hero .profile span { font-size: 10px; line-height: 1.25; white-space: normal; }
    .hero .hero-inner > div:last-child { min-width: 0; flex: 1; }
    .hero h1 { font-size: clamp(16px, 4.5vw, 27px) !important; line-height: 1.12; margin-bottom: 9px; }
    .hero h1 span { overflow-wrap: normal; }
    .hero::before { width: 72%; background-size: cover; background-position: center; opacity: .65; }
    .hero .pill, .hero .hero-secondary {
        font-size: 10px;
        padding: 7px 9px;
        margin: 2px 3px 2px 0;
        line-height: 1.25;
    }
    .home.wrap { width: 100%; padding: 10px; }
    .home .about-strip, .home .home-middle, .home .home-bottom { gap: 10px; margin-bottom: 10px; }
    .home .home-middle, .home .home-bottom { display: grid; grid-template-columns: minmax(0, 1fr); }
    .home h2 { font-size: 19px !important; line-height: 1.15; }
    .home h2 a { font: inherit; }
    .home p { font-size: 12px !important; line-height: 1.45; margin: 5px 0 8px; }
    .home .panel { padding: 10px; border-radius: 10px; }
    .home .about-strip {
        grid-template-columns: 70px minmax(0, 1fr);
        align-items: start;
        padding: 10px;
        border: 1px solid var(--site-color-6b0c3cf731, #c7a959);
        border-radius: 10px;
        background: var(--site-color-56c7e24071, #fffaf0);
    }
    .home .about-strip > img { width: 70px; height: 92px; }
    .home .about-strip > .bird { display: none; }
    .home .stats { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
    .home .stats > div { padding: 7px 4px; border: 1px solid var(--site-color-d4bab8cf35, #dfd6c380); }
    .home .stats strong, .home .stats small { font-size: 10px; line-height: 1.35; }
    .home .stats svg { width: 20px; height: 20px; }
    .home .videos-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .home .videos-strip > div:first-child { grid-column: 1 / -1; }
    .home .videos-strip > .video { width: 100%; min-width: 0; }
    .home .middle-more, .home .events-strip a { font-size: 12px; }
    .home .research { min-height: 175px; }
    .home .research p { max-width: 63%; }
    .home .research::before { width: 60%; }
    .home .project { grid-template-columns: 64px minmax(0, 1fr); gap: 9px; min-height: 168px; }
    .home .project > img:first-child { width: 64px; height: auto; max-height: 115px; }
    .home .project > div { padding-right: 30%; }
    .home .project h2 { font-size: 16px !important; }
    .home .project p { font-size: 11px !important; }
    .home .project .outline { font-size: 10px; padding: 6px 8px; border-radius: 6px; }
    .home .project .haveli { width: 30%; display: block; }
    .home .gallery-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .home .gallery-strip .gallery-copy { grid-column: 1 / -1; min-width: 0; }
    .home .gallery-strip > a { min-width: 0; }
    .home .gallery-strip img { height: 87px; width: 100%; object-fit: cover; }
    .home .events-strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
    .home .events-strip > img { width: 100%; height: 94px; object-fit: cover; }
    .home .award { grid-column: 1 / -1; max-width: none; border: 0; border-top: 1px solid var(--site-color-a84e225d56, #dfd6c3); padding: 8px 0 0; font-size: 13px; }
    .home .award svg { width: 26px; height: 26px; }
    .compact-contact.site-footer { justify-content: safe center; padding: 9px 3px; }
    .compact-contact > * { padding: 0 4px; font-size: 8px !important; }
    .compact-contact .contact-item { gap: 3px; }
    .compact-contact .contact-item span { font-size: inherit !important; }
}

@media (min-width: 681px) {
    .compact-contact .contact-icon { display: none; }
}

/* Compact mobile cards from the approved reference. */
@media (max-width: 680px) {
    .home .home-middle .research {
        min-height: 0;
        padding: 9px 10px;
    }
    .home .home-middle .research h2 {
        font-size: 17px !important;
        margin-bottom: 4px;
    }
    .home .home-middle .research p {
        max-width: 61%;
        font-size: 10px !important;
        line-height: 1.3;
        margin: 3px 0 5px;
    }
    .home .home-middle .research .middle-more {
        display: inline-block;
        font-size: 10px;
    }
    .home .home-middle .project {
        grid-template-columns: 55px minmax(0, 1fr);
        min-height: 0;
        padding: 9px;
        gap: 9px;
        align-items: center;
    }
    .home .home-middle .project > img:first-child {
        width: 55px;
        height: auto;
        max-height: 88px;
        object-fit: contain;
    }
    .home .home-middle .project > div {
        padding-right: 29%;
        min-width: 0;
    }
    .home .home-middle .project h2 {
        font-size: 14px !important;
        line-height: 1.1;
        margin: 0 0 4px;
    }
    .home .home-middle .project p {
        font-size: 10px !important;
        line-height: 1.3;
        margin: 3px 0 6px;
    }
    .home .home-middle .project .outline {
        font-size: 10px;
        line-height: 1.2;
        padding: 5px 7px;
    }
    .home .home-middle .project .haveli {
        display: block;
        width: 30%;
        height: 100%;
        max-height: none;
    }
    .home .gallery-strip {
        display: grid;
        grid-template-columns: minmax(0, 2.8fr) repeat(4, minmax(0, 1fr));
        align-items: center;
        gap: 5px;
        padding: 9px;
    }
    .home .gallery-strip .gallery-copy {
        grid-column: auto;
        min-width: 0;
    }
    .home .gallery-strip h2 {
        font-size: 14px !important;
        line-height: 1.15;
        margin: 0 0 4px;
    }
    .home .gallery-strip p {
        font-size: 10px !important;
        line-height: 1.3;
        margin: 3px 0 0;
    }
    .home .gallery-strip > a { display: block; min-width: 0; }
    .home .gallery-strip img {
        width: 100%;
        height: clamp(62px, 16vw, 90px);
        object-fit: cover;
        border-radius: 5px;
    }
}

@media (max-width: 680px) {
    .home .home-middle .videos-strip {
        display: grid;
        grid-template-columns: minmax(0, 1.12fr) repeat(2, minmax(0, 1fr));
        align-items: center;
        gap: 7px;
        padding: 9px;
    }
    .home .home-middle .videos-strip > div:first-child {
        grid-column: auto;
        min-width: 0;
    }
    .home .home-middle .videos-strip h2 {
        font-size: 14px !important;
        line-height: 1.15;
        margin: 0 0 4px;
    }
    .home .home-middle .videos-strip p {
        font-size: 10px !important;
        line-height: 1.3;
        margin: 3px 0 6px;
    }
    .home .home-middle .videos-strip .middle-more {
        display: inline-block;
        font-size: 10px;
        line-height: 1.3;
    }
    .home .home-middle .videos-strip > .video {
        width: 100%;
        min-width: 0;
        aspect-ratio: 16 / 9;
        border-radius: 5px;
    }
    .home .videos-strip .play {
        width: 26px;
        height: 26px;
        padding: 3px;
        font-size: 12px;
    }
    .home .videos-strip .fullscreen {
        right: 2px;
        top: 2px;
        padding: 2px;
    }
    .home .videos-strip .fullscreen svg {
        width: 13px;
        height: 13px;
    }
}

/* Mobile hero keeps separate space for the portrait, copy and ibis. */
@media (max-width: 680px) {
    .hero {
        margin: 0 8px;
        border: 1px solid var(--site-color-6b0c3cf731, #c7a959);
        border-radius: 10px;
    }
    .hero .hero-inner {
        width: 100%;
        min-height: 0;
        padding: 10px 9px;
        gap: 8px;
        align-items: center;
        position: relative;
        z-index: 1;
    }
    .hero .profile {
        flex: 0 0 16%;
        min-width: 0;
        padding-right: 7px;
    }
    .hero .profile img {
        width: 100%;
        height: clamp(57px, 16vw, 90px);
        object-fit: cover;
        border-radius: 7px;
    }
    .hero .profile span {
        font-size: clamp(7px, 1.8vw, 10px);
        line-height: 1.2;
        margin-top: 4px;
    }
    .hero .hero-inner > div:last-child {
        flex: 0 0 49%;
        width: 49%;
        min-width: 0;
    }
    .hero .hero-inner h1.copy {
        white-space: normal;
        font-size: clamp(12px, 3.1vw, 20px) !important;
        line-height: 1.12;
        margin: 0 0 8px;
    }
    .hero .hero-inner h1 span {
        display: block;
        margin: 0;
        padding: 0;
    }
    .hero .pill, .hero .hero-secondary {
        font-size: clamp(7px, 1.6vw, 10px);
        line-height: 1.2;
        padding: 5px 6px;
        margin: 2px 2px 0 0;
        vertical-align: middle;
    }
    .hero::before {
        width: 43%;
        opacity: 1;
        background-size: contain;
        background-position: right center;
        -webkit-mask-image: linear-gradient(to right, transparent, var(--site-color-598b32b7d9, #000) 22%);
        mask-image: linear-gradient(to right, transparent, var(--site-color-598b32b7d9, #000) 22%);
    }
}

/* Vector contact icons stay sharp at small sizes. */
.compact-contact svg.contact-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    vertical-align: middle;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@media (max-width: 680px) {
    .compact-contact svg.contact-icon { width: 10px; height: 10px; }
    .research-page { min-width: 0; max-width: 100%; }
    .research-page .research-hero {
        display: block;
        min-height: 0;
    }
    .research-page .research-hero > div {
        width: 100%;
        padding: 14px 12px 12px;
    }
    .research-page .research-hero h1 {
        max-width: none;
        white-space: nowrap;
        font-size: clamp(18px, 4.7vw, 28px);
        line-height: 1.15;
        letter-spacing: -.3px;
    }
    .research-page .research-hero p {
        max-width: none;
        font-size: 12px;
        line-height: 1.4;
        margin-top: 8px;
    }
    .research-page .research-hero img {
        position: static;
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        object-fit: contain;
        clip-path: none;
    }
    .research-page .research-hero::after { display: none; }
    .research-page .research-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        padding: 8px;
        overflow: visible;
    }
    .research-page .research-tabs button {
        min-width: 0;
        max-width: 100%;
        padding: 8px 5px;
        gap: 5px;
        font-size: 11px;
        line-height: 1.2;
        white-space: normal;
        overflow-wrap: anywhere;
        transform: none;
        box-shadow: none;
    }
    .research-page .research-tabs button::before { display: none; }
    .research-page .research-tabs svg { width: 16px; height: 16px; }
    .research-page .research-filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 8px;
        padding: 8px 10px;
        font-size: 11px;
    }
    .research-page .research-filters > strong { grid-column: 1 / -1; }
    .research-page .research-filters label {
        min-width: 0;
        margin: 0;
        gap: 5px;
    }
    .research-page .research-filters label:last-child { grid-column: 1 / -1; margin: 0; }
    .research-page .research-filters select {
        min-width: 0;
        width: 100%;
        max-width: none;
        font-size: 11px;
        padding: 6px;
    }
    .research-page .research-filters label:last-child select { width: auto; max-width: 70%; }
    .research-page .research-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 3px 10px 14px; }
    .research-page .research-card { min-width: 0; }
    .research-page .research-card:not(.research-guidance) > img {
        aspect-ratio: 2.8;
        height: auto;
        object-fit: contain;
        background: var(--site-color-decc212ee0, #f3eacb);
    }
    .research-page .research-card-body { padding: 8px 10px 10px; }
    .research-page .research-card h2 { font-size: 16px; }
    .research-page .research-card p { font-size: 12px; line-height: 1.4; }
}

/* Fill the mobile hero height instead of letterboxing the wide bird photo. */
@media (max-width: 680px) {
    .hero::before {
        inset: 0 0 0 auto;
        width: 64%;
        height: 100%;
        background-size: auto 100%;
        background-position: right center;
        background-repeat: no-repeat;
        opacity: 1;
        -webkit-mask-image: linear-gradient(to right, transparent 3%, var(--site-color-598b32b7d9, #000) 42%);
        mask-image: linear-gradient(to right, transparent 3%, var(--site-color-598b32b7d9, #000) 42%);
    }
    .hero .hero-inner {
        min-height: 118px;
        padding-top: 11px;
        padding-bottom: 11px;
    }
}

/* Dedicated mobile artwork places the entire bird beyond the text. */
@media (max-width: 680px) {
    .hero::before {
        width: 100%;
        height: 100%;
        background-image: url('/media/photography/mobile-ibis-right.png');
        background-size: auto 100%;
        background-position: right center;
        background-repeat: no-repeat;
        -webkit-mask-image: none;
        mask-image: none;
        opacity: 1;
    }
}

/* Start the photographic transition beside the mobile heading. */
@media (max-width: 680px) {
    .hero::before {
        inset: 0 0 0 auto;
        width: 85%;
        height: 100%;
        background-image: url('/media/photography/mobile-ibis-blend.png');
        background-size: 100% 100%;
        background-position: right center;
        -webkit-mask-image: none;
        mask-image: none;
    }
}

/* Contact footer: larger icons, a consistent text gap and centered alignment. */
.compact-contact.site-footer {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: safe center;
    column-gap: clamp(22px, 3vw, 56px);
    padding: 18px 24px;
    overflow-x: auto;
}
.compact-contact.site-footer > .contact-item {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    padding: 0;
    border: 0;
    white-space: nowrap;
    text-decoration: none;
    font-size: clamp(15px, 1vw, 18px);
    line-height: 1.35;
}
.compact-contact.site-footer > .contact-item > span {
    display: block;
    line-height: 1.35;
}
.compact-contact.site-footer svg.contact-icon {
    display: block;
    width: 24px;
    height: 24px;
    min-width: 24px;
    flex: 0 0 24px;
    color: var(--site-color-25bbf85cd3, #fff5d9);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.compact-contact.site-footer a.contact-item:hover > span {
    text-decoration: underline;
    text-underline-offset: 4px;
}
@media (min-width: 681px) and (max-width: 1000px) {
    .compact-contact.site-footer { column-gap: 18px; padding: 15px 16px; }
    .compact-contact.site-footer > .contact-item { gap: 7px; font-size: 13px; }
    .compact-contact.site-footer svg.contact-icon {
        width: 20px;
        height: 20px;
        min-width: 20px;
        flex-basis: 20px;
    }
}
@media (max-width: 680px) {
    .compact-contact.site-footer { column-gap: 10px; padding: 11px 6px; }
    .compact-contact.site-footer > .contact-item {
        gap: 4px;
        font-size: clamp(8px, 1.8vw, 11px) !important;
    }
    .compact-contact.site-footer svg.contact-icon {
        width: 13px;
        height: 13px;
        min-width: 13px;
        flex-basis: 13px;
    }
}
