/* ==========================================================================
   Dynasty Modern Gurukul Academy - visual & motion enhancements
   Loaded last so it can refine the existing theme without rewriting it.
   Palette is taken from the site as-built:
     brand blue   #2680b4      deep navy  #0d1d37
     accent amber #ffac00      accent red #ec121e
   ========================================================================== */

:root {
    --dmga-blue: #2680b4;
    --dmga-navy: #0d1d37;
    --dmga-amber: #ffac00;
    --dmga-red: #ec121e;
    --dmga-ink: #23303f;
    --dmga-muted: #5b6b7c;
    --dmga-line: rgba(13, 29, 55, .12);
    --dmga-shadow-sm: 0 2px 8px rgba(13, 29, 55, .08);
    --dmga-shadow-md: 0 10px 28px rgba(13, 29, 55, .14);
    --dmga-shadow-lg: 0 18px 44px rgba(13, 29, 55, .20);
    --dmga-ease: cubic-bezier(.22, .61, .36, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    color: var(--dmga-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Anchor jumps shouldn't hide content behind the sticky-ish header */
section[id], div[id] {
    scroll-margin-top: 90px;
}

/* --------------------------------------------------------------------------
   1. Accessible focus rings (the theme had none)
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--dmga-amber);
    outline-offset: 2px;
    border-radius: 3px;
}

/* --------------------------------------------------------------------------
   2. Navigation
   -------------------------------------------------------------------------- */
.navbar-expand-lg .navbar-nav .nav-link {
    position: relative;
    transition: color .25s var(--dmga-ease);
}

    /* animated underline that grows from the centre */
    .navbar-expand-lg .navbar-nav .nav-link::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 4px;
        width: 0;
        height: 2px;
        background: var(--dmga-amber);
        border-radius: 2px;
        transform: translateX(-50%);
        transition: width .28s var(--dmga-ease);
    }

    .navbar-expand-lg .navbar-nav .nav-link:hover::after,
    .navbar-expand-lg .navbar-nav .nav-item.active > .nav-link::after {
        width: calc(100% - 22px);
    }

.dropdown-menu {
    border: 0;
    border-radius: 10px;
    box-shadow: var(--dmga-shadow-md);
    padding: 8px;
    overflow: hidden;
    animation: dmgaDropIn .22s var(--dmga-ease) both;
}

@keyframes dmgaDropIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    border-radius: 7px;
    padding: 7px 12px;
    transition: background-color .2s var(--dmga-ease), color .2s var(--dmga-ease), padding-left .2s var(--dmga-ease);
}

    .dropdown-item:hover,
    .dropdown-item:focus {
        background: var(--dmga-blue);
        color: #fff;
        padding-left: 18px;
    }

/* --------------------------------------------------------------------------
   3. Header contact + social icons
   -------------------------------------------------------------------------- */
.social-icon {
    transition: transform .25s var(--dmga-ease), box-shadow .25s var(--dmga-ease), background-color .25s var(--dmga-ease);
}

    .social-icon:hover {
        transform: translateY(-3px) scale(1.08);
        box-shadow: 0 6px 16px rgba(244, 67, 54, .45);
    }

.conticon {
    transition: color .2s var(--dmga-ease);
}

    .conticon:hover .mno,
    .conticon:hover .mid {
        color: var(--dmga-blue);
    }

/* --------------------------------------------------------------------------
   4. Section headings - accent rule under the title
   -------------------------------------------------------------------------- */
.sup-head {
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

    .sup-head::after {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 64px;
        height: 4px;
        border-radius: 4px;
        background: linear-gradient(90deg, var(--dmga-amber), var(--dmga-red));
        transition: width .5s var(--dmga-ease);
    }

h1:hover .sup-head::after {
    width: 110px;
}

.colorus {
    background: linear-gradient(90deg, var(--dmga-blue), #4aa9e0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   4b. Section dividers
   The top divider now carries its own "coloured section bulges upward" path,
   so the theme's transform:rotate(180deg) (which flipped the white wedge down
   into the middle of the band) must be cancelled.
   .bigHalfCircle - the bottom divider - is intentionally left alone.
   -------------------------------------------------------------------------- */
.test-header {
    transform: none;
}

/* The coloured sections are pulled up under these dividers with a negative
   margin, and an SVG (inline content) paints above a float's background - so
   the white shape was covering the top of the staff portraits. Layer it:
   band background -> divider -> section content. .garmentsone / .acti keep
   z-index:auto so they do NOT open a stacking context and trap .container. */
.test-header,
.bigHalfCircle {
    position: relative;
    z-index: 1;
}

.garmentsone,
.acti {
    position: relative;
}

    .garmentsone > .container,
    .acti > .container {
        position: relative;
        z-index: 3;
    }

/* --------------------------------------------------------------------------
   5. Cards - facilities, staff, quick actions
   -------------------------------------------------------------------------- */
.schoolf,
.three,
.shadowall {
    transition: transform .35s var(--dmga-ease), box-shadow .35s var(--dmga-ease);
    will-change: transform;
}

    .schoolf:hover,
    .three:hover,
    .shadowall:hover {
        transform: translateY(-8px);
        box-shadow: var(--dmga-shadow-lg);
    }

.fimg {
    overflow: hidden;
    border-radius: 10px;
}

    .fimg img {
        transition: transform .6s var(--dmga-ease);
        display: block;
        width: 100%;
    }

.schoolf:hover .fimg img {
    transform: scale(1.08);
}

.facility {
    transition: color .3s var(--dmga-ease), letter-spacing .3s var(--dmga-ease);
}

.schoolf:hover .facility {
    color: var(--dmga-blue);
    letter-spacing: .4px;
}

/* staff cards */
.fstffive {
    transition: transform .35s var(--dmga-ease);
}

    .fstffive:hover {
        transform: translateY(-6px);
    }

/* Staff portraits: the photo must fill the whole oval.
   The theme gave .pri img a fixed 233px height plus 28/30px margins and a
   5px border, so inside the rounded frame you saw a bordered rectangle with
   gaps around it. Selector is .garmentsone .pri to outrank the theme's
   .pri img rules (including the ones inside its mobile media query). */
/* Keep the theme's 28px top offset so the portraits stay clear of the
   section divider above; the oval is drawn on the <img> itself. */
.garmentsone .pri {
    float: left;
    width: 100%;
    height: 263px;
    padding-top: 28px;
    overflow: visible;
    transition: transform .35s var(--dmga-ease);
}

    .garmentsone .pri img {
        display: block;
        width: 100%;
        height: 233px;
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        object-fit: cover;
        object-position: center 18%;
        background: rgba(255, 255, 255, .10);
        box-shadow: var(--dmga-shadow-sm);
        transition: transform .5s var(--dmga-ease), box-shadow .35s var(--dmga-ease);
    }

.fstffive:hover .pri img {
    box-shadow: 0 12px 30px rgba(0, 0, 0, .30);
}

    .fstffive:hover .pri img {
        transform: scale(1.06);
    }

.prip {
    transition: color .3s var(--dmga-ease);
}

.fstffive:hover .prip {
    color: var(--dmga-blue);
}

/* quick-action tiles (Online form / Pay fees) */
.shadowall .thirtee {
    overflow: hidden;
}

    .shadowall .thirtee img {
        transition: transform .5s var(--dmga-ease);
    }

.shadowall:hover .thirtee img {
    transform: scale(1.06);
}

.shadowall .sevethee {
    transition: background-color .3s var(--dmga-ease), color .3s var(--dmga-ease);
}

/* --------------------------------------------------------------------------
   6. Activities / gallery imagery
   -------------------------------------------------------------------------- */
.Activities .col-lg-4 {
    overflow: hidden;
    border-radius: 10px;
}

.Activities img {
    transition: transform .6s var(--dmga-ease), filter .4s var(--dmga-ease);
}

.Activities .col-lg-4:hover img {
    transform: scale(1.07);
    filter: saturate(1.12);
}

.main-container1 div,
.main-container div {
    transition: transform .3s var(--dmga-ease), box-shadow .3s var(--dmga-ease);
}

.Activities:hover .main-container1 div {
    transform: translateY(-4px) skew(-5deg);
    box-shadow: var(--dmga-shadow-md);
}

/* gallery marquee strip */
.marthird img,
#gallery img {
    border-radius: 10px;
    margin: 0 8px;
    box-shadow: var(--dmga-shadow-sm);
    transition: transform .4s var(--dmga-ease), box-shadow .4s var(--dmga-ease);
}

    .marthird img:hover,
    #gallery img:hover {
        transform: translateY(-5px) scale(1.03);
        box-shadow: var(--dmga-shadow-md);
    }

/* toppers strip */
#toppers .slide img {
    transition: transform .4s var(--dmga-ease), box-shadow .4s var(--dmga-ease), border-color .4s var(--dmga-ease);
}

    #toppers .slide img:hover {
        transform: translateY(-6px) scale(1.05);
        border-color: var(--dmga-amber) !important;
        box-shadow: var(--dmga-shadow-md);
    }

