/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
    font-size: 16px;
    /* Default scroll padding for desktop/portrait */
    scroll-padding-top: 130px;
}

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #f9f9f9; /* This is the page background shown in gaps */
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 0 20px;
}

a {
    color: #333;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: #800000; /* Maroon */
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 {
    font-size: 1.8rem;
    color: #555;
    text-align: left; /* Align title to the left */
    margin-bottom: 1rem; /* Adjust bottom margin */
}

/* Header Styles */
#header {
    background-color: #800000; /* Maroon */
    color: #fff;
    /* Increased padding for a bigger header */
    padding: 1.5rem 0; /* Was 1rem */
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.header-left {
    display: flex;
    align-items: center;
}

.profile-pic {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-right: 20px;
    border: 2px solid #fff;
    object-fit: cover;
    flex-shrink: 0; /* Prevent shrinking */
}

/* Wrapper for Name and Title */
.name-title-wrapper {
    display: flex;
    flex-direction: column; /* Stack name and title */
    margin-right: 25px; /* Space between name/title block and icons */
}

/* Styling for Name */
.name-title-wrapper h1 {
    font-size: 2.1rem;
    font-variant: small-caps;
    color: #fff;
    margin: 0; /* Reset margin */
    line-height: 1.1; /* Adjust line height */
}
/* Ensure link inside h1 keeps styles */
.name-title-wrapper h1 a {
    color: #fff;
    text-decoration: none;
}


/* Styling for Job Title */
.job-title {
    font-size: 1rem; /* Adjust size as needed */
    color: #eee; /* Slightly lighter color */
    margin: 0; /* Remove default paragraph margin */
    margin-top: 2px; /* Small space below name */
    font-weight: 400; /* Regular weight */
    line-height: 1.2;
}

/* Contact Icons */
.contact-icons {
    display: flex; /* Ensure icons are in a row */
    align-items: center;
    flex-shrink: 0; /* Prevent shrinking */
}
.contact-icons a {
    color: #fff;
    margin-left: 15px; /* Slightly increased spacing */
    font-size: 1.4rem; /* Slightly larger icons */
    transition: color 0.3s ease;
}
.contact-icons a:hover {
    color: #ddd;
    text-decoration: none;
}

/* Navigation */
#header nav {
    flex-shrink: 0; /* Prevent shrinking */
}
#header nav ul {
    display: flex;
    align-items: center;
}
#header nav li {
    margin-left: 25px;
}
#header nav a {
    color: #fff;
    font-weight: bold;
    padding: 5px 0;
    transition: color 0.3s ease;
    border-bottom: 2px solid transparent; /* For hover effect */
}
#header nav a:hover {
    color: #ddd;
    text-decoration: none;
    border-bottom-color: #ddd; /* Underline on hover */
}

/* Sections */
main {
    padding-top: 2rem; /* Add padding below sticky header */
}
section {
    padding: 2.5rem 0; /* Internal space */
    margin-bottom: 2rem; /* Creates space BELOW each section */
    background-color: #fff; /* Default background for sections */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-radius: 5px;
}
#profile {
    background-color: #e9ecef; /* Slightly darker gray */
    margin-bottom: 2rem; /* Explicitly defined margin */
}
/* Who Am I Section Paragraph */
.profile-paragraph {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
    margin-top: 1rem; /* Space below the H2 */
}

.highlight {
    color: #800000; /* Maroon color */
    font-weight: inherit;
}

.markedhigh {
    color: #800000; /* Maroon color */
    font-weight: bold;
}

/* Section List Items (for other sections) */
section ul {
    padding-left: 10px;
}

section ul li {
    margin-bottom: 1.8rem;
    padding-left: 1.8rem;
    position: relative;
    border-left: 3px solid #800000; /* old #eee */
    padding-bottom: 1rem;
}

section ul li::before {
    content: '>';
    position: absolute;
    left: 0.5rem;
    top: 1px;
    color: #800000;
    font-weight: bold;
    font-size: 1.1rem;
}

.date {
    font-style: italic;
    color: #666;
    display: inline-block;
    min-width: 90px;
    margin-right: 5px;
}

.title {
    color: #333;
    font-weight: 700;
}

.place {
    font-style: italic;
    color: #777;
    margin-left: 5px;
}

.description {
    margin-top: 0.5rem;
    color: #444;
    padding-left: 0;
    font-size: 0.95rem;
}

/* Footer */
footer {
    background-color: #333;
    color: #ccc;
    text-align: center;
    padding: 2rem 20px;
    margin-top: 3rem;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1100px;
    margin: auto;
}

