/* =====================================================================
   H View header — final: compact masthead + brand gradient navigation
   Replaces the previous "Design 5" header CSS. Works with the existing
   markup (.topline, .site-header, .masthead, .main-nav, .mobile-app-nav).
   The markup, fonts, live IST clock and active-page highlighting all come
   from header_html() in app.php. Save this file as /assets/header-design-5.css
   ===================================================================== */

:root {
  --blue: #1E4CFF;
  --blue-dark: #1746B2;
  --violet: #6553D9;
  --pink: #D81B76;
  --pink-dark: #B5155F;
  --ink: #0A1735;
  --muted: #394D69;
  --line: #E8ECF2;
  --soft-blue: #EEF4FF;
  --soft-pink: #FFF0F7;
  --grad: linear-gradient(105deg, #1E4CFF 0%, #6553D9 55%, #D81B76 100%);
  --hv-sans: 'Mukta', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --hv-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --hv-script: 'Dancing Script', 'Brush Script MT', cursive;
  --header-w: 1320px;
}

body { color: var(--ink); }
.topline, .site-header, .mobile-app-nav { font-family: var(--hv-sans); }
.topline a, .site-header a, .mobile-app-nav a { text-decoration: none; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 2000;
  padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff;
  font: 600 14px var(--hv-sans); transition: top .2s;
}
.skip-link:focus { top: 12px; }
.brand-fallback { display: none; }
.topline :focus-visible, .site-header :focus-visible, .mobile-app-nav :focus-visible {
  outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px;
}

/* ---------------------------------------------------------------------
   1. Slim top line: latest headline · site links · subscribe
   --------------------------------------------------------------------- */
.topline {
  width: 100%;
  max-width: none;
  margin: 0;
  background: #FFF7FA;
  color: var(--ink);
  border-bottom: 1px solid #F3E4EC;
}

.topinner {
  width: min(var(--header-w), calc(100% - 48px));
  max-width: var(--header-w);
  min-height: 38px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  font-weight: 600;
}

.top-latest {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.top-latest b {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.top-latest a,
.top-latest span {
  overflow: hidden;
  color: #263B5A;
  text-overflow: ellipsis;
}

.top-latest a:hover { color: var(--pink); }

.top-links { display: flex; gap: 18px; white-space: nowrap; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--pink); }

/* The date lives in the masthead clock on desktop; the top line shows it on phones */
.top-date { display: none; }

.top-subscribe {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff !important;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .2s;
}
.top-subscribe:hover { background: var(--pink-dark); }

/* ---------------------------------------------------------------------
   2. Compact masthead: logo · seam · slogan · live clock · search
   --------------------------------------------------------------------- */
.site-header {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 0;
}

.masthead {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  /* Clean white band. To bring back the workspace photo, use:
     background: #FFF4F8 url('/assets/header-workspace-bg.jpg') center 56% / cover no-repeat; */
  background: linear-gradient(100deg, #FFF6FA 0%, #FFFFFF 42%, #FFFFFF 62%, #F3F6FF 100%);
  border: 0;
}

.masthead-inner {
  width: min(var(--header-w), calc(100% - 48px));
  max-width: var(--header-w);
  min-height: 96px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto minmax(260px, 360px);
  grid-template-areas: "brand slogan . clock search";
  align-items: center;
  column-gap: 22px;
  padding: 10px 0;
}

.brand { grid-area: brand; min-width: 0; justify-self: start; }

.brand img {
  display: block;
  width: auto;
  height: 72px;
  max-width: 240px;
  object-fit: contain;
  object-position: left center;
}

.header-slogan {
  grid-area: slogan;
  position: relative;
  padding-left: 22px;
  color: var(--ink);
  font: 700 clamp(26px, 2.3vw, 34px) / .95 var(--hv-script);
  text-align: left;
}

/* Two-tone seam between logo and slogan, taken from the logo */
.header-slogan::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 52px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--blue) 0 50%, var(--pink) 50% 100%);
  transform: translateY(-50%);
}

.header-slogan em { color: #173D82; font-style: normal; }

/* Live clock card (rendered by header_html, kept live by its script) */
.hv-clock {
  grid-area: clock;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px 7px 8px;
  border-radius: 16px;
  background: #F6F7FB;
  white-space: nowrap;
}

.hv-clock-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
}

