/* -----------------------------------------------------
   GLOBAL
----------------------------------------------------- */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #222;
    line-height: 1.6;
}

p {
    text-align: justify;
    text-justify: inter-word;
}

a {
    text-decoration: none;
    color: rgb(50, 50, 179); /* link color for text links */
    transition: color 0.2s;
}

a:hover {
    color: rgb(255, 82, 82);
}

/* -----------------------------------------------------
   CONTAINER
----------------------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* -----------------------------------------------------
   HEADER
----------------------------------------------------- */
header {
    background: rgb(21, 96, 130); /* header color */
    padding: 10px 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

/* Site name with icon */
.site-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Roboto Slab', Georgia, serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: white;

    /* Always show overline + underline in red */
    text-decoration-line: underline;
    text-decoration-color: rgb(255, 82, 82);
    text-decoration-thickness: 4px;
    text-underline-offset: 4px;
    text-overline-offset: 4px;
}

/* Keep site name white on hover */
.site-name:hover {
    color: white;
}

.site-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* -----------------------------------------------------
   NAVIGATION
----------------------------------------------------- */
.header-nav a {
    margin-left: 20px;
    font-weight: 500;
    color: white;
    position: relative;
    text-decoration: none; /* remove default underline */
    transition: color 0.2s;
}

/* Hover: red text + lines */
.header-nav a:hover {
    color: rgb(255, 82, 82);
}

.header-nav a:hover::before,
.header-nav a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgb(255, 82, 82);
}

.header-nav a:hover::before { top: -3px; } /* overline */
.header-nav a:hover::after  { bottom: -3px; } /* underline */

/* Active page: white text + red lines */
.header-nav a.active {
    color: white;
}

.header-nav a.active::before,
.header-nav a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgb(255, 82, 82);
}

.header-nav a.active::before { top: -3px; }
.header-nav a.active::after  { bottom: -3px; }

/* -----------------------------------------------------
  HAMBURGER MENU FOR MOBILE
----------------------------------------------------- */
/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background: rgb(21, 96, 130);
        flex-direction: column;
        padding-top: 80px;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    .header-nav.active {
        right: 0;
    }
    
    .header-nav a {
        margin: 0;
        padding: 15px 30px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: block;
    }
    
    /* Hamburger animation when active */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Optional: darken background when menu is open */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .menu-overlay.active {
        display: block;
    }
}


/* -----------------------------------------------------
   MAIN CONTENT
----------------------------------------------------- */
main {
    margin: 40px auto;
}

/* -----------------------------------------------------
   HOME INTRO SECTION
----------------------------------------------------- */
.intro-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-top: 40px;
}

.intro-left {
    flex: 1;
}

.home-name {
    font-family: 'Roboto Slab', Georgia, serif;
    font-weight: bold;
    font-size: 3rem;
    margin: 0 0 10px 0;
}

.home-role {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 25px;
}

/* Profile Photo */
.intro-photo img {
    width: 330px;
    border-radius: 6px;
    object-fit: cover;
}

/* -----------------------------------------------------
   CONTACT ICONS
----------------------------------------------------- */
.contact-icons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.icon-circle {
    width: 36px;                  /* 75% of previous size */
    height: 36px;
    background: rgba(21, 96, 130, 0.5);  /* 50% opacity header color */
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
    transition: 0.2s;
}

.icon-circle:hover {
    background: rgb(21, 96, 130);
    transform: translateY(-3px);
}

.cv-icon {
    font-size: 0.8rem;
}

