/* ==========================================================================
   HKUST – Li-Ning Joint Laboratory
   This site's own components. site.css carries the inherited base (reset,
   navbar, cards, news, people, CMS block grid); everything here is layered on
   top of it, so a change to the shared base never has to be re-merged.
   ========================================================================== */

/* ===== Brand palette =====
   Li-Ning's red is brighter than the HKUST red site.css uses for --brand, and
   this site is co-branded, so --brand is re-pointed at the university red while
   the partner red gets its own token for the wordmark and accents. */
:root {
    --lab-red: #e1251b;
    --lab-ink: #101828;
    --lab-paper: #f6f7f9;
    --lab-line: #e5e7eb;
    --lab-navy: #12295e;
    --lab-max: 1180px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-primary {
    background: var(--brand);
    color: var(--light);
}

.btn-primary:hover {
    background: var(--brand-2);
    color: var(--light);
}

.btn-ghost {
    background: transparent;
    color: var(--brand);
    border: 2px solid var(--brand);
}

.btn-ghost:hover {
    background: var(--brand);
    color: var(--light);
}

.btn-light {
    background: var(--light);
    color: var(--lab-navy);
}

.btn-light:hover {
    background: #eef2ff;
    color: var(--lab-navy);
}

/* ===== Navbar wordmark =====
   The laboratory has no logo of its own yet, so the lock-up is HKUST's mark, a
   typeset name, and Li-Ning's mark. Typesetting it keeps the name editable and
   crisp at every width instead of shipping a banner image.

   The inherited bar sizes three 44px images and a 32px menu gap, which is wider
   than the 77px container can hold next to six nav items -- the Li-Ning mark
   ended up underneath the menu. Everything here exists to buy back that width. */
.nav-logo .logo-hkust-link,
.nav-logo .logo-wordmark,
.nav-logo .logo-aaf-link {
    height: 40px;
}

.logo-hkust {
    height: 36px;
}

.logo-wordmark {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    height: auto;
    max-width: 232px;
    line-height: 1.2;
    text-align: left;
}

.logo-line-1 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--lab-ink);
    white-space: nowrap;
}

.logo-line-2 {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
}

.logo-aaf-link .logo-aaf {
    /* Li-Ning's lock-up is wide and short; cap its height so it balances HKUST's. */
    height: 28px;
    max-width: 92px;
    object-fit: contain;
    object-position: left center;
}

.nav-menu {
    gap: 18px;
}

.nav-link {
    padding: 7px 8px;
    font-size: .96rem;
}

/* Below this the bar cannot hold all three marks plus the menu. The selector
   has to carry `.nav-logo` to match site.css's `.nav-logo .logo-aaf-link`
   display:flex -- a bare `.logo-partner` loses on specificity and does nothing. */
@media (max-width: 1279px) {
    .nav-logo .logo-partner {
        display: none;
    }
}

/* ===== Hamburger promoted from 768px to 1023px =====
   Measured, not guessed: at 900px the desktop row has exactly zero clearance,
   because the lock-up (407px) and six menu items (486px) want 893px and the
   container only offers 860. site.css does not switch to the off-canvas menu
   until 768px, so 769-1023px was a collision.

   These rules restate the nav half of site.css's 768px block at a wider
   breakpoint rather than editing that block in place, for two reasons: the
   inherited stylesheet stays pristine and re-mergeable against the sibling
   site, and the block it lives in also carries unrelated hero/card/footer rules
   that must keep their 768px switch. At 768px and below both copies declare the
   same values, so they cannot disagree. */
