/*************************************************************************
 * GitHub: https://github.com/yenchiah/project-website-template
 * Version: v3.29
 * This CSS file is for the website frame
 * If you want to keep this template updated, avoid modifying this file
 * Instead, add your own CSS in the index.css
 *************************************************************************/

/*========================================================================
  Global Resets & Base Element Styling
========================================================================*/

html,
body {
  margin: 0;
  padding: 0;
  background-image: linear-gradient(to bottom, #FAF8F8, #F2F2F2); /* Subtle gradient */
  font-family: 'Merriweather', Georgia, serif; /* CUSTOM: Changed font */
  color: #343a40; /* CUSTOM: Darker text for better contrast */
  line-height: 1.5;
}

/*
  Keep viewport width stable between pages with different heights without
  forcing a visible scrollbar gutter ("blank strip") on pages that don't scroll.
*/
html {
  scrollbar-gutter: stable;
}

body {
  overflow-y: auto;
}

/* Make width/padding calculations consistent across pages/components */
*,
*::before,
*::after {
  box-sizing: border-box;
}

a {
  outline: none;
  cursor: pointer;
  color: #0056b3; /* CUSTOM: Softer blue for links */
  text-decoration: none;
  font-family: 'Merriweather', Georgia, serif;
}

a:hover {
  text-decoration: underline;
  color: #004085; /* CUSTOM: Darker blue on hover */
}

img,
video {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

h1 { /* CUSTOM: Added h1 styling */
  font-size: 2.2em;
  color: #343a40;
  margin-top: 1em;
  margin-bottom: 0.5em;
  font-family: 'Merriweather', Georgia, serif;
}

h2 {
  font-size: 25px;
  color: #343a40;
  margin: 10px 0 0.2em 0;
  padding: 0;
  font-weight: bold;
  font-family: 'Raleway', sans-serif;
}

h3 {
  font-size: 20px;
  color: #343a40;
  margin: 10px 0 0 0; /* Base */
  padding: 0;
  font-weight: bold;
  font-family: 'Merriweather', Georgia, serif;
}

p, li, span, div {
  font-family: 'Merriweather', Georgia, serif;
}

/* CUSTOM: Styling for h3.subsection-title from end of original file */
h3.subsection-title {
  margin-top: 0.5em; /* Space above h3 */
  margin-bottom: 0.5em; /* Space below h3 */
}

ul,
ol {
  margin: 10px 0; /* Consistent margin */
}

li ol,
li ul {
  margin: 0; /* Reset margin for nested lists */
}

hr {
  border: 0;
  height: 1px;
  background: #2E2D29;
  margin: 0 0 10px 0;
}

/*========================================================================
  Layout Utilities - Flexbox
========================================================================*/
.flex-column {
  display: flex;
  flex-direction: column;
  /* flex-wrap: wrap; */ /* Often default or not needed for column */
  justify-content: flex-start;
  align-items: stretch;
  /* align-content: stretch; */ /* More for multi-line flex containers */
  box-sizing: border-box;
}

.flex-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  /* align-content: stretch; */ /* More for multi-line flex containers */
  box-sizing: border-box;
}

.flex-row-space-between {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  /* align-content: stretch; */
  box-sizing: border-box;
}

.flex-row-center {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /* align-content: stretch; */
  box-sizing: border-box;
}

/* CUSTOM: Added from end of file */
.flex-row.align-bottom {
    align-items: flex-end !important;
}

.flex-item {
  margin: 0 20px; /* Default spacing for flex items */
}

.flex-item-stretch,
.flex-item-stretch-2,
.flex-item-stretch-3,
.flex-item-stretch-4,
.flex-item-stretch-5 {
  flex: 1 auto; /* Base behavior, overridden by media query */
}

/*========================================================================
  Layout Utilities - General
========================================================================*/
.left-align {
  float: left; /* Consider modern alternatives like Flexbox/Grid if possible */
}

.right-align {
  float: right; /* Consider modern alternatives */
}

.full-width {
  width: 100%;
}

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

.left-align-content {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.noselect {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.break-long-url {
  overflow-wrap: break-word;
  word-wrap: break-word; /* Fallback for older browsers */
  -ms-word-break: break-all;
  word-break: break-all; /* Be cautious with this, `break-word` is often safer */
  word-break: break-word; /* Non-standard but widely supported */
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/*========================================================================
  Menu / Navigation
========================================================================*/
.menu-container {
  z-index: 2;
  position: sticky;
  top: 0;
  width: 100%;
  background-color: #8c1515; /* CUSTOM: Stanford Red or #343a40 for dark gray */
  /* Allow narrow viewports without horizontal scroll/drift */
  min-width: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.menu {
  position: relative;
  margin: 0 auto;
  max-width: 960px; /* Match content-container for symmetric margins */
}

.menu-table { /* This uses table display, consider if flex/grid is better */
  padding: 10px 10px;
  width: 100%;
  margin: 0;
}

.logo {
  margin-left: 20px;
}

.logo a {
  font-family: 'Raleway', Georgia, serif;
  font-size: 30px;
  text-decoration: none;
  font-weight: 800;
  flex: 1 auto;
  color: rgba(255, 255, 255, 0.9); /* CUSTOM: Brighter white from end of file */
}

.logo a:hover {
  color: #ffffff; /* CUSTOM: Full white on hover */
}

.menu-items a {
  text-decoration: none;
  font-size: 19px;
  flex: 1 auto;
  transition: opacity 0.1s ease-in-out;
  font-family: 'Raleway', Helvetica, Arial, sans-serif; /* Base font */
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9); /* CUSTOM: Brighter white */
  font-weight: 200; /* CUSTOM: Slightly bolder */
}

.menu-items a:not(:last-child) {
  margin-right: 25px;
}

.menu-items a:hover,
.menu-items a.menu-highlight,
.menu-items a.current-page { /* Added current-page to the selector */
  color: #ffffff; /* CUSTOM: Full white on hover/active */
  opacity: 1; /* Ensure full opacity */
}

.menu-items a.current-page {
  /* Active tab indicator */
  font-weight: 700;
  text-decoration: none;
}

/* .menu-highlight is now part of .menu-items a:hover, .menu-items a.menu-highlight */
/*
.menu-highlight {
  color: rgb(255, 255, 255) !important;
  opacity: 1 !important;
  font-weight: 700 !important;
}
*/

.menu-button {
  width: 40px;
  height: 40px;
  display: none; /* Shown in media query */
  cursor: pointer;
  margin-right: 20px;
  background-color: transparent;
  border: none;
  padding: 0;
}

.menu-button img {
  width: 30px;
  height: 30px;
}

/*========================================================================
  Content Area
========================================================================*/
.content-container {
  z-index: 1;
  position: relative;
  width: 100%;
  /* Allow narrow viewports without horizontal scroll/drift */
  min-width: 0;
  max-width: 960px; /* CUSTOM: Slightly wider content */
  margin: 0 auto 20px auto; /* Remove top margin, keep bottom margin */
  padding: 10px; /* Base padding */
  background-color: #ffffff; /* CUSTOM */
  box-shadow: 0 6px 18px rgba(0,0,0,0.07); /* CUSTOM: Softer, deeper shadow */
  border-radius: 0 0 15px 15px; /* CUSTOM: Softened border radius, removed top radius */
}

.content {
  position: relative;
  margin: 0 auto;
  font-size: 16px; /* Base font size */
  font-family: 'Merriweather', Helvetica, Arial, sans-serif; /* Consistent with body */
  font-weight: 400;
  line-height: 1.5;
  max-width: 920px; /* CUSTOM: Adjusted for content-container padding */
  overflow-x: auto; /* For tables or wide content */
}

/* CUSTOM: Ensure text within content is legible */
.content .text,
.content p,
.content li {
  color: #343a40;
}

.content p a,
.content ul a,
.content ol a {
  text-decoration: none;
  color: #006CB8; /* Base link color, overridden by global 'a' styles */
}

.content p a:hover,
.content ul a:hover,
.content ol a:hover {
  text-decoration: underline;
  color: #00548F; /* Base link hover, overridden by global 'a:hover' */
}

.content-table { /* Uses table display */
  padding: 20px 20px;
  width: 100%;
  margin: 0;
}

/* CUSTOM: Profile section name styling */
.content .flex-item.flex-column > h2:not(.add-top-margin) {
    color: #343a40; 
    border-bottom: none; /* Remove underline if not desired for the name */
    font-size: 24px; /* Consistent with h2 base */
    margin-bottom: 0.2em; /* Reduced bottom margin */
    font-family: 'Merriweather', Georgia, serif;
    /* margin-top: 10px; From base h2, padding-bottom removed */
}

/* CUSTOM: Add some top margin to main sections for better visual separation */
.content .flex-column > h2.add-top-margin {
    margin-top: 20px; /* Increased top margin for section titles */
}

/*========================================================================
  Text Styling & Utilities
========================================================================*/
.badge-text {
  font-size: 30px;
  font-weight: 700;
}

.text {
  margin: 10px 0; /* Default */
  padding: 0;
  line-height: 1.6;
}

.text-large-margin {
  margin: 15px 0;
  padding: 0;
  /* line-height: 1.6; already in .text */
}

.text-small-margin {
  margin: 5px 0;
  padding: 0;
  line-height: 1.6;
}

.text-no-margin {
  margin: 0;
  padding: 0;
  /* line-height: 1.6; consider if needed or inherit */
}

.text-large {
  font-size: 20px;
}

.text-small {
  font-size: 12px;
}

.text-italic {
  font-style: italic;
}

.text-justify {
  text-align: justify;
}

.text-center {
  text-align: center;
}

.highlight-text {
  font-weight: bold;
}

/* Custom Text Colors */
.custom-text-info,
.custom-text-info p,
.custom-text-info a {
  color: #17a2b8;
}
.custom-text-info a:hover {
  color: #007082;
}

.custom-text-primary,
.custom-text-primary p,
.custom-text-primary a {
  color: #007bff;
}
.custom-text-primary a:hover {
  color: #005cbf;
}

.custom-text-danger,
.custom-text-danger p,
.custom-text-danger a {
  color: #dc3545;
}
.custom-text-danger a:hover {
  color: #a71120;
}

/*========================================================================
  Image Styling
========================================================================*/
.image {
  border-radius: 5px;
  width: 100%;
  margin: 15px 0;
  display: flex; /* For alignment of image inside */
}

.image.center {
  align-self: center; /* If .image is a flex item */
  /* For centering the .image block itself, use margin: 15px auto; */
}

.image img,
.image video {
  width: 100%;
  height: 100%; /* Or auto for maintaining aspect ratio */
  box-sizing: border-box;
  /* display: table-cell; */ /* Not typical for img/video directly */
  overflow: hidden;
  border-radius: 5px; /* Inherited from .image often */
}

.adaptive-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.image-wrap-text {
  float: left;
  margin: 5px 40px 25px 0;
}

.image-caption {
  width: 100%;
  text-align: center;
  margin-top: -10px;
  margin-bottom: 10px;
}

.small-image { /* General small image utility */
    width: 240px;
    height: auto;
}

/* CUSTOM: Profile image specific (was flex-row .flex-item.flex-column img.small-image) */
/* If it's always inside a flex container for profile, this can be more specific */
.profile-image.small-image { /* Assuming you'd add 'profile-image' class to the img */
    margin-right: 20px;
    margin-bottom: 10px;
    /* border-radius: 50%; */ /* Example: Circular profile image, if desired */
    /* border: 3px solid #dee2e6; */
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.07); */
}

.max-width-400 {
  max-width: 400px;
}

.max-width-140 {
  max-width: 140px;
}

/*========================================================================
  Publication & List Styling
========================================================================*/
ol.publication {
  display: flex;
  flex-direction: column-reverse; /* Shows newest first if items added chronologically */
  list-style: none;
  margin: 7px 0;
  padding: 0;
  /* flex-wrap: wrap; */ /* Usually not needed for single column reversed list */
}

ol.publication li {
  display: flex; /* For aligning counter and text */
  align-items: baseline;
  margin: 0;
  padding: 0;
}

ol.publication li p:before { /* Styling for generated content like [C1] */
  line-height: 1;
  margin-right: 5px;
}

/* Counter styling for different publication types */
ol.publication.C-list { counter-reset: C-counter; }
ol.publication.C-list li p { counter-increment: C-counter; }
ol.publication.C-list li p:before { content: "[C"counter(C-counter)"]"; }

ol.publication.J-list { counter-reset: J-counter; }
ol.publication.J-list li p { counter-increment: J-counter; }
ol.publication.J-list li p:before { content: "[J"counter(J-counter)"]"; }

ol.publication.T-list { counter-reset: T-counter; }
ol.publication.T-list li p { counter-increment: T-counter; }
ol.publication.T-list li p:before { content: "[T"counter(T-counter)"]"; }

ol.publication.O-list { counter-reset: O-counter; }
ol.publication.O-list li p { counter-increment: O-counter; }
ol.publication.O-list li p:before { content: "[O"counter(O-counter)"]"; }

ol.publication.P-list { counter-reset: P-counter; }
ol.publication.P-list li p { counter-increment: P-counter; }
ol.publication.P-list li p:before { content: "[P"counter(P-counter)"]"; }

ol.publication.M-list { counter-reset: M-counter; }
ol.publication.M-list li p { counter-increment: M-counter; }
ol.publication.M-list li p:before { content: "[M"counter(M-counter)"]"; }

ol.publication.F-list { counter-reset: F-counter; }
ol.publication.F-list li p { counter-increment: F-counter; }
ol.publication.F-list li p:before { content: "[F"counter(F-counter)"]"; }

ol.publication.A-list { counter-reset: A-counter; }
ol.publication.A-list li p { counter-increment: A-counter; }
ol.publication.A-list li p:before { content: "[A"counter(A-counter)"]"; }

/* Nested ordered lists */
ol.nested {
  list-style: none;
  counter-reset: item;
}
ol.nested>li:before {
  counter-increment: item;
  content: counters(item, ".") ". ";
  padding-right: 0.6em;
}

/* CUSTOM: Spacing for publication and talk list items */
/* Consider making these more specific if #publication and #talks are IDs */
/* If they are general classes for lists: */
.publication-list li, /* Assuming a class like .publication-list for the <ul> or <ol> */
.talk-list li {       /* Assuming a class like .talk-list for the <ul> or <ol> */
    margin-bottom: 10px; /* Add space between list items */
}

.publication-list ul, /* For nested lists within a .publication-list item */
.talk-list ul {       /* For nested lists within a .talk-list item */
    margin-top: 5px;
    margin-left: 20px; /* Indent sub-lists */
}

/* CUSTOM: Publication Entry Styling (New Structure) */
.publication-entry {
    display: flex;
    flex-direction: column; /* Ensure abstract appears below */
    align-items: flex-start;
    margin-bottom: 20px; /* CUSTOM: Increased from 15px */
    background-color: #FDF5F5; /* CUSTOM: Changed from light red-tinted bg */
    border: none; /* CUSTOM: Lighter grey border */
    border-radius: 15px; /* CUSTOM: Softened border radius */
    padding: 20px; /* CUSTOM: Increased padding */
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out, background-color 0.3s ease-in-out; /* CUSTOM: Smoother transition */
}

.publication-main {
    display: flex;
    width: 100%;
}

.publication-entry:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); /* CUSTOM: Enhanced hover shadow */
    transform: translateY(-5px); /* CUSTOM: Add lift effect on hover */
    background-color: #FBECEC;
}

.publication-text {
    flex-grow: 1;
    margin-right: 15px;
}

.publication-title {
    font-style: normal;
    color: #343a40; /* Near black */
    font-size: 1.1em;
    display: block;
    margin-top: 4px;
    margin-bottom: 4px;
    font-weight: bold; /* Making title slightly more prominent */
}

.publication-authors {
    font-size: 1.0em;
    color: #5d6064; 
    font-style: italic;
}

.publication-authors b {
    color: #343a40;
}

.publication-venue {
    color: #5d6064; /* Grey */
    display: inline;
    font-style: italic;
    font-size: 1.0em;
}

.publication-keywords {
    font-size: 0.85em; /* CUSTOM: Reduced from 0.9em */
    margin-top: 8px; /* CUSTOM: Increased from 5px */
    font-style: italic;
}

.publication-thumbnail {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border: 1px solid #e9ecef; /* CUSTOM: Lighter grey border */
    padding: 3px;
    background-color: #fdfdfd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
    border-radius: 15px; /* CUSTOM: Softer radius for thumbnail */
}

/* Ensure sub-lists (e.g., for links, notes) within publication-entry are styled appropriately */
.publication-entry ul {
    flex-basis: 100%; /* Make sub-list take full width if it's a direct child flex item */
    margin-top: 5px;
    padding-left: 20px; /* Indent for typical list appearance */
    list-style: disc; /* Or desired list style */
}
.publication-entry ul li {
    margin-bottom: 5px;
}

/* Links within publication entries */
.publication-entry a {
    color: #0056b3; /* Matches global link color */
}
.publication-entry a:hover {
    color: #004085; /* Matches global link hover color */
}

/* Smooth expand/collapse for selected publication abstracts */
.abstract-container {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.25s ease, margin 0.25s ease;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  background-color: transparent; /* Match card background */
  border-left: 3px solid #8c1515; /* Match header color */
}

.abstract-container.is-open {
  max-height: 1000px; /* Enough for typical abstracts */
  opacity: 1;
  margin-top: 8px; /* Reduce space above heading */
  padding: 10px 15px 10px 15px; /* Reduce bottom padding */
}

/* Tighten heading spacing inside abstract */
.abstract-container h4 {
  margin-top: 0;
  margin-bottom: 8px;
}

/* Remove extra space after the last piece of abstract content */
.abstract-container > :last-child {
  margin-bottom: 0;
}

/* CUSTOM: Profile links (if this is a specific section) */
.profile-links a { /* Assuming a container with class .profile-links */
    margin: 0 5px; /* CUSTOM: Adjusted from 0 0px, assuming some horizontal spacing */
}

.profile-links {
    font-size: 1.0em;
    margin-bottom: 1em;
}

.no-list-indent {
    padding-left: 0;
    margin-left: 0;
}

/*========================================================================
  IFrames
========================================================================*/
.iframe-container { /* For full-page iframes, likely needs specific context */
  position: absolute;
  top: 61px; /* Assumes fixed header height */
  bottom: 0;
  left: 0;
  height: auto; /* Or calc(100% - 61px) */
  width: 100%;
  min-width: 0;
}

.iframe { /* General iframe styling */
  border: 0;
  width: 100%;
  height: 100%;
}

.iframe-in-body { /* For embedded iframes within content flow */
  width: 100%;
  height: 400px;
  border: 1px solid #666666;
  margin: 15px 0;
}

.iframe-in-tab { /* For iframes in tab-like structures */
  width: 100%;
  height: 400px;
  border: 0;
  margin: 0;
  padding: 0;
}

.align-self-start {
    align-self: flex-start;
}

/*========================================================================
  Gallery
========================================================================*/
.gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  /* align-items: center; */ /* Can cause uneven heights if items vary */
  align-items: stretch; /* To make items of same row equal height */
  /* align-content: stretch; */ /* For multi-row alignment */
  box-sizing: border-box;
  width: 100%;
  padding: 0 10px; /* Gutters for gallery items */
}

