/**
 * Custom Grid System CSS
 * Replacement for grid-plus plugin
 */

/* Grid Wrapper */
.grid-plus-wrapper,
.custom-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns, 3), 1fr);
    gap: var(--grid-gap, 20px);
    width: 100%;
    margin: 0 auto;
}

/* Grid Items */
.grid-plus-item,
.custom-grid-item {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.custom-grid-item:hover .grid-post-content {
    opacity: 1;
    visibility: visible;
    top: 50%;
}

/* Image styling within grid items */
.grid-plus-wrapper img,
.grid-plus-item img,
.custom-grid-wrapper img,
.custom-grid-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.custom-grid-item > a {

   aspect-ratio: 1 / 1;
}

/* .grid-plus-item img:hover,
.custom-grid-item img:hover {
    transform: scale(1.05);
    opacity: 0.9;
} */

/* Masonry Layout */
.custom-grid-masonry {
    grid-template-rows: masonry;
}

.custom-grid-masonry .custom-grid-item {
    break-inside: avoid;
}

/* Column Span Support */
.custom-grid-span-2 {
    grid-column: span 2;
}

.custom-grid-span-3 {
    grid-column: span 3;
}

.custom-grid-span-4 {
    grid-column: span 4;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .grid-plus-wrapper,
    .custom-grid-wrapper {
        grid-template-columns: repeat(var(--grid-columns-md, 2), 1fr);
    }
    
    .custom-grid-span-2,
    .custom-grid-span-3,
    .custom-grid-span-4 {
        grid-column: span 2;
    }
}

@media (max-width: 600px) {
    .grid-plus-wrapper,
    .custom-grid-wrapper {
        grid-template-columns: repeat(var(--grid-columns-sm, 1), 1fr);
        gap: var(--grid-gap-sm, 15px);
    }
    
    .custom-grid-span-2,
    .custom-grid-span-3,
    .custom-grid-span-4 {
        grid-column: span 1;
    }
}

/* Auto-fit columns for flexible layouts */
.custom-grid-wrapper[data-auto-fit="true"] {
    grid-template-columns: repeat(auto-fit, minmax(var(--grid-min-width, 250px), 1fr));
}

/* Auto-fill columns for flexible layouts */
.custom-grid-wrapper[data-auto-fill="true"] {
    grid-template-columns: repeat(auto-fill, minmax(var(--grid-min-width, 250px), 1fr));
}

/* Post Grid Specific Styles */
.custom-post-grid-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.custom-post-grid-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.grid-post-thumbnail {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px 10px 0 0;
}

.grid-post-content {
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 60%;
    transform: translateY(-50%);
    left: 0;
    width: 100%;
    overflow: hidden;
    text-align: center;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    transition: all 0.3s;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.grid-post-title {
    margin: 0 0 10px 0 !important;
    /* font-size: 1.2em;
    line-height: 1.3;
    font-weight: 600; */
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.grid-post-title a {
    text-decoration: none;
    color: #fff;
}

.grid-post-title a:hover {
    color: #5d97af;
}


.grid-post-excerpt {
    font-size: 0.9em;
    line-height: 1.6;
    color: #fff;
    margin-top: 10px;
    /* font-family: 'Open Sans', sans-serif; */
}

/* Grid Item Content */
.grid-plus-item .grid-item-content,
.custom-grid-item .grid-item-content {
    padding: 15px;
}

.grid-plus-item .grid-item-title,
.custom-grid-item .grid-item-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.grid-plus-item .grid-item-description,
.custom-grid-item .grid-item-description {
    margin: 0;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Link wrapper for grid items */
.grid-plus-item a,
.custom-grid-item a {
    display: block;
    text-decoration: none;
}

.grid-plus-item a:hover,
.custom-grid-item a:hover {
    text-decoration: none;
}

/* Loading state */
.custom-grid-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animation for items - Simple fade-in */
@keyframes gridItemFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Apply animation to all grid items - start hidden */
.grid-plus-item,
.custom-grid-item,
.custom-post-grid-item {
    opacity: 0;
}

/* When individual item is in view, trigger animation */
.grid-plus-item.in-view,
.custom-grid-item.in-view,
.custom-post-grid-item.in-view {
    animation: gridItemFadeIn 0.8s ease-out forwards;
}

/* Ensure images maintain aspect ratio */
.grid-plus-item img,
.custom-grid-item img {
    aspect-ratio: attr(data-aspect-ratio);
}

/* Support for different aspect ratios */
.custom-grid-item[data-aspect-ratio="square"] img {
    aspect-ratio: 1 / 1;
}

.custom-grid-item[data-aspect-ratio="landscape"] img {
    aspect-ratio: 16 / 9;
}

.custom-grid-item[data-aspect-ratio="portrait"] img {
    aspect-ratio: 3 / 4;
}

.header-image {

    margin-bottom: 110px
}



@media (max-width: 1024px) {


    .header-image {

        margin-bottom: 50px
    }
}

@media (max-width: 781px) {
	
	.posttype-post.category-referenz,
	.posttype-post.category-logodesign {
		
		padding: 0 1rem;
	}
}

@media (max-width: 767px) {

    .header-image {

        margin-bottom: 50px
    }
}