@media (max-width: 1023px) {
    .nav-container {
        height: 69px;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 69px;  /* matches .nav-container height above */
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        background-color: var(--light);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-hover);
        gap: 0;
        padding: 16px;
        z-index: 999;
    }

    .nav-toggle:checked ~ .nav-menu {
        left: 0;
    }

    .nav-item {
        margin: 0;
    }

    .nav-link {
        padding: 10px 8px;
        display: block;
        margin: 0;
        font-size: 14px;
    }

    .hamburger {
        display: flex;
        margin-left: auto;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    /* Dropdowns stack inside the panel instead of floating on hover. */
    .nav-item.dropdown {
        display: flex;
        flex-direction: column;
        grid-column: span 1;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: #f8f9fa;
        margin-top: 8px;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s ease;
    }

    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 520px;
        transform: none;
    }

    .dropdown-link {
        padding: 8px 12px;
        border-bottom: 1px solid #e9ecef;
        font-size: 13px;
        text-align: left;
    }

    .dropdown-link:last-child {
        border-bottom: none;
    }
}

/* ===== Home hero ===== */
.lab-hero {
    padding: 64px 20px 36px;
    text-align: center;
}

.lab-eyebrow {
    margin: 0 0 14px;
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand);
}

.lab-hero .hero-title {
    max-width: 900px;
    margin: 0 auto 18px;
    font-size: 2.6rem;
    line-height: 1.18;
}

.lab-hero .hero-subtitle {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.2rem;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin: 30px 0 0;
}

/* ===== Home video =====
   The laboratory's introduction film is the first substantial element on the
   page. It is a 16:9 clip, so it is sized from its own aspect ratio inside a
   capped column rather than cropped to a fixed 500px band the way site.css
   sizes the inherited carousel. */
.lab-video-section {
    padding: 0 0 8px;
    background: #05070d;
}

.lab-video-section .carousel-container {
    max-width: var(--lab-max);
    margin: 0 auto;
    padding: 0;
}

.lab-video-section .carousel-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 660px;
    object-fit: cover;
    background: #05070d;
}

.lab-video-section .carousel-controls {
    padding: 14px 0 18px;
    background: #05070d;
}

.lab-video-section .carousel-dot {
    background: rgba(255, 255, 255, .35);
}

.lab-video-section .carousel-dot:hover {
    background: var(--lab-red);
}

.lab-video-section .carousel-controls label[for] {
    /* The active-dot rules in site.css key off #home-slide-N; keep the colour
       legible against the dark band without re-declaring each selector. */
    border: 1px solid rgba(255, 255, 255, .25);
}

.lab-video-caption {
    max-width: var(--lab-max);
    padding: 22px 20px 34px;
    text-align: center;
}

.lab-video-caption-title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    color: var(--light);
}

.lab-video-caption p {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.02rem;
    color: #b9c2d0;
}

/* ===== Shared section headings ===== */
.lab-section-title {
    margin: 0 0 10px;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.lab-section-sub {
    max-width: 780px;
    margin: 0 auto 34px;
    font-size: 1.08rem;
    color: var(--muted);
    text-align: center;
}

/* ===== Home: about-the-laboratory band ===== */
.lab-intro {
    padding: 68px 0;
    background: var(--lab-paper);
}

.lab-intro-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 48px;
    align-items: center;
}

.lab-intro-text h2 {
    margin-top: 0;
    font-size: 2rem;
}

.lab-intro-text .lead {
    font-size: 1.15rem;
    color: var(--text);
}

.lab-intro-text p {
    font-size: 1.06rem;
    line-height: 1.75;
    color: var(--muted);
}

.lab-intro-links {
    margin-top: 26px !important;
    font-weight: 600;
}

.lab-intro-figure {
    margin: 0;
}

.lab-intro-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
}

.lab-intro-figure figcaption {
    margin-top: 12px;
    font-size: .93rem;
    color: var(--muted);
    text-align: center;
}

/* ===== Home: disciplines strip ===== */
.lab-disciplines {
    padding: 58px 0 6px;
}

.discipline-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    list-style: none;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0;
}

.discipline-list li {
    padding: 22px 16px;
    font-size: 1.02rem;
    font-weight: 600;
    text-align: center;
    color: var(--lab-ink);
    background: var(--light);
    border: 1px solid var(--lab-line);
    border-top: 3px solid var(--brand);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin: 0;
}

/* ===== Home: cards ===== */
.home-cards {
    padding-top: 52px;
}

.home-cards .cards {
    margin-top: 8px;
}

