﻿/* =========================================================
   R.S. Banaras Law College - Responsive / Mobile Layer
   Keeps desktop design intact and improves tablet + phone UX.
   ========================================================= */

/* ---------- Safe defaults for every page ---------- */
html,
body {
    max-width: 100%;
}

body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

#mainContent {
    min-height: 1px;
    overflow-x: clip;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

iframe,
embed,
object {
    max-width: 100%;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

/* Long emails / URLs should never break the mobile layout. */
a,
p,
li,
span,
div {
    overflow-wrap: break-word;
}

/* Tables remain usable on narrow phones even on future pages. */
table {
    max-width: 100%;
}

.table-responsive,
.rs-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Header / navbar ---------- */
.top-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.top-navigation {
    flex-wrap: wrap;
    gap: 2px;
}

.rs-premium-header,
.rs-premium-navbar,
.rs-navbar-collapse {
    width: 100%;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .28) !important;
}

.rs-dropdown-menu .dropdown-item {
    white-space: normal;
    line-height: 1.45;
}

/* ---------- Common typography / content ---------- */
.section-title,
.section-heading h1,
.section-heading h2 {
    text-wrap: balance;
}

.section-desc,
.section-heading p {
    text-wrap: pretty;
}

/* Form controls: prevent iOS auto zoom and improve touch. */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select {
    min-height: 46px;
}

textarea.form-control,
textarea {
    min-height: 120px;
}

