/* Apply Inter font globally */
body {
    font-family: 'Inter', sans-serif;
    padding-top: 60px; /* Offset for fixed header, adjust if your header height changes */
}

/* Improve text readability */
h1, h2, h3 {
    font-weight: 600;
}

p, a {
    font-weight: 400;
}

/* Layout: Ensure content is centered and image is positioned lower */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

/* Main content area stretches to push the footer down */
.main-content {
    flex: 1;
}

/* ===================== HEADER & NAVIGATION ===================== */

/* Header: fixed at top, flex row with space between */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f8f9fa;
    padding: 10px 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* Name on the left */
.header-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-left: 1.5em;
}

/* Navigation on the right */
nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    position: relative;
}

/* Hamburger toggle */
.nav-toggle {
    display: none;
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 1em;
}

/* Horizontal nav menu, right-aligned */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0 1.5em 0 0;
    padding: 0;
    align-items: center;
    background: none;
    position: static;
    justify-content: flex-end;
}

.nav-menu li {
    display: block;
}

.nav-menu li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.nav-menu li a:hover,
.nav-menu li a.active,
.nav-menu .active {
    background-color: #ddd;
    color: #007bff;
}

/* Responsive (dropdown) menu for small/medium screens */
@media (max-width: 900px) {
    .header-name {
        margin-left: 1em;
        font-size: 1.2em;
    }

    .nav-toggle {
        display: block;
        z-index: 102;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        right: 0;
        top: 2.7em;
        margin: 0;
        padding: 1em 0;
        width: 200px;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0,0,0,0.11), 0 1.5px 6px rgba(0,0,0,0.07);
        border-radius: 8px;
        z-index: 101;
        align-items: flex-end;
        justify-content: flex-start;
    }

    .nav-menu.nav-menu-visible {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: right;
        margin: 0.5em 0;
        padding-right: 1.2em;
    }
}

/* ===================== END HEADER & NAVIGATION ===================== */


/* Publications header section */
.publications-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 15px 20px; /* Add space above, sides, and below */
    text-align: center; /* Center the text */
}

.publications-header h1 {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin: 0; /* Remove margin to keep it compact */
}

.publications-header p {
    font-size: 1rem;
    color: #555;
    margin-top: 10px; /* Space between title and paragraph */
}

/* Container for centering the publications */
.publication-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 15px; /* Add space on both sides */
}

/* Each individual publication entry */
.publication-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Make sure it's responsive */
    max-width: 1200px; /* Max width to prevent overly wide entries */
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px; /* Adjust space between entries */
}

.publication-entry.column {
    flex-direction: column;
    align-items: flex-start; /* Ensures text is aligned to the left */
}

/* Left section with the title and text */
.publication-left {
    flex: 1;
    font-size: 1rem;
    color: #333;
    text-align: left; /* Align text to the left */
}
.publication-right {
    flex: 1;
    text-align: right; /* Aligns content to the right */
}

/* Modify this to center text only if text exists on the right */
.publication-entry.has-right-text .publication-right {
    text-align: center; /* Center content when there's text on the right */
}

/* Right section with the image */
.publication-right img {
    max-width: none; /* Adjust image size */
    width: 70%;
    height: auto;
    object-fit: cover;
}

/* Ensure proper alignment and style for links */
.publication-left a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    margin-bottom: 0px; /* Removes extra spacing */
}

.publication-left a:hover {
    text-decoration: underline;
}

.link-text {
    text-decoration: underline; /* Makes the text appear underlined */
    color: #007bff; /* Optional: Make the text look like a link */
    cursor: pointer; /* Make it look clickable */
}

.publication-left .name {
    display: inline; /* Keeps the title inline with the text */
}

/* Ensure the blog name and date are on the next line but without extra space */
.publication-left span {
    display: block; /* Forces onto a new line */
    color: #555;
    font-size: 0.9em;
    line-height: 1.2; /* Controls spacing between lines */
    margin-top: 0px; /* Ensures no additional gap */
}

/* Footer styling */
footer {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    width: 100%; /* Ensure it spans the full width */
    margin-top: auto; /* Push the footer to the bottom */
}

/* ===================== Responsive: Stack image under text on small screens ===================== */
@media (max-width: 700px) {
  .publication-entry {
    flex-direction: column;
    align-items: stretch;
  }
  .publication-left {
    width: 100%;
    text-align: left;   /* Text stays left-aligned on mobile */
  }
  .publication-right {
    width: 100%;
    text-align: center; /* Image is centered on mobile */
  }
  .publication-right img {
    width: 90vw;           /* Make image almost as wide as the viewport */
    max-width: 98vw;       /* Prevent overflow */
    min-width: 0;
    margin: 0 auto 1rem auto;
    display: block;
    height: auto;
    border-radius: 8px;
  }
}
