:root {
    --dark-bg: #343a40;
    --card-bg: #3b4449;
    --card-hover-bg: #354552;
    --border-color: #323232;
    --border-hover-color: #414e50;
    --text-color: #fff;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

.card-img-top {
    height: 120px;
    object-fit: contain;
    margin: 0 auto;
    padding: 10px;
}

.custom-bg-dark {
    background-color: var(--dark-bg);
    color: var(--text-color);
}

.card-container {
    display: flex;
    align-items: stretch;
}

.card-body {
    min-height: 200px;
    flex: 1;
}

.card-title {
    font-weight: bold;
    font-size: 110%;
}

.custom-card {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    display: flex;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.custom-card:hover {
    background-color: var(--card-hover-bg);
    border-color: var(--border-hover-color);
    box-shadow: 0 0 8px var(--shadow-color);
}

.custom-card:hover::after {
    content: '→';
    position: absolute;
    bottom: -1em;
    right: 50%;
    transform: translateY(-50%);
    font-size: 28px;
}

.custom-card:focus {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

.card-text {
    position: relative;
    line-height: 1.4em;
    max-height: 8.4em;
    overflow: hidden;
}

.card-text.overflowing::after {
    content: "...";
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 0 20px 1px 45px;
    background: none;
    color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .card-body {
        min-height: 150px;
    }
    
    .card-text {
        max-height: 6.2em; /* Show fewer lines on mobile */
    }
    
    .custom-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 1200px) {
    .card-text {
        max-height: 160px;
    }
    .custom-card {
        height: 360px;
    }
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Needed for the stretched-link class to work with our card layout */
.stretched-link {
    position: static;
    color: inherit;
    text-decoration: none;
}

.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* Fix the card anchor text color */
.custom-card a {
    color: var(--text-color);
    text-decoration: none;
}
