/* Education Cards
   This section contains all styles related to the education cards,
   including the card structure, image handling, content areas,
   and various states like hover effects */

/* Education Cards */
.education-card {
    background: #fff;
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: auto; /* Changed from fixed 650px */
    min-height: 550px; /* Add minimum height for consistency */
    width: 100%;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Card Link */
.card-link {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    height: 100%;
    position: relative;
}

/* Image Section */
.card-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 240px;
    flex-shrink: 0;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.education-card:hover .card-img {
    transform: scale(1.05);
}

/* Image Overlay Gradient */
.card-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

/* Principles Header (when no image) */
.card-principles-header {
    height: 240px;
    background-color: color-mix(in srgb, var(--primary-color) 10%, white);
    border-bottom: 1px solid #eee;
    padding: 15px;
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
    position: relative;
}

/* Principles Tags */
.card-principles-tags {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    z-index: 2;
}

.card-principles-tags .category-label,
.card-principles-header .category-label {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.card-principles-tags .category-label {
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Content Section */
.card-content {
    padding: 1.25rem;
    flex: 1; /* This makes it expand to fill available space */
    display: flex;
    flex-direction: column;
}

/* Title */
.card-title {
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-color);
}

.education-card:hover .card-title {
    color: var(--primary-color);
}

/* Author Section */
.card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.card-author i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Excerpt/Blurb */
.card-blurb {
    flex-grow: 1;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    overflow: hidden;
    position: relative;
}

.card-blurb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.6em;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

/* Footer Section */
.card-taxonomy-footer {
    min-height: 80px; /* Changed from fixed height */
    padding: 1rem;
    background: #fff;
    border-top: 1px solid #eee;
}

/* Tags Section */
.card-other-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow: hidden;
    max-height: 100%;
}

.card-other-tags .category-label {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.card-other-tags .category-label:hover {
    background-color: var(--primary-color-light);
}

/* Post Type Indicator */
.card-post-type {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.8rem;
    text-transform: capitalize;
    z-index: 2;
}

/* Grid Layout */
.post-grid {
    margin: 0 -15px; /* Align with Bootstrap gutters */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .education-card {
        height: auto;
        min-height: 600px;
    }
    
    .card-image-wrapper {
        height: 200px;
    }
}