/* ============================================================
   DEPARTMENT PAGE — professional layer
   css/department-page-pro.css

   Loaded after css/department-page.css and the page's inline <style>
   blocks. Selectors start with "body" so they win over those rules
   without depending on load order; !important is used only where the
   markup carries inline style="" attributes.
============================================================ */

:root{
  --pro-ink:#0f172a;
  --pro-text:#334155;
  --pro-muted:#64748b;
  --pro-line:#e5e9f0;
  --pro-alt:#f5f7fa;
  --pro-card-shadow:0 1px 2px rgba(15,23,42,.04),0 6px 20px rgba(15,23,42,.05);
  --pro-card-shadow-hover:0 2px 4px rgba(15,23,42,.05),0 14px 34px rgba(15,23,42,.09);
  --pro-radius:14px;
}

/* Header ticker on this page was 12px wider than phones — stop sideways scrolling.
   overflow-x:clip (not hidden) keeps the sticky section nav working. */
body{overflow-x:clip;}

/* ── Base typography ───────────────────────────────────────── */
body .agr-wrap{color:var(--pro-text);}
body .agr-wrap p,
body .agr-wrap li,
body .agr-wrap .agr-hod-quote{text-align:left;}
/* Rich-text content often carries inline justify — it leaves wide gaps in narrow cards */
body .agr-wrap [style*="justify"]{text-align:left!important;}