.hv-clock-icon svg { width: 18px; height: 18px; }
.hv-clock-text { display: flex; flex-direction: column; line-height: 1.25; }
.hv-clock-date { font: 600 15px/1.25 var(--hv-serif); color: var(--ink); }
.hv-clock-time { font-size: 13.5px; font-weight: 600; color: var(--blue); }

.search {
  grid-area: search;
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0;
  justify-self: end;
}

.search input {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  padding: 10px 56px 10px 20px;
  border: 1px solid #E3E8F2;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 500 15px var(--hv-sans);
  box-shadow: 0 8px 22px rgba(22, 42, 74, .08);
  transition: border-color .2s, box-shadow .2s;
}

.search input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(30, 76, 255, .12), 0 8px 22px rgba(22, 42, 74, .08);
}

.search input::placeholder { color: #52647F; opacity: 1; }

.search button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.search button svg { width: 18px; height: 18px; }
.search button:hover { background: var(--grad); transform: scale(1.05); }

/* ---------------------------------------------------------------------
   3. Brand gradient navigation band
   --------------------------------------------------------------------- */
.main-nav {
  position: relative;
  z-index: 3;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--grad);
  border: 0;
  box-shadow: 0 10px 24px -18px rgba(30, 40, 120, .7);
}

.navinner {
  width: min(var(--header-w), calc(100% - 48px));
  max-width: var(--header-w);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin: 0 auto;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  scrollbar-width: none;
}

.navinner::-webkit-scrollbar { display: none; }

.navinner a {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  color: #fff;
  transition: background .2s, color .2s;
}

