/* Event Management App - Improved Event Cards CSS with Teaser Support */

/* Event Card Improvements - Compact Dynamic Dimensions */
.event-card-container {
    width: 216px;
    min-height: 260px; /* Reduced from 280px */
    margin: 0 auto 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
}

.event-card-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.event-card-image {
    width: 216px;
    height: 108px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-card-container:hover .event-card-image img {
    transform: scale(1.05);
}

.event-card-details {
    width: 216px;
    min-height: 152px; /* Reduced from 172px */
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1; /* Allow details to grow */
    overflow: hidden;
}

.event-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0; /* Reduced from 10px to 6px */
    line-height: 1.3;
    height: auto; /* Allow title to expand naturally */
    min-height: 36px; /* Minimum height for consistency */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-shrink: 0; /* Prevent title from shrinking */
}

.event-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.event-card-title a:hover {
    color: #00ab6b;
}

/* IMPROVED: Event Card Teaser Styling - More Compact */
.event-card-teaser {
    font-size: 12px;
    color: #555;
    font-style: italic;
    line-height: 1.3; /* Reduced from 1.4 */
    margin: 4px 0 8px 0; /* Reduced spacing: top 4px (was 8px), bottom 8px (was 12px) */
    padding: 6px 8px; /* Reduced padding from 8px 10px */
    background: linear-gradient(135deg, rgba(0, 171, 107, 0.08), rgba(0, 171, 107, 0.03));
    border-radius: 5px; /* Slightly smaller radius */
    border-left: 3px solid #00ab6b;
    max-height: none; /* Allow full teaser to show */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Reduced from 3 to 2 lines for compactness */
    -webkit-box-orient: vertical;
    flex-shrink: 0; /* Prevent teaser from shrinking */
    box-shadow: 0 1px 2px rgba(0, 171, 107, 0.08); /* Reduced shadow */
    position: relative;
}

.event-card-teaser:empty {
    display: none;
    margin: 0;
    padding: 0;
}

/* Add a subtle animation to teaser */
.event-card-teaser::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #00ab6b, #008a56);
    border-radius: 0 3px 3px 0;
}

.event-card-info {
    flex: 1; /* Allow info section to grow and fill space */
    display: flex;
    flex-direction: column;
    gap: 5px; /* Reduced from 6px */
    margin-bottom: 8px; /* Reduced from 10px */
    min-height: 70px; /* Reduced from 80px */
}

.event-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
    line-height: 1.2;
}

.event-info-item i {
    color: #00ab6b;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.event-info-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.event-card-footer {
    margin-top: auto;
    text-align: center;
    flex-shrink: 0; /* Prevent footer from shrinking */
    padding-top: 6px; /* Reduced from 8px */
}

.event-card-read-more {
    color: #00ab6b;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 5px 10px; /* Reduced from 6px 12px */
    border: 1px solid #00ab6b;
    border-radius: 4px;
    display: inline-block;
}

.event-card-read-more:hover {
    color: white;
    background-color: #00ab6b;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 171, 107, 0.3);
}

/* Grid Layout for Event Cards */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 216px);
    gap: 18px; /* Reduced from 20px */
    justify-content: center;
    margin: 20px 0;
    align-items: start; /* Align cards to start to handle different heights */
}

/* Featured Events Layout */
.featured-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 216px);
    gap: 18px; /* Reduced from 20px */
    justify-content: center;
    margin: 20px 0;
    align-items: start; /* Align cards to start to handle different heights */
}

/* Post Page Image Improvements */
.post-featured-image {
    width: 100%;
    max-width: 600px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Event Details Section Improvements */
.event-details-section {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid #00ab6b;
}

.event-details-section h3 {
    color: #00ab6b;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.event-detail-item {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.event-detail-item h5 {
    color: #333;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
    min-width: 80px;
}

.event-detail-item p {
    font-size: 14px;
    margin: 0;
    color: #666;
    flex: 1;
}

.event-detail-item i {
    color: #00ab6b;
    margin-right: 5px;
    width: 16px;
    text-align: center;
}

/* Article Post Content */
.article-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.article-post h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.article-post p {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .events-grid,
    .featured-events-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 216px));
        gap: 15px;
        padding: 0 10px;
    }
    
    .event-card-container {
        width: 100%;
        max-width: 216px;
        min-height: 250px; /* Reduced for mobile */
    }
    
    .event-card-image {
        width: 100%;
    }
    
    .event-card-details {
        width: 100%;
        min-height: 142px; /* Reduced for mobile */
    }
    
    .event-card-teaser {
        font-size: 11px;
        margin: 3px 0 6px 0; /* Further reduced spacing on mobile */
        padding: 5px 6px; /* Smaller padding on mobile */
        -webkit-line-clamp: 2; /* Keep 2 lines on mobile */
    }
    
    .event-card-title {
        margin: 0 0 4px 0; /* Reduced title margin on mobile */
    }
    
    .post-featured-image {
        max-width: 100%;
        height: 200px;
        margin: 15px 0;
    }
    
    .event-details-section {
        padding: 15px;
        margin: 15px 0;
    }
    
    .article-post {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .events-grid,
    .featured-events-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .event-card-container {
        width: 100%;
        max-width: 300px;
        min-height: 240px; /* Compact for small mobile */
    }
    
    .event-card-image {
        width: 100%;
        height: 140px; /* Slightly smaller image on small mobile */
    }
    
    .event-card-details {
        width: 100%;
        min-height: 100px; /* Very compact details section */
        padding: 10px; /* Reduced padding */
    }
    
    .event-card-teaser {
        font-size: 10px;
        margin: 2px 0 4px 0; /* Minimal spacing on small mobile */
        padding: 4px 5px; /* Very compact padding */
        -webkit-line-clamp: 2;
    }
    
    .event-card-title {
        margin: 0 0 3px 0; /* Minimal title margin */
        font-size: 13px; /* Slightly smaller title */
    }
    
    .event-card-info {
        gap: 4px; /* Reduced gap */
        min-height: 60px; /* Compact info section */
    }
    
    .event-detail-item {
        flex-direction: column;
        gap: 5px;
    }
    
    .event-detail-item h5 {
        min-width: auto;
    }
    
    .event-info-item {
        font-size: 10px; /* Smaller text on small mobile */
    }
}