.gallery a {
  border: 1px solid transparent; /* For consistent box model, or remove */
  color: #2E2D29;
  text-decoration: none;
  padding: 10px; /* Spacing around each gallery item's content */
  cursor: default; /* Or pointer if they are actual links */
  /* user-select: none; */ /* Already on img, video. Not needed here. */
  box-sizing: border-box; /* Ensure padding is included in width calc for flex items */
}

.gallery a>img,
.gallery a>video {
  border-radius: 2px;
  width: 100%;
  background-image: url(../img/loading.gif);
  background-repeat: no-repeat;
  background-size: 30px 30px;
  background-position: center;
  min-height: 50px; /* Placeholder height while loading */
  display: block; /* Remove extra space below image */
}

.gallery a>div { /* For captions below gallery images */
  width: 100%;
  text-align: center;
  padding-top: 5px; /* Space between image and caption */
}

.custom-list {
    padding-left: 0;
    list-style: none;
    margin-left: 0;
}

.custom-list > li {
    margin-bottom: 1em;
    padding-left: 1.2em;
    position: relative;
}

.custom-list > li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #343a40;
    font-weight: bold;
    font-size: 1.2em;
}

.venue {
    font-style: italic;
    color: #5d6064;
}

/*========================================================================
  Custom Tables
========================================================================*/
.custom-table-container {
  display: grid; /* Can simplify centering */
  width: fit-content;
  width: -moz-fit-content; /* Firefox fallback */
  margin: 10px 0;
}

