@import "./styles.css";


:root{
    --h-title-color:#3948d2;
}

.header {
    border-bottom: solid 2px var(--bs-blue);
    z-index: 10000;
}

.bg-bottom {
    background-color: var(--h-title-color);
}

.top-section {
    position: relative;
    padding: 10rem 0;
    background-position: center;
    background-size: cover;
    height: 25rem;
}

/* Hero variant that preserves image aspect ratio without cropping */
#research-hero.aspect-contain {
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
    /* Provide a flexible min-height so tall images can expand naturally */
    min-height: 320px;
    /* Let height auto-expand based on intrinsic aspect ratio; use padding-top fallback */
    padding-top: 2rem;
    padding-bottom: 2rem;
    height: auto; /* Override .top-section fixed height to preserve original aspect ratio */
}

/* Optional: add a subtle backdrop for text readability when using contain */
#research-hero.aspect-contain .top-section-content {
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Image-based hero to avoid any cropping */
#research-hero .hero-media {
    position: relative;
    z-index: 1; /* ensure image sits above ::before overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* ensure no accidental overflow when image is wide */
}

#research-hero img#research-hero-img {
    display: block;
    width: 100%;
    height: auto;            /* maintain original aspect ratio */
    max-height: 60vh;        /* prevent the hero from becoming too tall */
    object-fit: contain;     /* be explicit: never crop */
    background: #222;        /* placeholder background while loading */
}

/* Slightly reduce padding and allow auto height for the research hero when using image */
#research-hero {
    padding: 1.5rem 0 1rem 0;
    height: auto;
    min-height: 320px; /* keep a visible area even before image loads */
}

/* Disable default dark overlay when we are using an <img> */
#research-hero.no-overlay::before {
    display: none;
}

.top-section h2 {
    font-weight: 400;
}

.top-section .top-section-content {
    position: relative;
    z-index: 1;
}

.top-section:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

section header h2{
    font-family: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    color: var(--h-title-color);
    font-size: 2.3rem;
    line-height: 4rem;
}

section .main-body{
    font-size: 1.3rem;
    font-weight: 200;
    line-height: 2.4rem;
}


.bg-gradient-primary-to-secondary-light {
    background: linear-gradient(45deg, #fcfcfc, #ffffff) !important;
}

.bg-gradient-primary-to-secondary-gray {
    background: linear-gradient(45deg, #f0f0f0, #f1f1f1) !important;
}



.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: fill;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}


#avatar {
    position: relative;
    height: 0;
    top:min(-65px,max(-100px,calc(-1*100vw/12)));
    max-width: 55em;
    margin: 0 1.5rem 0 0;
    float: right;
    z-index: 9000;
}

#avatar img {
    height: max(130px,min(200px,calc(100vw/6)));
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 991px) {
    #avatar {
        margin: 0;
    }
}

/* Compact spacing for pages with fixed-top navbar (used by research.html) */
.page-with-fixed-nav {
    padding-top: 4rem; /* minimal offset so content not hidden by navbar */
}
@media (min-width: 992px) {
    .page-with-fixed-nav {
        padding-top: 4.5rem; /* slightly more on larger screens */
    }
}


