/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #FAE051;
  color: #002469;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

/* Skip navigation link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Sticky Header and Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #002469;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav ul {
  display: flex;
  justify-content: space-around;
  list-style: none;
  flex-wrap: wrap;
  padding: 10px;
}

nav li {
  padding: 10px;
  text-align: center;
  flex: 1;
  min-width: 150px;
}

/* Navigation links on BLUE background */
nav a {
  color: #FAE051;
  text-decoration: none;
  display: block;
}

nav a:visited {
  color: #FAE051;
}

nav a:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

nav a:focus {
  outline: none;
}

nav a:focus-visible {
  color: #FFFFFF;
  text-decoration: underline;
  outline: 2px solid #FAE051;
  outline-offset: 2px;
}

/* Current page indicator */
nav .current-page {
  color: #002469;
  font-weight: bold;
}

nav img {
  display: block;
  margin: 0 auto 10px;
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  scroll-margin-top: 260px;
}

.profile-section {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  align-items: flex-start;
}

.profile-info {
  flex: 1;
  min-width: 300px;
  padding: 20px 0;
}

.profile-image {
  background-color: #002469;
  padding: 20px;
  text-align: center;
  flex: 0 0 auto;
}

/* Headings */
h1 {
  font-size: 2.5em;
  margin-bottom: 15px;
  color: #002469;
}

h2 {
  font-size: 1.3em;
  margin-bottom: 15px;
  margin-top: 20px;
  font-weight: bold;
  color: #000000;
}

h3 {
  font-size: 1.1em;
  margin-bottom: 10px;
  margin-top: 15px;
  font-weight: bold;
  color: #002469;
}

.contact-info {
  margin-top: 20px;
}

.contact-info p {
  margin-bottom: 12px;
  font-size: 0.95em;
}

/* Links in main content (on YELLOW background) */
main a {
  color: #002469;
  text-decoration: underline;
}

main a:visited {
  color: #4B0082;
}

main a:hover {
  color: #000000;
  background-color: rgba(0, 36, 105, 0.1);
}

main a:focus {
  outline: none;
}

main a:focus-visible {
  color: #000000;
  background-color: rgba(0, 36, 105, 0.1);
  outline: 2px solid #002469;
  outline-offset: 1px;
}

/* Teaching page layout with sidebar quotes */
.teaching-container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 30px;
  align-items: start;
  padding-top: 20px;
}

.teaching-content {
  min-width: 0;
}

.teaching-content section {
  margin-bottom: 15px;
}

.teaching-content p {
  margin-bottom: 8px;
}

/* Quote sidebar - SCROLLABLE */
.quote-sidebar {
  position: sticky;
  top: 260px;
  align-self: flex-start;
  background-color: #002469;
  color: #FAE051;
  padding: 20px;
  position: sticky;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #FAE051 #002469;
}

/* Webkit scrollbar styling for quote sidebar */
.quote-sidebar::-webkit-scrollbar {
  width: 8px;
}

.quote-sidebar::-webkit-scrollbar-track {
  background: rgba(250, 224, 81, 0.1);
}

.quote-sidebar::-webkit-scrollbar-thumb {
  background: #FAE051;
  border-radius: 4px;
}

.quote-sidebar::-webkit-scrollbar-thumb:hover {
  background: #FFFFFF;
}

.quote {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(250, 224, 81, 0.3);
}

.quote:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.quote p {
  font-style: italic;
  font-size: 0.85em;
  line-height: 1.6;
  margin-bottom: 8px;
}

.quote .attribution {
  font-style: normal;
  font-size: 0.8em;
  margin-top: 8px;
  opacity: 0.9;
}

/* Quote section (for other pages like index) */
.quote-section {
  background-color: #002469;
  color: #FAE051;
  padding: 30px 20px;
  margin: 30px 0;
  text-align: center;
}

.quote-section p {
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.8;
  margin-bottom: 10px;
}

.quote-section .attribution {
  font-style: normal;
  margin-top: 15px;
}

/* Lists */
ul {
  margin-left: 20px;
  margin-bottom: 15px;
}

li {
  margin-bottom: 8px;
}

/* Articles (for publications page) */
article {
  margin-bottom: 15px;
}

