/* Global Styles */

html{
    font-family: 'Open Sans', sans-serif !important;
}

body{
    padding-top: 56px;
    min-width: 320px;
}


@media (max-width:991.98px) {
   .nav-link {
      padding: 15px 5px;
   }
}

@media (max-width:767px){
   .nav-item{
       text-align:center;
   }
   
   .nav-link {
       padding: 12px 8px;
       font-size: 1.1rem;
   }
   
   .navbar-brand {
       font-size: 1.2rem;
   }
}

/* Navbar active state with full-height background highlight */
.navbar-nav .nav-item.active .nav-link,
.navbar-nav .nav-link.active {
    background-color: rgba(0, 0, 0, 0.1);
    color: inherit;
    margin-top: -8px;
    margin-bottom: -8px;
    padding-top: calc(0.5rem + 8px);
    padding-bottom: calc(0.5rem + 8px);
}

.navbar-nav .nav-item.active .nav-link:hover,
.navbar-nav .nav-link.active:hover {
    background-color: rgba(0, 0, 0, 0.15);
    color: inherit;
}

/* Bootstrap 5 btn-default to match Bootstrap 3 appearance */
.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.42857143;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.btn-default:hover,
.btn-default:focus,
.btn-default:active {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
    text-decoration: none;
}

.btn-default.btn-lg {
    padding: 14px 16px;
    font-size: 18px;
    line-height: 1.33;
    border-radius: 6px;
}

/* Bootstrap 5 jumbotron to match Bootstrap 3 appearance */
.jumbotron {
    padding: 30px;
    margin-bottom: 30px;
    color: inherit;
    background-color: #eee;
    border-radius: 6px;
}

/* Bootstrap 5 doesn't have text-justify by default */
.text-justify {
    text-align: justify;
}