.card-blurb {
    padding: 0 20px 20px;
    margin: 0;
    font-size: .97rem;
    line-height: 1.6;
    color: var(--muted);
    text-align: center;
}

/* ===== Home: quote band ===== */
.lab-quote-band {
    padding: 64px 0;
    background: var(--lab-navy);
}

.lab-quote {
    max-width: 900px;
    margin: 0 auto;
    padding: 0;
    border: none;
    text-align: center;
}

.lab-quote p {
    margin: 0 0 20px;
    font-size: 1.45rem;
    line-height: 1.55;
    font-weight: 300;
    color: var(--light);
}

.lab-quote p::before {
    content: "\201C";
}

.lab-quote p::after {
    content: "\201D";
}

.lab-quote cite {
    display: block;
    font-size: 1rem;
    font-style: normal;
    font-weight: 600;
    color: #fca5a5;
}

/* ===== Home: news teaser ===== */
.lab-news {
    padding: 62px 0 20px;
}

.lab-news-head {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.lab-news-head .lab-section-title {
    margin: 0;
}

.lab-news-more {
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

.lab-news-more:hover {
    text-decoration: underline;
}

.lab-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 360px));
    justify-content: center;
    gap: 28px;
}

.lab-news-card {
    display: flex;
    flex-direction: column;
    background: var(--light);
    border: 1px solid var(--lab-line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.lab-news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.lab-news-poster {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--lab-paper);
}

.lab-news-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lab-news-body {
    padding: 18px 20px 24px;
}

.lab-news-body time {
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand);
}

.lab-news-body h3 {
    margin: 8px 0 6px;
    font-size: 1.12rem;
    line-height: 1.4;
}

.lab-news-body h3 a {
    color: var(--text);
    text-decoration: none;
}

.lab-news-body h3 a:hover {
    color: var(--brand);
}

.lab-news-loc {
    margin: 0;
    font-size: .92rem;
    color: var(--muted);
}

/* ===== Home: closing call to action ===== */
.lab-cta {
    margin-top: 58px;
    padding: 46px 0;
    background: var(--brand);
}

.lab-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    flex-wrap: wrap;
}

.lab-cta h2 {
    margin: 0 0 8px;
    font-size: 1.7rem;
    color: var(--light);
}

.lab-cta p {
    margin: 0;
    max-width: 720px;
    font-size: 1.04rem;
    color: #fee2e2;
}

/* ===== Interior page furniture ===== */
.crumbs {
    margin: 0 0 14px;
    font-size: .9rem;
    color: var(--muted);
}

.crumbs a {
    color: var(--muted);
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--brand);
    text-decoration: underline;
}

.page-inline-nav {
    margin-top: 30px;
    font-weight: 600;
}

.page-pager {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 26px;
    border-top: 1px solid var(--lab-line);
}

.page-pager a {
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

.page-pager-next {
    margin-left: auto;
}

.page-pager a:hover {
    text-decoration: underline;
}

/* ===== Media bands on the focus-area pages ===== */
.media-band {
    padding: 12px 0 40px;
}

.media-band .container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
}

.media-band-item {
    margin: 0;
}

.media-video,
.media-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
    background: var(--lab-paper);
}

.media-video {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #05070d;
}

.media-caption {
    margin: 10px 0 0;
    font-size: .93rem;
    color: var(--muted);
    text-align: center;
}

/* ===== About page ===== */
.about-figure-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 26px;
    margin: 30px 0 10px;
}

.about-figure {
    margin: 0;
}

.about-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.about-figure figcaption {
    margin-top: 10px;
    font-size: .93rem;
    color: var(--muted);
}

.about-quote {
    margin: 26px 0;
    padding: 6px 0 6px 22px;
    border-left: 4px solid var(--brand);
}

.about-quote p {
    margin: 0 0 10px;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text);
}

.about-quote cite {
    font-size: .95rem;
    font-style: normal;
    font-weight: 600;
    color: var(--muted);
}

.about-direction-links,
.about-partner-cta {
    font-weight: 600;
}

