a{
  color: black;
}

/* Font Customization */

p, .blog-post-teaser{
  line-height: 1.5;
}


.copytext p, .blog-post-teaser p{
  margin-top: -.4rem;
}

.infotext p, .infotext li{
  font-family: var(--secondary-font-family);
  margin-top: -.3rem;

}

h1, h2, h3, h4, h5, h6{
  all: unset;
  margin-top: -.2rem;
}

h1{
    font-size: calc((var(--basicfontsize)) * 1.618 * 1.618);
}

h2, .blog-post-title{
  font-size: calc((var(--basicfontsize)) * 1.618);
}

h3, h4, h5, h6{
  font-size: var(--basicfontsize);
}

/* Buttons */


#sort-buttons, .read-more-button, .overlay-header, .language-button, .custom-button p{
  letter-spacing: 8%;
}

button{
  all: unset;
  cursor: pointer;
  width: fit-content;
}

#sort-buttons, #language-buttons {
  display: flex;
  gap: var(--space-s);
  flex-wrap: wrap;
}

@media screen and (min-width: 768px) {
  #sort-buttons {
    margin-left: calc(var(--space-s) * -1 + 8.85%);
  }
}

.sort-button, .read-more-button{
  all: unset;
  font-family: var(--secondary-font-family);
  background-color: var(--cat-color, #ddd);
  color: #000;
  border: 1px solid var(--cat-color, #ddd);
  padding: 0.4em .7em;
  cursor: pointer;
  align-self: flex-start; /* or center, or baseline, depending on layout */
}

.sort-button.active {
  border: 1px solid #000;
}

.unsort-button.active{
  display: none!important;
}

.close-button, .return-button{
    width: 1.925rem;
    height: 1.925rem;
}

.close-button svg, .return-button svg{
  border: 1px solid black;
  transition: background-color 0.2s ease, fill 0.2s ease;
  width: 100%;
  height: 100%;
  display: block;
}

.close-button:hover svg, .return-button:hover svg{
  background-color: black;
  fill: white;
}

.read-more-button{
  background-color: #fff;
  border: 1px solid #000;
  transition: background-color 0.2s ease, color 0.2s ease;  
}

.custom-button p, .custom-button a{
  all: unset;
}

.custom-button p{
  font-family: var(--secondary-font-family);
  padding: 0.4em .7em;
  border: 1px solid black;
  width: fit-content;
  transition: background-color 0.1s ease, color 0.1s ease;
  display: table;
  cursor: pointer;
}

.custom-button p:hover, .custom-button.active a, .language-button.active{
  background-color: black;
  color: white;
}



/* Other Styles */


.blog-post-title{
  margin-bottom: var(--space-s);
}

.masonry-grid {
  display: flex;
  flex-wrap: wrap;
  margin-left: -7px;
  margin-right: -7px;
}

.masonry-grid-item {
  box-sizing: border-box;
  padding: 7px;
  width: 100%;
  margin-top: var(--space-xxl);
}

@media screen and (min-width: 768px) {
  .masonry-grid-item {
    width: 50%;
  }
}

@media screen and (min-width: 992px) {
  .masonry-grid-item {
    width: calc(100% / 3);
  }
}

@media screen and (min-width: 1200px) {
  .masonry-grid-item {
    width: 25%; /* 4 columns */
  }
}

@media screen and (min-width: 1700px) { /* Added 5-column breakpoint */
  .masonry-grid-item {
    width: 20%; /* 5 columns */
  }
}

@media screen and (min-width: 2000px) {
  .masonry-grid-item {
    width: calc(100% / 6); /* 6 columns */
  }
}




.masonry-grid-item figure {
  opacity: 1;
}

.masonry-grid-item.dimmed figure{
  opacity: 0.25;
}



.masonry-grid-item{
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  cursor: pointer;
}

.masonry-grid-item:hover .read-more-button{
  background-color: #000;
  color: #fff;
}

.masonry-grid-item figure {
  overflow: hidden;
}

.masonry-grid-item img {
  transition: transform 0.3s ease;
}

#post-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow-y: auto;
  display: none;
}

#post-overlay .overlay-background{
  background: var(--cat-color, #fff);
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.75;
  cursor: w-resize;
}

#post-overlay .overlay-header{
  font-family: var(--secondary-font-family);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

#post-overlay .overlay-header-info-wrapper{
  display: flex;
  flex-direction: row;
  gap: var(--space-s);
  align-items: center;
}


