/* ==========================================================================
   The Edinburgh Single-Molecule Biophysics Group — static site stylesheet
   Matches the markup generated in *.html (classes: .wrap .site-header .brand
   .site-nav .hero .gallery .logo-row .member .research-item .pub-list ...)
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #3c4043;
    background: #fff;
}

/* ---- layout ----------------------------------------------------------- */
.wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

main.wrap { padding-top: 28px; padding-bottom: 48px; }

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

/* ---- top banner (laser optics background on every page) --------------- */
.page-banner {
    position: relative;
    background: #091f3f url("../images/header-bg.jpg") center/cover no-repeat;
    color: #fff;
    padding: 16px 0 30px;
}

.page-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(9, 31, 63, 0.55);
}

.page-banner .wrap { position: relative; z-index: 1; }

.banner-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px 24px;
}

.brand { display: block; }
.brand img { height: 46px; width: auto; }

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 0.94rem;
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    padding: 2px 0;
    border-bottom: 2px solid transparent;
    opacity: 0.9;
}

.site-nav a:hover { opacity: 1; }

.site-nav a.active {
    font-weight: 700;
    border-bottom-color: #fff;
    opacity: 1;
}

.banner-head { margin-top: 26px; text-align: center; }
.banner-head h1 { color: #fff; margin: 0; font-weight: 300; }
.banner-sub { color: rgba(255, 255, 255, 0.9); margin: 0.4rem 0 0; font-size: 1.05rem; }

/* ---- headings & text -------------------------------------------------- */
h1 {
    font-size: 1.9rem;
    line-height: 1.25;
    font-weight: 300;
    color: #0b2c53;
    margin: 0 0 0.6rem;
}

h2 {
    font-size: 1.35rem;
    font-weight: 400;
    color: #0b2c53;
    margin: 1.8rem 0 0.8rem;
}

h3 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.25rem; }
h4 { font-size: 1rem; font-weight: 600; margin: 0 0 0.3rem; }

p { margin: 0.5rem 0 0.9rem; }

a { color: #1a73e8; }

.page-title {
    border-bottom: 3px solid #0b2c53;
    padding-bottom: 0.4rem;
    margin-bottom: 1.2rem;
}

.section-title {
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 0.4rem;
    margin-top: 2.4rem;
}

.muted { color: #5f6368; }

/* ---- home hero -------------------------------------------------------- */
.hero { text-align: center; padding: 14px 0 8px; }

.hero h1 { margin-bottom: 0.3rem; }

.subtitle {
    font-size: 1.1rem;
    color: #5f6368;
    margin: 0 0 1.2rem;
}

/* the group photo — deliberately capped so it never fills the screen */
.hero-photo {
    width: 100%;
    max-width: 680px;
    height: auto;
    margin: 0.6rem auto 1rem;
    border-radius: 6px;
}

.bluesky { font-size: 0.95rem; color: #5f6368; }

.lead {
    max-width: none;
    margin: 0.6rem 0 1rem;
    text-align: left;
    font-size: 1.02rem;
}

/* ---- home gallery ----------------------------------------------------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin: 1.6rem 0;
}

.gallery img {
    width: 100%;
    height: 105px;
    object-fit: cover;
    border-radius: 4px;
}

/* ---- funders ---------------------------------------------------------- */
.funders { margin-top: 1.4rem; }

.logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px 30px;
    margin-top: 0.8rem;
}

.logo-row img {
    height: 46px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

/* ---- research --------------------------------------------------------- */
.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 1rem;
}

.research-item {
    border-top: 3px solid #0b2c53;
    padding-top: 10px;
}

.research-item img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 4px;
}

.research-item h2 {
    font-size: 1.15rem;
    margin: 0.7rem 0 0;
}

/* ---- team ------------------------------------------------------------- */
.team-grid { margin-top: 0.5rem; }

.member {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 18px 0;
    border-bottom: 1px solid #eef0f2;
}

.member-photo {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

.member-body { flex: 1 1 auto; min-width: 0; }

.member .role {
    font-style: italic;
    color: #5f6368;
    margin: 0 0 0.4rem;
}

.member p { font-size: 0.97rem; }

.prev-list .prev { margin-bottom: 1.1rem; }
.prev-list .prev p { font-size: 0.94rem; margin-top: 0.2rem; }

/* ---- publications ----------------------------------------------------- */
.year {
    font-size: 1.25rem;
    border-bottom: 2px solid #0b2c53;
    padding-bottom: 0.3rem;
    margin-top: 2rem;
}

.pub-list { padding-left: 1.6rem; }
.pub-list li { margin-bottom: 1rem; }

.pub-title { font-weight: 600; color: #202124; margin: 0 0 0.15rem; }
.pub-authors { font-size: 0.9rem; color: #5f6368; margin: 0 0 0.15rem; }
.pub-journal { font-size: 0.9rem; font-style: italic; margin: 0; }
.pub-journal a { font-style: normal; }

/* ---- research card links + sub-pages ---------------------------------- */
.research-link { display: block; text-decoration: none; color: inherit; }
.research-link:hover .research-item { transform: translateY(-3px); }
.research-item { transition: transform 0.15s ease; }

.sub-h {
    font-size: 1.2rem;
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 0.3rem;
    margin-top: 2rem;
}

.sub-list { padding-left: 1.4rem; }
.sub-list li { margin: 0.3rem 0; }

.sub-img {
    width: 100%;
    max-width: 720px;
    height: auto;
    margin: 1.2rem auto;
    border-radius: 6px;
}

.back { margin-top: 2.2rem; font-weight: 600; }

.pub-entry { margin-bottom: 1.5rem; }

/* ---- embedded news blog ----------------------------------------------- */
main.wrap-fluid { max-width: none; padding: 0; margin: 0; }

.news-frame {
    width: 100%;
    height: 85vh;
    min-height: 640px;
    border: 0;
    display: block;
}

/* ---- footer ----------------------------------------------------------- */
.site-footer {
    border-top: 1px solid #e8eaed;
    background: #f8f9fa;
    padding: 22px 0;
    margin-top: 30px;
    font-size: 0.9rem;
    color: #5f6368;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer .copy { color: #80868b; }

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 600px) {
    h1 { font-size: 1.5rem; }
    .subtitle { font-size: 1rem; }
    .brand img { height: 42px; }
    .member { flex-direction: column; }
    .member-photo { width: 120px; height: 120px; flex-basis: auto; }
    .gallery img { height: 90px; }
}
