/* ****************************************************************************** 
                                        STYLE                               
   ****************************************************************************** */ 
/* --------------------------- CSS: Responsive Design --------------------------- */
@media screen and (max-width: 768px) {
    .layout-container {
        flex-direction: column;
    }

    .floating-sidebar {
        position: static;
        width: 100%;
        max-width: none;
        margin-bottom: 20px;
        box-shadow: none;
    }

    .main-content {
        width: 100%;
    }
}



/* --------------------------- CSS: Layout --------------------------- */
.layout-container {
    display: flex;
    flex-direction: row;
    /* align-items: flex-start; */
    align-items: stretch; /* make columns align top to bottom */
    gap: 40px;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* --------------------------- CSS: Sidebar --------------------------- */
.floating-sidebar {
    flex: 1;
    max-width: 300px;
    /* background: white; */
    /* padding: 200px 20px 200px 20px; */
    padding: 0 20px 0 20px;
    box-shadow: 2px 0 0 0 rgba(0,0,0,0.1);
    font-size: 1.05em;
    line-height: 1.5;
    z-index: 1000;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    align-content: top;
    top: 100px;
}

.floating-sidebar h2 {
    font-size: 1.2em;
    color: #007072;
    margin-bottom: 10px;
    white-space: pre-wrap; /* allow long titles to wrap */
}

.floating-sidebar ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}

.floating-sidebar ul ul {
    list-style: circle;
    padding-left: 20px;
}

.floating-sidebar a {
    color: #007072e8;
    text-decoration: none;
}

.floating-sidebar a:hover {
    text-decoration: underline;
}

.sidebar-desc {
    color: #555;
    font-size: 1.00em;
    margin-top: 20px;
}

/* --------------------------- CSS: Main Content --------------------------- */
.main-content {
    flex: 3;
    min-width: 0;
    padding-left: 0px;
}

/* --------------------------- CSS: General Styles --------------------------- */
body {
    font-family: 'Arial', sans-serif;
    background-color: #eaeaea;
    margin: 0;
    padding: 20px;
}

h1 {
    text-align: left;
    color: #015e5f;
    margin-bottom: 30px;
    margin-top: 45px;
}
h2 {
    border-bottom: #0070721e solid 2px;
    padding-bottom: 5px;
    margin-bottom: 2px;
    padding-left: 4px;
}
h3 {
    margin-top: 20px;
    margin-bottom: 2px;
    padding-left: 4px;
}

.zotero-list {
    max-width: 800px;
    margin: 0 auto;
}

/* --------------------------- CSS: Zotero Items --------------------------- */
.item {
    background: #ffffffc4;
    margin: 1px 0;
    padding: 20px 10px 2px 10px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.item-title-container {
    position: relative;
    /* display: block; */
}
.item-title {
    font-weight: bold;
    white-space: normal;
    font-size: 1.1em;
    padding-bottom: 2px;
    align: left;
    position: relative;  /* so .title-popup anchors to this */
    display: inline-block;  
}
.item-title a {
    color: #17447f;
}
.thin {
    font-weight: normal;
    font-size: smaller;
    color: #555555cc;
    vertical-align: text-top;
    display: inline-block;
    margin-top: 2px;
}
.item-title:hover .link-badge {
    background-color: #e0e0e0;
    border-color: #999;
    }


.title-popup {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;  /* appears directly to the right of .item-title */
    margin-left: 10px;
    background: #11111193;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7em;
    font-weight: normal;
    white-space: normal;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    align: top;
}

.item-title-container:hover .title-popup {
    display: block;
}

.item-meta {
    color: #483f3c;
    margin-bottom: 3px;
}

/* --------------------------- CSS: Links --------------------------- */
a {
    color: #0645ad;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.no-content {
    color: #999;
}

.authors {
    color: #222;  /* Darker than default #555 */
    font-weight: 100;
    padding-bottom: 5px;
}
.authors-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    max-height: calc(1.4em * 3); /* limit to 3 lines */
}