/* The old rule painted the first link pink on every page; reset it */
.navinner a:first-child { color: #fff; }

.navinner a:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* Current page (aria-current is set by header_html) */
.navinner a[aria-current="page"],
.navinner a.active,
.navinner a.is-active {
  background: #fff;
  color: #C0156A;
  box-shadow: 0 6px 16px -8px rgba(10, 23, 53, .45);
}

.ticker { display: none !important; }

.mobile-app-nav { display: none; }

/* No extra space between the header and the page */
.site-header + .mobile-app-nav + main.wrap,
.site-header + main.wrap {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.site-header + .mobile-app-nav + main.wrap > :first-child,
.site-header + main.wrap > :first-child { margin-top: 0 !important; }

/* ---------------------------------------------------------------------
   Laptop / tablet
   --------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .masthead-inner {
    grid-template-columns: auto auto minmax(0, 1fr) minmax(240px, 320px);
    grid-template-areas: "brand slogan . search";
  }
  .hv-clock { display: none; }
  .top-date { display: block; color: var(--muted); white-space: nowrap; }
  .topinner { grid-template-columns: minmax(150px, 1fr) auto auto auto; }
  .navinner { justify-content: flex-start; }
}

@media (max-width: 900px) {
  .topinner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .top-latest { display: none; }
  .top-date { justify-self: start; }
  .masthead-inner {
    width: calc(100% - 36px);
    grid-template-columns: auto minmax(0, 1fr) minmax(200px, 300px);
    grid-template-areas: "brand . search";
    min-height: 84px;
  }
  .header-slogan { display: none; }
  .brand img { height: 62px; }
  .navinner { width: calc(100% - 24px); }
}

/* ---------------------------------------------------------------------
   Phone: date line, logo + search, swipeable gradient sections, app dock
   --------------------------------------------------------------------- */
@media (max-width: 700px) {
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

  .topinner {
    width: calc(100% - 28px);
    min-height: 32px;
    display: flex;
    justify-content: center;
    gap: 0;
    font-size: 12px;
  }

  .top-latest, .top-links, .top-subscribe { display: none; }
  .top-date { display: block; color: var(--ink); }
  .top-date .hv-top-time { color: var(--blue); }

  .masthead { background: linear-gradient(100deg, #FFF6FA 0%, #FFFFFF 60%, #F3F6FF 100%); }

  .masthead-inner {
    width: calc(100% - 28px);
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "search";
    row-gap: 8px;
    padding: 8px 0 10px;
  }

  .brand img { height: 50px; max-width: 190px; }

  .search { max-width: none; justify-self: stretch; }
  .search input { height: 44px; padding-left: 16px; font-size: 15px; }
  .search button { top: 4px; right: 4px; width: 36px; height: 36px; }

  /* Sections stay reachable on phones as swipeable white-on-gradient tabs */
  .main-nav { display: block; box-shadow: none; }
  .navinner {
    width: 100%;
    min-height: 48px;
    gap: 2px;
    padding: 0 10px;
    font-size: 14px;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .navinner a { padding: 7px 13px; scroll-snap-align: start; }

  /* Floating app dock */
  .mobile-app-nav {
    position: fixed;
    z-index: 1000;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 8px 4px;
    border-radius: 22px;
    background: rgba(10, 23, 53, .96);
    box-shadow: 0 14px 30px -10px rgba(10, 23, 53, .55);
    backdrop-filter: blur(12px);
  }

  .mobile-app-nav a {
    display: flex;
    min-width: 0;
    min-height: 46px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 2px 1px;
    border-radius: 14px;
    color: #DFE5F5;
  }

  .mobile-app-nav .mobile-app-icon {
    display: grid;
    place-items: center;
    color: #DFE5F5;
    line-height: 1;
  }
  .mobile-app-nav .mobile-app-icon svg { width: 22px; height: 22px; }

  .mobile-app-nav small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-app-nav a[aria-current="page"],
  .mobile-app-nav a[aria-current="page"] .mobile-app-icon { color: #FF8CC4; }
  .mobile-app-nav a[aria-current="page"] { background: rgba(255, 255, 255, .08); }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 24px); }
  .brand img { height: 46px; max-width: 175px; }
  .mobile-app-nav small { font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .topline *, .site-header *, .mobile-app-nav * { transition: none !important; }
}

/* =====================================================================
   v2 additions: sticky header, condensed state, phone bar, menu drawer
   ===================================================================== */

/* position: sticky stops working if a parent hides overflow; "clip" keeps
   horizontal overflow hidden without breaking it */
html, body { overflow-x: clip !important; }
html.hv-lock, html.hv-lock body { overflow: hidden !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  transition: box-shadow .3s;
}
.site-header.is-stuck { box-shadow: 0 10px 28px -16px rgba(10, 23, 53, .35); }

.masthead-inner,
.brand img,
.header-slogan,
.header-slogan::before,
.hv-clock { transition: min-height .3s, padding .3s, height .3s, font-size .3s, opacity .3s; }

/* Condensed desktop state once the top line has scrolled away */
.site-header.is-stuck .masthead-inner { min-height: 64px; padding: 4px 0; }
.site-header.is-stuck .brand img { height: 50px; }
.site-header.is-stuck .header-slogan { font-size: 24px; }
.site-header.is-stuck .header-slogan::before { height: 36px; }
.site-header.is-stuck .hv-clock { padding-block: 4px; }
.site-header.is-stuck .hv-clock-icon { width: 32px; height: 32px; border-radius: 10px; }
.site-header.is-stuck .search input { height: 42px; }
.site-header.is-stuck .search button { top: 3px; width: 36px; height: 36px; }
.site-header.is-stuck .navinner { min-height: 46px; }

/* Phone-only buttons */
.hv-burger,
.hv-search-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #E3E8F2;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.hv-burger svg, .hv-search-toggle svg { width: 20px; height: 20px; }
.hv-burger:hover, .hv-search-toggle:hover { border-color: var(--blue); color: var(--blue); }
.hv-search-toggle { background: var(--pink); border-color: var(--pink); color: #fff; }
.hv-search-toggle:hover { background: var(--pink-dark); color: #fff; border-color: var(--pink-dark); }
.site-header.is-search-open .hv-search-toggle { background: var(--ink); border-color: var(--ink); }

/* ---------- Menu drawer ---------- */
.hv-drawer a { text-decoration: none; }
.hv-drawer :focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.hv-drawer { position: fixed; inset: 0; z-index: 1300; visibility: hidden; pointer-events: none; font-family: var(--hv-sans); }
.hv-drawer.is-open { visibility: visible; pointer-events: auto; }
.hv-drawer-scrim { position: absolute; inset: 0; background: rgba(10, 23, 53, .45); opacity: 0; transition: opacity .3s; }
.hv-drawer.is-open .hv-drawer-scrim { opacity: 1; }
.hv-drawer-panel {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: min(88vw, 380px);
  display: flex; flex-direction: column; gap: 16px;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  background: #fff;
  box-shadow: 20px 0 50px -20px rgba(10, 23, 53, .5);
  transform: translateX(-104%);
  transition: transform .38s cubic-bezier(.2, .7, .2, 1);
}
.hv-drawer.is-open .hv-drawer-panel { transform: none; }
.hv-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.hv-drawer-brand img { display: block; width: auto; height: 46px; }
.hv-drawer-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; cursor: pointer; }
.hv-drawer-close svg { width: 18px; height: 18px; }
.hv-drawer-date { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; font-size: 13.5px; font-weight: 600; }
.hv-drawer-date time { font: italic 500 15px var(--hv-serif); color: var(--ink); }
.hv-drawer-date span { color: var(--blue); white-space: nowrap; }
.hv-drawer-search { position: relative; margin: 0; }
.hv-drawer-search input { box-sizing: border-box; width: 100%; height: 48px; padding: 0 54px 0 16px; border: 1px solid #E3E8F2; border-radius: 14px; background: #F7F8FC; font: 500 15px var(--hv-sans); color: var(--ink); }
.hv-drawer-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(30, 76, 255, .12); }
.hv-drawer-search button { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: var(--pink); color: #fff; }
.hv-drawer-search button svg { width: 17px; height: 17px; }
.hv-drawer-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hv-drawer-sections a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0; min-height: 48px; padding: 6px 12px; border-radius: 12px;
  background: #F6F7FB; color: var(--ink); font-size: 14.5px; font-weight: 650; line-height: 1.2;
}
.hv-drawer-sections a span { font-size: 12.5px; font-weight: 600; color: #5D6A80; }
.hv-drawer-sections a:hover { background: var(--soft-blue); color: var(--blue); }
.hv-drawer-sections a[aria-current="page"] { background: var(--grad); color: #fff; }
.hv-drawer-sections a[aria-current="page"] span { color: rgba(255, 255, 255, .85); }
.hv-drawer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; font-weight: 600; }
.hv-drawer-links a { color: var(--muted); padding: 4px 0; }
.hv-drawer-links a:hover { color: var(--pink); }
.hv-drawer-foot { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; border-radius: 18px; background: var(--grad); color: #fff; }
.hv-drawer-slogan { font: 700 22px/1 var(--hv-script); }
.hv-drawer-sub { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 46px; border-radius: 999px; background: #fff; color: var(--ink) !important; font-weight: 700; }

/* ---------- Phone: one slim sticky bar ---------- */
@media (max-width: 700px) {
  .topline { display: none; }

  .masthead { background: #fff; border-bottom: 1px solid var(--line); }
  .masthead-inner {
    width: calc(100% - 24px);
    min-height: 64px;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-areas: "burger brand toggle" "search search search";
    column-gap: 10px;
    row-gap: 0;
    padding: 8px 0;
  }
  .hv-burger { grid-area: burger; display: grid; }
  .hv-search-toggle { grid-area: toggle; display: grid; }
  .brand { justify-self: center; display: flex; justify-content: center; }
  .brand img { height: 48px; max-width: 200px; object-position: center; }
  .header-slogan, .hv-clock { display: none; }

  /* Search field slides open under the bar */
  .search { display: none; grid-area: search; margin-top: 8px; }
  .site-header.is-search-open .search { display: block; animation: hv-drop .25s ease both; }

  /* The drawer replaces the gradient tabs on phones */
  .main-nav { display: none; }

  .site-header.is-stuck .masthead-inner { min-height: 56px; padding: 4px 0; }
  .site-header.is-stuck .brand img { height: 42px; }
}
@keyframes hv-drop { from { opacity: 0; transform: translateY(-6px); } }

/* Tablet keeps the full header but gains the menu button for the long section list */
@media (min-width: 701px) and (max-width: 900px) {
  .masthead-inner { grid-template-columns: auto minmax(0, 1fr) minmax(200px, 300px) 44px; grid-template-areas: "brand . search burger"; }
  .hv-burger { grid-area: burger; display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .hv-drawer-panel, .hv-drawer-scrim, .site-header * { transition: none !important; animation: none !important; }
}