.legal-notice {
    margin-bottom: 1rem;
}
.legal-notice a {
    color: #fff;
}

.cert-logos img {
    width: auto;
    height: 150px;
    margin: 0 10px;
    display: inline-block;
    vertical-align: middle;
    filter: grayscale(100%) brightness(100%);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.cert-logos img:hover {
    opacity: 1;
    filter: none;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.6rem; }

section {
    padding: 2rem 0;
}

.date {
    display: block;
    min-width: 0;
    margin-bottom: 0.2rem;
}
 .title {
     display: block;
 }
 .place {
    display: block;
    margin-left: 0;
    margin-bottom: 0.3rem;
}

/* --- Hamburger Menu Styles --- */
.hamburger-menu {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 1010; /* Ensure it's above other header content if overlapping */
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: #fff; /* White bars for maroon header */
    transition: all 0.3s ease-in-out;
}

/* Hamburger animation to "X" when active */
.hamburger-menu.active .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-menu.active .hamburger-bar:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Menu */
.mobile-nav {
    display: none; /* Hidden by default */
    position: absolute; /* Or fixed, depending on desired behavior */
    top: 100%; /* Position below the header */
    left: 0;
    width: 100%;
    background-color: #800000; /* Slightly darker maroon or same as header */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1005; /* Below hamburger but above page content */
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.2); /* Subtle separator */
}

.mobile-nav.active {
    display: block; /* Show when active */
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.mobile-nav li {
    padding: 0;
}

.mobile-nav a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.mobile-nav a:hover {
    background-color: #800000; /* Original header color or slightly lighter */
    text-decoration: none;
}


/* --- Responsive Adjustments for Navigation --- */

/* Styles for when the hamburger menu should be visible */
/* This breakpoint should match your existing mobile styles (e.g., 768px) */
@media (max-width: 768px) {
    /* Adjust scroll padding for smaller header */
    html {
        scroll-padding-top: 250px; /* Adjust if header height changes drastically */
    }

    #header {
        padding: 1rem 0; /* Reduce padding on small screens */
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-left {
        margin-bottom: 1rem;
        flex-direction: column; /* Stack profile pic, name/title, icons */
    }

    .profile-pic {
        width: 60px; /* Reduce pic size */
        height: 60px;
        margin-right: 0;
        margin-bottom: 0.5rem; /* Space below pic */
    }

     .name-title-wrapper {
         margin-right: 0; /* Remove margin when stacked */
         margin-bottom: 0.75rem; /* Space below title block */
         align-items: center; /* Center name/title */
     }

     .name-title-wrapper h1 {
         font-size: 1.8rem; /* Adjust name size */
     }

     .job-title {
         font-size: 0.9rem; /* Adjust title size */
     }

    .contact-icons a {
        margin: 0 10px; /* Adjust spacing */
        font-size: 1.3rem; /* Adjust icon size */
    }

    #header nav ul {
        justify-content: center;
        flex-wrap: wrap;
        padding-top: 0.5rem;
    }

    #header nav li {
        margin: 5px 10px;
    }

    .desktop-nav {
        display: none; /* Hide desktop nav links */
    }
    .hamburger-menu {
        display: block; /* Show hamburger button */
        /* Potentially adjust its position if needed, e.g., using order or margin */
        /* Placed after desktop-nav in HTML, so it should appear to the right by default in flex */
        margin-left: auto; /* Push hamburger to the right if header-content is flex */
    }
}
 
