/*=============================================
  VARIABLES
=============================================*/
:root {
  --garnet: #4d060e;
  --garnet-light: #6e1015;
  --garnet-dark: #330003;
  --garnet-transparent: rgba(77, 6, 14, 0.8);
  --accent: #e0b0b8;
  --text-light: #f5f5f5;
  --text-dark: #333333;
  --transition: 0.3s ease-in-out;
}

/*=============================================
  GLOBAL RESET & TYPOGRAPHY
=============================================*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--text-dark);
  background-color: #4d060e;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lora', serif;
  color: var(--garnet-dark);
  margin-top: 0;
}

/*=============================================
  HEADER / MASTHEAD
=============================================*/
.masthead {
  position: relative;
  background-size: cover;
  background-position: center;
}

.masthead .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--garnet-transparent);
}

.site-heading {
  position: relative;
  text-align: center;
  top: 75px;
  z-index: 2;
}

.site-heading h1 {
  font-size: 3rem;
  color: var(--text-light);
  text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
  margin-bottom: 0.5rem;
}

.site-heading .subheading {
  color: var(--garnet-light);
  font-size: 1.25rem;
  font-style: italic;
}

/* Scroll-down arrow */
.scroll-down .scroll a {
  color: var(--text-light);
  font-size: 1.2rem;
  text-decoration: none;
  display: inline-block;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/*=============================================
  CONTENT AREA
=============================================*/
#content {
  padding: 16px;
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Post previews */
.post-preview {
  border-left: 4px solid var(--garnet);
  padding-left: 1.5rem;
  transition: background var(--transition), transform var(--transition);
}

.img_wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.recent-preview {
  transition: background var(--transition), transform var(--transition);

}

.post-preview:hover {
  background-color: #f9f2f2;
  transform: translateX(5px);
}

.recent-preview:hover {
  background-color: #6e1015;
  transform: translateX(5px);
}

.post-title {
  font-size: 2rem;
  color: var(--garnet-dark);
  margin-bottom: 0.25rem;
  transition: color var(--transition);
}

.post-title:hover {
  color: var(--garnet-light);
}

.post-subtitle {
  font-size: 1.1rem;
  color: #555;
}

.post-meta {
  font-size: 1.25rem;
  color: #6e1015;
}

/* Images in posts */
.post-preview img {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 1rem;
  max-height: 300px;

}

/*=============================================
  BUTTONS & LINKS
=============================================*/
a {
  color: var(--garnet);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--garnet-light);
}

.btn-primary {
  background-color: var(--garnet);
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  transition: background var(--transition), transform var(--transition);
  margin-top: 10px;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--garnet-light);
  transform: translateY(-2px);
}

/* Pager links */
.clearfix .btn {
  margin: 0.5rem;
}


/*=============================================
  UTILITIES
=============================================*/
hr {
  border: none;
  height: 1px;
  background-color: #e2e2e2;
  margin: 3rem 0;
}

.group {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #4d060e;

}

.group__title {
  margin-bottom: 36px;
  font-weight: 800;
}

.group__researchers {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  min-width: 700px;
  margin-bottom: 112px;
}

.res {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: start;
  margin: 18px;
  width: 100%;

}

.res__img {
  height: 150px;
  width: 150px;
  background-color: gray;
  border: solid 2px #4d060e;
  margin-bottom: 24px;
  object-fit: cover;
}

.res__name {
  font-size: 24px;
  text-align: left;
  min-width: 100px;
}

.res__info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}


.gross {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: #4d060e;
}


.gross__img {
  max-height: 250px;
  max-width: 225px;
  background-color: gray;
  border: solid 2px #4d060e;
  margin-bottom: 24px;
  font-size: 24px;

}

.gross__info {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  width:fit-content;
  font-size: 24px;

}

.gross__name {
  font-size: 24px;
  
}

.gross__info p{
  margin: 0 12px;
  
}

.gross__desc--text {
  min-width:800px
}



#recent-actions-sidebar {
  position: fixed;
  bottom: 65px;           /* stick to the bottom */
  top:69px;
  width: 20vw;
  overflow-y: auto;
  background-color: #4d060e;
  padding: 0 1rem;
  z-index: 1000;
  color: var(--text-light);
  border-top:  #e0b0b8 5px solid ;
  border-bottom:  #e0b0b8 5px solid ;
  border-right:  #e0b0b8 5px solid ;
  transition: transform var(--transition);
  
  /* remove any height property here */
}
/* .recent-actions-container {
  margin-top: 75px
} */
#recent-actions-sidebar.collapsed {
  transform: translateX(-100%);
  /* optional: collapse instantly or animate */
  transition: transform var(--transition);
}



#recent-actions-sidebar h2 {
  margin: 0;           
  padding: 1rem 0;       
  width: 100%;         
  background-color: #4d060e;
  color: #fff;
  box-sizing: border-box;
  /* If you want it to stick at the top as you scroll: */
  position: sticky;
  top: 0;
  z-index: 10000;
}

.site-footer {
  background: var(--garnet);
  color: var(--text-light);
  padding: 2rem 0;
}
.site-footer .nav-link {
  color: var(--text-light);
  padding: .2rem .5rem;
  transition: color .3s;
}
.site-footer .nav-link:hover {
  color: var(--accent);
}

.navbar-nav {
  display: flex;
  flex-direction: row;
}


/* side rails: only show on large screens */
.fig-rail {
  position: sticky;
  top: 80px;                   /* adjust to your navbar/header height */
  max-height: calc(100vh - 100px);
  width: 200px;                /* fixed width */
  overflow: auto;
  padding: .5rem;
  margin: 0 2rem
  display: flex;
  flex-direction: column;
  align-items: end;
}