.custom-table-container.center {
  margin-left: auto;
  margin-right: auto;
}

.custom-table {
  display: block; /* For overflow-x to work */
  overflow-x: auto;
  border: 1px solid #666666;
  border-collapse: collapse;
  border-spacing: 0;
  empty-cells: show;
  margin: 0; /* Handled by container */
  padding: 0;
}

.custom-table thead {
  text-align: left;
  border-bottom: 1px solid #666666;
}

.custom-table tfoot {
  border-top: 1px solid #666666;
}

.custom-table tr.bg-color-gray {
  background-color: #dadada;
}

.custom-table tr.bg-color-light-gray {
  background-color: #efefef;
}

.custom-table td,
.custom-table th {
  padding: 5px 10px;
}

/*========================================================================
  Margin & Padding Utilities (Consider consolidating or being more specific)
========================================================================*/
.no-top-margin { margin-top: 0 !important; }
.no-bottom-margin { margin-bottom: 0 !important; }

.add-top-margin { margin-top: 15px !important; }
.add-top-margin-small { margin-top: 5px !important; }
.add-top-margin-large { margin-top: 20px !important; }

.add-bottom-margin { margin-bottom: 15px !important; }
.add-bottom-margin-small { margin-bottom: 5px !important; }
.add-bottom-margin-large { margin-bottom: 20px !important; }