/* ── Section rhythm ────────────────────────────────────────── */
body .agr-section{padding:76px 0;}
body .agr-section--white{background:#fff;}
body .agr-section--light{background:var(--pro-alt);}
body .agr-section .text-center.mb-5,
body .agr-section .text-center.mb-4{margin-bottom:44px!important;}

body .agr-chip{font-size:11px;letter-spacing:1.6px;padding:5px 14px;margin-bottom:14px;background:rgba(15,118,110,.08);border:1px solid rgba(15,118,110,.14);}
body .agr-section .agr-heading{font-size:clamp(1.6rem,2.6vw,2.25rem)!important;font-weight:600;letter-spacing:-.01em;color:var(--agr-navy);margin-bottom:0;}
body .agr-divider{width:48px;height:3px;border-radius:3px;margin:16px 0 0;background:linear-gradient(90deg,var(--agr-green),var(--agr-gold));}
body .agr-divider--center{margin-left:auto;margin-right:auto;}

/* ── Hero ──────────────────────────────────────────────────── */
body .agr-hero__title{font-size:clamp(2.1rem,4.2vw,3.4rem);line-height:1.12;margin-bottom:26px;text-shadow:0 2px 18px rgba(0,0,0,.25);}
body .agr-hero__badge{font-size:12.5px;padding:6px 14px;margin-bottom:0;background:rgba(15,23,42,.35);border-color:rgba(255,255,255,.22);}
body .agr-hero .d-flex.flex-wrap.gap-2.mb-3{margin-bottom:18px!important;}
body .agr-hero__btn{padding:12px 24px;font-size:14px;}
body .agr-apply-card{border-radius:16px;padding:28px;}

/* ── Stat cards ────────────────────────────────────────────── */
body .agr-statcards{padding:44px 0;}
body .agr-stat-card{border-radius:var(--pro-radius);box-shadow:var(--pro-card-shadow);border:1px solid var(--pro-line);padding:24px 18px;height:100%;}
body .agr-stat-card span{display:block;font-size:13px;line-height:1.45;}

/* ── Sticky section nav ────────────────────────────────────── */
body .agr-prog-nav{box-shadow:0 1px 0 var(--pro-line),0 6px 16px rgba(15,23,42,.04);border-bottom:0;}
body .agr-prog-nav__list .nav-link{padding:15px 14px;font-size:13px;}

/* ── Shared card look ──────────────────────────────────────── */
body .agr-hl-card,
body .agr-lab-card,
body .agr-rf-card,
body .agr-elig-box,
body .agr-career-card,
body .agr-achiev-card,
body .agr-event-card,
body .agr-blog-card,
body .agr-alumni-card{border:1px solid var(--pro-line);border-radius:var(--pro-radius);box-shadow:var(--pro-card-shadow);transition:transform .22s,box-shadow .22s,border-color .22s;}
body .agr-hl-card:hover,
body .agr-lab-card:hover,
body .agr-rf-card:hover,
body .agr-career-card:hover,
body .agr-achiev-card:hover,
body .agr-event-card:hover,
body .agr-blog-card:hover,
body .agr-alumni-card:hover{transform:translateY(-3px);box-shadow:var(--pro-card-shadow-hover);border-color:rgba(15,118,110,.3);}

/* ── HOD card ──────────────────────────────────────────────── */
body .agr-hod-card{border-radius:var(--pro-radius);box-shadow:var(--pro-card-shadow-hover);}

/* ── Highlights: left-aligned, icon on top ─────────────────── */
body .agr-hl-card{text-align:left;padding:26px 24px;}
body .agr-hl-icon{width:52px;height:52px;margin:0 0 18px;border-radius:12px;font-size:22px;}
body .agr-hl-card h5{font-size:1rem;line-height:1.4;margin-bottom:10px;}
body .agr-hl-card > div:last-child{font-size:14px;line-height:1.7;color:var(--pro-muted);}
body .agr-hl-card > div:last-child p{margin:0 0 8px;}
body .agr-hl-card > div:last-child p:last-child{margin-bottom:0;}

/* ── Labs ──────────────────────────────────────────────────── */
body .agr-lab-card{height:100%!important;min-height:0;padding:24px;}
body .agr-lab-card .agr-lab-icon{width:50px;height:50px;border-radius:12px;background:var(--agr-light);display:grid;place-items:center;font-size:22px;margin-bottom:16px;}
body .agr-lab-card h5{min-height:0;margin-bottom:8px;}
body .agr-lab-card .agr-lab-cap{margin-bottom:16px;}
body .agr-lab-expand-btn{padding:6px 14px;}

/* ── Gallery ───────────────────────────────────────────────── */
body .agr-gallery-grid{gap:14px;}
body .agr-gallery-item{border-radius:12px;box-shadow:var(--pro-card-shadow);}

/* ── Research focus ────────────────────────────────────────── */
body .agr-rf-desc{color:var(--pro-muted);}

/* ── Events tabs as a segmented control ────────────────────── */
body .agr-ev-tabs{border:0;gap:6px;display:inline-flex;background:#eef2f6;padding:5px;border-radius:12px;}
body .agr-ev-tabs .nav-link{border:0!important;border-radius:9px;color:var(--pro-muted);padding:8px 18px;font-size:14px;}
body .agr-ev-tabs .nav-link.active{background:#fff;color:var(--agr-navy);box-shadow:0 1px 3px rgba(15,23,42,.12);}
body #agr-events .tab-content{margin-top:6px;}

/* ── Careers: light header instead of heavy navy bars ──────── */
body .agr-career-card{overflow:hidden;height:100%;}
body .agr-career-head{background:linear-gradient(180deg,#f3f8f7,#fff);color:var(--agr-navy);border-bottom:1px solid var(--pro-line);padding:18px 20px;font-size:15px;}
body .agr-career-head i{width:36px;height:36px;border-radius:10px;background:var(--agr-light);color:var(--agr-green);display:inline-grid;place-items:center;font-size:17px;flex:0 0 36px;}
body .agr-career-list li{font-size:14px;line-height:1.6;align-items:flex-start;border-bottom:0;padding:4px 0;color:var(--pro-text);}
body .agr-career-list li::before{content:'\F26E';font-family:'bootstrap-icons';color:var(--agr-green);font-size:15px;line-height:1.6;}

/* ── Events ────────────────────────────────────────────────── */
body .agr-event-card{overflow:hidden;height:100%;background:#fff;cursor:pointer;}
body .agr-event-card > img,
body .agr-event-card > div:first-child{width:100%!important;height:180px!important;object-fit:cover;display:block;}

/* ── Alumni ────────────────────────────────────────────────── */
body .agr-alumni-card{height:100%;}
body .agr-alumni-photo,
body .agr-alumni-ini{height:200px;}
body .agr-alumni-info h5{font-size:.92rem;letter-spacing:.01em;}

/* ── Faculty strength tiles ────────────────────────────────── */
.agr-fac-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;}
.agr-fac-stat{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--pro-line);border-radius:var(--pro-radius);padding:18px;box-shadow:var(--pro-card-shadow);}
.agr-fac-stat__ico{flex:0 0 46px;width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:var(--agr-light);color:var(--agr-green);font-size:20px;}
.agr-fac-stat strong{display:block;font-size:1.6rem;line-height:1.1;font-weight:700;color:var(--agr-navy);}
.agr-fac-stat div > span{display:block;font-size:12.5px;line-height:1.35;color:var(--pro-muted);margin-top:3px;}
.agr-fac-stat:first-child{background:linear-gradient(135deg,var(--agr-navy),#24507f);border-color:transparent;}
.agr-fac-stat:first-child .agr-fac-stat__ico{background:rgba(255,255,255,.12);color:#fff;}
.agr-fac-stat:first-child strong{color:#fff;}
.agr-fac-stat:first-child div > span{color:rgba(255,255,255,.75);}
.agr-fac-stat:last-child{grid-column:span 2;}

/* ── Data tables (projects, publications, patents) ─────────── */
body .agr-rtable{border-collapse:separate;border-spacing:0;background:#fff;border:1px solid var(--pro-line);border-radius:var(--pro-radius);overflow:hidden;box-shadow:var(--pro-card-shadow);}
body .agr-rtable thead th{background:var(--agr-navy);color:#fff;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;padding:13px 14px;border:0;white-space:nowrap;}
body .agr-rtable tbody td{padding:13px 14px;border-bottom:1px solid var(--pro-line);vertical-align:top;color:var(--pro-text);}
body .agr-rtable tbody tr:last-child td{border-bottom:0;}
body .agr-rtable tbody tr:nth-child(even) td{background:#fafbfc;}
body .agr-rtable tbody tr:hover td{background:#f2f8f7;}
body .agr-rtable .agr-td-title{color:var(--pro-ink);}

/* ── Collaborations: MoUs in a grid, affiliations beside ──── */
body .coll-mem-grid{grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:40px;}
body .coll-mem-grid > div:only-child{grid-column:1 / -1;}
.agr-collab-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
body .agr-collab-card{height:100%;border-color:var(--pro-line);box-shadow:var(--pro-card-shadow);padding:14px 16px;}
body .agr-collab-card:hover{transform:translateY(-2px);}
body .agr-collab-card>i{width:38px;height:38px;flex:0 0 38px;border-radius:10px;background:var(--agr-light);display:grid;place-items:center;font-size:17px;}
body .agr-collab-card span{font-size:13.5px;line-height:1.4;}
body .agr-mem-grid{grid-template-columns:1fr;}
body .agr-mem-card{padding:12px 14px;border:1px solid var(--pro-line);border-left:3px solid var(--agr-green);box-shadow:var(--pro-card-shadow);}
body .agr-mem-card span{font-size:13px;}

/* ── "View all" buttons ────────────────────────────────────── */
body .agr-section .agr-hero__btn--outline{padding:11px 24px;font-size:14px;}
body .agr-section .agr-hero__btn--outline:hover{background:var(--agr-navy)!important;color:#fff!important;border-color:var(--agr-navy)!important;}

/* ════════════════════════════════════════════════════════════
   Tablet
════════════════════════════════════════════════════════════ */
@media (max-width:991px){
  body .agr-section{padding:64px 0;}
  body .agr-section .text-center.mb-5,
  body .agr-section .text-center.mb-4{margin-bottom:32px!important;}
  body .agr-hero__title{font-size:2.2rem;}
  .agr-fac-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
  body .coll-mem-grid{grid-template-columns:1fr;gap:36px;}
  body .agr-mem-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* ════════════════════════════════════════════════════════════
   Phone
════════════════════════════════════════════════════════════ */
@media (max-width:767px){
  body .agr-section{padding:48px 0;}
  /* g-5 rows (48px gutter) stick out 12px past the screen on phones */
  body .agr-wrap .row.g-5{--bs-gutter-x:1.5rem;--bs-gutter-y:2rem;}
  body .agr-section .text-center.mb-5,
  body .agr-section .text-center.mb-4{margin-bottom:26px!important;}
  body .agr-section .agr-heading{font-size:1.5rem!important;}
  body .agr-chip{font-size:10px;margin-bottom:10px;}

  /* Hero — extra bottom shade so the title stays readable over busy photos */
  body .agr-hero{padding:84px 0 32px;}
  body .agr-hero::after{content:'';position:absolute;inset:0;z-index:1;pointer-events:none;background:rgba(15,23,42,.5);}
  body .agr-hero__title{font-size:1.85rem;margin-bottom:20px;}
  body .agr-hero__badge{font-size:11px;padding:5px 11px;}
  body .agr-hero .d-flex.flex-wrap.gap-2.mb-3{gap:6px!important;margin-bottom:14px!important;}
  body .agr-apply-card{padding:22px 18px;margin-top:8px;}

  /* Stats: two per row */
  body .agr-statcards{padding:28px 0;}
  body .agr-statcards .row{--bs-gutter-x:12px;--bs-gutter-y:12px;}
  body .agr-stat-card{padding:18px 12px;}
  body .agr-stat-card h4{font-size:1.65rem;}
  body .agr-stat-card span{font-size:12px;}

  body .agr-prog-nav__list .nav-link{padding:13px 12px;font-size:12.5px;}

  /* Cards breathe less on small screens */
  body .agr-hl-card,
  body .agr-lab-card{padding:20px 18px;}
  body #agr-labs .col-lg-4,
  body #agr-labs .col-md-6{margin-bottom:0;}
  body .agr-alumni-photo,
  body .agr-alumni-ini{height:150px;}
  body .agr-alumni-ini{font-size:2.2rem;}
  body .agr-alumni-info{padding:12px 10px 14px;}
  body .agr-ev-tabs{display:flex;width:100%;}
  body .agr-ev-tabs .nav-item{flex:1;}
  body .agr-ev-tabs .nav-link{width:100%;font-size:13px;padding:8px 10px;}

  /* Faculty tiles */
  .agr-fac-stats{gap:10px;}
  .agr-fac-stat{padding:14px 12px;gap:10px;flex-direction:column;align-items:flex-start;}
  .agr-fac-stat__ico{width:38px;height:38px;flex-basis:38px;font-size:17px;}
  .agr-fac-stat strong{font-size:1.4rem;}
  .agr-fac-stat:last-child{flex-direction:row;align-items:center;}

  /* Tables become stacked cards */
  body .agr-rtable{border:0;background:transparent;box-shadow:none;border-radius:0;overflow:visible;}
  body .agr-rtable thead{display:none;}
  body .agr-rtable tbody{display:block;}
  body .agr-rtable tbody tr{display:flex;flex-direction:column;background:#fff;border:1px solid var(--pro-line);border-radius:12px;padding:14px 16px;margin-bottom:12px;box-shadow:var(--pro-card-shadow);}
  body .agr-rtable tbody tr[style*="none"]{display:none!important;}
  /* tr:nth-child(n) lifts these above the desktop zebra/hover rules */
  body .agr-rtable tbody tr:nth-child(n) td{display:flex;gap:12px;align-items:baseline;padding:5px 0;border:0;background:transparent;max-width:none!important;font-size:13px;}
  body .agr-rtable tbody tr:nth-child(n) td::before{content:attr(data-label);flex:0 0 104px;font-size:10.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:#94a3b8;}
  body .agr-rtable tbody tr:nth-child(n) td.agr-td-num{display:none;}
  body .agr-rtable tbody tr:nth-child(n) td.agr-td-title{order:-1;display:block;font-size:14px!important;font-weight:600;line-height:1.45;padding:0 0 10px;margin-bottom:6px;border-bottom:1px dashed var(--pro-line);}
  body .agr-rtable tbody tr:nth-child(n) td.agr-td-title::before{display:none;}
  body .agr-rtable tbody td small{font-size:13px;}

  /* Collaborations */
  .agr-collab-list{grid-template-columns:1fr;gap:10px;}
  body .agr-mem-grid{grid-template-columns:1fr;}
}

@media (max-width:400px){
  body .agr-hero__title{font-size:1.65rem;}
  body .agr-rtable tbody td::before{flex-basis:92px;}
}
