/* =========================================
   1. Variables & Breakpoints
   ========================================= */
:root {
  /* Typography */
  --font-body: 'Source Sans Pro', sans-serif;
  --font-heading: 'Montserrat', sans-serif;

  /* Palette */
  --color-primary:    #2a3a54;
  --color-accent:     #e07a5f;
  --color-text:       #000000;
  --color-background: #ffffff;
  --color-link:       #0366d6;
  --color-link-hover: #ea4aaa;
  --color-highlight:  #FFBF00;

  /* Layout */
  --header-height: 4.375rem; 

  /* Responsive Breakpoints */
  --header-width: 82.5rem; 
}

/* =========================================
   2. Global Reset & Box Sizing
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: clamp(0.6875rem, 1.2vw, 0.8125rem);
}

body {
  margin: 0;
  padding-top: var(--header-height);
  font-family: var(--font-body);
  color: var(--color-primary);
  line-height: 1.3;
  background-color: var(--color-background);
}

/* =========================================
   3. Typography & Links
   ========================================= */
strong, b {
  font-weight: 600;
}

li {
  font-size: 0.93em;
  list-style: disc outside;
}

li::marker {
  font-size: 1.2em;
  font-weight: 700;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover,
a:focus {
  color: var(--color-link-hover);
  text-decoration: underline;
  outline: none;
}
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* =========================================
   4. Layout & Containers
   ========================================= */
section {
  width: 90%;
  max-width: 85rem; /* = 1200px */
  margin: 2rem auto;
}

header {
  text-align: center;
  margin: 2rem 0;
}

#header {
  margin-bottom: 1.875rem; /* = 30px */
  background-color: var(--color-background);
  color: #777;
  text-align: center;
  font-size: 1rem; /* = 16px */
  font-weight: 700;
}

#header-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--color-background);
  color: #333;
  opacity: 0.99;
  z-index: 1000;
}

#header-bar-wrap {
  max-width: var(--header-width);
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1rem;
}

.intro-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

#secrobust,
#secML,
#secconst {
  scroll-margin-top: var(--header-height);
}

/* =========================================
   5. Navigation
   ========================================= */
nav {
  padding: 1rem 0;
}

nav a {
  color: var(--color-text);
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 500;
  line-height: 1.2;
  background: none;
  transition: color 0.2s ease;
}

nav a:hover,
nav a:focus {
  color: var(--color-accent);
}

.main-menu,
.logo,
.main-contact {
  flex: 1;
}

.main-menu {
  display: flex !important;
  justify-content: flex-start;
  gap: 1rem;
}

.main-menu .main-option a {
  color: var(--color-text);
  text-transform: uppercase;
  line-height: var(--header-height);
}

.main-menu .main-selected a {
  font-weight: 700;
}

.logo {
  text-align: center;
  font-family: "KaTeX_Main", sans-serif;
  font-size: 1.875rem; /* = 30px */
  letter-spacing: -0.0625rem; /* = -1px */
  font-weight: bold;
  line-height: var(--header-height);
}

.main-contact {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.main-contact a {
  background: transparent;
  text-decoration: none;
  color: inherit;
  line-height: initial;
}

.main-contact a:hover,
.main-menu a:hover {
  background: whitesmoke;
}

/* =========================================
   6. Components
   ========================================= */
.linksWeb {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;      
  margin-top: 0;
  flex-wrap: wrap;    
}

.linksWeb a {
  color: var(--color-text);
  font-weight: 100;
  white-space: nowrap;        
  margin-top: 0;              
  border-bottom: thin dashed; 
}

.abstract,
.summary {
  margin: 0.5rem 0 0 1.5rem;
  background: #f9f9f9;
  padding: 0.75rem;
  border-left: 3px solid var(--color-accent);
}

a.abstractlink,
a.summlink,
a.abstractlinkFull {
  cursor: pointer;
}
a.abstractlink,
a.paperlink-selected {
  display: none;
  text-decoration: none;
}

/* Removed underline for selected authors titles */
.authors_selected a {
  color: var(--color-primary);
  text-decoration: none;
}

/* Paper titles and author links get dashed underline */
.paper_title_selected a,
.authors a:link,
.authors a:visited {
  color: var(--color-primary);
  border-bottom: thin dashed;
}

ul.paperlistFull {
  list-style: disc outside;
  margin: 0.75rem 0 1rem 1.5rem;
  padding: 1rem;
  line-height: 1.4;
}

ul.paperlistFull li {
  margin-bottom: 1.5rem;
}

ul.paperlist {
  list-style: disc outside;
  margin: 0.75rem 0 1rem 1.5rem;
  padding: 0;
  line-height: 1.25;
}

ul.paperlist li {
  margin-bottom: 0.5rem;
}

/* =========================================
   7. Images & Media
   ========================================= */
#imageCH {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.profile-pic {
  width: clamp(12rem, 25vw, 16.375rem);
  /*aspect-ratio: 1/1;*/
  border-radius: 30%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
}

/* =========================================
   8. Utilities & Animations
   ========================================= */
.hidden {
  display: none !important;
}

.flash-highlight {
  animation: highlightFade 2s ease-in-out forwards;
}

@keyframes highlightFade {
  0%   { background-color: transparent; }
  10%, 90% { background-color: var(--color-highlight); }
  100% { background-color: transparent; }
}

/* =========================================
   9. Responsive Media Queries
   ========================================= */


@media (max-width: 1000px) {
  #header-bar-wrap {
    justify-content: center;
  }
  .main-contact {
    display: none;
  }
 .main-menu {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width:  25%;             /* fluid: 20% of viewport */
    min-width: 80px;       /* never narrower than 150px */
    max-width: 90px;       /* never wider than 300px */
    height: 100%;       
    padding: 1rem 0;
    z-index: 1000;
    box-sizing: border-box;
  }

  .container,
  section {
    margin-left: min(50px, max(300px, 20%)); 
  }

  .main-menu .main-option {
    flex: 0 0 auto;
  }
  .main-menu .main-option a {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    line-height: 1.3;
    text-align: left;
  }
}
