/* ==========================================================================
   Home Responsive Stylesheet
   Global mobile/tablet/desktop rules applied across all home/* views.
   Loaded after bootstrap.min.css + style.css so it can override as needed.
   ========================================================================== */

/* ---------- Universal guards ---------- */
img {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
}

iframe, video {
    max-width: 100%;
}

/* Wrap long content inside common containers */
.main-content,
.bredcrumb,
.coursebox-body,
.welcome-section,
.newscontent {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ---------- Breadcrumb header (used by most inner pages) ---------- */
@media (max-width: 991px) {
    .bredcrumb {
        padding: 60px 20px;
    }
    .bredcrumb h1,
    .bredcrumb h2 {
        font-size: 26px;
    }
}

@media (max-width: 767px) {
    .bredcrumb {
        padding: 40px 15px;
    }
    .bredcrumb h1,
    .bredcrumb h2 {
        font-size: 22px;
    }
    .bredcrumb p,
    .bredcrumb li,
    .bredcrumb a {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .bredcrumb {
        padding: 30px 10px;
    }
    .bredcrumb h1,
    .bredcrumb h2 {
        font-size: 18px;
    }
}

/* ---------- Section titles ---------- */
@media (max-width: 767px) {
    h1 { font-size: 24px !important; }
    h2 { font-size: 20px !important; }
    h3 { font-size: 18px !important; }
    h4 { font-size: 16px !important; }
    h5 { font-size: 15px !important; }
    h6 { font-size: 14px !important; }
    p, li { font-size: 14px; line-height: 1.6; }
}

/* ---------- Containers ---------- */
@media (max-width: 767px) {
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
    .main-content {
        margin-top: 15px !important;
        margin-bottom: 15px !important;
    }
}

/* ---------- Tables: horizontal scroll on mobile ---------- */
.table-responsive-auto {
    width: 100%;
}

@media (max-width: 767px) {
    .table-responsive-auto,
    .content-box .table,
    .fee-table,
    table.data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
}

/* ---------- Forms: touch-friendly inputs ---------- */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="search"],
    input[type="url"],
    select,
    textarea,
    .form-control {
        font-size: 16px !important; /* prevents iOS zoom */
        min-height: 40px;
        padding: 8px 12px;
    }

    .form-group {
        margin-bottom: 14px;
    }

    label {
        font-size: 13px;
        margin-bottom: 4px;
    }
}

/* ---------- Buttons: tap-friendly on mobile ---------- */
@media (max-width: 767px) {
    .btn {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 14px;
    }
    .btn-lg {
        padding: 10px 20px;
        font-size: 15px;
    }
    .btn-sm,
    .btn-xs {
        min-height: 32px;
        padding: 5px 12px;
        font-size: 12px;
    }
    .btn-block-mobile {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }
}

/* ---------- Card / panel spacing ---------- */
@media (max-width: 767px) {
    .panel,
    .card,
    .content-box,
    .coursebox,
    .course-card {
        margin-bottom: 15px;
    }
}

/* ---------- Two-column layouts: ensure stacking has spacing ---------- */
@media (max-width: 991px) {
    .col-md-8 + .col-md-4,
    .col-md-9 + .col-md-3,
    .col-md-4 + .col-md-8,
    .col-md-3 + .col-md-9 {
        margin-top: 20px;
    }
}

/* ---------- Lists / ULs commonly used for meta info ---------- */
@media (max-width: 767px) {
    ul.meta-list,
    ul.info-list,
    .pagedetail ul {
        padding-left: 18px;
    }
}

/* ---------- Hero / banner images inside content ---------- */
.content-hero-img,
.page-hero img,
.welcome-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- Footer column stacking ---------- */
@media (max-width: 767px) {
    footer .col-md-3,
    footer .col-md-4 {
        margin-bottom: 20px;
    }
}

/* ---------- Breadcrumb nav (list) ---------- */
@media (max-width: 767px) {
    .breadcrumb {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ---------- Pagination ---------- */
@media (max-width: 480px) {
    .pagination > li > a,
    .pagination > li > span {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* ---------- Modals: fit viewport ---------- */
@media (max-width: 767px) {
    .modal-dialog {
        margin: 10px;
        width: auto !important;
    }
    .modal-body {
        padding: 15px;
    }
}

/* ---------- Owl carousel / sliders general ---------- */
.owl-carousel .item img {
    max-width: 100%;
    height: auto;
}

/* ---------- Utility: hide long inline tables' overflow ---------- */
.ck-content img,
.content-body img,
.welcome-content img {
    max-width: 100%;
    height: auto;
}

/* ---------- Galleries ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 420px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-grid img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
}

@media (max-width: 767px) {
    .gallery-grid img {
        height: 140px;
    }
}

/* ---------- Auth pages (login / register / forgot) ---------- */
@media (max-width: 767px) {
    .auth-box,
    .login-box,
    .register-box {
        width: 100% !important;
        max-width: 420px;
        margin: 20px auto !important;
        padding: 20px !important;
    }
}

/* ---------- Dashboard layout ---------- */
@media (max-width: 991px) {
    .dashboard-sidebar {
        margin-bottom: 20px;
    }
}

/* ---------- Long horizontal forms (admission) ---------- */
@media (max-width: 767px) {
    .row-form .col-md-6,
    .row-form .col-md-4,
    .row-form .col-md-3 {
        margin-bottom: 8px;
    }
}

/* ---------- Testimonial & CTA fallbacks ---------- */
@media (max-width: 767px) {
    .testimonials-section,
    .cta-section {
        padding: 40px 0 !important;
    }
}

/* ---------- Prevent horizontal page scroll globally ---------- */
html, body {
    overflow-x: hidden;
}