/* Mobile typography improvements */
@media (max-width: 768px) {
    .text-justify {
        text-align: left;
    }
    
    h1, h2 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    h3, h4 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 0.8rem;
    }
    
    .lead {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .transparent-bg h2 {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .transparent-bg .lead {
        font-size: 1rem;
        line-height: 1.4;
    }
}


/* Full Page Image Header Area */

.header-bg{
    padding-top:20%;
    padding-bottom:70%;
    background-color:white;
    max-height: 750px;
    --parallax-image: url(../img/splash.jpg);
    --parallax-position: top center;
    --parallax-size: auto 100vh;
    background-image: url(../img/splash.jpg);
    background-repeat: no-repeat;
    background-position: top center;
    background-attachment: fixed;
}

.transparent-bg{
    background-color: rgba(255, 255, 255, 0.9);
    max-width:700px;
    padding: 2px 15px;
    margin-left: 10%;
}

/* Mobile-specific header optimizations */
@media (max-width: 768px) {
    .header-bg {
        padding-top: 15%;
        padding-bottom: 25%;
        min-height: 400px;
        max-height: none;
        background-attachment: scroll;
        background-size: cover;
        position: relative;
        overflow: hidden;
    }

    .header-bg > * {
        position: relative;
        z-index: 1;
    }
    
    .transparent-bg {
        margin-left: 5%;
        margin-right: 5%;
        max-width: 90%;
        padding: 10px 15px;
    }
    
    .header-bg .btn {
        margin-top: 10px;
    }
}

.content{
    padding: 5%;
    position: relative;
    z-index: 1;
    background-color: white;
}

/* Mobile-specific content spacing */
@media (max-width: 768px) {
    .content {
        padding: 3% 4%;
    }

    .mobile-parallax .content {
        box-shadow: 0 0 0 100vmax white;
        clip-path: inset(0 -100vmax);
    }
}

.content-bg{
    height: 600px;
    --parallax-offset: 0px;
    --parallax-image: url(../img/about.jpg);
    --parallax-position: center;
    --parallax-size: auto 80vh;
    background-image: url(../img/about.jpg);
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    background-size: auto 600px;
    -o-background-size: auto 600px;
    -moz-background-size: auto 600px;
    -webkit-background-size: auto 600px;
    transition: opacity 0.3s ease;
}

/* Mobile-specific background optimizations */
@media (max-width: 768px) {
    .content-bg {
        height: 300px;
        background-attachment: scroll;
        background-size: cover;
        transition: transform 0.1s ease-out, opacity 0.3s ease;
        will-change: transform, opacity;
    }
    
    .content-bg.content-bg8-end {
        display: none;
    }
    
    /* Enhanced mobile parallax effect */
    .content-bg {
        position: relative;
        overflow: hidden;
        z-index: 0;
    }

    .mobile-parallax .header-bg,
    .mobile-parallax .content-bg {
        background-color: transparent !important;
        background-image: none !important;
        isolation: isolate;
    }

    .mobile-parallax .header-bg::before,
    .mobile-parallax .content-bg::before {
        content: '';
        position: absolute;
        top: var(--mobile-parallax-layer-top, 0);
        left: 50%;
        width: 100vw;
        height: var(--mobile-parallax-viewport-height, 100vh);
        background-image: var(--parallax-image);
        background-repeat: no-repeat;
        background-size: var(--parallax-size);
        background-position: var(--parallax-position);
        pointer-events: none;
        transform: translate3d(-50%, 0, 0);
        z-index: 0;
    }
}

.content-bg.content-bg1{
    --parallax-image: url(../img/about.jpg);
    background-image: url(../img/about.jpg);
}

.content-bg.content-bg3{
    --parallax-image: url(../img/interests.jpg);
    background-image: url(../img/interests.jpg);
}

.content-bg.content-bg6{
    --parallax-image: url(../img/oxford.jpg);
    background-image: url(../img/oxford.jpg);
}

.content-bg.content-bg7{
    --parallax-image: url(../img/publication.jpg);
    background-image: url(../img/publication.jpg);
}

.content-bg.content-bg8{
    --parallax-image: url(../img/rowing.jpg);
    background-image: url(../img/rowing.jpg);
}

.content-bg.content-bg8-end{
    height: 400px;
    --parallax-image: url(../img/rowing.jpg);
    background-image: url(../img/rowing.jpg);
}

@media (prefers-reduced-motion: reduce) {
    .mobile-parallax .header-bg,
    .mobile-parallax .content-bg {
        background-image: var(--parallax-image) !important;
        background-color: transparent !important;
    }

    .mobile-parallax .header-bg::before,
    .mobile-parallax .content-bg::before {
        display: none;
    }
}

/* Mobile spacing and layout improvements */
@media (max-width: 768px) {
    .jumbotron {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col-md-8.offset-md-2, .col-md-10.offset-md-1 {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@supports (-webkit-touch-callout: inherit) {
  .content-bg {
    background-attachment: scroll;
  }
  .content-bg.content-bg8-end{
    visibility: hidden;
  }
}

.safari-no-parallax .header-bg,
.safari-no-parallax .content-bg {
    background-attachment: scroll;
}

.safari-no-parallax.mobile-parallax .header-bg,
.safari-no-parallax.mobile-parallax .content-bg {
    background-image: var(--parallax-image) !important;
    background-color: inherit !important;
}

.safari-no-parallax.mobile-parallax .header-bg::before,
.safari-no-parallax.mobile-parallax .content-bg::before {
    display: none;
}

/* Bootstrap 5 media object to match Bootstrap 3 behavior */
.media {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.media-left{
    margin-right: 15px;
    flex-shrink: 0;
}

.media-object {
    width: 75px;
    height: 75px;
    object-fit: contain;
}

/* Mobile media object improvements */
@media (max-width: 768px) {
    .media {
        margin-bottom: 20px;
    }
    
    .media-object {
        width: 60px;
        height: 60px;
    }
    
    .media-left {
        margin-right: 12px;
    }
    
    .media-heading {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
}

.media-body{
    flex: 1;
}

.media-body p{
    margin-bottom: 0px;
}

/* Set media heading font size to match original 18px */
.media-heading {
    font-size: 18px;
}

/* Contact section - align text to middle of icons */
#contact .media {
    align-items: center;
}

#contact .media-left {
    width: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn-circle {
  width: 50px;
  height: 50px;
  text-align: center;
  padding: 10px 0;
  font-size: 24px;
  line-height: 1.42;
  border-radius: 25px;
}
#toTop {
    text-align:center; 
    position:fixed;
    bottom:30px;
    right:30px;
    display:none;
    background-color:#BF4D28;
    border-color:#BF4D28;
    color: white;
}
#toTop:hover {
    background-color:orange;
    border-color:orange;
    color: white;
}

/* Mobile touch-friendly improvements */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .btn-lg {
        min-height: 50px;
        padding: 15px 24px;
        font-size: 1.1rem;
    }
    
    .navbar-toggler {
        padding: 8px 12px;
        font-size: 1.25rem;
    }
    
    /* Ensure contact links are touch-friendly */
    #contact .media-left a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px;
    }
    
    /* Improve back-to-top button for mobile */
    #toTop {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.2rem;
    }
    
    /* Add spacing between clickable elements */
    .nav-link, .btn, a {
        margin: 2px 0;
    }
}

/* Extra small screens (phones, less than 480px) */
/* Note: Due to min-width: 481px on body, this breakpoint prevents problematic scaling */
@media (max-width: 480px) {
    /* Prevent jumbotron text and button changes - keep them at 768px mobile size */
    .header-bg {
        padding-top: 15% !important;
        padding-bottom: 35% !important;
        max-height: none !important;
    }
    
    .transparent-bg {
        margin-left: 5% !important;
        margin-right: 5% !important;
        max-width: 90% !important;
        padding: 10px 15px !important;
    }
    
    .transparent-bg h2 {
        font-size: 1.5rem !important;
    }
    
    .transparent-bg .lead {
        font-size: 1rem !important;
    }
    
    /* Fix button positioning to prevent leaking past background */
    .header-btn-container {
        padding-left: 5% !important;
        padding-right: 5% !important;
        padding-top: 5px !important;
        padding-bottom: 15px !important;
    }
    
    /* Keep other elements at mobile sizes but not extra-small */
    .content {
        padding: 3% 4% !important;
        margin-bottom: 20px !important;
    }
    
    .content-bg {
        height: 250px;
        margin-top: 20px !important;
        transform: none !important;
        opacity: 1 !important;
    }
    
    .media-object {
        width: 50px;
        height: 50px;
    }
    
    .media-left {
        margin-right: 10px;
    }
    
    h1, h2 {
        font-size: 1.6rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
}
