/* file: assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Montserrat:wght@300;400;700&family=Source+Sans+3:wght@400;600;700&family=Space+Grotesk:wght@400;500;700&display=swap');

/* ---- Theme + font tokens ---- */
:root {
    /* fonts (default set) */
    --display-font: 'Space Grotesk', sans-serif;
    --body-font: 'Source Sans 3', sans-serif;

    /* light theme colors */
    --bg: #fafafa;
    --text: #333;
    --muted: #777;
    --faint: #dbdbdb;
    --border: #dbdbdb;
    --accent: #7eb47f;
    --panel: #f3f3f3;
    --icon: #404040;
    --pic-border: #686868;
    --footer-bg: #2c2c2c;   /* darker band in light mode */
    --footer-text: #f0f0f0;
}

/* alternate font set (the original Montserrat + Lato) */
:root[data-fonts="alt"] {
    --display-font: 'Montserrat', sans-serif;
    --body-font: 'Lato', sans-serif;
}

/* dark theme colors */
:root[data-theme="dark"] {
    --bg: #16171a;
    --text: #e6e6e6;
    --muted: #9a9a9a;
    --faint: #444;
    --border: #34363b;
    --accent: #8fc490;
    --panel: #212327;
    --icon: #cfcfcf;
    --pic-border: #555;
    --footer-bg: #e8e8e8;   /* lighter band in dark mode */
    --footer-text: #222;
}

/* Reset some default styles for a clean slate */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    transition: background-color 0.25s ease, color 0.25s ease;
    /* Sticky footer: fill at least the viewport so the footer sits at the bottom */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bold {
    font-weight: bold;
}

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

.inactive-link, .inactive-link:hover {
    color: var(--faint);
}

/* Hover effect for all links */
a:hover {
    color: var(--accent);
}

.section {
    margin-bottom: 55px;
}

.section a {
    font-weight: bold;
}

.section p {
    margin-bottom: 10px;
}

.section h4 {
    margin-bottom: 20px;
}

.social-links {
    width: 140px;
    float: right;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.paper-icon {
    color: var(--icon);
    margin-left: 8px;
}

.social-icon {
    color: var(--icon);
    margin-left: 8px;
}

.news-list {
    list-style-type: disc; /* or 'none' if you don't want any bullets */
    padding-left: 20px; /* Adjusts padding to align with your content */
    margin-left: 0; /* Adjust as needed */
    /* Additional styling here if needed */
}

/* Wrapper for the entire layout: a centered flex row (sidebar + content) */
.wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex: 1 0 auto; /* grow to push the footer to the bottom on short pages */
    width: 100%;
    max-width: 750px; /* Sidebar (160) + content; centered on the page */
    margin: 100px auto 0;
}

.section {
    padding-top: 100px; /* Same as your top margin */
    margin-top: -100px; /* Negative margin to offset the position */
}

/* Sidebar sticks alongside the content while scrolling */
.sidebar {
    position: sticky;
    top: 40px;
    width: 160px; /* Sidebar width */
    flex-shrink: 0; /* Never collapse into the main content */
    align-self: flex-start;
    text-align: right;
    padding: 0 25px 0 0;
}

.sidebar ul {
    list-style-type: none;
}

.sidebar ul li a {
    padding: 8px 0;
    display: block;
    font-size: 0.92em;       /* slightly smaller than the name, to keep hierarchy */
    letter-spacing: 0.01em;  /* gently open tracking, contrasting the tight name */
}

.sidebar .nametag a {
    font-family: var(--display-font);
    font-size: 1.2em;           /* "Matthias Hofer" fits one line at this larger size */
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;        /* never wrap to a second line */
    display: block;
}

.profile-pic-frame {
    width: 136px;
    height: 136px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--pic-border);
    display: block;
    margin: 4px auto 15px;
}

/* Pan/zoom driven by CSS variables; defaults reproduce the original fit.
   Tune via the photo tool at /admin/ and paste the values here. */
.profile-pic {
    --pic-x: -1.0%;
    --pic-y: -2.8%;
    --pic-zoom: 1.18;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: translate(var(--pic-x, 0%), var(--pic-y, 0%)) scale(var(--pic-zoom, 1));
}

/* Main content styling */
.main-content {
    flex: 1;
    min-width: 0; /* Allow long words/links to wrap instead of forcing overflow */
    padding: 0 25px 0 25px;
    margin-bottom: 160px;
    line-height: 1.6;
}

.scrollable-content-header {
    margin-top: 0px;
    font-family: var(--display-font);
    font-weight: 300;
    font-size: 1.1em;
    margin-bottom: 10px;
    text-transform: uppercase;
    border-bottom: 1px var(--border) solid;
}

.research-section {
    background-color: var(--panel);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 5px;
    border-left: 3px solid var(--border); /* color set per-section to match its research area */
}

.publication-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.publication-list .paper {
    margin-bottom: 14px;
}

.publication-list .venue {
    color: var(--muted);
}

.publication-list .year {
    color: var(--muted);
}

/* Research-area markers */
.area-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    vertical-align: middle;
}

.paper-areas {
    margin-left: 6px;
    white-space: nowrap;
}

.paper-areas .area-dot {
    margin-left: 3px;
}

.area-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 4px 0 20px;
    font-size: 0.82em;
    color: var(--muted);
}

.area-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.underline {
    text-decoration: underline;
}

/* ---- Footer bar with theme + font toggles ---- */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    width: 100%;
    padding: 13px 25px; /* ~80% of the previous height */
    flex-shrink: 0;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.site-footer-inner {
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-note {
    font-size: 0.85em;
    opacity: 0.85;
}

.footer-updated {
    opacity: 0.6;
}

.footer-toggles {
    display: flex;
    gap: 4px;
}

.footer-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 1em;
    line-height: 1;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.footer-btn:hover {
    color: var(--accent);
    background-color: rgba(127, 127, 127, 0.18);
}

/* Small tablets and large smartphones: stack the sidebar on top */
@media (max-width: 768px) {
    .wrapper {
        flex-direction: column;
        margin-top: 50px;
    }

    .sidebar {
        position: static;
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .sidebar ul {
        display: flex;
        justify-content: center;
        padding: 0;
    }

    .sidebar ul li {
        margin: 0 10px;
    }

    .sidebar .profile-pic-frame {
        margin: 10px auto;
    }

    .main-content {
        padding: 0 15px;
        margin-bottom: 50px;
    }

    .social-links {
        width: 100%;
        text-align: center;
        float: none;
        padding-top: 15px;
        margin-top: 15px;
        border-top: none;
    }

    .social-links a {
        margin: 0 10px;
    }
}

/* Smartphones */
@media (max-width: 480px) {
    .sidebar ul {
        flex-direction: column;
        align-items: center;
    }

    .sidebar ul li {
        margin: 10px 0;
    }

    .sidebar .nametag a {
        font-size: 1.2em;
    }

    .main-content {
        padding: 0 10px;
    }

    .social-links a {
        margin: 5px;
    }
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}