/* Footer - updated layout with blue background */
footer {
  background-color: #002469;  /* Changed from #FAE051 to #002469 */
  padding: 20px;
  margin-top: 40px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-nav ul {
  display: flex;
  list-style: none;
  gap: 20px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.footer-nav li {
  padding: 0;
  margin: 0;
}

.footer-logo {
  margin-left: auto;
}

/* Footer links on BLUE background - changed to yellow/white */
footer a {
  color: #FAE051;  /* Changed from #002469 to #FAE051 */
  text-decoration: underline;
}

footer a:visited {
  color: #FAE051;  /* Changed to match main color */
}

footer a:hover {
  color: #FFFFFF;  /* Changed to white for hover */
  text-decoration: underline;
}

footer a:focus {
  outline: none;
}

footer a:focus-visible {
  color: #FFFFFF;
  outline: 2px solid #FAE051;  /* Changed outline color */
  outline-offset: 1px;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .footer-nav ul {
    flex-direction: column;
    gap: 10px;
  }
  
  .footer-logo {
    margin-left: 0;
    align-self: center;
  }
}


/* Responsive design */
@media (max-width: 1024px) {
  .teaching-container {
    grid-template-columns: 1fr;
  }
  
  .quote-sidebar {
    position: static;
    max-height: 400px;
    order: 2;
  }
}

@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
  }
  
  .profile-section {
    flex-direction: column;
    align-items: center;
  }
  
  h1 {
    font-size: 2em;
  }
  
  nav img, .profile-image img {
    width: 100px;
    height: 100px;
  }
  
  footer nav ul {
    flex-direction: row;
  }
  
  .quote-sidebar {
    max-height: 300px;
  }
}

@media (max-width: 480px) {
  footer nav ul {
    flex-direction: column;
  }
}

/* CV page specific styles */
.cv-container {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 30px;
  align-items: start;
}

.cv-content {
  min-width: 0;
}

.cv-content section {
  margin-bottom: 30px;
}

.cv-content dl {
  margin-left: 0;
}

.cv-content dt {
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 5px;
}

.cv-content dd {
  margin-left: 20px;
  margin-bottom: 10px;
}

.cv-image-container {
  margin: 20px 0;
  text-align: center;
}

.cv-image-container img {
  max-width: 100%;
  height: auto;
}

/* CV sidebar */
.cv-sidebar {
  background-color: #002469;
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 260px;
}

.cv-sidebar img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 1024px) {
  .cv-container {
    grid-template-columns: 1fr;
  }
  
  .cv-sidebar {
    position: static;
    order: 2;
  }
}

/* Publications page specific styles */
.pubs-container {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 30px;
  align-items: start;
}

.pubs-content {
  min-width: 0;
}

.pubs-content article {
  margin-bottom: 15px;
}

.pubs-content article p {
  line-height: 1.8;
}

.pubs-content article img {
  vertical-align: middle;
  margin-right: 8px;
}

.book-entry {
  margin-bottom: 20px;
}

.book-entry img {
  margin-bottom: 15px;
}

/* Publications sidebar with images */
.pubs-sidebar {
  background-color: #002469;
  padding: 15px;
  text-align: center;
  position: sticky;
  top: 260px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #FAE051 #002469;
  align-self: flex-start;
}

.pubs-sidebar figure {
  margin-bottom: 15px;
}

.pubs-sidebar figure:last-child {
  margin-bottom: 0;
}

.pubs-sidebar img {
  display: block;
  margin: 0 auto;
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (max-width: 1024px) {
  .pubs-container {
    grid-template-columns: 1fr;
  }
  
  .pubs-sidebar {
    position: static;
    order: 2;
  }
  
  .pubs-sidebar figure {
    display: inline-block;
    margin: 10px;
  }
}

/* Remove underline from image-only links */
main a img {
  text-decoration: none;
}

/* Better: add margin after PDF icons */
.pubs-content article a img {
  margin-right: 8px;
  vertical-align: middle;
  text-decoration: none;
}

/* Remove text decoration from links containing only images */
main a:has(img:only-child) {
  text-decoration: none;
}

/* ArXiv link styling - updated for logo image */
.arxiv-link {
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  text-decoration: none !important;
  padding: 0;
  background-color: transparent;
  transition: opacity 0.2s;
  border: none;
}

.arxiv-link img {
  vertical-align: middle;
  display: inline-block;
  border: none;
}

.arxiv-link:hover,
.arxiv-link:focus {
  opacity: 0.7;
  outline: none;
}

.arxiv-link:focus-visible {
  outline: 2px solid #002469;
  outline-offset: 2px;
  opacity: 1;
}

/* Request link (info icon) styling */
.request-link {
  display: inline-block;
  margin-right: 6px;
  font-size: 1.1em;
  text-decoration: none !important;
  vertical-align: baseline;
  transition: transform 0.2s ease;
}

.request-link:hover,
.request-link:focus {
  transform: scale(1.2);
  text-decoration: none !important;
}

.request-link:focus-visible {
  outline: 2px solid #002469;
  outline-offset: 2px;
  border-radius: 3px;
}

/* Update availability note */
.availability-note {
  margin-top: 40px;
  padding: 20px;
  background-color: rgba(0, 36, 105, 0.05);
  border-left: 4px solid #002469;
  scroll-margin-top: 20px; /* For smooth scrolling to anchor */
}

.availability-note h2 {
  font-size: 1.1em;
  margin-bottom: 10px;
}

.availability-note p {
  font-size: 0.95em;
  line-height: 1.6;
}