/* --------------------------------------------------------------------------
   7. Buttons & carousel controls
   -------------------------------------------------------------------------- */
.btn,
.btn-default {
    transition: transform .2s var(--dmga-ease), box-shadow .2s var(--dmga-ease), filter .2s var(--dmga-ease);
}

    .btn:hover,
    .btn-default:hover {
        transform: translateY(-2px);
        filter: brightness(1.06);
        box-shadow: var(--dmga-shadow-sm);
    }

    .btn:active,
    .btn-default:active {
        transform: translateY(0);
    }

.carousel-control-prev,
.carousel-control-next {
    opacity: .55;
    transition: opacity .3s var(--dmga-ease);
}

    .carousel-control-prev:hover,
    .carousel-control-next:hover {
        opacity: 1;
    }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(13, 29, 55, .55);
    border-radius: 50%;
    padding: 18px;
    background-size: 45% 45%;
}

/* --------------------------------------------------------------------------
   8. News ticker
   -------------------------------------------------------------------------- */
#ulNews li {
    transition: background-color .3s var(--dmga-ease);
}

    #ulNews li:hover {
        background-color: rgba(38, 128, 180, .06);
    }

.lifirst img {
    transition: transform .4s var(--dmga-ease);
}

#ulNews li:hover .lifirst img {
    transform: scale(1.06);
}

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.qlinks li a,
.foot .list-unstyled li a {
    transition: color .25s var(--dmga-ease), padding-left .25s var(--dmga-ease);
    display: inline-block;
}

    .qlinks li a:hover,
    .foot .list-unstyled li a:hover {
        color: var(--dmga-amber);
        padding-left: 7px;
        text-decoration: none;
    }