/* Mobile */
@media (max-width: 850px) {
    .intro-wrapper {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .intro-photo img {
        width: 240px;
    }
}

/* -----------------------------------------------------
   COURSE / RESEARCH BOXES
----------------------------------------------------- */
.course-box {
    background-color: #ffffff;
    padding: 25px 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2); /* darker, smaller, southeast */
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.course-text {
    flex: 1;
}

.course-university {
    font-size: 0.85rem;
    font-weight: bold;
    margin: 0 0 2px 0; /* Reduced from 5px */
    color: #555;
    text-transform: uppercase;
}

.course-name {
    margin: 0 0 5px 0;
    font-size: 1.45rem;
    font-weight: bold;
    color: rgb(0, 90, 181);
    line-height: 1.2; /* Add this to reduce line spacing */
}

.course-name a {
    color: rgb(0, 90, 181); /* same as course-name text */
    text-decoration: none;
    transition: color 0.2s;
}

.course-name a:hover {
    color: rgb(255, 82, 82); /* optional hover color */
}

.course-role-date {
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    margin-top: -3px; /* Brings it closer to course-name */
    margin-bottom: 5px; /* Reduced from 15px */
}

.course-image img {
    width: 400px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.course-image a img {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.course-image a:hover img {
    box-shadow: 0 8px 15px rgba(0,0,0,0.1); /* optional shadow for depth */
}

/* Description */
.course-description {
    font-size: 1rem;
    margin-top: 4px; /* Add explicit top margin */
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Buttons */
.course-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.course-buttons .btn {
    padding: 10px 20px;
    border-radius: 6px;
    background-color: rgba(21, 96, 130, 0.5);
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: 0.2s;
}

.course-buttons .btn:hover {
    background-color: rgb(21, 96, 130); /* existing */
    color: rgb(255, 82, 82);           /* add this line */
    transform: translateY(-2px);
}

@media (max-width: 500px) {
    .course-buttons {
        flex-direction: column;
    }
    .course-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 500px) {

    /* Reduce horizontal padding inside the box */
    .course-box {
        padding: 20px;
    }

    /* Make buttons smaller and ensure they never overflow */
    .course-buttons .btn {
        width: 100%;
        padding: 8px 12px;      /* smaller padding */
        font-size: 0.9rem;      /* slightly smaller text */
        box-sizing: border-box; /* prevents overflow */
    }
}

@media (max-width: 700px) {
    .course-content {
        flex-direction: column;
    }

    .course-image img {
        width: 100%;
        margin-top: 10px;
    }
}

@media (max-width: 700px) {
    .course-name {
        line-height: 1.15; /* Even tighter line height on mobile */
    }
    
    .course-description {
        margin-top: 5px; /* Less space before description on mobile */
        margin-bottom: 12px;
    }
}

/* -----------------------------------------------------
   PAGE HEADINGS
----------------------------------------------------- */
main h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: black;
}

/* -----------------------------------------------------
   FOOTER
----------------------------------------------------- */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 40px 0;
    color: white;
    background: rgba(21, 96, 130, 0.5); /* 50% opacity of header */
}

/* Update footer container to use flexbox */
.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-container p {
    margin: 0;
}

.footer-image {
    height: 60px
    width: auto;
    max-height: 60px
}

/* Mobile responsiveness */
@media (max-width: 500px) {
    .footer-container {
        flex-direction: column;
        gap: 15px;
    }
}

/* -----------------------------------------------------
   PRESENTATION BOX
----------------------------------------------------- */
.presentations-list {
    list-style: none;
    padding-left: 0;
}

.presentations-list li {
    display: block;
    margin-bottom: 12px;
}

.presentation-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: top;
}

.presentations-list a {
    white-space: normal;
}

.presentations-list,
.presentations-list li,
.presentations-list a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.calendar-icon {
    width: 18px;
    height: 18px;
    fill: rgb(21, 96, 130);
    margin-right: 6px;
    flex-shrink: 0;
}

/* Fix presentation box overflow on mobile */
@media (max-width: 500px) {
    .presentations-list {
      font-size: 0.9rem; /* Slightly smaller text */
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .presentations-list a {
        word-break: break-word
    }
    
    /* Reduce padding on mobile for more space */
    .course-box {
        padding: 20px;
    }
}

/* -----------------------------------------------------
   CAROUSEL
----------------------------------------------------- */
.carousel {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.carousel-slide {
    display: none;
}

.carousel-slide.active {
    display: block;
}

/* Caption with integrated navigation */
.carousel-caption-nav {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changed from center */
    gap: 10px;
    margin-bottom: 8px;
    min-height: 48px;
    width: 100%; /* Ensure full width */
}

.carousel-caption {
    font-size: 0.9rem;
    color: #444;
    text-align: center;
    flex: 1; /* Changed to take up all available space */
    padding: 0 10px; /* Add some padding from buttons */
}

/* Navigation arrows beside caption */
.carousel-btn {
    background: rgba(21,96,130,0.3);
    border: none;
    padding: 6px 10px;
    font-size: 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.carousel-btn:hover {
    background: rgba(21,96,130,0.7);
    color: white;
}

/* Image wrapper with fixed height */
.carousel-image-wrapper {
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.9),
        rgba(255,255,255,0.5),
        rgba(255,255,255,0)
    );
    height: 300px; /* Fixed height container */
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

/* Remove the old controls section */
.carousel-controls {
    display: none;
}

/* Abstract and carousel container */
.abstract-carousel-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 40px;
}

.abstract-carousel-container > div:first-child {
    flex: 2;
}

.abstract-carousel-container > div:last-child {
    flex: 1;
}

/* Mobile: stack vertically */
@media (max-width: 850px) {
    .abstract-carousel-container {
        flex-direction: column;
    }
    
    .abstract-carousel-container > div {
        width: 100%;
        flex: unset;
    }
}

/* Carousel and presentations container */
.carousel-presentations-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.carousel-presentations-container > div {
    flex: 1;
}

/* Mobile: stack vertically */
@media (max-width: 850px) {
    .carousel-presentations-container {
        flex-direction: column;
    }
    
    .carousel-presentations-container > div,
    .carousel-presentations-container > section {
        width: 100%;
        flex: unset;
    }
}

/* make box-sizing consistent so padding/borders don't create overflow */
*, *::before, *::after {
  box-sizing: border-box;
}

/* container that holds carousel + presentations */
.carousel-presentations-container {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  flex-wrap: wrap;   /* allow children to wrap to next line on narrow screens */
}

/* force each column to be allowed to shrink */
.carousel-presentations-container > div,
.carousel-presentations-container > section {
  flex: 1 1 0;   /* grow 1, shrink 1, base 0 */
  min-width: 0;  /* critical: lets the item shrink below its content width */
}

/* presentations box: full width inside its flex column */
.carousel-presentations-container > section.course-box {
  margin: 0;          /* you had margin: 0 earlier but ensure consistent */
  width: 100%;
  overflow-wrap: anywhere; /* allow long words / links to wrap */
}

/* ensure images and wrappers don't force overflow */
.carousel-image-wrapper,
.carousel-img,
.course-image img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* if you want the presentations box to be slightly narrower on large screens */
@media (min-width: 1000px) {
  /* e.g. give carousel 60% and presentations 40% */
  .carousel-presentations-container > div:first-child { flex: 0 1 60%; }
  .carousel-presentations-container > section { flex: 0 1 40%; }
}