.footer-info {
    text-align: center;
    padding: 10px 0;
    font-size: 0.75em;
    color: #999;
    margin-top: 20px;
}

/*========================================================================
  Miscellaneous & UI Elements
========================================================================*/
.graph-title { /* Assuming this is for charts/graphs */
  font-size: 20px;
  margin-bottom: 0;
  margin-top: 15px;
}

.force-no-scroll { overflow-y: hidden !important; } /* Use with caution */
.force-scroll { overflow-y: scroll !important; } /* Use with caution */


/* Dialogs (from original end of file) */
.custom-dropdown { /* If these are general, keep. If specific, rename/scope. */
  width: 240px;
}

.custom-textbox {
  width: 240px;
}

#dialog-1,
#dialog-2,
#dialog-3,
#dialog-4,
#share-dialog {
  display: none; /* Base state for dialogs */
}

#share-url {
  width: 100%;
  -webkit-touch-callout: default !important; /* Allow text selection for URL */
  -webkit-user-select: text !important;
  -khtml-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

#share-url-copy-prompt {
  display: none;
  color: #007bff; /* Bootstrap primary blue */
}


/*========================================================================
  Media Queries
========================================================================*/

/* Flex item stretching for larger screens */
@media screen and (min-width: 900px) {
  .flex-item-stretch { flex: 1; }
  .flex-item-stretch-2 { flex: 2; }
  .flex-item-stretch-3 { flex: 3; }
  .flex-item-stretch-4 { flex: 4; }
  .flex-item-stretch-5 { flex: 5; }
}

