/* ==========================================================================
   Raiganj University - Hero carousel + flash-news & scheme tickers
   File: assets/css/03-hero.css
   ======================================================================= */

/* ===== Hero ===== */
.hero{
  position:relative;
  background:var(--maroon-dark);
  color:#F7EFE0;
  overflow:hidden;
}

/* Hero carousel - full-bleed image, whole hero section */
.hero-carousel{
  position:relative;
  width:100%;
  height:78vh;
  min-height:460px;
  max-height:680px;
  overflow:hidden;
}
.hero-slides{
  position:relative;
  width:100%; height:100%;
}
.hero-slide{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  visibility:hidden;
  transition:opacity .6s ease, visibility 0s linear .6s;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.hero-slide.active{
  position:relative;
  opacity:1;
  visibility:visible;
  transition:opacity .6s ease;
}
.hero-slide.active .hero-slide-bg{
  animation:heroKenBurns 4s ease-out forwards;
}
@keyframes heroKenBurns{
  from{ transform:scale(1.0); }
  to{ transform:scale(1.04); }
}
.hero-slide-bg{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  object-position:center;
  z-index:0;
  display:block;
}
.hero-slide::before{
  content:"";
  position:absolute; inset:0; z-index:1;
  background:
    linear-gradient(180deg, rgba(20,9,7,0.32) 0%, rgba(20,9,7,0.06) 42%, rgba(20,9,7,0.55) 100%);
}
.hero-slide > .hero-slide-content{ position:relative; z-index:2; }
.hero-slide-content{ padding:0 24px; max-width:900px; }
.hero-college-name{
  font-size:clamp(32px, 6vw, 64px); line-height:1.06; color:#fff;
  text-shadow:0 4px 18px rgba(0,0,0,0.65), 0 2px 6px rgba(0,0,0,0.6);
}
.hero-established{
  display:inline-block; margin-top:18px;
  font-family:'IBM Plex Mono', monospace; font-size:14px; letter-spacing:.18em;
  text-transform:uppercase; color:var(--gold-soft);
  text-shadow:0 2px 10px rgba(0,0,0,0.6);
}
.hero-carousel-controls{
  position:absolute; left:0; right:0; bottom:26px;
  display:flex; align-items:center; justify-content:center; gap:18px;
  z-index:2;
}
.hero-dots{ display:flex; gap:8px; }
.hero-dot{
  width:26px; height:3px; padding:0; border:none; background:rgba(247,239,224,0.4);
  cursor:pointer; transition:background .25s ease, width .25s ease;
}
.hero-dot.active{ background:var(--gold); width:38px; }
.hero-arrows{ display:flex; gap:8px; }
.hero-arrow{
  width:38px; height:38px; display:flex; align-items:center; justify-content:center;
  border:1px solid rgba(247,239,224,0.5); background:rgba(0,0,0,0.2); color:#F7EFE0;
  cursor:pointer; font-family:'IBM Plex Mono', monospace; font-size:15px;
  transition:background .2s ease, border-color .2s ease;
}
.hero-arrow:hover{ background:rgba(255,255,255,0.15); border-color:var(--gold-soft); }

/* ===== Flash News ticker ===== */
.flash-news{
  background:linear-gradient(135deg, #FBF3DE, #F3E4B8);
  border-bottom:2px solid var(--maroon);
  position:relative; z-index:4;
}
.flash-news-inner{
  max-width:100%; margin:0 auto; padding:0 24px;
  display:flex; align-items:center; gap:22px; height:46px;
}
.flash-label{
  flex-shrink:0; display:flex; align-items:center; gap:8px;
  align-self:stretch;
  font-family:'IBM Plex Mono', monospace; font-size: 14pt;
    font-weight: 500;
  letter-spacing:.1em; text-transform:uppercase; color:#fff;
  background:var(--maroon-dark);
  padding:0 16px; margin:0 4px 0 -24px;
  white-space:nowrap;
}
.flash-label .dot{
  width:8px; height:8px; border-radius:50%; background:#E43D3D;
  box-shadow:0 0 0 0 rgba(228,61,61,0.6);
  animation:flashPulse 1.6s ease-out infinite;
}
@keyframes flashPulse{
  0%{ box-shadow:0 0 0 0 rgba(228,61,61,0.5); }
  70%{ box-shadow:0 0 0 7px rgba(228,61,61,0); }
  100%{ box-shadow:0 0 0 0 rgba(228,61,61,0); }
}
.flash-track-wrap{ flex:1; overflow:hidden; height:100%; display:flex; align-items:center; }
.flash-track{
  display:flex; align-items:center; gap:36px; white-space:nowrap;
  animation:flashMarquee 32s linear infinite;
}
.flash-track:hover{ animation-play-state:paused; }
.flash-track .item{
  display:inline-flex; align-items:center; gap:10px;
  font-size:14pt; color:var(--ink);
}
.flash-track .item a{ color:var(--maroon-dark); }
.flash-track .item a:hover{ color:var(--maroon); text-decoration:underline; }
.flash-track .item .fdate{
  font-family:'IBM Plex Mono', monospace; font-size:14pt; color:var(--maroon);
}
.flash-track .sep{ color:rgba(110,20,35,0.35); }
@keyframes flashMarquee{
  from{ transform:translateX(0); }
  to{ transform:translateX(-50%); }
}

/* Single flash-news item - not duplicated, so the -50% marquee has nothing to
   loop against. This one scrolls the item across the whole band instead: the
   padding-left:100% resolves against .flash-track-wrap, so the item starts
   exactly at the right edge, and translateX(-100%) carries it exactly past the
   left edge. Works for any headline length, short or long. */
.flash-track.flash-track-single{
  flex:0 0 auto;
  padding-left:100%;
  animation:flashMarqueeSingle 26s linear infinite;
}
@keyframes flashMarqueeSingle{
  from{ transform:translateX(0); }
  to{ transform:translateX(-100%); }
}

/* ===== Government Schemes ticker ===== */
.schemes-news{
  background:var(--paper);
  border-bottom:2px solid var(--gold);
  position:relative; z-index:4;
}
.schemes-news-inner{
  max-width:100%; margin:0 auto; padding:0 0px 0 0;
  display:flex; align-items:center; gap:0; height:46px;
}
.schemes-label{
  flex-shrink:0; display:flex; align-items:center; gap:8px;
  align-self:stretch;
  font-family:'IBM Plex Mono', monospace; font-size:14pt; font-weight:500;
  letter-spacing:.1em; text-transform:uppercase; color:var(--teal);
  background:var(--gold-soft);
  padding:0 16px 0 24px; margin:0 4px 0 0;
  white-space:nowrap;
}
.schemes-label svg{ width:14px; height:14px; flex-shrink:0; color:var(--maroon); }
.schemes-track-wrap{
  flex:1; align-self:stretch; overflow:hidden; display:flex; align-items:center;
  background:linear-gradient(135deg, var(--maroon-dark), #300A11);
  padding:0 22px;
}
.schemes-track{
  display:flex; align-items:center; gap:36px; white-space:nowrap;
  animation:schemesMarquee 34s linear infinite;
}
.schemes-track:hover{ animation-play-state:paused; }
.schemes-track .item{
  display:inline-flex; align-items:center; gap:9px;
  font-size:13px; color:#F1E4D8;
}
.schemes-track .item i{
  width:24px; height:24px; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:12px; color:var(--maroon-dark);
  background:var(--gold-soft);
  border-radius:50%;
}
.schemes-track .item a{ color:var(--gold-soft); font-weight:300; }
.schemes-track .item a:hover{ color:#fff; text-decoration:underline; }
.schemes-track .sep{ color:rgba(255,255,255,0.28); }
@keyframes schemesMarquee{
  from{ transform:translateX(0); }
  to{ transform:translateX(-50%); }
}
@media (max-width:768px){
  .schemes-news-inner{ padding:0 16px 0 0; }
  .schemes-label{ font-size:9.5px; padding:0 12px 0 16px; gap:6px; margin:0 2px 0 0; }
  .schemes-track-wrap{ padding:0 12px; }
  .schemes-track .item i{ width:20px; height:20px; font-size:10.5px; }
}

/* ---------- the band itself ----------
   .hero-carousel is declared twice in this file. The first declaration (top of
   the file) belongs to the designer's unused slide carousel and sets
   height:78vh / min-height:460px. A later rule only overrides the properties it
   names, so those two survived into the video band and fought with the fixed
   height on .hero-video-container - leaving up to 230px of empty maroon below
   the video on tablets and phones.

   Resetting to auto hands height control entirely to .hero-video-container, so
   the responsive rules further down only have to change one number. */
.hero-carousel {
    position: relative;
    width: 100%;
    height: auto; /* cancels height:78vh from the earlier declaration */
    min-height: 0; /* cancels min-height:460px from the earlier declaration */
    max-height: none; /* the child sets the height now */
    overflow: hidden;
}


.hero-video-container {
    position: relative;
    width: 100%;
    height: 440px;
    overflow: hidden;
    background: var(--teal); /* shows for the split second before the video paints */
}

/* Full-bleed 16:9 cover. Whichever dimension is short gets overflowed and
   clipped, so the video always fills the band with no letterboxing. */
#heroYtPlayer,
#heroYtPlayer iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 177.7778vh;
    min-width: 100%;
    height: 56.25vw;
    min-height: 100%;
    transform: translate(-50%,-50%);
    border: 0;
    pointer-events: none; /* clicks pass through; no YouTube chrome */
    z-index: 0;
}

/* Fallback still, used when no video is configured or none is ready */
.hero-still {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 0;
}

/* Nothing configured at all - brand gradient rather than a black hole */
.hero-empty {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--maroon) 0%, var(--teal) 100%);
    z-index: 0;
}


/* ---------- readability overlay ----------
   Sits between the media and the caption. Darker top and bottom, lighter
   through the middle, so the video is still clearly visible. */
/* No scrim. It existed for the static caption, which is gone. The typewriter
   supplies its own text-shadow and its own background colour from the CMS.
   If a specific video ever needs help, set a Background_Color on that
   typewriter in the admin rather than dimming the whole band. */
.carousel-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: none;
}