/* ---------- Tablet ---------- */
@media (max-width: 1199.98px) {
    .rs-navbar-collapse {
        max-height: calc(100vh - 125px);
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .rs-main-menu .nav-item,
    .rs-main-menu .rs-menu-link,
    .rs-dropdown-menu,
    .rs-dropdown-menu .dropdown-item {
        width: 100%;
    }

    .rs-main-menu .dropdown-toggle {
        justify-content: space-between;
    }

    .rs-main-menu .dropdown-toggle::after {
        margin-left: auto;
    }

    .rs-dropdown-menu {
        border-top: 0;
        border-left: 3px solid #D4AF37;
        box-shadow: none;
    }

    .rs-dropdown-menu .dropdown-item {
        padding: 11px 24px !important;
    }

    .rs-apply-button {
        justify-content: center;
    }

    .section-title {
        font-size: clamp(34px, 5vw, 44px) !important;
    }
}

/* ---------- Tablet / large phone ---------- */
@media (max-width: 991.98px) {
    section {
        padding-top: 64px;
        padding-bottom: 64px;
    }

    .container,
    .container-fluid {
        --bs-gutter-x: 1.75rem;
    }

    .hero-title {
        font-size: 42px;
    }

    .hero-text {
        font-size: 16px;
        line-height: 28px;
    }

    .hero-section {
        text-align: center;
        min-height: auto !important;
        aspect-ratio: 1673 / 940;
        background-size: cover;
        background-position: center center;
    }

    .hero-section .container,
    .hero-section .row,
    .hero-row {
        min-height: 0 !important;
        height: 100%;
    }

    .footer .row > [class*="col-"] {
        margin-bottom: 28px;
    }
}

/* ---------- Phones ---------- */
@media (max-width: 767.98px) {
    body {
        font-size: 15px;
        line-height: 1.65;
    }

    section {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .container,
    .container-fluid {
        --bs-gutter-x: 1.5rem;
    }

    /* Top utility bar */
    .top-bar {
        min-height: 0 !important;
        padding: 8px 0 !important;
    }

    .top-bar .container,
    .top-bar .container-fluid {
        min-height: 0;
    }

    .top-bar .row {
        row-gap: 3px;
    }

    .top-contact {
        width: 100%;
        justify-content: center;
        gap: 5px;
    }

    .college-top-name {
        width: 100%;
        justify-content: center;
        margin: 0 0 5px !important;
        padding: 0 8px;
        white-space: normal !important;
        text-align: center;
        font-size: 12px !important;
        line-height: 1.4;
    }

    .college-top-name i {
        flex: 0 0 auto;
        font-size: 14px !important;
    }

    .top-mobile-highlight {
        margin: 2px !important;
        padding: 4px 8px !important;
    }

    .top-mobile-highlight a {
        font-size: 10.5px !important;
        white-space: nowrap;
    }

    .top-email {
        display: none !important;
    }

    .top-navigation {
        display: flex !important;
        width: 100%;
        justify-content: center;
        gap: 0;
        margin-top: 5px !important;
    }

    .top-navigation .top-link {
        margin-left: 0 !important;
        padding: 4px 8px;
        font-size: 11px !important;
    }

    /* Main navbar */
    .rs-header-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .rs-premium-navbar {
        min-height: 82px !important;
        padding: 4px 0 !important;
    }

    .rs-header-brand {
        flex: 0 0 112px !important;
        width: 112px !important;
        height: 76px !important;
    }

    .rs-header-logo {
        width: auto !important;
        height: 72px !important;
        max-width: 110px !important;
        max-height: 72px !important;
    }

    .rs-menu-toggle {
        width: 44px !important;
        height: 42px !important;
        border-radius: 10px !important;
    }

    .rs-navbar-collapse {
        max-height: calc(100dvh - 112px);
        margin-top: 5px !important;
        padding: 6px 0 14px !important;
        border-radius: 0 0 12px 12px;
    }

    .rs-main-menu .rs-menu-link {
        min-height: 48px !important;
        padding: 13px 16px !important;
        font-size: 15px !important;
        line-height: 1.4;
    }

    .rs-dropdown-menu .dropdown-item {
        padding: 11px 18px 11px 25px !important;
        font-size: 13.5px;
    }

    .rs-dropdown-menu .dropdown-item:hover,
    .rs-dropdown-menu .dropdown-item:focus {
        padding-left: 28px !important;
    }

    .rs-apply-button {
        width: calc(100% - 28px) !important;
        min-height: 48px !important;
        margin: 12px 14px 2px !important;
        padding: 12px 18px !important;
        font-size: 14px !important;
    }

    /* Home hero: preserve the source image ratio; removes tall blank/cropped mobile hero. */
    .hero-section {
        aspect-ratio: 1673 / 940;
        min-height: 0 !important;
        width: 100%;
        background-size: cover !important;
        background-position: center center !important;
    }

    .hero-section .container,
    .hero-section .row,
    .hero-row {
        min-height: 0 !important;
        height: 100% !important;
    }


    /* Page hero/banner blocks used across inner pages */
    [class$="-hero"] {
        padding-top: 42px !important;
        padding-bottom: 42px !important;
    }

    [class$="-hero"] h1 {
        font-size: clamp(28px, 8vw, 36px) !important;
        line-height: 1.18 !important;
    }

    [class$="-hero"] p {
        max-width: 100% !important;
        font-size: 14px !important;
        line-height: 1.7 !important;
    }

    /* Common headings */
    .section-title {
        font-size: clamp(28px, 8vw, 36px) !important;
        line-height: 1.18 !important;
        margin-bottom: 18px !important;
    }

    .section-subtitle {
        font-size: 12px !important;
        letter-spacing: 1.3px;
    }

    .section-desc {
        font-size: 14px;
        line-height: 1.7;
    }

    /* Cards / common content should never force horizontal scrolling. */
    .quick-card,
    .home-about-content,
    .vision-card,
    .leadership-profile-card,
    .contact-card,
    .inquiry-card,
    .objective-box {
        max-width: 100%;
    }

    .quick-links .row,
    .leadership-section .row,
    .vision-section .row {
        --bs-gutter-y: 1rem;
    }

    .quick-card {
        height: 100%;
        min-height: 0;
        padding: 26px 20px !important;
    }

    .home-about-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .about-highlight-item {
        align-items: flex-start;
    }

    .leadership-profile-head {
        gap: 16px;
    }

    /* Forms */
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        width: 100% !important;
        font-size: 16px !important;
    }

    .btn,
    button,
    input[type="submit"] {
        min-height: 44px;
    }

    /* Maps, videos and viewers */
    iframe {
        width: 100% !important;
    }

    /* Footer */
    .footer {
        padding-top: 50px !important;
        padding-bottom: 20px !important;
    }

    .footer .row > [class*="col-"] {
        margin-bottom: 28px !important;
    }

    .footer h4 {
        margin-bottom: 15px;
    }

    .footer-about,
    .footer-about > p {
        max-width: 100% !important;
    }

    .footer-about .footer-logo {
        margin-left: 0 !important;
        max-width: 190px !important;
        height: auto !important;
    }

    .footer-social {
        flex-wrap: wrap;
    }

    .copyright {
        padding: 16px 0 !important;
        font-size: 12px;
    }

    .copyright .row {
        row-gap: 8px;
    }

    .copyright a {
        display: inline-block;
        padding: 3px 0;
    }

    .scroll-top-btn {
        right: 14px !important;
        bottom: 14px !important;
    }
}

/* ---------- Small phones ---------- */
@media (max-width: 575.98px) {
    section {
        padding-top: 42px;
        padding-bottom: 42px;
    }

    .container,
    .container-fluid {
        --bs-gutter-x: 1.25rem;
    }

    .top-mobile-highlight {
        padding: 3px 7px !important;
    }

    .top-mobile-highlight a {
        font-size: 10px !important;
    }

    .top-navigation .top-link {
        padding-left: 6px;
        padding-right: 6px;
        font-size: 10.5px !important;
    }

    .rs-header-brand {
        flex-basis: 104px !important;
        width: 104px !important;
    }

    .rs-header-logo {
        max-width: 102px !important;
    }

    .section-title {
        font-size: clamp(26px, 8.5vw, 32px) !important;
    }

    .leadership-profile-head {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .leadership-person-info {
        width: 100%;
    }

    .about-highlight-item {
        padding: 16px !important;
    }

    .about-highlight-item .highlight-icon {
        flex: 0 0 auto;
    }

    .inquiry-heading,
    .inquiry-form,
    .inquiry-side {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }
}

/* ---------- Very narrow phones ---------- */
@media (max-width: 359.98px) {
    .college-top-name {
        font-size: 11px !important;
    }

    .top-contact {
        gap: 3px;
    }

    .top-mobile-highlight {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .top-mobile-highlight a {
        font-size: 9.5px !important;
    }

    .top-navigation .top-link {
        font-size: 10px !important;
        padding-left: 4px;
        padding-right: 4px;
    }

    .rs-header-brand {
        flex-basis: 96px !important;
        width: 96px !important;
    }

    .rs-header-logo {
        max-width: 94px !important;
    }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto !important;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Current page indication */
.rs-main-menu .rs-menu-link.active {
    color: #F2C94C !important;
    -webkit-text-fill-color: #F2C94C !important;
}

@media (min-width: 1200px) {
    .rs-main-menu .rs-menu-link.active::before {
        transform: scaleX(1);
    }
}


/* =========================================================
   FINAL MOBILE HERO IMAGE + NON-STICKY HEADER FIX
   2026-09-07
   ========================================================= */

/* Header must scroll normally with the page. */
.rs-premium-header {
    position: relative !important;
    top: auto !important;
}

/* The home hero is a background image. Give it the exact
   image ratio on phones so it cannot collapse into a strip. */
@media (max-width: 767.98px) {
    .hero-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;

        width: 100% !important;
        height: 56.19vw !important;       /* 940 / 1673 */
        min-height: 200px !important;
        max-height: 430px !important;
        aspect-ratio: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        background-image: url("../images/hero.png") !important;
        background-repeat: no-repeat !important;
        background-position: center center !important;
        background-size: 100% 100% !important;

        overflow: hidden !important;
    }

    .hero-section .container,
    .hero-section .row,
    .hero-row {
        min-height: 0 !important;
        height: 100% !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

@media (max-width: 430px) {
    .hero-section {
        min-height: 202px !important;
        height: 56.19vw !important;
    }
}