.doi-link {
    white-space: normal;
    }


/* --------------------------- CSS: Link Badge --------------------------- */
.link-badge-container {
    position: relative;
    display: inline-block;
    color: inherit;
}

.link-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateY(-6px);
    background: #333;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: normal;
    z-index: 10;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.link-badge-container:hover .link-popup {
    display: block;
    color: inherit; 
}
.link-badge {
    display: inline-block;
    font-family: 'Courier New', monospace;  /* or 'JetBrains Mono', 'Fira Code', etc. */
    font-size: 0.60em;
    margin-left: 4px;
    margin-top: 2px;
    padding: 0px 5px;
    border: 1px solid #bbb;
    border-radius: 4px;
    background-color: #f1f1f1;
    color: #09090988;
    vertical-align: text-top;
    cursor: pointer;
    }
.link-badge a {
    color: inherit;  /* inherit color from .link-badge */
}

/* --------------------------- CSS: Back Button --------------------------- */
.back-button {
    position: relative;
    display: inline-block;
    font-family: 'Courier New', monospace;  /* or 'JetBrains Mono', 'Fira Code', etc. */
    font-size: 0.50em;
    /* margin-left: 10px;  */
    margin-left: -5px;
    padding: 2px 6px 3px 5px;
    border: 0.1px solid #bbb;
    border-radius: 4px;
    background-color: #f1f1f1;
    color: #09090988;
    /* vertical-align: text-bottom; */
    vertical-align: text-top;
    cursor: pointer;
    white-space: nowrap;
}
.back-button a {
    color: inherit;  
}   
.back-button:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

/* --------------------------- CSS: Abstract Text --------------------------- */
.abstract-container {
    margin-top: 5px;
    margin-bottom: 10px;
    width: 100%;
}
.abstract-text {
    color: #777;
    font-size: 0.9em;  /* Or try 0.85em or 13px */
    line-height: 1.4;
    /* white-space: normal; */
}

.clamp-abstract {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4em;
    max-height: calc(1.4em * 3); /* 3 lines max */
}
/* --------------------------- CSS: Abstract Toggle --------------------------- */
.toggle-abstract {
    margin-left: 0px;
    margin-top: 0px;
    padding: 2px 4px;
    background-color: #f8f8f8;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #0c1a5fcb;
    font-size: 0.50em;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.toggle-note {
    font-size: 0.85em;
    color: #888;
    font-weight: normal;
}

.toggle-abstract:hover {
    background-color: #e0e0e0;
    border-color: #999;
}

.toggle-abstract strong {
    font-size: 1.2em;     /* slightly larger than surrounding text */
    font-weight: bold;
}

/* ------------------------------ CSS: Scrolling --------------------------- */
html {
    scroll-behavior: smooth;
    }
section:target {
    scroll-margin-top: 35vh; /* offsets scrolling downward to leave room for sticky header */
    }
.spy-anchor:target {
    scroll-margin-top: 35vh; /* offsets scrolling downward to leave room for sticky header */
}

.floating-sidebar a.active {
    font-weight: bold;
    color: #054748;
    }
#back-to-top {
    font-family: 'Courier New', monospace;  /* or 'JetBrains Mono', 'Fira Code', etc. */
    font-size: 0.60em;
    font-weight: bold;
    padding: 2px 8px 3px 7px;
    border: 0.1px solid #bbb;
    border-radius: 1px;
    background-color: #f1f1f1;
    color: #3a3a3aec;
    position: absolute; /* Change to absolute positioning */
    right: 0; /* Align to the right of the sidebar */
    margin-top: 50px; /* Add spacing from the sidebar content */
    margin-right: 20px; /* Add spacing from the right edge */
    /* box-shadow: 3px 2px 5px rgba(0, 0, 0, 0.05); */
    transition: background 0.3s ease;
    display: none;
    text-align: center;
    cursor: pointer;
}

#back-to-top:hover {
    background: #007072b6;
    color: #ffffff;
}