/* ---------- responsive ---------- */
@media (max-width:900px) {
    .hero-video-container {
        height: 420px;
    }


    /* heading only on tablets */
}

@media (max-width:520px) {
    .hero-video-container {
        height: 320px;
    }   
}


/* ---------- Typewriter overlay ----------
   Position, colour, background and font-size come from the CMS as inline
   styles on .typewriter-container. These are only the defaults for when an
   admin leaves a field blank, plus the responsive sizing ported from
   vu-styles.css so the text scales the same way it did on VU. */
.typewriter-container {
    position: absolute;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    padding: 10px 18px;
    text-align: center;
    color: #fff;
    font-family: 'Fraunces', serif;
    line-height: 1.15;
    pointer-events: none;
}

    /* An admin-set top/left overrides the centring above; drop the transform so
   the coordinates mean what they say. */
    .typewriter-container[style*="top:"],
    .typewriter-container[style*="left:"] {
        transform: none;
    }

.typewriter-text {
    font-family: inherit;
    white-space: pre-wrap;
}

/* Responsive font sizes, ported from vu-styles.css lines 5-62 */
@media (min-width: 1400px) {
    .typewriter-container {
        font-size: 250% !important;
    }
}

@media (max-width: 1399px) {
    .typewriter-container {
        font-size: 200% !important;
    }
}

