
:root {
    --masonry-gutter: 16px;
  }


/* — sticky header — */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1100;               /* sit above the grid */
    background-color: #fff;      /* ensure it covers content beneath */
}

/* — disable text selection on the header — */
.site-header,
.site-header * {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE10+ */
  user-select: none;         /* Standard */
}

/* — slide-in from left for entry titles — */
@keyframes slideInLeft {
    from {
      transform: translateX(-20px);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  /* — slide-out to left for entry-title — */
@keyframes slideOutLeft {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(-20px);
      opacity: 0;
    }
  }
  


.grid {
    position: relative;
    width: 100%;
  }

  /* hide grid until Masonry lays it out */
.grid {
    visibility: hidden;
  }
  
/* Masonry 4-column calc-based widths */
.grid {
    position: relative;
  }
  
  .grid-sizer,
  .grid-item {
    /* (100% – 3 gutters) ÷ 4 columns */
    width: calc((100% - (3 * var(--masonry-gutter))) / 4);
    padding: 0;
    margin: 0 0 var(--masonry-gutter);
  }

  #mosaic{
    padding-bottom: 5em;
  }
  
/* — image fade-in transition — */
.masonry-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;                        /* start hidden */
    transition: opacity 0.5s ease-in-out;
  }
  
  .masonry-img.loaded {
    opacity: 1;                        /* fade to fully visible */
  }
  
  /* — placeholder + image swap — */

/* — focus states for keyboard users — */
.masonry-link:focus-visible {
    outline: 2px dashed #333;
    outline-offset: 4px;
  }
  
  /* ensure hover/focus both reveal the overlay */
  .masonry-link:hover .overlay,
  .masonry-link:focus-visible .overlay {
    opacity: 1;
  }
  /* the gray box reserves the exact tile size */
  .placeholder {
    width: 100%;
    /* aspect-ratio set inline */
  }
  
  /* keep overlay above everything */
  .overlay {
    position: absolute;
    inset: 0;
    background: rgba(128, 128, 128, 0.6);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;    /* make sure the overlay sits above the image */
  }

  /* Prevent selection of the overlay text */
.overlay,
.overlay h4,
.overlay p {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE10+ */
  user-select: none;         /* Standard */
}

/* Optionally let clicks go "through" the overlay to the <a> underneath */
.overlay {
  pointer-events: none;
}
  .box-masonry:hover .overlay {
    opacity: 1;
  }
  
  /* position & hide the real image until it’s ready */
  .masonry-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;    /* make sure the image sits above the placeholder */
  }
  
  .masonry-img.loaded {
    opacity: 1;
  }
  
  /* placeholder stays behind the image */
  .placeholder {
    width: 100%;
    /* aspect-ratio set inline in Twig */
    background-color: #ccc;
    z-index: 0;
  }
  /* — placeholder pulse animation — */
@keyframes placeholderPulse {
    0%, 100% {
      background-color: #919191;
    }
    50% {
      background-color: #c0bfbf;
    }
  }
  
  .placeholder {
    /* existing rules (aspect-ratio, etc.) remain */
    animation: placeholderPulse 1.5s ease-in-out infinite;
  }
  
  /* overlay styling */
  .overlay {
    position: absolute;
    inset: 0;
    background: rgba(128, 128, 128, 0.6);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left; 
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  /* — card overlay text styling — */

/* Title (uppercase, bold, spaced) */
.overlay h4 {
    font-size: clamp(0.8rem, 0.9vw, 1.2rem);
    line-height: 1.5;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.5rem;
    align-self: flex-start;
  }
  
  /* Description (legible body text) */
  .overlay p {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
    margin: 0;
    align-self: flex-start;
  }
  
  /* Optional: adjust color/contrast if needed */
  .overlay h4,
  .overlay p {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  }

  /* — card rounding, shadow and hover “lift” — */
.box-masonry {
  position: relative;
    border-radius: 8px;                    /* soften corners */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* subtle base shadow */
    overflow: hidden;                      /* clip children to rounded corners */
    transition: transform 0.3s ease, 
                box-shadow 0.3s ease;      /* animate lift and shadow */
  }
  
  .box-masonry:hover {
    transform: translateY(-4px);           /* float up slightly */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2); /* stronger shadow */
  }
  
  /* ensure overlay and image inherit the rounding */
  .box-masonry img,
  .box-masonry .overlay {
    border-radius: 8px;
  }
  .box-masonry:hover .overlay {
    opacity: 1;
  }
  
  /* — fade-in-up animation for entry elements — */
@keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* base class: hidden until animated */
  .fade-in-up {
    opacity: 0;
    animation-name: fadeInUp;
    animation-duration: 0.6s;
    animation-fill-mode: forwards;  /* retain end state */
    /* animation-delay set inline in Twig for staggering */
  }
  
  /* container for the mosaic, so we can blur it when overlay is open */
#mosaic-container {
  position: relative;
  z-index: 1;
  transition: filter 0.3s ease;
}

/* when an entry is open, blur & dim the mosaic */
body.overlay-open #mosaic-container {
  filter: blur(8px) brightness(0.6);
}

/* the overlay panel (fills screen, scrollable) */
#entry-overlay {
  position: fixed;
  inset: 0;
  background: transparent;       
  z-index: 1000;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  padding: 2rem;
  box-sizing: border-box;
}


/* show it */
body.overlay-open #entry-overlay {
  opacity: 1;
  visibility: visible;
}

/* optional: entry panel inner scrolling */
#entry-overlay .entry-content {
  background: #fff;              /* white panel atop the transparent layer */
  border-radius: 4px;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
  /* — responsive tweaks — */
  @media (max-width: 992px) {
    .detail-title h1 {
      font-size: 1.75rem;
    }
    .lead {
      font-size: 1.125rem;
    }
  }
  
  @media (max-width: 576px) {
    .detail-title h1 {
      font-size: 1.5rem;
    }
    .lead {
      font-size: 1rem;
    }
    /* constrain slider height on small screens */
    #main-slider .item img {
      max-height: 200px;
      object-fit: cover;
      width: 100%;
    }
    .detail-body {
      font-size: 0.95rem;
    }
  }

  /* responsive fallbacks */
  @media (max-width: 992px) {
    .grid-sizer,
    .grid-item {
      /* (100% – 1 gutter) ÷ 2 columns */
      width: calc((100% - var(--masonry-gutter)) / 2);
    }
  }
  
  @media (max-width: 576px) {
    .grid-sizer,
    .grid-item {
      width: 100%;
    }
  }

/* Stop the overlay container from scrolling itself */
#entry-overlay {
  overflow: hidden;       /* no scroll on the backdrop */
  padding: 0;
}

/* Make the white panel fill from below the header to the bottom */
body.overlay-open #entry-overlay .entry-content {
  position: absolute;
  /* offset from header and bottom */
  top: 2.5rem;     /* adjust if your header is taller/shorter */
  bottom: 2rem;  /* creates breathing room at the bottom */
  
  /* center horizontally */
  left: 50%;
  transform: translateX(-50%);
  
  /* width constraints */
  width: 80%;
  max-width: 1400px;
  
  /* limit height so it feels like a card */
  max-height: calc(100vh - 0rem); /* top + bottom offsets = 12rem */

  height:100vh;
  
  /* internal scroll if content exceeds card height */
  overflow-y: auto;
  
  /* styling for a floating card */
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 2rem;
  box-sizing: border-box;
}

/* hide separator + entry-title by default */
.site-header .separator,
.site-header .entry-title {
  display: inline-block;
  opacity: 0;
  transform: translateX(-20px);
}

/* when overlay opens, run the keyframe animation */
body.overlay-open .site-header .separator,
body.overlay-open .site-header .entry-title
 {
  animation: slideInLeft 0.4s ease forwards 0s;
}

body.overlay-open .site-header .entry-title {
  animation: slideInLeft 0.4s ease forwards 0.2s;
}

/* — style the inner scroll-bar on the entry card — */
body.overlay-open #entry-overlay .entry-content {
  /* Firefox: thin, custom colors */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}

/* Chrome, Edge, Safari */
body.overlay-open #entry-overlay .entry-content::-webkit-scrollbar {
  width: 8px;
}

body.overlay-open #entry-overlay .entry-content::-webkit-scrollbar-track {
  background: transparent;    /* match the card background */
  border-radius: 4px;         /* round the track ends */
  margin: 8px 0;              /* inset so corners don’t touch the card edges */
}

body.overlay-open #entry-overlay .entry-content::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 4px;         /* perfectly round ends on the thumb */
  border: 2px solid transparent; /* optional: add some whitespace around the thumb */
}

body.overlay-open #entry-overlay .entry-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,0,0,0.3);
}

/* Minimalistic “×” button */
body.overlay-open #entry-overlay .close-entry {
  position: absolute;
  top: 2rem;                   /* 1rem down from the top of the card */
  right: 4rem;                 /* 1rem in from the right edge */
  background: none;
  border: none;
  font-size: 3rem;
  line-height: 1;
  cursor: pointer;
  color: #333;                 /* adjust to suit your palette */
  z-index: 1200;                 /* above the scrollable content */
  padding: 0.25rem;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
body.overlay-open #entry-overlay .close-entry:hover {
  color: #111111;
}