/* ============================================
   ENDERGO.NET — Olivieri Group, University of Basel
   Shared stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Serif+Display&display=swap');

/* ---------- Variables ---------- */
:root {
    --teal:        #2A8C82;
    --teal-light:  #A5D7D2;
    --teal-pale:   #dff0ee;
    --teal-dark:   #1e6960;
    --bg:          #f7f8f6;
    --bg-card:     #ffffff;
    --text:        #2c2c2c;
    --text-muted:  #6b7280;
    --accent:      #e8a44a;
    --border:      #e2e5e0;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
    --shadow-md:   0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:   0 8px 30px rgba(0,0,0,.10);
    --radius:      10px;
    --max-w:       960px;
    --font-body:   'DM Sans', sans-serif;
    --font-display:'DM Serif Display', serif;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; transition: color .2s; }
a:hover { color: var(--teal-dark); }

/* ---------- Site header ---------- */
.site-header {
    background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 50%, var(--teal-light) 100%);
    color: white;
    padding: 2.5rem 1.5rem 1rem;
    position: relative;
    overflow: hidden;
}
.site-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: var(--accent);
}
.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.site-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: .01em;
    margin-bottom: .15rem;
}
.site-subtitle {
    font-size: .85rem;
    font-weight: 300;
    opacity: .85;
    letter-spacing: .04em;
}

/* ---------- Navigation ---------- */
.site-nav {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.site-nav a {
    color: var(--text);
    font-size: .88rem;
    font-weight: 500;
    padding: .85rem 1.25rem;
    position: relative;
    transition: color .2s, background .2s;
}
.site-nav a:hover,
.site-nav a.active {
    color: var(--teal);
    background: var(--teal-pale);
}
.site-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 1.25rem; right: 1.25rem;
    height: 2.5px;
    background: var(--teal);
    border-radius: 2px 2px 0 0;
}

/* ---------- Main content wrapper ---------- */
.main {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ---------- Section headings ---------- */
.section-title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    color: var(--teal-dark);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: .5rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px; height: 3px;
    background: var(--accent);
    border-radius: 2px;
}
.section-title--center {
    text-align: center;
}
.section-title--center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 2rem;
    transition: box-shadow .25s, transform .25s;
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ---------- Bio cards (People page) ---------- */
.bio-card {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
    margin-bottom: 2rem;
}
.bio-card__photo {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--teal-light);
    flex-shrink: 0;
}
.bio-card__name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--teal-dark);
    margin-bottom: .35rem;
}
.bio-card__text {
    text-align: justify;
    font-size: .92rem;
    color: var(--text);
}
.bio-card__text p { margin-bottom: .65rem; }
.bio-card__contact {
    font-size: .85rem;
    margin-top: .5rem;
    color: var(--text-muted);
}
.bio-card__contact a { color: var(--teal); font-weight: 500; }

.role-label {
    display: inline-block;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--teal);
    background: var(--teal-pale);
    padding: .2rem .65rem;
    border-radius: 20px;
    margin-bottom: .5rem;
}

/* ---------- Publications ---------- */
.pub-list { list-style: none; }
.pub-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.pub-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.pub-item__number {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--teal-light);
    flex-shrink: 0;
    width: 36px;
    text-align: right;
    padding-top: 2px;
}
.pub-item__body { flex: 1; font-size: .9rem; line-height: 1.65; }
.pub-item__title {
    color: var(--teal);
    font-weight: 600;
    background: rgba(166,215,210,.2);
    padding: 1px 6px;
    border-radius: 4px;
}
.pub-item__img {
    margin-top: .75rem;
    max-width: 400px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.pub-year-heading {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--accent);
    margin: 2.5rem 0 1rem;
    padding-bottom: .35rem;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

/* ---------- Research page ---------- */
.research-text {
    text-align: justify;
    font-size: .95rem;
    line-height: 1.8;
    max-width: 740px;
    margin: 0 auto 2rem;
}
.research-img {
    max-width: 700px;
    margin: 0 auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* ---------- Join us ---------- */
.join-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: justify;
}
.join-content p { margin-bottom: 1rem; }
.join-img {
    max-width: 400px;
    margin: 2rem auto 0;
    border-radius: var(--radius);
}

/* ---------- Bonus / download cards ---------- */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.download-card {
    text-align: center;
    padding: 1.75rem 1.5rem;
}
.download-card__icon {
    font-size: 2.5rem;
    margin-bottom: .75rem;
}
.download-card__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--teal-dark);
    margin-bottom: .5rem;
}
.download-card__desc {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.55;
}
.btn {
    display: inline-block;
    background: var(--teal);
    color: white;
    padding: .55rem 1.4rem;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    transition: background .2s, transform .15s;
}
.btn:hover {
    background: var(--teal-dark);
    color: white;
    transform: translateY(-1px);
}
.btn--outline {
    background: transparent;
    color: var(--teal);
    border: 1.5px solid var(--teal);
}
.btn--outline:hover {
    background: var(--teal);
    color: white;
}

/* ---------- Home hero ---------- */
.hero {
    text-align: center;
    padding: 3rem 1rem;
}
.hero__tagline {
    font-family: var(--font-display);
    font-size: 1.45rem;
    color: var(--teal-dark);
    margin-bottom: 1rem;
    line-height: 1.4;
}
.hero__text {
    max-width: 620px;
    margin: 0 auto 2rem;
    font-size: .95rem;
    color: var(--text-muted);
    line-height: 1.75;
}
.hero__links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.highlight-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 3rem;
}
.highlight-card {
    text-align: center;
    padding: 1.75rem 1.25rem;
}
.highlight-card__icon {
    font-size: 1.8rem;
    margin-bottom: .5rem;
}
.highlight-card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--teal-dark);
    margin-bottom: .35rem;
}
.highlight-card__text {
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--teal-dark);
    color: rgba(255,255,255,.75);
    text-align: center;
    padding: 1.5rem;
    font-size: .8rem;
    margin-top: 3rem;
}
.site-footer a { color: var(--teal-light); }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
    .site-title { font-size: 1.5rem; }
    .bio-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .bio-card__text { text-align: left; }
    .bio-card__photo { width: 130px; height: 130px; }
    .pub-item { flex-direction: column; }
    .pub-item__number { width: auto; text-align: left; }
    .nav-inner { justify-content: center; }
    .site-nav a { padding: .7rem .85rem; font-size: .82rem; }
    .hero__tagline { font-size: 1.2rem; }
}
