/* Event Card Component Styles */
/* This is a shared component for event cards across all pages */

/* Base Card Structure */
.event-card-base {
    width: 100%;
    min-width: 240px;
    max-width: 280px;
    max-height: 440px;
    background: transparent;
    padding: 1px 1px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    cursor: pointer;
    animation: cardAppear 0.4s ease forwards;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    color: var(--text-color);
    flex: 1 1 auto;
}

.event-card-base::after {
    content: "";
    position: absolute;
    background: var(--color-secondary);
    top: -3px; /* Moves the shape slightly up */
    left: -3px; /* Moves it slightly left */
    width: calc(100% + 7px); /* Expands it beyond the event card */
    height: calc(100% + 7px); /* Expands beyond the event card */
    transition: background-color 0.3s ease;
    clip-path: polygon(
        0px 25px,              /* Top left corner */
        26px 0px,              /* Top left diagonal */
        calc(60% - 25px) 0px,  /* Top line start */
        60% 25px,              /* Top right notch */
        100% 25px,             /* Top right corner */
        100% calc(100% - 10px), /* Bottom right corner */
        calc(100% - 15px) calc(100% - 10px),   /* Bottom right notch */
        calc(80% - 10px)  calc(100% - 10px),   /* Bottom line start */
        calc(80% - 15px) calc(100% - 0px),     /* Bottom notch */
        10px  calc(100% - 0px), /* Bottom left corner */
        0% calc(100% - 10px)    /* Bottom line end */
     );
    z-index: -1; /* Moves it behind the event-card */
    /* transition removed */
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add animation delay for each card */
.event-card-base:nth-child(1) { animation-delay: 0s; }
.event-card-base:nth-child(2) { animation-delay: 0.1s; }
.event-card-base:nth-child(3) { animation-delay: 0.2s; }
.event-card-base:nth-child(4) { animation-delay: 0.3s; }
.event-card-base:nth-child(5) { animation-delay: 0.4s; }
.event-card-base:nth-child(6) { animation-delay: 0.5s; }
.event-card-base:nth-child(7) { animation-delay: 0.6s; }
.event-card-base:nth-child(8) { animation-delay: 0.7s; }
.event-card-base:nth-child(9) { animation-delay: 0.8s; }
.event-card-base:nth-child(10) { animation-delay: 0.9s; }
.event-card-base:nth-child(11) { animation-delay: 1.0s; }
.event-card-base:nth-child(12) { animation-delay: 1.1s; }

/* Hover effects for event-card-base */
.event-card-base:hover {
    transform: translateY(-5px) !important;
}

.event-card-base:hover::after {
    background: #d4621a; /* Darker orange for hover */
}

.category-card-wrapper {
    background: var(--card-background);
    color: var(--text-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    clip-path: polygon(
        0px 25px,              /* Top left corner */
        26px 0px,              /* Top left diagonal */
        calc(60% - 25px) 0px,  /* Top line start */
        60% 25px,              /* Top right notch */
        100% 25px,             /* Top right corner */
        100% calc(100% - 10px), /* Bottom right corner */
        calc(100% - 15px) calc(100% - 10px),   /* Bottom right notch */
        calc(80% - 10px)  calc(100% - 10px),   /* Bottom line start */
        calc(80% - 15px) calc(100% - 0px),     /* Bottom notch */
        10px  calc(100% - 0px), /* Bottom left corner */
        0% calc(100% - 10px)    /* Bottom line end */
     );
    /* transition removed */
}

.category-card-wrapper a {
    text-decoration: none;
    color: inherit;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* transition removed */
}

.category-event-image {
    width: 100%;
    height: 180px; /* Fixed height that's approximately 40% of typical card height */
    object-fit: cover;
    display: block;
    flex-shrink: 0; /* Prevent image from shrinking */
}

.category-event-details {
    padding: 15px 15px 22px 15px;
    display: flex;
    flex-direction: column;
    gap: calc(4px + 0.3vw); /* Responsive gap */
    flex: 1; /* Take up remaining space */
    /* transition removed */
}

.category-event-details h3 {
    margin: 0px;
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--text-color);
    font-weight: 600;
    /* transition removed */
    /* Limit to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 3rem;
    word-wrap: break-word;
    padding-bottom: 2px;
}

.category-event-details p {
    margin: 0;
    font-size: clamp(0.875rem, 0.8vw + 0.4rem, 0.95rem); /* Responsive font size */
    color: var(--text-color-light);
    display: flex;
    align-items: center;
    gap: 8px;
    /* transition removed */
}

/* Container for the location icon and text */
.category-event-location {
    display: flex;
    align-items: center;
    max-width: 100%;
    margin-bottom: 3px;
    min-width: 0; /* Allows the container itself to shrink */
}

/* The actual text element that will be truncated */
.category-event-location .location-text {
    display: block; /* Force block-level behavior for reliable truncation */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1; /* Explicitly allow this item to shrink */
    flex-basis: 100%; /* Let it take up space initially */
}

/* Location styles */

/* Additional styles for mobile view are in the media query at the bottom */

/* Category tags styling */
.category-event-categories {
    display: flex;
    flex-wrap: nowrap; /* Keep all tags on single line */
    gap: 6px;
    margin-top: auto; /* Push categories to bottom */
    padding-top: 8px;
    min-height: 36px; /* Ensure enough space for tags */
    max-height: 36px; /* Fixed height for single row */
    overflow: hidden; /* Hide overflow tags */
    position: relative;
    
    /* Subtle fade effect at the end to indicate more categories */
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.category-event-category {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.category-tag {
    display: inline-block;
    background: light-dark(rgba(42, 145, 208, 0.15), rgba(71, 158, 211, 0.25));
    color: light-dark(#2A91D0, #52b6f3);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid light-dark(rgba(42, 145, 208, 0.3), rgba(71, 158, 211, 0.4));
    margin-right: 4px;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark theme support for category tags - now handled by light-dark() above */
/* Removed duplicate dark theme styling */

/* Icons for event details */
.category-event-date::before,
.category-event-time::before,
.category-event-location::before,
.category-event-category::before {
    content: '';
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.category-event-date::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11z"/></svg>') no-repeat center;
}

.category-event-time::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"/></svg>') no-repeat center;
}

.category-event-location::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>') no-repeat center;
}

.category-event-category::before {
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16zM16 17H5V7h11l3.55 5L16 17z"/></svg>') no-repeat center;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Vertical layout for mobile - default card style */
    .event-card-base {
        width: 280px;
        min-width: 280px;
        max-width: 100%;
        height: auto;
        flex-direction: column;
        flex: 1 1 auto;
        margin: 0 auto;
    }
    
    /* Horizontal layout for cards with the horizontal-layout class */
    .event-card-base.horizontal-layout {
        height: 160px;
        flex-direction: row;
        width: 100%;
        min-width: 100%;
        max-width: none;
        flex: 1 1 auto;
    }
    
    /* Cards in specific sections need full width */
    .category-section .event-card-base,
    .location-events .event-card-base {
        width: 100%;
        min-width: 100%;
        max-width: none;
    }

    /* Default clip path for all cards */
    .event-card-base::after {
        clip-path: polygon(
            0px 25px,              /* Top left corner */
            26px 0px,              /* Top left diagonal */
            calc(60% - 25px) 0px,  /* Top line start */
            60% 25px,              /* Top right notch */
            100% 25px,             /* Top right corner */
            100% calc(100% - 10px), /* Bottom right corner */
            calc(100% - 15px) calc(100% - 10px),   /* Bottom right notch */
            calc(80% - 10px)  calc(100% - 10px),   /* Bottom line start */
            calc(80% - 15px) calc(100% - 0px),     /* Bottom notch */
            10px  calc(100% - 0px), /* Bottom left corner */
            0% calc(100% - 10px)    /* Bottom line end */
         );
    }
    
    /* Card wrapper clip path for all cards */
    .category-card-wrapper {
        clip-path: polygon(
            0px 25px,              /* Top left corner */
            26px 0px,              /* Top left diagonal */
            calc(60% - 25px) 0px,  /* Top line start */
            60% 25px,              /* Top right notch */
            100% 25px,             /* Top right corner */
            100% calc(100% - 10px), /* Bottom right corner */
            calc(100% - 15px) calc(100% - 10px),   /* Bottom right notch */
            calc(80% - 10px)  calc(100% - 10px),   /* Bottom line start */
            calc(80% - 15px) calc(100% - 0px),     /* Bottom notch */
            10px  calc(100% - 0px), /* Bottom left corner */
            0% calc(100% - 10px)    /* Bottom line end */
         );
    }
    
    /* Default vertical layout link */
    .category-card-wrapper a {
        height: 100%;
        flex-direction: column;
    }
    
    /* Horizontal layout link */
    .event-card-base.horizontal-layout .category-card-wrapper a {
        height: 100%;
        flex-direction: row;
    }
    
    /* Default vertical layout image */
    .category-event-image {
        width: 100%;
        height: 180px;
        margin: 0;
        border-radius: 8px 8px 0 0;
    }
    
    /* Horizontal layout image */
    .event-card-base.horizontal-layout .category-event-image {
        width: 35%;
        height: auto;
        margin: 0;
        border-radius: 8px 0 0 8px;
    }

    /* Default vertical layout details */
    .category-event-details {
        width: 100%;
        padding: 16px;
        min-height: 140px;
        gap: calc(4px + 0.5vw);
        align-self: auto;
    }
    
    /* Horizontal layout details */
    .event-card-base.horizontal-layout .category-event-details {
        width: 65%;
        padding: 8px;
        height: 80%;
        gap: calc(2px + 0.3vw);
        align-self: center;
        margin-top: 5px;
    }
    

    .category-event-details h3 {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }
    
    /* Horizontal layout title */
    .event-card-base.horizontal-layout .category-event-details h3 {
        font-size: 1rem;
        margin-bottom: 0px;
    }
}