#post-overlay .overlay-header-info-wrapper .overlay-header-category{
  padding: 0.4em .7em;
}

#post-overlay .overlay-header .overlay-header-category{
  background-color: var(--cat-color, #fff);
}

#post-overlay .overlay-content-wrapper{
  padding: var(--space-s);
  padding-top: var(--space-xl);
  transform: translateX(-100%);
  transition: transform .5s ease;
  margin-right: var(--space-m);
  background-color: #fff;
  display: flex;
  flex-direction: column;

  /* NEW: Force GPU acceleration */
  will-change: transform; /* Inform browser about upcoming animation */
  backface-visibility: hidden; /* Often a good general-purpose trick for 3D transforms */
}

#post-overlay.active .overlay-content-wrapper{
  transform: translateX(0);
}

@media screen and (min-width: 768px) {
  #post-overlay .overlay-content-wrapper, .has-overlay-width{
    margin-right: calc(100% - (100% * .85));
  }
}

@media screen and (min-width: 1024px) {
  #post-overlay .overlay-content-wrapperm, .has-overlay-width{
    margin-right: calc(100% - (100% / 1.618));
  }
}

@media screen and (min-width: 1200px) {
  #post-overlay .overlay-content-wrapper, .has-overlay-width{
    margin-right: 33%;
  }
}


@media screen and (min-width: 2000px) {
  #post-overlay .overlay-content-wrapper, .has-overlay-width{
    margin-right: 50%;
  }
}



a.nextcontainer {
  text-decoration: none;
  color: black;
}

a.nextcontainer:hover .custom-button p, a.nextcontainer:hover .custom-button p{
  background-color: black;
  color: white;
}


.blocks.english-language-content, .blocks.german-language-content{
  display: none!important;
}

.blocks.english-language-content.active, .blocks.german-language-content.active{
  display: grid!important;
}


.footer ul a{
  text-decoration: none;
  font-family: var(--secondary-font-family);
  display: table;
  cursor: pointer;
}

.footer ul a:hover{
  text-decoration: underline;
  text-underline-offset: 0.15em; /* tweak as needed */
  text-decoration-thickness: 1px; /* or `from-font`, `0.1em`, etc. */
}


@media screen and (max-width: 767px) {
  .footer ul{
    flex-direction: column;
  }
}

.splide__slide{
  cursor: grab;
}

.splide__slide:active{
  cursor: grabbing;
}

#post-overlay footer {
  padding: 0;
}


/* General container for images */
figure.image, figure.video {
    position: relative;
    align-self: start;
    width: 100%;
    /* The aspect-ratio will be applied via inline style from PHP for raster images */
}

.image img, .video video{
    height: 100%;
}


/* Styling for raster images (WebP, JPEG, GIFs) - both placeholder AND final image */
/* These will fill the aspect-ratio constrained figure */
.image img.is-raster-image {
  display: block; /* Removes extra space below inline elements */
  width: 100%;    /* Image fills the width of its parent */
  height: 100%;   /* Image fills the height of its parent (constrained by aspect-ratio) */
  object-fit: cover; /* This is typically what you want for photos: fill the space, crop if necessary */
  object-position: center; /* Center the image within its box */
}

/* Styling for SVGs (images WITHOUT the .is-raster-image class) */
/* These containers will NOT have the aspect-ratio styling from PHP */
.image img:not(.is-raster-image) {
  display: block;
  max-width: 100%; /* Prevents SVG from overflowing its container */
  height: auto;    /* Crucial for SVGs to maintain their own aspect ratio naturally */
  object-fit: contain; /* SVGs often look best when they fit entirely within their space */
  margin: 0 auto;  /* Centers smaller SVGs horizontally */
}