/* --------------------------------------------------------------------------
   10. Gallery / album tiles (photo-gallery + photo-album pages)
   -------------------------------------------------------------------------- */
.album {
    transition: transform .35s var(--dmga-ease), box-shadow .35s var(--dmga-ease), border-color .35s var(--dmga-ease);
}

    .album:hover {
        transform: translateY(-6px);
        box-shadow: var(--dmga-shadow-md);
        border-color: var(--dmga-amber);
    }

    .album span {
        transition: background-color .3s var(--dmga-ease);
        line-height: 30px;
        font-size: 13px;
        white-space: nowrap;
        padding: 0 8px;
    }

    .album:hover span {
        background: var(--dmga-navy);
    }

/* empty / error states injected by the AJAX widgets */
.gallery-message,
.bday-empty {
    width: 100%;
    margin: 24px auto;
    padding: 22px;
    text-align: center;
    color: var(--dmga-muted);
    background: #fff;
    border: 1px dashed var(--dmga-line);
    border-radius: 12px;
    font-size: 15px;
}

/* --------------------------------------------------------------------------
   11. Reveal-on-scroll
       Elements get .dmga-reveal from JS; .is-visible is added by the observer.
       Without JS nothing is hidden, so content is never lost.
   -------------------------------------------------------------------------- */
.dmga-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .7s var(--dmga-ease), transform .7s var(--dmga-ease);
}

    .dmga-reveal.is-visible {
        opacity: 1;
        transform: none;
    }

/* --------------------------------------------------------------------------
   12. Back-to-top button
   -------------------------------------------------------------------------- */
#dmgaToTop {
    position: fixed;
    right: 20px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--dmga-blue);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--dmga-shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity .3s var(--dmga-ease), transform .3s var(--dmga-ease), visibility .3s, background-color .3s;
    z-index: 9998;
}

    #dmgaToTop.is-shown {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    #dmgaToTop:hover {
        background: var(--dmga-navy);
        transform: translateY(-3px);
    }

/* --------------------------------------------------------------------------
   13. Popup modal polish
   -------------------------------------------------------------------------- */
#popupModal .modal-dialog {
    animation: dmgaPopIn .45s var(--dmga-ease) both;
}

@keyframes dmgaPopIn {
    from {
        opacity: 0;
        transform: scale(.94) translateY(18px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

#popupModal .close {
    transition: transform .25s var(--dmga-ease), background-color .25s var(--dmga-ease);
    cursor: pointer;
}

    #popupModal .close:hover {
        transform: rotate(90deg) scale(1.12);
        background: var(--dmga-red);
        color: #fff;
    }

/* the popup carousel was pinned to 100vh, which cropped the flyer on laptops */
#popupModal .carousel-inner {
    height: auto !important;
    max-height: 86vh;
}

#popupModal .carousel-item img {
    max-height: 86vh;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   14. Small-screen refinements
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .navbar-expand-lg .navbar-nav .nav-link::after {
        display: none;
    }

    .dropdown-menu {
        box-shadow: none;
    }
}

@media (max-width: 991.98px) {
    /* .fstffive goes full-width on small screens, which stretched the portrait
       into a very flat ellipse. Cap it so the oval keeps its shape. */
    .garmentsone .pri img {
        width: 220px;
        height: 240px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 767.98px) {
    .sup-head {
        padding-bottom: 9px;
    }

        .sup-head::after {
            width: 46px;
            height: 3px;
        }

    #dmgaToTop {
        right: 14px;
        bottom: 14px;
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    /* the awards page floats two 500px-tall images side by side; stack them */
    .awards-grid img,
    #ContentPlaceHolder1_lblDesc img[style*="49%"] {
        width: 100% !important;
        float: none !important;
        height: auto !important;
        margin: 0 0 14px 0 !important;
    }
}

/* --------------------------------------------------------------------------
   15. Respect reduced-motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .dmga-reveal {
        opacity: 1;
        transform: none;
    }
}
