﻿/* ============================================
   BASE STYLES & LAYOUT
   ============================================ */

/* Reset browser defaults */
* {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', serif;
    padding-top: 54px;
    color: #6b7178;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 992px) {
    body {
        padding-top: 0;
        padding-left: 17rem;
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Saira Extra Condensed', serif;
    font-weight: 700;
    text-transform: uppercase;
    color: #343a40;
}

h1 {
    font-size: 6rem;
    line-height: 5.5rem;
}

h2 {
    font-size: 3.5rem;
}

/* Images */
img {
    object-fit: contain;
    width: 100%;
    height: auto;
    display: block;
}

/* Constrain oversized charts but keep them responsive */
.chart-img {
    width: 100%;
    height: auto;
    max-width: 900px;
    /* adjust as needed */
}


/* Bootstrap 5 removed text-justify, add it back if needed */
.text-justify {
    text-align: justify !important;
}

/* Sticky footer support */
.container-fluid {
    flex: 1;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav-main {
    font-weight: 600;
    text-transform: uppercase;
}

.nav-mid {
    font-weight: 500;
    margin-left: 15px;
    text-transform: uppercase;
}

.nav-sub {
    margin-left: 30px;
}

/* Nav Bar scroll utility */
.vertScrol {
    overflow-y: auto;
}

@media (min-width: 992px) {
    #sideNav {
        text-align: -webkit-left;
        position: fixed;
        top: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        width: 17rem;
        height: 100vh;
    }

    #sideNav .navbar-brand {
        display: flex;
        margin: auto auto 0;
        padding: 0.5rem;
    }

    #sideNav .navbar-brand .img-profile {
        max-width: 10rem;
        max-height: 10rem;
        border: 0.5rem solid rgba(255, 255, 255, 0.2);
    }

    #sideNav .navbar-collapse {
        display: flex;
        align-items: flex-start;
        flex-grow: 0;
        width: 100%;
        margin-bottom: auto;
    }

    #sideNav .navbar-collapse .navbar-nav {
        flex-direction: column;
        width: 100%;
    }

    #sideNav .navbar-collapse .navbar-nav .nav-item {
        display: block;
    }

    #sideNav .navbar-collapse .navbar-nav .nav-item .nav-link {
        display: block;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }
}

/* Support link in navbar */
.support {
    text-transform: uppercase;
    padding-left: .5rem;
    padding-bottom: .5rem;
}

.support a {
    color: #FFF6D6; /* warm sand non-active */
    text-decoration: none;
    font-weight: 600;
}

.support a:hover {
    color: #FFF0BF; /* warm sand hover */
}

@media (min-width: 992px) {
    .support {
        width: 100%;
    }
}

/* Language dropdown menu */
.dropdown-menu {
    background: #C0C0C0 !important;
}


/* ============================================
   SECTIONS & LAYOUT
   ============================================ */

section.resume-section {
    border-bottom: 1px solid #dee2e6;
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}

/* Allow flex children to shrink (prevents long text from crowding adjacent columns) */
section.resume-section .resume-item > .resume-content {
    min-width: 0;
}

section.resume-section .resume-item .resume-date {
    min-width: none;
}

@media (min-width: 768px) {
    section.resume-section .resume-item .resume-date {
        min-width: 18rem;
    }
}

@media (min-width: 992px) {
    section.resume-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}


/* ============================================
   CONTENT PANELS
   ============================================ */

/* Equation panel */
.equation {
    background-color: #eeeeee;
    color: black;
    overflow-x: auto;
}

/* Calculation panel */
.calc {
    overflow-x: auto;
}

/* Note panel */
.note {
    background-color: #3898bd;
    color: white;
    border-left: 10px solid #276982;
}

.note a {
    color: gold;
    text-decoration: none;
    font-weight: bold;
}

.note a:hover {
    color: yellow;
}

/* Citation panel */
.citation {
    background-color: #fafafa;
    color: black;
    border-left: 10px solid #b3b3b3;
}


/* ============================================
   TEXT STYLING
   ============================================ */

/* Definitions */
.def {
    /*color: #bd5938;*/
    font-weight: bold;
}

/* Sub-bullets */
.subbullet {
    margin-left: 2em;
}

/* Reference list styling on KFworks page */
.ref {
    margin-bottom: 1.5rem;
    padding-left: 0.75rem;
    border-left: 3px solid #e0e0e0;
}

.ref-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: #343a40;
}

.ref-meta {
    font-weight: 400;
    font-size: 0.95rem;
    color: #6b7178;
    font-style: italic;
}


/* ============================================
   TABLES
   ============================================ */

.varTbl {
    vertical-align: top;
}

.varDef {
    padding-left: 10px;
}


/* ============================================
   BUTTONS
   ============================================ */

/* Previous/Next buttons */
.nxtPrevBtn {
    text-decoration: none;
    display: inline-block;
    width: 150px;
    padding: 8px 16px;
    background-color: #0d7377;
    /* previous - #BD5D38 */
    color: white;
}

.nxtPrevBtn:hover {
    background-color: #42a2c7;
    color: black;
    text-decoration: none;
}

/* Get the book buttons */
.getTheBook {
    text-decoration: none;
    display: inline-block;
    width: 180px;
    padding: 8px 16px;
    background-color: #0d7377;
    /* previous - #BD5D38 */
    color: white;
}

.getTheBook:hover {
    background-color: #42a2c7;
    color: black;
    text-decoration: none;
}


/* ============================================
   BOOK SECTION
   ============================================ */

