/**
 * InfoCard Widget Styles
 * Add this CSS to your theme or page header
 */
 
 /* Adds columns and rows to Kontakt */
 
.four-columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .four-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .four-columns {
        grid-template-columns: 1fr;
    }
}

.four-columns > div {
    line-height: 1.5;
}

.four-columns strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

/* Container */
.info-cards-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;  /* Added horizontal padding to prevent touching edges */
}

/* Grid Layout */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 20px;
    /*gap: 20px;*/  /* Increased gap for better spacing */
    position: relative;
    padding: 8px;  /* Added padding around grid */
}

@media (max-width: 991px) {
    .info-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .info-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Individual Card - Smaller size */
.info-card {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: visible;
    min-height: 120px;
}

.info-card:not(.is-expanded):not(.is-expanding):not(.is-collapsing):hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Remove transform when expanding/expanded so position:fixed child stays on viewport */
.info-card.is-expanded,
.info-card.is-expanding,
.info-card.is-collapsing {
    transform: none !important;
}

.info-card-inner {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Card Header (Icon + Title) */
.info-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
}

.info-card-icon {
    width: 48px;
    height: 48px;
    /* background: #7CB342; removed background color due to new icons */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: auto;
    flex-shrink: 0;
}

.info-card-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    /* Removed filter - icons should be visible with their original colors */
}

.info-card-icon-default {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.info-card-title {
    font-size: 21px;
    font-weight: 600;
    color: #7CB342;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    text-align: left;
    width: 100%;
    padding-top: 32px;
}

@media (max-width: 575px) {
    .info-cards-container {
        padding: 16px 12px;
    }
    
    .info-cards-grid {
        gap: 12px;
        padding: 4px;
    }
    
    .info-card {
        min-height: 100px;
    }
    
    .info-card-title {
        font-size: 20px;
        white-space: nowrap;  /* prevent one title from wrapping differently */
    }
    
    .info-card-icon {
        width: 36px;
        height: 36px;
    }
    
    .info-card-icon img {
        width: 35px;
        height: 35px;
    }
    
    .info-card-inner {
        padding: 12px;
    }
}

/* Expanded Panel (Hidden by default) */
.info-card-expanded {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.95);
    transition: none;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

/* Expanded State */
.info-card.is-expanded .info-card-expanded {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.info-card.is-expanded {
    z-index: 1044; /* above .info-cards-overlay (1043) */
}

.info-card.is-expanded .info-card-expanded {
    z-index: 10;
}

/* Expanding Animation State */
.info-card.is-expanding .info-card-expanded {
    opacity: 0;
    transform: scale(0.8);
}

/* Collapsing Animation State */
.info-card.is-collapsing .info-card-expanded {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Expanded Header */
.info-card-expanded-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.info-card-expanded-icon {
    width: 48px;
    height: 48px;
    /*background: #7CB342;*/
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.info-card-expanded-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    /* Removed filter */
}

.info-card-expanded-title {
    font-size: 20px;
    font-weight: 600;
    color: #7CB342;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    flex-grow: 1;
}

/* Close Button */
.info-card-close {
    width: 44px;
    height: 44px;
    background: #7CB342;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.info-card-close:hover {
    transform: scale(1.1);
    background: #6ba33a;
}

.info-card-close svg {
    transform: rotate(180deg);
}

/* Expanded Content Area */
.info-card-expanded-content {
    flex: 1 1 0;
    min-height: 0;
    padding: 24px;
    overflow-y: scroll;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

/* Full-width container for expanded content */
.info-card.is-expanded .info-card-expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.info-card.is-expanded .info-card-expanded {
    transform: translate(-50%, -50%) scale(1);
}

/* Mobile adjustments for expanded view */
@media (max-width: 767px) {
    .info-card.is-expanded .info-card-expanded {
        width: 95%;
        height: 85vh;
        max-height: 85vh;
    }

    .info-card-expanded-title {
        font-size: 18px;
    }

    .info-card-expanded-content {
        padding: 16px;
    }
}

/* Overlay Backdrop - No blur */
.info-cards-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    /* backdrop-filter removed */
    z-index: 1043; /* above mobile fixed header (.rd-navbar-panel z 1040, dots z 1042) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.info-cards-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Content Styling within Expanded Panel */
.info-card-expanded-content h1,
.info-card-expanded-content h2,
.info-card-expanded-content h3,
.info-card-expanded-content h4 {
    color: #333;
    margin-top: 0;
    margin-bottom: 16px;
}

.info-card-expanded-content p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.info-card-expanded-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.info-card-expanded-content th,
.info-card-expanded-content td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.info-card-expanded-content th {
    background: #f5f5f5;
    font-weight: 600;
}

.info-card-expanded-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.info-card-expanded-content iframe {
    max-width: 100%;
    border-radius: 8px;
}

.info-card-expanded-content ul,
.info-card-expanded-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.info-card-expanded-content li {
    margin-bottom: 8px;
}

.info-card-expanded-content a {
    color: #7CB342;
    text-decoration: none;
}

.info-card-expanded-content a:hover {
    text-decoration: underline;
}

.info-card-expanded-content .button,
.info-card-expanded-content button,
.info-card-expanded-content input[type="submit"] {
    display: inline-block;
    padding: 12px 24px;
    background: #7CB342;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.info-card-expanded-content .button:hover,
.info-card-expanded-content button:hover,
.info-card-expanded-content input[type="submit"]:hover {
    background: #6ba33a;
    transform: translateY(-2px);
}

/* Two-column layout for working hours */
.info-card-expanded-content .two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

@media (max-width: 767px) {
    .info-card-expanded-content .two-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Team section styling */
.info-card-expanded-content .team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 767px) {
    .info-card-expanded-content .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .info-card-expanded-content .team-grid {
        grid-template-columns: 1fr;
    }
}

/* Map container */
.info-card-expanded-content .map-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.info-card-expanded-content .map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Video container */
.info-card-expanded-content .video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-card-expanded-content .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Scrollbar styling for content area */
.info-card-expanded-content::-webkit-scrollbar {
    width: 8px;
}

.info-card-expanded-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.info-card-expanded-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.info-card-expanded-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Animation keyframes */
@keyframes cardExpand {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cardCollapse {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .info-card,
    .info-card-expanded,
    .info-cards-overlay,
    .info-card-close {
        transition: none !important;
    }
}