/* ================================================================
   FILE: /css/components/cards.css
   PURPOSE: Defines styles for elegant card components.
   - All classes are prefixed with `ch-` for namespacing.
   ================================================================ */

/* --- The Grid Container for the Cards --- */
.ch-card-grid {
    display: grid;
    /* Creates 1-3 columns based on available space */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--ch-spacing-md);
}

/* --- The Elegant Card Itself --- */
.ch-elegant-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards in a row have the same height */
    background-color: var(--ch-color-contrast);
    border: 1px solid var(--ch-color-border);
    border-radius: var(--ch-border-radius);
    padding: var(--ch-spacing-md);
    box-shadow: 0 2px 10px rgba(29, 45, 63, 0.04);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
}

/* --- The Elegant Hover Effect --- */
.ch-elegant-card:hover,
.ch-elegant-card:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(29, 45, 63, 0.08);
}

/* The animated accent line on hover */
.ch-elegant-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background-color: var(--ch-color-accent);
    border-top-left-radius: var(--ch-border-radius);
    border-top-right-radius: var(--ch-border-radius);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ch-elegant-card:hover::before,
.ch-elegant-card:focus-within::before {
    width: 100%;
}


/* --- Card Content Styling --- */

.ch-card-icon {
    color: var(--ch-color-accent);
    margin-bottom: var(--ch-spacing-sm);
    line-height: 1;
}

.ch-card-icon svg {
    width: 40px;
    height: 40px;
}

.ch-card-title {
    font-family: var(--ch-font-heading);
    font-size: 1.5rem;
    color: var(--ch-color-text-heading);
    margin-bottom: var(--ch-spacing-xs);
    line-height: 1.3;
}

.ch-card-description {
    font-family: var(--ch-font-body);
    color: var(--ch-color-text-body);
    line-height: 1.7;
    flex-grow: 1; /* Pushes the CTA down */
}

.ch-card-cta {
    display: inline-flex;
    align-items: center;
    font-family: var(--ch-font-body);
    font-weight: 700;
    color: var(--ch-color-primary);
    margin-top: var(--ch-spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    border-bottom: none; /* Override global link style */
}

.ch-elegant-card:hover .ch-card-cta {
    color: var(--ch-color-accent);
}

/* Arrow for the CTA */
.ch-card-cta::after {
    content: '→';
    margin-left: 0.5em;
    transition: transform 0.3s ease;
}

.ch-elegant-card:hover .ch-card-cta::after {
    transform: translateX(4px);
}