/* ==========================================================================
   Rowe Lab – Research in Evolutionary Ecology
   Modernized academic style, closely modelled on schluter lab site
   ========================================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
    --color-nav-bg:       #24433D;
    --color-nav-bg-light: #2F5850;
    --color-primary:      #003366;
    --color-link:         #3D6EA5;
    --color-link-hover:   #1F4C7A;
    --color-text:         #24292E;
    --color-text-muted:   #5B6570;
    --color-bg:           #FFFFFF;
    --color-surface:      #FAFBFC;
    --color-border:       #DFE3E8;
    --font-sans:          'Inter', system-ui, -apple-system, sans-serif;
    --transition:         0.15s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition);
}

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

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

.home-inline-photo {
    width: 100%;
    height: auto;
    margin: 8px auto 24px;
}

.home-inline-photo-sm {
    width: 56%;
}

.home-figure {
    max-width: 760px;
    margin: 8px 0 24px;
    text-align: center;
}

.home-figure .home-inline-photo,
.home-figure .home-inline-photo-sm {
    margin: 0 auto;
}

.home-figure-caption {
    width: 70%;
    font-size: 0.8rem;
    color: #666;
    margin: 6px auto 0;
}

.home-figure-caption-sm {
    width: 56%;
}

.contact-illustration {
    max-width: 600px;
    width: 100%;
    height: auto;
    margin: 24px auto 24px;
}

/* ---------- Layout Wrapper ---------- */
.site-wrapper {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Site Header + Nav (styled as one navbar, like the reference site) ---------- */
.site-header {
    background: var(--color-nav-bg);
    padding: 18px 0;
}

.site-header .site-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.site-branding {
    color: #fff;
}

.site-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: block;
    line-height: 1.2;
}

.site-title:hover {
    color: rgba(255,255,255,.8);
    text-decoration: none;
}

.site-description {
    font-size: 0.8125rem;
    color: rgba(255,255,255,.65);
    margin-top: 4px;
}

/* ---------- Primary Navigation ---------- */
.primary-nav {
    background: var(--color-nav-bg-light);
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.primary-nav .site-wrapper {
    padding-top: 0;
    padding-bottom: 0;
}

.primary-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.primary-nav ul li a {
    display: block;
    color: rgba(255,255,255,.8);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 12px 14px;
    text-decoration: none;
    transition: color var(--transition), background var(--transition);
}

.primary-nav ul li a:hover,
.primary-nav ul li a.active {
    color: #fff;
    background: rgba(255,255,255,.08);
    text-decoration: none;
}

/* ---------- Main Content Area ---------- */
.site-main {
    padding: 40px 0 64px;
    min-height: calc(100vh - 160px);
}

/* ---------- Page / Entry Styling ---------- */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.75rem;
    color: var(--color-primary);
    font-weight: 700;
    line-height: 1.2;
}

.entry-content h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 32px 0 12px;
}

.entry-content h3 {
    font-size: 1rem;
    color: var(--color-text);
    margin: 18px 0 6px;
    font-weight: 600;
}

.entry-content p {
    margin-bottom: 16px;
    color: var(--color-text);
    max-width: 760px;
}

.entry-content ul,
.entry-content ol {
    margin: 0 0 16px 24px;
}

.entry-content li {
    margin-bottom: 6px;
}

/* ---------- People Page ---------- */
.people-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 40px 0 12px;
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
}

.entry-content > .people-section-title:first-of-type,
.people-intro-text .people-section-title {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.alumni-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 3;
    column-gap: 32px;
}

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

.alumni-list li {
    font-size: 0.875rem;
    padding: 3.5px 0;
    break-inside: avoid;
    color: var(--color-text-muted);
}

.alumni-list:not(.single-column) li {
    padding: 1.75px 0;
}

.alumni-list li strong {
    color: var(--color-text);
    font-weight: 500;
}

/* ---------- Publications Page ---------- */
.pub-year-group {
    margin-bottom: 28px;
}

.pub-year {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
}

.pub-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pub-list li {
    font-size: 0.9rem;
    padding: 10px 0;
    position: relative;
    line-height: 1.6;
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

.pub-list li:hover {
    box-shadow: none;
    transform: none;
}

.pub-list li .pub-journal {
    font-style: italic;
    color: var(--color-text-muted);
}

/* ---------- Teaching Page ---------- */
.course-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.course-item {
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    padding: 18px 0;
    background: none;
    transition: none;
}

.course-item:hover {
    box-shadow: none;
    transform: none;
}

.course-item h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

.course-item .course-code {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-block;
    background: none;
    padding: 0;
    border-radius: 0;
}

.course-item p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ---------- Contact Page ---------- */
.contact-info {
    margin-top: 12px;
    border-top: 1px solid var(--color-border);
}

.contact-card {
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    padding: 22px 0;
    box-shadow: none;
    transition: none;
}

.contact-card:hover {
    box-shadow: none;
    transform: none;
}

.contact-card h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.contact-card h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 16px 0 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.contact-card p,
.contact-card address {
    font-size: 0.9rem;
    font-style: normal;
    line-height: 1.8;
    color: var(--color-text-muted);
}

.contact-card a {
    color: var(--color-link);
    font-weight: 500;
}

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

.contact-card ul {
    list-style: none;
    padding: 0;
}

.contact-card ul li {
    margin-bottom: 10px;
}

.people-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.people-intro-text {
    flex: 1;
}

.rowe-portrait {
    width: 220px;
    height: auto;
    flex-shrink: 0;
    margin: 0;
}

/* ---------- Site Footer ---------- */
.site-footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 24px 0;
}

.site-footer a {
    color: var(--color-text-muted);
    transition: color var(--transition);
}

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

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* ---------- Utility ---------- */
.text-muted {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .alumni-list {
        columns: 1;
    }

    .site-main {
        padding: 28px 0 48px;
    }

    .people-intro {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .people-intro-text {
        width: 100%;
    }

    .rowe-portrait {
        width: 160px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .primary-nav ul li a {
        padding: 10px 10px;
        font-size: 0.8125rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .people-intro {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .people-intro-text {
        width: 100%;
    }

    .rowe-portrait {
        width: 160px;
        margin: 0 auto;
    }
}