@media (max-width: 1199px) {
    .typewriter-container {
        font-size: 180% !important;
    }
}

@media (max-width: 991px) {
    .typewriter-container {
        font-size: 150% !important;
    }
}

@media (max-width: 767px) {
    .typewriter-container {
        font-size: 120% !important;
    }
}

@media (max-width: 575px) {
    .typewriter-container {
        font-size: 100% !important;
    }
}

@media (max-width: 479px) {
    .typewriter-container {
        font-size: 80% !important;
    }
}

@media (max-width: 319px) {
    .typewriter-container {
        font-size: 70% !important;
    }
}

/* ==========================================================================
   Hero slide caption
   Title + caption band pinned to the bottom of each image slide. The gradient
   scrim keeps text legible over light photos (sky, lab coats) without dimming
   the whole image.
   ========================================================================== */
.hero-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 70px 0 38px;
    pointer-events: none;
}

    /* The scrim lives here rather than on .hero-caption itself. A mask forces
       it to zero opacity before the top edge, so the box boundary can never
       show as a line across the photo. Horizontal fade protects the image:
       only the left third darkens, the subject stays untouched. */
    .hero-caption::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(to right, rgba(20,10,8,0.88) 0%, rgba(20,10,8,0.62) 34%, rgba(20,10,8,0) 64%);
        -webkit-mask-image: linear-gradient(to top, #000 0%, #000 45%, transparent 100%);
        mask-image: linear-gradient(to top, #000 0%, #000 45%, transparent 100%);
    }

.hero-caption-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    border-left: 4px solid var(--gold);
    padding-left: 20px;
}