.fig-rail img {
  width: 100%;
  height: 150px;      /* fixed height */
  object-fit: cover;  /* crops edges */
}



/* ===== Mobile-first fixes (phones & small tablets) ===== */
@media (max-width: 991.98px) {

  /* Header/masthead spacing */
  .masthead { min-height: 42vh; }
  .site-heading { top: 24px; padding: 0 16px; }
  .site-heading h1 { font-size: 2rem; }
  .site-heading .subheading { font-size: 1rem; }

  /* Navbar: let Bootstrap stack links when collapsed */
  .navbar-nav { flex-direction: column; gap: .25rem; }

  /* Rails are already hidden with d-none d-lg-block; just ensure main spans full width */
  main.col-12 { padding-left: 16px; padding-right: 16px; }

  /* Post preview: stack text above image for narrow screens */
  .post-preview > a {
    display: flex;
    flex-direction: column;    /* was row on desktop */
    align-items: flex-start;
    gap: .5rem;
  }
  .post-preview > a > img {
    max-width: 100% !important;  /* override 200px limit */
    height: auto;
    margin: .5rem 0 0 0;
  }
  .post-title { font-size: 1.35rem; }
  .post-subtitle { font-size: 1rem; }
  .post-meta { font-size: .95rem; }

  /* Filter form: full-width stacked controls */
  form.form-inline {
    display: block;
  }
  form.form-inline .form-group {
    display: block;
    width: 100%;
    margin: 0 0 .75rem 0 !important;
  }
  form.form-inline label { display: block; margin-bottom: .25rem; }
  form.form-inline select,
  form.form-inline input,
  form.form-inline .btn {
    width: 100%;
  }

  /* Kill desktop-only minimum widths that break small screens */
  .group__researchers { min-width: 0; }
  .gross__desc--text { min-width: 0; }

  /* Recent-actions sidebar: don't reserve space on mobile */
  #recent-actions-sidebar {
    position: static;
    width: 100%;
    border-width: 0;
  }

  /* Generic spacing tweaks */
  #content { padding: 12px; }
  hr { margin: 2rem 0; }
}

/* Slight tablet boost */
@media (min-width: 576px) and (max-width: 991.98px) {
  .post-title { font-size: 1.6rem; }
}


/* Make the main area use a comfortable readable width without wasting space */
.main-inner { max-width: 980px; margin: 0 auto; }
@media (min-width: 1400px) { .main-inner { max-width: 1080px; } }

/* Trim excessive gaps that cause empty feel */
.post-preview { margin-bottom: 1.25rem; }
hr { margin: 1.5rem 0; }

/* Rails: subtle background and tidy collage of images */
.rail { background: linear-gradient(#fff, #fafafa); }
.figure-rail {
  position: sticky;
  top: 72px;                 /* keep in view under navbar */
  display: grid;
  gap: 12px;
}

/* If your tag outputs wrappers around each figure, target them: */
.figure-rail > * { 
  border-radius: 12px; 
  overflow: hidden; 
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* If the tag outputs images directly, this still works */
.figure-rail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

/* Make a pleasing collage: mix aspect ratios so the rail isn't a long strip */
.figure-rail > * { aspect-ratio: 1 / 1; }               /* default square */
.figure-rail > *:nth-child(3n) { aspect-ratio: 4 / 5; } /* portrait */
.figure-rail > *:nth-child(4n) { aspect-ratio: 16 / 9; }/* landscape */

/* If the tag outputs plain <img>, fall back to per-image aspect ratio: */
.figure-rail img:nth-child(3n) { aspect-ratio: 4/5; }
.figure-rail img:nth-child(4n) { aspect-ratio: 16/9; }

/* Ensure rails don’t force awkward empty columns when content is short */
.rail { align-self: start; }

/* Optional: soften the header to reclaim vertical room on index */
.masthead { min-height: 38vh; }
.site-heading { margin-top: 8px; }

/* Mobile/Tablet: rails are already hidden by d-none classes, but tighten spacing */
@media (max-width: 991.98px) {
  #content { padding: 12px; }
  .post-title { font-size: 1.35rem; }
  .post-subtitle { font-size: 1rem; }
}

/* === Side-rail fixes: show ALL figures, no square crops === */
@media (min-width: 992px) {
  .rail .figure-rail {
    position: sticky;          /* keep rail visible as you scroll */
    top: 72px;
    display: block;            /* switch off grid for reliable stacking */
    column-count: 1;           /* single column by default (narrow rails) */
    column-gap: 12px;
  }

  /* Each figure/card should avoid being split across columns */
  .rail .figure-rail > * {
    break-inside: avoid;
    display: block;
    margin: 0 0 12px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    /* Remove any forced square/landscape aspect ratios */
    aspect-ratio: auto !important;
    height: auto !important;
  }

  .rail .figure-rail img {
    width: 100%;
    height: auto !important;   /* natural height */
    display: block;
    object-fit: cover;         /* cover within card if parent has fixed height (it won't now) */
  }

  /* On very wide screens, allow a gentle "masonry" with two columns */
  @media (min-width: 1400px) {
    .rail .figure-rail { column-count: 2; }
  }
}


/* Rail never taller than viewport; scroll inside */
@media (min-width: 992px) {
  .rail .figure-rail {
    position: sticky;
    top: var(--rail-top, 72px);
    max-height: calc(100vh - var(--rail-top, 72px) - 16px);
    overflow-y: auto;
    padding-right: 6px;           /* room for scrollbar */
  }
  .rail .figure-rail::-webkit-scrollbar { width: 6px; }
  .rail .figure-rail::-webkit-scrollbar-thumb { background: #ddd; border-radius: 8px; }
}





