/* Main Container */
.mat-policy-widget {
    font-family: inherit;
    /* Inherit from site */
    max-width: 1200px;
    margin: 0 auto;
}

.mat-policy-loading,
.mat-policy-error,
.mat-policy-empty {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 4px;
    color: #666;
}

.mat-policy-error {
    color: #dc3545;
    background: #fde8e8;
}

/* Category Header */
.mat-policy-category {
    margin-bottom: 2rem;
}

.mat-policy-category-title {
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* List / Grid Layout */
.mat-policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.mat-policy-item {
    /* Container for the <a> tag */
    display: block;
}

/* Card Link Design (Matching User Request - Compact) */
.mat-policy-link {
    display: block;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    border: 5px solid #734a97;
    border-radius: 0;
    padding: 0.75rem;
    /* Reduced padding */
    text-decoration: none;
    min-height: 60px;
    /* Reduced height */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* The Sliding Overlay */
.mat-policy-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 0%;
    height: 100%;
    background-color: #734a97;
    transition: width 0.4s cubic-bezier(0.5, 0, 1, 1);
    z-index: 1;
}

.mat-policy-link:hover .mat-policy-overlay,
.mat-policy-link:focus .mat-policy-overlay {
    width: 100%;
}

/* Text Content */
.mat-policy-content {
    position: relative;
    z-index: 2;
    transition: color 0.4s ease;
    /* Default Text Color */
    color: #734a97;
}

.mat-policy-link:hover .mat-policy-content,
.mat-policy-link:focus .mat-policy-content {
    color: #fff;
}

/* Title & Meta */
.mat-policy-title {
    display: block;
    font-weight: bold;
    font-size: 1rem;
    /* Slightly smaller */
    margin-bottom: 0.25rem;
}

.mat-policy-meta {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.mat-policy-badge {
    background: #734a97;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    /* Keeping slight radius for badge only, or remove if strict */
    font-size: 0.75rem;
    border: 1px solid #734a97;
}

/* Invert badge on hover so it remains visible against purple background? 
   Or make it white with purple text? */
/* Invert badge on hover so it remains visible against purple background? 
   Or make it white with purple text? */
.mat-policy-link:hover .mat-policy-badge {
    background: #fff;
    color: #734a97;
    border-color: #fff;
}

.mat-policy-type {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}