/* =====================================================================
   DBRAIT - Responsive layer for the public site (MasterPage.master)
   Loaded after every other theme stylesheet.
   Breakpoints:  >=1200 desktop | 768-1199 tablet | <768 phone | <400 small phone
   ===================================================================== */

*, *::before, *::after { box-sizing: border-box; }

body { overflow-x: clip; } /* stop stray wide elements causing sideways page scroll (clip keeps position:sticky working) */

/* ---------------------------------------------------------------------
   Top quick-links bar
   --------------------------------------------------------------------- */
.site-topbar {
    background: #4285F4;
    color: #fff;
    font-size: 0.95rem;
    padding: 8px 0;
}

.site-topbar-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    row-gap: 4px;
}

.site-topbar .site-topbar-links a {
    color: #fff;
    text-decoration: none;
    margin: 0;
    padding: 0 12px;
    white-space: nowrap;
    line-height: 1.6;
}

.site-topbar .site-topbar-links a + a { border-left: 1px solid rgba(255,255,255,0.55); }
.site-topbar .site-topbar-links a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------
   Logo header
   --------------------------------------------------------------------- */
.logo-bar.site-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 15px;
    box-shadow: 0 4px 12px rgba(66,133,244,0.15);
}

.site-header .site-header-logo {
    height: 110px;
    width: 110px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.1));
}