.hero-caption-title {
    margin: 0;
    font-family: 'Fraunces', serif;
    font-size: clamp(26px, 3.2vw, 42px);
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.55);
}

.hero-caption-text {
    margin: 8px 0 0;
    font-size: clamp(13px, 1.15vw, 16px);
    line-height: 1.55;
    color: #F3E9DC;
    max-width: 720px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.55);
}

@media (max-width: 900px) {
    .hero-caption {
        padding: 50px 0 22px;
    }

    .hero-caption-inner {
        padding-left: 14px;
        border-left-width: 3px;
    }
}

@media (max-width: 640px) {
    .hero-caption {
        padding: 40px 0 16px;
    }

        .hero-caption .hero-caption-text {
            display: none; /* title only - caption text is unreadable at this size */
        }
}

/* ==========================================================================
   Hero video statement
   Same gold-rule lockup as the image captions, at larger scale, with a
   staggered entrance. The rule draws in first, then the headline rises,
   then the subline - so the eye lands on the words in reading order.
   ========================================================================== */
.hero-caption--video {
    padding: 100px 0 44px;
}

    .hero-caption--video .hero-caption-inner {
        border-left-color: transparent; /* the ::before draws the rule instead */
        position: relative;
    }

        /* Gold rule, drawn top-to-bottom */
        .hero-caption--video .hero-caption-inner::before {
            content: "";
            position: absolute;
            left: -4px;
            top: 0;
            width: 4px;
            height: 100%;
            background: var(--gold);
            transform: scaleY(0);
            transform-origin: top;
            animation: heroRuleDraw .55s cubic-bezier(.22,.61,.36,1) forwards;
        }

        .hero-caption--video .hero-caption-title {
        font-size: clamp(28px, 3.6vw, 48px);
        opacity: 0;
        animation: heroRise .7s cubic-bezier(.22,.61,.36,1) .35s forwards;
    }

    .hero-caption--video .hero-caption-text {
        font-size: clamp(14px, 1.35vw, 19px);
        max-width: 640px;
        opacity: 0;
        animation: heroRise .7s cubic-bezier(.22,.61,.36,1) .58s forwards;
    }

@keyframes heroRuleDraw {
    to {
        transform: scaleY(1);
    }
}

@keyframes heroRise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

/* Respect the OS setting - show everything, skip the motion */
@media (prefers-reduced-motion: reduce) {
    .hero-caption--video .hero-caption-inner::before {
        transform: scaleY(1);
        animation: none;
    }

    .hero-caption--video .hero-caption-title,
    .hero-caption--video .hero-caption-text {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

@media (max-width: 900px) {
    .hero-caption--video {
        padding: 70px 0 26px;
    }
}

@media (max-width: 640px) {
    .hero-caption--video {
        padding: 55px 0 18px;
    }

        .hero-caption--video .hero-caption-text {
            display: none;
        }
}