/*
 * Shared "photo gallery card" design system (Aug 2026) — originally built
 * for Infrastructure/Facilities, reused as-is for Activities so both areas
 * look identical, per Balaji's request. Scoped to its own classes (mg-*)
 * rather than the shared .courses-box1 component used elsewhere on the site
 * (Academics carousel, etc.), so this can't accidentally affect those pages.
 * Loaded after style.css in header.php. Formerly css/mg-facilities.css.
 */

/* ---- Co-Curricular Activities tab bar: arrow-scroll instead of wrap ----
 * .course-details-tab-btn (style.css) is a plain inline-block list with no
 * wrap handling — fine for a handful of tabs, but once an admin adds enough
 * activities it wraps into a mostly-empty trailing row (reported by Balaji
 * after adding 10 activities). Only used on co-curricular-activities.php
 * (confirmed — not shared with any other page), so safe to override here
 * rather than touching the shared style.css rule. Keeps the existing
 * Bootstrap tab markup/JS completely unchanged — CSS + a small inline
 * script on that page handle the scrolling. */
.mg-tab-scroll-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.course-details-tab-btn {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    /* Native scrollbar hidden — the arrow buttons are the intended way to scroll */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.course-details-tab-btn::-webkit-scrollbar {
    display: none;
}
.course-details-tab-btn > li {
    flex: 0 0 auto;
}

.mg-tab-scroll-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e3e6f0;
    background: #fff;
    color: #111d5e;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(17, 29, 94, 0.12);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 2;
}
.mg-tab-scroll-btn:hover {
    background: #111d5e;
    color: #fff;
}
.mg-tab-scroll-btn--left {
    margin-right: 8px;
}
.mg-tab-scroll-btn--right {
    margin-left: 8px;
}

/* ---- Page intro section spacing ---- */
.mg-page-intro {
    padding: 50px 0 10px;
}
.mg-page-intro p {
    max-width: 900px;
    color: #5b6270;
    line-height: 1.8;
}

/* ---- Card grid section ---- */
.mg-card-section {
    padding: 20px 0 70px;
    background: #f7f8fb;
}

.mg-card {
    position: relative;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 18px rgba(17, 29, 94, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 30px;
}
.mg-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(17, 29, 94, 0.16);
}

.mg-card__media {
    position: relative;
    width: 100%;
    padding-top: 68%; /* ~4:3 */
    overflow: hidden;
    background: #eef0f6;
}
.mg-card__media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.mg-card:hover .mg-card__media img {
    transform: scale(1.08);
}

.mg-card__badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    background: rgba(17, 29, 94, 0.78);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.2px;
}

.mg-card__body {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Icon badge (e.g. Special Activities) sits top-left so it doesn't collide
   with the photo-count badge, which stays bottom-right. */
.mg-card__badge:not(.mg-card__badge--photos) {
    right: auto;
    left: 12px;
    top: 12px;
    bottom: auto;
    font-size: 15px;
    padding: 8px 10px;
}

.mg-card__title {
    font-size: 19px;
    font-weight: 700;
    color: #111d5e;
    margin-bottom: 10px;
    line-height: 1.35;
}
.mg-card__title a {
    color: inherit;
}

.mg-card__desc {
    color: #6a7080;
    font-size: 14.5px;
    line-height: 1.7;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.mg-card__link {
    color: #e32845;
    font-weight: 600;
    font-size: 14.5px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    transition: gap 0.2s ease, color 0.2s ease;
    position: relative;
    z-index: 2;
}
.mg-card__link i {
    transition: transform 0.2s ease;
}
.mg-card:hover .mg-card__link {
    color: #111d5e;
}
.mg-card:hover .mg-card__link i {
    transform: translateX(4px);
}

.mg-card__overlay-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

@media (max-width: 767px) {
    .mg-card__title {
        font-size: 17px;
    }
    .mg-card-section {
        padding: 10px 0 40px;
    }
}

/* ---- Detail page (facility-details.php / activity-details.php) ----
 * Applied alongside the site's standard .breadcrumb-area (same element/
 * markup every other page uses — banner-title.php, infrastructure.php,
 * etc.) so the centered breadcrumb pill, heading style, and header offset
 * all stay consistent with the rest of the site. This class only adds a
 * darkening gradient, since facility/activity cover photos are arbitrary
 * admin-uploaded images (unlike the site's few fixed banner images) and
 * need guaranteed contrast for the white heading text. */
.mg-detail-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(17, 29, 94, 0.25) 0%, rgba(17, 29, 94, 0.7) 100%);
    z-index: 0;
}
.mg-detail-hero .breadcrumb-wrap,
.mg-detail-hero .breadcrumb-wrap2 {
    position: relative;
    z-index: 1;
}

.mg-detail-body {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(17, 29, 94, 0.08);
    padding: 30px 32px;
    /* No negative margin/overlap onto the hero — titles are admin-entered
       and can wrap to 2+ lines, which broke an earlier overlapping design
       (card covered the breadcrumb). Sits cleanly below the hero instead. */
    margin-top: 30px;
    position: relative;
    z-index: 3;
}
.mg-detail-body p {
    color: #5b6270;
    line-height: 1.85;
}

.mg-gallery-section {
    padding: 45px 0 70px;
}
.mg-gallery-heading {
    font-size: 20px;
    font-weight: 700;
    color: #111d5e;
    margin-bottom: 20px;
}
.mg-gallery-item {
    position: relative;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(17, 29, 94, 0.08);
}
.mg-gallery-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}
.mg-gallery-item:hover img {
    transform: scale(1.1);
}
.mg-gallery-item::after {
    content: "\f00e";
    font-family: "FontAwesome";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    background: rgba(17, 29, 94, 0);
    opacity: 0;
    transition: opacity 0.25s ease, background 0.25s ease;
}
.mg-gallery-item:hover::after {
    opacity: 1;
    background: rgba(17, 29, 94, 0.35);
}

@media (max-width: 767px) {
    .mg-detail-body {
        margin-top: 20px;
        padding: 22px 20px;
    }
    .mg-gallery-item img {
        height: 110px;
    }
}