/* ===== People page ===== */
.partner-roster {
    list-style: none;
    padding: 0;
    margin: 18px 0;
}

.partner-roster li {
    padding: 13px 16px;
    margin-bottom: 10px !important;
    font-size: 1.02rem;
    background: var(--lab-paper);
    border-left: 3px solid var(--brand);
    border-radius: 0 6px 6px 0;
}

/* ===== Partners page ===== */
.partner-block {
    margin: 34px 0;
    padding: 28px;
    background: var(--light);
    border: 1px solid var(--lab-line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.partner-block-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.partner-block-head h3 {
    margin: 0;
}

.partner-logo {
    height: 46px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

.partner-logo-lining {
    height: 40px;
}

.partner-link {
    margin-bottom: 0;
    font-weight: 600;
}

/* ===== Contact page ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 26px;
    margin: 28px 0 8px;
}

.contact-card {
    padding: 26px;
    background: var(--lab-paper);
    border: 1px solid var(--lab-line);
    border-radius: 12px;
}

.contact-card h3 {
    margin-top: 0;
}

.contact-list {
    margin: 0;
}

.contact-list dt {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 14px;
}

.contact-list dt:first-child {
    margin-top: 0;
}

.contact-list dd {
    margin: 3px 0 0;
    font-size: 1.04rem;
    color: var(--text);
}

.link-list {
    list-style: none;
    padding: 0;
}

.link-list li {
    padding: 11px 0;
    border-bottom: 1px solid var(--lab-line);
    margin: 0 !important;
}

.useful-links-note {
    margin-top: 34px;
    font-size: .93rem;
    color: var(--muted);
}

/* ===== Footer ===== */
.footer-brand {
    padding: 42px 0 8px;
    text-align: center;
}

.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.footer-logo-lining {
    height: 38px;
    width: auto;
}

.footer-logo-sep {
    font-size: 1.3rem;
    color: #94a3b8;
}

.footer-name {
    margin: 0 0 6px;
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--light);
}

.footer-tagline {
    margin: 0 auto;
    max-width: 640px;
    font-size: .95rem;
    color: #cbd5e1;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 26px;
    padding: 22px 0;
    margin-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, .16);
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: .96rem;
}

.footer-links a:hover {
    color: var(--light);
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .16);
    text-align: center;
}

.footer-bottom p {
    font-size: .9rem;
    color: #cbd5e1;
}

/* ===== News, presented as articles rather than seminar listings ===== */
.news-card .news-body {
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--brand);
}

.news-summary {
    margin: 10px 0 0;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--muted);
}

.news-byline {
    margin: 10px 0 0;
    font-size: .9rem;
    color: var(--muted);
}

.news-more {
    margin: auto 0 0;
    padding-top: 14px;
    font-weight: 600;
}

.news-standfirst {
    padding: 0;
    margin: 0 0 26px;
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text);
    border-left: 4px solid var(--brand);
    padding-left: 20px;
}

.news-story {
    max-width: 820px;
}

.news-story h3 {
    margin-top: 0;
}

.news-story-text p {
    margin-bottom: 20px;
    font-size: 1.08rem;
    line-height: 1.8;
    color: #374151;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .lab-intro-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .discipline-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .lab-hero {
        padding: 42px 20px 26px;
    }

    .lab-hero .hero-title {
        font-size: 1.95rem;
    }

    .lab-hero .hero-subtitle {
        font-size: 1.06rem;
    }

    .lab-video-section .carousel-image {
        max-height: none;
    }

    .lab-video-caption-title {
        font-size: 1.15rem;
    }

    .lab-quote p {
        font-size: 1.18rem;
    }

    .lab-section-title {
        font-size: 1.7rem;
    }

    .logo-wordmark {
        max-width: 190px;
    }

    .logo-line-1 {
        font-size: 11.5px;
    }

    .logo-line-2 {
        font-size: 10px;
    }

    .lab-cta-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 560px) {
    .discipline-list {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        text-align: center;
    }

    .page-pager {
        flex-direction: column;
        gap: 12px;
    }

    .page-pager-next {
        margin-left: 0;
    }
}
