/**
 * Legacy Styles - Mozkrat Gahza
 * Styles for pages not yet updated (teachers, sections, search)
 * Version: 1.1 - Optimized for Core Web Vitals
 */

/* ===================================
   Circular Teacher Images
   =================================== */
/* High specificity to override .img-container when both classes are present */
.img-container.teacher-img,
.teacher-img.img-preview,
.teacher-img {
    border-radius: 50% !important;
    object-fit: cover !important;
    width: 150px !important;
    height: 150px !important;
    max-width: 150px !important;
    max-height: 150px !important;
    border: 5px solid #ddd !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Responsive teacher images */
@media (max-width: 480px) {

    .img-container.teacher-img,
    .teacher-img.img-preview,
    .teacher-img {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px !important;
        max-height: 120px !important;
        border-width: 4px !important;
    }
}

/* ===================================
   Teacher Section Styles
   =================================== */
.teacher-section {
    width: 14.4rem;
    margin-top: 1rem;
    height: auto;
    padding: 0;
}

/* Responsive teacher section */
@media (max-width: 576px) {
    .teacher-section {
        width: 100%;
        max-width: 14.4rem;
    }
}

.teacher-section .teacher-card-desc,
.teacher-section [id="imageDescription"] {
    background: transparent;
}

.teacher-card-desc {
    height: auto;
    text-align: center;
    padding-bottom: 10px;
    font-weight: 700;
    margin: 0;
}

/* ===================================
   Legacy File Card Styles
   =================================== */

/* Image Container - Top corners only (NOT for teacher images) */
.img-container:not(.teacher-img) {
    padding: 0;
    border-radius: 4px 4px 0 0;
    height: 12rem;
    width: 14.3rem;
    max-width: 100%;
    background-position: center top;
}

/* Responsive image container */
@media (max-width: 576px) {
    .img-container:not(.teacher-img) {
        width: 100%;
        height: auto;
        min-height: 10rem;
    }
}

/* Image Preview */
.img-preview:not(.teacher-img) {
    display: block;
    margin: 0 auto;
    object-fit: fill;
}

/* Ensure book-card images fill container */
.book-card .img-preview {
    width: 100%;
    max-width: 100%;
}

/* Image Description - Bottom corners only */
.features-icons [id="imageDescription"],
.books-section [id="imageDescription"],
.teacher-section [id="imageDescription"] {
    background-color: #fff;
    width: 100%;
    max-width: 14.3rem;
    border-radius: 0 0 4px 4px;
    height: auto;
    min-height: 5rem;
    max-height: 5.8rem;
    font-size: 0.8rem;
    padding: 5px 0.5rem 0 5px;
    font-weight: 700;
    text-align: right;
    overflow-wrap: break-word;
    white-space: pre-line;
    overflow: hidden;
    margin-bottom: 0;
}

/* Legacy Section for File Cards */
.features-icons .section,
.books-section .section {
    width: 14.4rem;
    max-width: 100%;
    margin-top: 1rem;
    height: auto;
    padding: 0;
}

/* Responsive sections */
@media (max-width: 576px) {

    .features-icons .section,
    .books-section .section {
        width: 100%;
    }
}

/* ===================================
   Grid and Layout
   =================================== */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1rem;
}

.cell {
    height: 150px;
    margin-bottom: 5px;
    border-bottom: 1px solid rgb(160, 160, 160);
    text-align: right;
}

@media (min-width: 576px) {
    .cell {
        flex: 0 0 32%;
    }
}

@media (max-width: 575px) {
    .cell {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col {
        flex: 1 1 100%;
    }

    .float-child {
        max-width: 100%;
        float: none;
    }
}

.wrapper {
    display: grid;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}