/* Book image animation */
.book-image {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.book-image.animate {
    opacity: 1;
    transform: scale(1);
}

/* Disable animation for LCP elements (above the fold) */
.book-image.no-animate {
    opacity: 1 !important;
    transform: scale(1) !important;
    transition: none !important;
}

.book-link a {
    font-size: 1.1rem;
    color: #fff;
    background-color: #007bff;
    padding: 0.6em 1.2em;
    border-radius: 0.3em;
    display: inline-block;
    text-decoration: none;
    margin: 0 !important;
}

.book-link a:hover {
    background-color: #0056b3;
    text-decoration: none;
}

.book-subtext {
    font-size: 0.95rem;
    color: #666;
    margin: 1.2em auto 1.5em auto;  /* Increased vertical margins */
    font-style: italic;
    display: inline-block;
    max-width: 35ch;  /* Increased from 28ch to accommodate longer German text */
    padding-inline: 0.5rem;
    overflow-wrap: break-word;
    hyphens: auto;
    text-wrap: balance;
}



/* ============================================
   EFFECTS & ANIMATIONS
   ============================================ */

/* Fading text container */
.fade-container {
    height: 200px;
    background-color: #fff;
    mask-image: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
    -webkit-mask-image: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}

.fade-text {
    margin-top: 50px;
}


/* ============================================
   THEME COLORS
   ============================================ */

.bg-primary {
    background-color: #0d7377 !important;
    /* previous - #BD5D38 */
}

.text-primary {
    color: #0d7377 !important;
    /* previous - #BD5D38 */
}

/* ============================================
   MENU PALETTES
   ============================================ */

/* Warm Sand palette on teal side panel */
#sideNav .navbar-nav.menu-warm-sand .nav-item.nav-main .nav-link:not(.active) {
    color: #FFF6D6 !important; /* non-active (warm sand, paler than active) */
}

#sideNav .navbar-nav.menu-warm-sand .nav-item.nav-main .nav-link:not(.active):hover {
    color: #FFF0BF !important; /* hover (warm sand, midpoint) */
}

#sideNav .navbar-nav.menu-warm-sand .nav-item.nav-main .nav-link.active {
    color: #FFE8A1 !important; /* active (warm sand, richer) */
}

/* Warm Sand for upper nav (page-level tabs) */
/* Scoped class so only targeted items change */
#sideNav .upper-warm-sand.not-active a {
    color: #FFF6D6 !important;
    text-decoration: none;
}

#sideNav .upper-warm-sand.not-active a:hover {
    color: #FFF0BF !important;
    text-decoration: none;
}

#sideNav .upper-warm-sand.active a {
    color: #FFE8A1 !important;
    text-decoration: none;
}


/* Override Bootstrap 5 colors to match Bootstrap 4 */
.text-info {
    color: #17a2b8 !important;
}

.btn-info {
    background-color: #138496 !important;
    border-color: #138496 !important;
    color: #fff !important;
}

.btn-info:hover,
.btn-info:focus {
    background-color: #17a2b8 !important;
    border-color: #17a2b8 !important;
}

.btn-info:active,
.btn-info.active {
    background-color: #0f6674 !important;
    border-color: #0f6674 !important;
}

/* ============================================
   FOOTER
============================================ */

footer {
    background-color: #f5f5f5;
}

footer a {
    color: #0d7377 !important;
    text-decoration: none !important;
}

footer a:hover {
    color: #0d7377 !important;
    text-decoration: none !important;
}

/* ============================================
   ACCESSIBILITY WIDGET OVERRIDES
   ============================================ */

/* Override the main button color */
html body div.asw-container .asw-widget a.asw-menu-btn {
    background: #0d7377 !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
    outline: none !important;
    animation: none !important;
}

/* Handle potential pseudo-elements or parent wrappers that might cause the blue ring */
html body div.asw-container .asw-widget a.asw-menu-btn::before,
html body div.asw-container .asw-widget a.asw-menu-btn::after {
    border-color: #0d7377 !important;
    box-shadow: none !important;
}

html body div.asw-container .asw-widget {
    box-shadow: none !important;
}

/* Override the menu header color */
html body div.asw-container .asw-menu .asw-menu-header {
    background: #0d7377 !important;
}

/* Override the reset button in the menu */
html body div.asw-container .asw-menu button.asw-menu-reset-footer-btn {
    background: #0d7377 !important;
}

/* Override the selected item border and icon color */
html body div.asw-container .asw-menu .asw-items .asw-btn.asw-selected {
    border-color: #0d7377 !important;
}

html body div.asw-container .asw-menu .asw-items .asw-btn.asw-selected svg,
html body div.asw-container .asw-menu .asw-items .asw-btn.asw-selected span {
    fill: #0d7377 !important;
    color: #0d7377 !important;
}

/* Override hover states */
html body div.asw-container .asw-menu .asw-items .asw-btn:hover {
    border-color: #0d7377 !important;
}

html body div.asw-container .asw-menu .asw-footer a:hover,
html body div.asw-container .asw-menu .asw-footer a:hover span {
    color: #0d7377 !important;
}

/* ============================================
   FORMS
   ============================================ */

/* Make form borders darker for better visibility */
.form-control {
    border-color: #6c757d;
}

.form-control:focus {
    border-color: #0d7377;
    /* Use primary color on focus */
    box-shadow: 0 0 0 0.25rem rgba(13, 115, 119, 0.25);
}
.main-footer {
    background-color: #f5f5f5;
}