@media screen and (orientation: landscape) and (max-height: 500px) {
    /* Target mobile landscape where height is limited */

    html {
        /* Adjust scroll padding for the shorter landscape header */
        scroll-padding-top: 75px; /* NEEDS TESTING - Approx height */
    }

    #header {
        padding: 0.5rem 0; /* Reduce vertical padding significantly */
    }

    .header-content {
        flex-direction: row; /* Try to keep things in a row */
        justify-content: space-between;
        align-items: center;
    }

    .header-left {
       flex-direction: row; /* Keep pic, name/title, icons in a row */
       margin-bottom: 0; /* Remove bottom margin */
       width: auto; /* Don't force full width */
       align-items: center; /* Vertically align items in the row */
    }

    .profile-pic {
        width: 45px; /* Smaller picture */
        height: 45px;
        margin-right: 10px; /* Reduced margin */
        margin-bottom: 0; /* Remove bottom margin */
    }

    .name-title-wrapper {
       margin-right: 15px; /* Space between name/title and icons */
       text-align: left; /* Ensure text is left aligned */
       align-items: flex-start; /* Align text block top */
    }

    .name-title-wrapper h1 {
        font-size: 1.3rem; /* Smaller name */
        line-height: 1.1;
    }

    .job-title {
        font-size: 0.75rem; /* Smaller title */
        line-height: 1;
    }

    .contact-icons {
        margin-bottom: 0; /* Remove bottom margin */
    }
    .contact-icons a {
        font-size: 1.1rem; /* Smaller icons */
        margin-left: 8px; /* Tighter spacing */
    }

    #header nav {
        /* Ensure nav stays right */
        margin-left: auto; /* Push nav to the right if needed */
    }
    #header nav ul {
        padding-top: 0; /* Remove padding */
        justify-content: flex-end; /* Align nav items right */
        flex-wrap: nowrap; /* Prevent nav wrapping if possible */
    }
    #header nav li {
        margin: 0 8px; /* Tighter nav spacing */
    }
    #header nav a {
        font-size: 0.85rem; /* Smaller nav text */
        padding: 2px 0;
    }
    .mobile-nav {
        /* Consider max-height for the dropdown in landscape to prevent it from being too tall */
        max-height: calc(100vh - 65px); /* Example: viewport height minus header height */
        overflow-y: auto; /* Add scroll if content exceeds max-height */
    }
    .hamburger-menu {
        /* Ensure it's still visible in landscape mobile */
        display: block;
        margin-left: auto;
    }
    .desktop-nav {
        display: none;
    }
}

/* --- Accordion Styles --- */
.accordion-container {
    margin-top: 1rem; /* Space above the first accordion */
    margin-bottom: 1rem; /* Space above the first accordion */
}

.accordion-button {
    background-color: #f0f0f0; /* Light gray */
    color: #444;
    cursor: pointer;
    padding: 15px 20px; /* Increased padding */
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1.1rem; /* Slightly larger font */
    font-weight: 600; /* Semi-bold */
    transition: background-color 0.4s ease;
    border-bottom: 1px solid #ddd; /* Separator line */
    position: relative; /* For the plus/minus icon */
}

.accordion-button:first-of-type {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}
.accordion-button:last-of-type {
   /* border-bottom-left-radius: 4px;
   border-bottom-right-radius: 4px; */
   /* Removed bottom radius as panel comes next */
}
.accordion-button:not(:last-of-type) {
    /* No bottom border if it's not the last button before a panel */
}


.accordion-button:hover, .accordion-button.active {
    background-color: #e0e0e0; /* Darker on hover/active */
}

.accordion-button:focus {
    outline: 2px solid var(--primary-color); /* o #800000 */
    outline-offset: -2px;
}

/* Plus/Minus Icon */
.accordion-button::after {
    content: '\002B'; /* Unicode character for "plus" sign (+) */
    color: #777;
    font-weight: bold;
    float: right;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.accordion-button.active::after {
    content: "\2212"; /* Unicode character for "minus" sign (-) */
    transform: rotate(180deg); /* Optional: if you want a rotating arrow effect instead of just + - */
}


.accordion-panel {
    padding: 0 18px;
    background-color: #e9ecef;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    /* border-bottom: 1px solid #ddd; */ /* Applied to last panel instead */
}
.accordion-panel:last-of-type {
    border-bottom: 1px solid #ddd; /* Only bottom border for the very last panel */
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

/* Styling for lists inside accordion panels */
.accordion-panel ul {
    padding: 20px 0px 10px 0px; /* Top/bottom padding inside panel, no left list indent for now */
    list-style: none; /* Ensure no default bullets if not already set */
}

.accordion-panel ul li {
    /* Using existing list item styling from other sections, but adjusted for no ::before bullet */
    margin-bottom: 1.5rem;
    position: relative;
    border-left: 3px solid #800000; /* Maroon left border for emphasis */
    padding-left: 1rem; /* Space after the maroon border */
    padding-bottom: 1rem; /* Space below each item */
}
.accordion-panel ul li:last-child {
    border-bottom: none; /* No separator for the last item in a list */
    margin-bottom: 0;
}

/* Remove the default ::before bullet for accordion lists */
.accordion-panel ul li::before {
    content: none;
}

/* Ensure .date, .title, .place, .description styles apply well */
.accordion-panel .date { /* No change needed if already globally styled */ }
.accordion-panel .title { /* No change needed if already globally styled */ }
.accordion-panel .place { /* No change needed if already globally styled */ }
.accordion-panel .description { margin-top: 0.4rem; } /* Minor adjustment */