/* Bootstrap Card Override for Consistency */
.card-columns .card {
    width: 216px !important;
    min-height: 260px !important; /* Reduced height */
    margin-bottom: 18px !important; /* Reduced margin */
    border-radius: 8px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.card-columns {
    column-count: auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, 216px) !important;
    gap: 18px !important; /* Reduced gap */
    justify-content: center !important;
    align-items: start !important;
}

/* Featured Events Specific Styling */
.listfeaturedtag .card {
    width: 216px !important;
    min-height: 260px !important; /* Reduced height */
    display: flex !important;
    flex-direction: column !important;
}

.listfeaturedtag .wrapthumbnail {
    height: 108px !important;
    flex: none !important;
}

.listfeaturedtag .thumbnail {
    height: 100% !important;
    background-size: cover !important;
    background-position: center !important;
}

.listfeaturedtag .card-block {
    min-height: 152px !important; /* Reduced height */
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

/* Recent Events Specific Styling */
.listrecent .card {
    width: 216px !important;
    min-height: 260px !important; /* Reduced height */
    display: flex !important;
    flex-direction: column !important;
}

.listrecent .card img {
    width: 100% !important;
    height: 108px !important;
    object-fit: cover !important;
}

.listrecent .card-block {
    min-height: 152px !important; /* Reduced height */
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

/* Text Truncation for Card Content */
.listfeaturedtag h2.card-title,
.listrecent h2.card-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    min-height: 36px !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    margin-bottom: 6px !important; /* Reduced margin */
    flex-shrink: 0 !important;
}

/* IMPROVED: Legacy card teaser support - More Compact */
.listfeaturedtag .card-teaser,
.listrecent .card-teaser {
    font-size: 12px !important;
    color: #555 !important;
    font-style: italic !important;
    line-height: 1.3 !important; /* Reduced line height */
    margin: 4px 0 8px 0 !important; /* Reduced spacing */
    padding: 6px 8px !important; /* Reduced padding */
    background: linear-gradient(135deg, rgba(0, 171, 107, 0.08), rgba(0, 171, 107, 0.03)) !important;
    border-radius: 5px !important; /* Smaller radius */
    border-left: 3px solid #00ab6b !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important; /* Reduced to 2 lines */
    -webkit-box-orient: vertical !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 2px rgba(0, 171, 107, 0.08) !important; /* Reduced shadow */
}

.listfeaturedtag .card-teaser:empty,
.listrecent .card-teaser:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.listfeaturedtag .wrapfooter,
.listrecent .wrapfooter {
    position: static !important;
    width: 100% !important;
    margin-top: auto !important;
    font-size: 10px !important;
    flex-shrink: 0 !important;
    padding-top: 6px !important; /* Reduced padding */
}

/* Hover Effects */
.card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
    transition: all 0.3s ease !important;
}

/* Author Thumb Sizing */
.author-thumb {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
}

/* Meta Footer Adjustments */
.meta-footer-thumb {
    margin-right: 6px !important;
}

.author-meta {
    font-size: 10px !important;
}

.post-name,
.post-date,
.post-read {
    font-size: 10px !important;
}

.post-read-more {
    font-size: 11px !important;
}

/* ENHANCED: Card content organization - More Compact */
.event-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px; /* Reduced from 8px */
}

.event-card-meta {
    margin-top: auto;
    padding-top: 6px; /* Reduced from 8px */
    border-top: 1px solid #f0f0f0;
}

/* IMPROVED: Teaser visibility and readability */
.event-card-teaser {
    position: relative;
    z-index: 1;
}

.event-card-teaser::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px; /* Reduced from 20px */
    height: 15px; /* Reduced from 20px */
    background: linear-gradient(45deg, transparent 50%, rgba(0, 171, 107, 0.1) 50%);
    border-radius: 0 0 5px 0; /* Adjusted for smaller radius */
}

/* ENHANCED: Card spacing and layout - Tighter Spacing */
.event-card-container .event-card-details > * {
    margin-bottom: 0;
}

.event-card-container .event-card-details > *:not(:last-child) {
    margin-bottom: 6px; /* Reduced from 8px */
}

.event-card-container .event-card-teaser + .event-card-info {
    margin-top: 2px; /* Reduced from 4px */
}

/* IMPROVED: Focus states for accessibility */
.event-card-title a:focus,
.event-card-read-more:focus {
    outline: 2px solid #00ab6b;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ENHANCED: Loading state placeholder */
.event-card-container.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* IMPROVED: Print styles */
@media print {
    .event-card-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .event-card-teaser {
        background: #f9f9f9 !important;
        color: #333 !important;
    }
    
    .event-card-read-more {
        display: none;
    }
}
