/* ---------- GLOBAL ---------- */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.55;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: #124f9c;
}

body.dark-mode {
    background-color: #111418;
    color: #e6e8eb;
}

body.dark-mode a {
    color: #8fc4ff;
}

h1,
h2 {
    line-height: 1.2;
}

h2 {
    margin: 0 0 0.7rem;
    font-size: clamp(1.55rem, 2.1vw, 2rem);
}

p,
li {
    font-size: 1rem;
}

section {
    margin-bottom: 2.2rem;
}


.content {
    margin-left: 270px;   /* MUST MATCH .sidebar width */
    padding: 30px;
    box-sizing: border-box;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    z-index: 2000;
}

.skip-link:focus {
    left: 8px;
}


/* ---------- SIDEBAR (DESKTOP) ---------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    box-sizing: border-box;
    background-color: black;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar h1 {
    margin: 0;
    font-size: 24px;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin-top: 40px;
}

.sidebar nav ul li {
    margin: 20px 0;
}

.sidebar nav ul li a {
    color: white;
    text-decoration: none;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a:focus,
#menu a:hover,
#menu a:focus {
    text-decoration: underline;
}

.sidebar nav ul li a.active,
#menu a.active {
    font-weight: 700;
}

.sidebar-actions {
    margin-top: auto;
    padding-top: 20px;
}

.theme-toggle {
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: transparent;
    color: inherit;
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 40px;
    cursor: pointer;
    font-size: 0.9rem;
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar .theme-toggle {
    color: #fff;
    min-height: 44px;
    border-color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .sidebar,
body.dark-mode .topbar,
body.dark-mode #menu {
    background-color: #0b0d10;
}

body.dark-mode #menu a.active {
    background-color: #f3f5f7;
    color: #111418;
}

body.dark-mode .cv-note {
    color: #bcc4cc;
}

body.dark-mode .page-updated {
    color: #bcc4cc;
}

/* ---------- HOME SECTION (PHOTO LEFT, TEXT RIGHT) ---------- */

.home-section {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 30px;     /* space between photo and text */
    flex-wrap: nowrap;
    margin-bottom: 40px;
}

.home-photo {
    flex-shrink: 0;     /* prevents image from shrinking */
}

.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
}

.home-text {
    flex: 1;            /* text takes the rest of the horizontal space */
    min-width: 300px;
}

/* ---------- Match layout of Home section ---------- */

.contact-section {
    display: flex;
    flex-direction: column;  /* stacks in a clean column */
    margin-left: 0;          /* remove any unintended offset */
    max-width: 700px;        /* matches text width */
    padding-left: 0;
}

#contact {
    margin-left: calc(150px + 30px); /* photo width + gap */
    max-width: 700px;
}

.home-cta {
    margin-top: 16px;
}

.cv-note {
    font-size: 0.95rem;
    color: #555;
}

.profiles {
    margin-top: 1.25rem;
}

.profiles h3 {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
}

.profile-links {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    padding: 0;
    margin: 0;
}

.profile-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.6);
}

body.dark-mode .profile-links a {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

.profile-links a:hover,
.profile-links a:focus {
    text-decoration: underline;
}

.page-updated {
    font-size: 0.95rem;
    color: #555;
}

.publication-list li {
    margin-bottom: 0.65rem;
}


/* ---------- TOPBAR (MOBILE) ---------- */

.topbar {
    display: none; /* Hidden on desktop */
    background-color: black;
    color: white;
    padding: 12px 16px;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(1.15rem, 4.8vw, 1.4rem);
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 4px;
}

/* ---------- MOBILE SLIDE‑DOWN MENU ---------- */

#menu {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    background-color: black;
    color: white;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1001;
}

#menu[hidden] {
    display: none;
}

#menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#menu li {
    margin: 8px 0;
}

#menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 14px 8px;
    min-height: 44px;
    box-sizing: border-box;
    border-radius: 8px;
}

#menu a.active {
    background-color: #fff;
    color: #000;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
}

.overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 1002;
    }

    .sidebar-actions {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: 18px 16px 28px;
    }

    .home-section {
        flex-direction: column;
        gap: 14px;
    }

    .home-text {
        min-width: 0;
    }

    h2 {
        font-size: clamp(1.4rem, 6.6vw, 1.8rem);
        margin-bottom: 0.6rem;
    }

    p,
    li {
        font-size: 0.98rem;
    }

    .home-text p,
    .home-text ul,
    #contact p {
        margin-top: 0.6rem;
        margin-bottom: 0.6rem;
    }

    .profile-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content section + section {
        margin-top: 1.9rem;
    }

    #contact {
        margin-left: 0;
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding: 10px 12px;
    }

    .topbar-controls {
        gap: 6px;
    }

    .topbar .theme-toggle {
        font-size: 0.82rem;
        padding: 8px 10px;
    }

    .profile-links {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 16px 12px 24px;
    }

    .profile-photo {
        width: 128px;
        height: 128px;
    }

    #menu {
        padding: 14px 12px;
        top: 52px;
    }

    #menu a {
        padding: 12px 8px;
    }
}