/* Mobile Menu & Image Wrap */
@media screen and (max-width: 750px) {
  .logo {
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on logo */
  }

  .menu-items {
    display: none; /* Hidden by default, shown on button focus/hover */
    width: 100%;
  }
  .menu-items a { /* Stack items vertically */
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    display: block; /* Ensure they take full width */
  }
  .menu-items a:first-child {
    margin-top: 10px; /* Space above first item */
  }

  .menu-button { /* Display the hamburger button */
    display: flex; /* Use flex for alignment if needed for icon inside */
    /* flex-direction, justify-content, align-items from original */
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    align-content: stretch;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  /* Menu reveal logic: using focus and hover */
  /* Reveal menu when JS toggles the 'open' class */
  .menu-items.open {
    display: block;
  }
  /* .menu-button:focus + .menu-items a { display: block; } */ /* Already handled by .menu-items a */
  /* .menu-items > a { display: block; } */ /* Already handled by .menu-items a */

  .image-wrap-text { /* Stack image above text */
    max-width: 100%;
    margin-bottom: 20px;
    margin-right: 0;
    float: none; /* Override float */
  }
}

/* Gallery Responsive Layout */
@media screen and (min-width: 900px) {
  .gallery a { /* 4 columns */
    flex: 0 0 25%; /* Don't grow, don't shrink, basis 25% */
    max-width: 25%;
  }
}
@media screen and (min-width: 700px) and (max-width: 899.98px) { /* Adjusted breakpoint */
  .gallery a { /* 3 columns */
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }
}
@media screen and (min-width: 500px) and (max-width: 699.98px) { /* Adjusted breakpoint */
  .gallery a { /* 2 columns */
    flex: 0 0 50%;
    max-width: 50%;
  }
}
@media screen and (max-width: 499.98px) { /* Adjusted breakpoint */
  .gallery a { /* 1 column */
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Content Container Padding Adjustments for smaller screens */
@media screen and (max-width: 768px) {
  .content-container {
    margin: 0 auto 8px auto; /* Remove top margin, keep bottom margin */
    padding: 8px;
    border-radius: 0 0 15px 15px; /* No top radius on smaller screens */
  }
}
@media screen and (max-width: 480px) {
  .content-container {
    margin: 0 auto 5px auto; /* Remove top margin, keep bottom margin */
    padding: 5px;
    border-radius: 0; /* No radius on very small screens if preferred */
  }
  h1 { font-size: 1.8em; } /* Smaller h1 on mobile */
  h2 { font-size: 22px; } /* Smaller h2 on mobile */
  h3 { font-size: 18px; } /* Smaller h3 on mobile */
}

/* CUSTOM: Styles from index.css for responsive publication entries */
@media screen and (max-width: 750px) {
  .publication-main {
    flex-direction: column;
    align-items: flex-start; /* Align items to the left */
  }

  .publication-thumbnail {
    margin-top: 15px; /* Add space above the image when stacked */
    margin-right: 0; /* Remove right margin */
    width: 100%; /* Make image wider when stacked */
    max-width: 300px; /* But not too wide */
  }

  .publication-text {
    margin-right: 0; /* Remove right margin */
    width: 100%; /* Ensure text takes full width */
    text-align: left; /* Align text to the left */
  }
}
/* End of publication-entry responsive rules */

/*========================================================================
  UI Controls (buttons, inputs, dialogs)
========================================================================*/

.custom-image-button {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  align-content: stretch;
  box-sizing: border-box;
  text-decoration: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.custom-button {
  font-family: 'Merriweather', Georgia, serif;
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  line-height: 15px;
  outline: none;
  border-radius: 2px;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.1s, box-shadow 0.1s, border 0.1s;
  text-decoration: none;
  display: block;
  box-sizing: border-box;
  color: white;
  border: 1px solid #7d7d7d;
  background-color: #7d7d7d;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.custom-button:not(:disabled):hover {
  background-color: #4d4d4d;
  border-color: #4d4d4d;
}

.custom-button:not(:disabled):active {
  background-color: #4d4d4d;
  border-color: #4d4d4d;
}

.custom-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.custom-button-primary {
  background-color: #007bff;
  border-color: #007bff;
}

.custom-button-primary:not(:disabled):hover {
  background-color: #005cbf;
  border-color: #005cbf;
}

.custom-button-primary:not(:disabled):active {
  background-color: #005cbf;
  border-color: #005cbf;
}

.custom-button-danger {
  background-color: #dc3545;
  border-color: #dc3545;
}

.custom-button-danger:not(:disabled):hover {
  background-color: #a71120;
  border-color: #a71120;
}

.custom-button-danger:not(:disabled):active {
  background-color: #a71120;
  border-color: #a71120;
}

.custom-button-info {
  background-color: #17a2b8;
  border-color: #17a2b8;
}

.custom-button-info:not(:disabled):hover {
  background-color: #007082;
  border-color: #007082;
}

.custom-button-info:not(:disabled):active {
  background-color: #007082;
  border-color: #007082;
}

.custom-button-flat {
  font-family: 'Merriweather', Georgia, serif;
  text-align: center;
  font-size: 16px;
  line-height: 16px;
  outline: none;
  border-radius: 48px;
  cursor: pointer;
  box-shadow: none;
  transition: background-color 0.1s, box-shadow 0.1s, border 0.1s;
  text-decoration: none;
  color: #2E2D29;
  border: 1px solid #777777;
  background-color: white;
  padding: 13px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: center;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.custom-button-flat.large {
  font-size: 18px;
  line-height: 18px;
  padding: 17px;
  border-radius: 56px;
}

.custom-button-flat.small {
  font-size: 14px;
  line-height: 14px;
  padding: 12px;
  border-radius: 42px;
}

.custom-button-flat:disabled {
  opacity: 0.4;
  cursor: default;
}

.custom-button-flat img {
  width: 20px;
  height: 20px;
}

.custom-button-flat.small img {
  width: 16px;
  height: 16px;
}

.custom-button-flat.large img {
  width: 24px;
  height: 24px;
}

.custom-button-flat span {
  margin-left: 6px;
}

input.custom-textbox,
textarea.custom-textbox {
  font-family: 'Merriweather', Georgia, serif;
  box-sizing: border-box;
  padding: 5px 10px;
  background: rgb(255, 255, 255);
  border: 1px solid #7d7d7d;
  font-size: 16px;
  outline: none;
  border-radius: 2px;
  resize: vertical;
}

input.custom-textbox {
  min-height: 37px;
  max-height: 37px;
}

textarea.custom-textbox {
  min-height: 60px;
  max-height: 200px;
}

input[readonly].custom-textbox,
textarea[readonly].custom-textbox {
  cursor: default;
  background: rgb(230, 230, 230);
}

.control-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  align-content: stretch;
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.control-group .custom-image-button {
  margin: 10px 0 10px 0;
}

.control-group .custom-image-button:not(:last-child) {
  margin-right: 15px;
}

.control-group .custom-button {
  margin: 10px 0 10px 0;
}

.control-group .custom-button:not(:last-child) {
  margin-right: 15px;
}

.control-group .custom-button-flat {
  margin: 10px 0 10px 0;
}

.control-group .custom-button-flat:not(:last-child) {
  margin-right: 15px;
}

.control-group .custom-textbox {
  margin: 10px 0 10px 0;
}

.control-group .custom-textbox:not(:last-child) {
  margin-right: 15px;
}

@media screen and (max-width: 500px) {
  .stretch-on-mobile {
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 1 0 100%;
    max-width: 100%;
  }
}

.pulse-white {
  box-shadow: 0 0 0 rgba(255, 255, 255, 0.5);
  animation: pulse-white 2s infinite;
}

@-webkit-keyframes pulse-white {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }

  70% {
    -webkit-box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }

  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes pulse-white {
  0% {
    -moz-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }

  70% {
    -moz-box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }

  100% {
    -moz-box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

.pulse-black {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0.5);
  animation: pulse-black 2s infinite;
}

@-webkit-keyframes pulse-black {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.5);
  }

  70% {
    -webkit-box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
  }

  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

@keyframes pulse-black {
  0% {
    -moz-box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.5);
  }

  70% {
    -moz-box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
    box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
  }

  100% {
    -moz-box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

.pulse-primary {
  box-shadow: 0 0 0 rgba(0, 123, 255, 0.5);
  animation: pulse-primary 2s infinite;
}

@-webkit-keyframes pulse-primary {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.5);
  }

  70% {
    -webkit-box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
  }

  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

@keyframes pulse-primary {
  0% {
    -moz-box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.5);
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.5);
  }

  70% {
    -moz-box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
    box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
  }

  100% {
    -moz-box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
  }
}

.pulse-danger {
  box-shadow: 0 0 0 rgba(220, 53, 69, 0.5);
  animation: pulse-danger 2s infinite;
}

@-webkit-keyframes pulse-danger {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5);
  }

  70% {
    -webkit-box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
  }

  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

@keyframes pulse-danger {
  0% {
    -moz-box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5);
  }

  70% {
    -moz-box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
    box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
  }

  100% {
    -moz-box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
  }
}

.pulse-info {
  box-shadow: 0 0 0 rgba(23, 162, 184, 0.5);
  animation: pulse-info 2s infinite;
}

@-webkit-keyframes pulse-info {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.5);
  }

  70% {
    -webkit-box-shadow: 0 0 0 15px rgba(23, 162, 184, 0);
  }

  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
  }
}

@keyframes pulse-info {
  0% {
    -moz-box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.5);
    box-shadow: 0 0 0 0 rgba(23, 162, 184, 0.5);
  }

  70% {
    -moz-box-shadow: 0 0 0 15px rgba(23, 162, 184, 0);
    box-shadow: 0 0 0 15px rgba(23, 162, 184, 0);
  }

  100% {
    -moz-box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
    box-shadow: 0 0 0 0 rgba(23, 162, 184, 0);
  }
}