.site-header-titles {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.site-header .dbrait-main-title {
    font-size: 2rem;
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-weight: 700;
    color: #032c54;
    text-align: center;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.site-header .dbrait-hindi-title {
    font-size: 1.3rem;
    color: #4285F4;
    font-weight: 600;
    text-align: center;
    margin-top: 5px;
}

.site-header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.site-header .site-header-iso {
    height: 110px;
    width: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(66,133,244,0.2);
    padding: 8px 12px;
}

/* ---------------------------------------------------------------------
   Main navigation (desktop)
   --------------------------------------------------------------------- */
nav.main-nav {
    background: linear-gradient(135deg, #032c54 0%, #4285F4 100%);
    margin-top: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(3,44,84,0.25);
    position: relative;
    z-index: 1000;
}

.main-nav-bar { display: none; }

.main-nav .main-nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 2px;
}

.main-nav .main-nav-list > .nav-item > .nav-link {
    color: #fff;
    background: transparent;
    padding: 18px 28px;
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    white-space: nowrap;
}

.main-nav .main-nav-list > .nav-item > .nav-link i { margin-right: 8px; }

/* nested submenus opened by tap/click (responsive.js) */
.main-nav .dropdown-submenu > .dropdown-menu.show { display: block; }

/* Narrow desktops: tighten the menu so all 9 items fit on one line */
@media (min-width: 1200px) and (max-width: 1499.98px) {
    .main-nav .main-nav-list > .nav-item > .nav-link {
        padding: 16px 14px;
        font-size: 0.95rem;
    }
}

/* ---------------------------------------------------------------------
   Content area
   --------------------------------------------------------------------- */
.site-main {
    min-height: 60vh;
    background: #f8f9ff;
}

.site-main img,
.site-main video,
.site-main iframe,
.site-main embed,
.site-main object,
.site-main canvas { max-width: 100%; }

.site-main [style*="width"] { max-width: 100%; }

.site-main pre { white-space: pre-wrap; word-wrap: break-word; }

/* wide tables scroll sideways instead of stretching the page (added by responsive.js) */
.rtable-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.rtable-wrap > table { margin-bottom: 0; }

/* =====================================================================
   TABLET & PHONE  (< 1200px) - hamburger menu
   ===================================================================== */
@media (max-width: 1199.98px) {

    /* --- header --- */
    .logo-bar.site-header { gap: 14px; padding: 14px 12px; }
    .site-header .site-header-logo { height: 84px; width: 84px; }
    .site-header .site-header-iso { height: 84px; padding: 6px 8px; }
    .site-header .dbrait-main-title { font-size: 1.5rem; }
    .site-header .dbrait-hindi-title { font-size: 1.05rem; }

    /* --- menu bar with toggle --- */
    .main-nav-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 56px;
    }

    .main-nav-label {
        color: #fff;
        font-family: 'Montserrat', 'Poppins', sans-serif;
        font-weight: 600;
        font-size: 1.05rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .main-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        border: 1px solid rgba(255,255,255,0.45);
        border-radius: 8px;
        background: rgba(255,255,255,0.12);
        color: #fff;
        font-size: 1.35rem;
        cursor: pointer;
    }

    .main-nav-toggle:hover,
    .main-nav-toggle:focus-visible {
        background: rgba(255,255,255,0.25);
        outline: 2px solid #fff;
        outline-offset: 2px;
    }

    /* --- collapsible list --- */
    .main-nav .main-nav-list {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 4px 0 10px;
        border-top: 1px solid rgba(255,255,255,0.2);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .main-nav .main-nav-list.is-open { display: flex; }

    .main-nav .main-nav-list > .nav-item { width: 100%; }

    .main-nav .main-nav-list > .nav-item > .nav-link {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 14px 16px;
        font-size: 1rem;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,0.12);
        white-space: normal;
    }

    .main-nav .main-nav-list > .nav-item > .nav-link::before { display: none; }

    .main-nav .main-nav-list > .nav-item > .nav-link:hover {
        transform: none;
        background: rgba(255,255,255,0.12);
    }

    .main-nav .main-nav-list > .nav-item > .nav-link i { width: 24px; text-align: center; margin-right: 10px; }

    /* the theme's ripple effect hijacks ::after - restore Bootstrap's caret so users can tell what expands */
    .main-nav .main-nav-list > .nav-item > .dropdown-toggle::after {
        content: "";
        display: inline-block;
        position: static;
        width: 0;
        height: 0;
        margin-left: auto;
        opacity: 1;
        background: none;
        border-radius: 0;
        border-top: 0.4em solid;
        border-right: 0.4em solid transparent;
        border-left: 0.4em solid transparent;
        border-bottom: 0;
        transform: none;
        transition: transform 0.2s ease;
    }

    .main-nav .main-nav-list > .nav-item > .dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

    /* --- dropdowns become inline accordions --- */
    .main-nav .dropdown-menu {
        position: static !important;
        inset: auto !important;
        transform: none !important;
        float: none;
        width: auto;
        min-width: 0;
        margin: 4px 10px 10px !important;
        border-width: 1px;
        box-shadow: none;
    }

    .main-nav .dropdown-submenu > .dropdown-menu {
        margin: 2px 8px 6px 18px !important;
        border-color: rgba(66,133,244,0.4);
    }

    /* touch screens keep :hover "stuck" - only open what was tapped */
    .main-nav li:hover > ul.dropdown-menu:not(.show) { display: none; }

    .main-nav .dbrait-dropdown .dropdown-item {
        white-space: normal;
        padding: 12px 16px;
    }

    .main-nav .dbrait-dropdown .dropdown-item:hover,
    .main-nav .dbrait-dropdown .dropdown-item:focus {
        transform: none;
        padding-left: 16px;
    }

    .main-nav .dropdown-submenu > .dropdown-toggle {
        display: flex;
        align-items: center;
    }

    .main-nav .dropdown-submenu > .dropdown-toggle::after { margin-left: auto; }
}

/* =====================================================================
   PHONE  (< 768px)
   ===================================================================== */
@media (max-width: 767.98px) {

    /* --- top bar: centred, wrapping --- */
    .site-topbar { font-size: 0.8rem; padding: 6px 0; }
    .site-topbar-links { justify-content: center; }
    .site-topbar .site-topbar-links a { padding: 0 8px; }

    /* --- header: logo | title | ISO, conference badge on its own row --- */
    .logo-bar.site-header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "logo title iso"
            "badge badge badge";
        align-items: center;
        gap: 8px 10px;
        padding: 10px;
    }

    .site-header .site-header-logo { grid-area: logo; height: 58px; width: 58px; }
    .site-header-titles { grid-area: title; }
    .site-header-right { display: contents; }
    .site-header .site-header-iso { grid-area: iso; height: 58px; padding: 4px; border-radius: 6px; }
    .site-header .conf-link-badge { grid-area: badge; justify-self: center; white-space: normal; text-align: center; }

    .site-header .dbrait-main-title { font-size: 0.95rem; letter-spacing: 0.2px; line-height: 1.25; }
    .site-header .dbrait-hindi-title { font-size: 0.78rem; margin-top: 3px; line-height: 1.3; }

    /* --- floating social buttons: smaller, out of the reading area --- */
    .social-sidebar { top: auto !important; bottom: 90px; gap: 4px; }
    .social-sidebar a { width: 34px !important; height: 34px !important; font-size: 1rem !important; }

    /* --- footer --- */
    .dbrait-footer .footer-copyright h5 { font-size: 0.95rem !important; }

    /* --- conference modal --- */
    #confModal .conf-modal-head { padding: 22px 18px; }
    #confModal .conf-modal-body { padding: 18px; }
    #confModal .conf-modal-head h5 { font-size: 1.15rem; }

    /* --- general content --- */
    .site-main h1 { font-size: 1.6rem; }
    .site-main h2 { font-size: 1.35rem; }
    .site-main .btn { white-space: normal; }
}

/* =====================================================================
   SMALL PHONE  (< 400px)
   ===================================================================== */
@media (max-width: 399.98px) {
    .site-header .site-header-logo,
    .site-header .site-header-iso { height: 46px; width: auto; }
    .site-header .site-header-logo { width: 46px; }
    .site-header .dbrait-main-title { font-size: 0.8rem; }
    .site-header .dbrait-hindi-title { font-size: 0.68rem; }
    .site-topbar { font-size: 0.74rem; }
}

@media print {
    .main-nav-bar, .social-sidebar { display: none !important; }
    .main-nav .main-nav-list { display: flex !important; }
}
