/* Typography Fixes - Ensure Perfect Fit in Containers */

/* Prevent text overflow in all containers */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Fix course titles to fit in cards */
.course-title,
.course-title-cell,
h1, h2, h3, h4, h5, h6 {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* Ensure course card text doesn't overflow */
.course-card,
.modern-course-card {
    overflow: hidden !important;
}

.course-card * {
    max-width: 100% !important;
}

/* Fix long course names */
.course-title {
    font-size: 1.1rem !important;
    line-height: 1.5 !important;
    max-width: 100% !important;
}

.course-title a {
    display: block !important;
    max-width: 100% !important;
}

/* Fix descriptions */
.course-description {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    max-width: 100% !important;
}

/* Fix info items */
.info-item,
.meta-item,
.course-meta div {
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Responsive typography */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    .course-title {
        font-size: 1rem !important;
    }
    
    .course-description {
        font-size: 0.9rem !important;
    }
}

/* Fix table cells */
.course-title-cell {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.course-date-cell,
.course-venue-cell,
.course-fee-cell {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Fix sidebar text */
.filter-label,
.filter-option {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Ensure buttons fit */
.btn,
.btn-primary,
.btn-secondary,
.btn-outline {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Fix page header text */
.page-header * {
    max-width: 100% !important;
}

/* Fix footer text */
.footer * {
    word-wrap: break-word !important;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.container {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Fix grid items */
.courses-grid > *,
.features-grid > *,
.subjects-grid > * {
    min-width: 0 !important;
    overflow: hidden !important;
}

