/* ==========================================================
   Aritra Hazra — academic homepage stylesheet
   One file shared by all pages (index, background, teaching,
   research, project, recognition, service).
   ========================================================== */

:root {
  --ink: #1f2328;
  --muted: #5b636e;
  --line: #e3e0da;
  --line-soft: #efece6;
  --paper: #fbfaf7;
  --card: #ffffff;
  --accent: #7a1f2b;          /* deep maroon */
  --accent-soft: #f6eeee;
  --accent-line: #ead7d8;
  --link: #1d4e89;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .15s, color .15s, background .15s; }
a:hover { border-bottom-color: currentColor; }
a:has(img) { border-bottom: 0; }
img { max-width: 100%; height: auto; }

.wrap, .container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header: campus banner with the navigation tabs along its bottom edge ---------- */
:root { --banner-h: 230px; --tab-h: 50px; }
header.site {
  position: sticky; top: calc(var(--tab-h) - var(--banner-h)); z-index: 20;
  border-bottom: 4px solid var(--accent);
}
.banner {
  position: relative; height: var(--banner-h);
  background: #2b2f36 url("../images/iitkgp-banner.jpg") center 42% / cover no-repeat;
  display: flex; flex-direction: column; justify-content: space-between;
}
.banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(15,18,24,.68) 0%, rgba(15,18,24,.18) 45%, rgba(15,18,24,.15) 62%, rgba(15,18,24,.78) 100%);
}
.banner-title { position: relative; width: 100%; padding-top: 26px; }
.brand {
  font-family: var(--serif); font-size: 42.5px; font-weight: 600; line-height: 1.1;
  color: #fff; letter-spacing: .3px; border: 0; white-space: nowrap;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.brand:hover { color: #fff; border: 0; opacity: .92; }
.brand-sub {
  margin: 6px 0 0; color: rgba(255,255,255,.92); font-size: 20px; letter-spacing: .3px;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
.tabbar { position: relative; height: var(--tab-h); }
.tabbar-inner { height: 100%; display: flex; align-items: flex-end; position: relative; }
nav.primary ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
nav.primary a {
  display: block; padding: 0 20px; height: 42px; line-height: 42px; border: 0;
  font-size: 18px; font-weight: 500; letter-spacing: .4px;   /* same size and weight as the section chips (.page-toc) */
  color: rgba(255,255,255,.92); border-radius: 6px 6px 0 0;
  background: rgba(255,255,255,.10); backdrop-filter: blur(2px);
}
nav.primary a:hover { color: #fff; background: rgba(255,255,255,.24); border: 0; }
nav.primary a.active { color: #fff; background: var(--accent); }
.nav-toggle {
  display: none; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.4); border-radius: 4px;
  padding: 7px 10px; margin-bottom: 7px; cursor: pointer; color: #fff;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: currentColor; margin: 4px 0; }

/* ---------- Page heading (inner pages) ---------- */
.page-head { background: var(--card); border-bottom: 1px solid var(--line); padding: 34px 0 30px; }
.crumbs { font-size: 15px; letter-spacing: .4px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span.sep { margin: 0 8px; color: #b8b2a8; }
.page-head h1 { font-family: var(--serif); font-size: 49px; font-weight: 600; line-height: 1.1; margin: 0; }
.page-toc { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.page-toc a {
  display: inline-block; font: 500 18px/1.4 var(--sans); padding: 7px 20px; border-radius: 999px;   /* same size as the Research group button */
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
.page-toc a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Content sections (carried over from the original pages) ---------- */
main.content { padding: 8px 0 56px; }
main.content > .about,
main.content > .team { padding: 44px 0 12px; scroll-margin-top: 70px; }
main.content > .about + .about,
main.content > .about + .team,
main.content > .team + .about,
main.content > .team + .team { border-top: 1px solid var(--line); }

main.content > div > .container > h3 {
  font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.2;
  margin: 0 0 14px; display: flex; align-items: center; gap: 16px;
}
main.content > div > .container > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }

p.qui {
  margin: 0 0 26px; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--muted);
}
p.qui i { color: var(--ink); opacity: .85; }

/* Grid columns used by the original markup */
.about-grids { display: flex; flex-wrap: wrap; gap: 28px 36px; align-items: flex-start; margin-bottom: 24px; }
.about-grids > * { min-width: 0; }
.about-grids > .col-md-12, .about-grids > .panel-group, .about-grids > div:not([class*="col-md"]):not(.clearfix) { flex: 1 1 100%; }
.about-grids > [class*="col-md"] { flex: 1 1 0; }
/* a column that only holds a picture stays narrow so the text beside it gets the room */
.about-grids > .col-md-12 { flex: 1 1 100%; }
.about-grids > [class*="col-md"]:has(> img) { flex: 0 0 250px; }
#research-areas .about-grids > [class*="col-md"]:has(> img) { flex: 0 0 40%; }
/* long reference lists read better full-width than squeezed side by side */
#publications .about-grids > .col-md-6,
#student-supervision .about-grids > [class*="col-md"]:not(:has(> img)) { flex: 1 1 0; }
#publications .about-grids > .col-md-6 { flex-basis: 100%; }
.about-grids > .clearfix { display: none; }
.about-grids > h4, .about-grids > li, .about-grids > ul, .about-grids > br, .about-grids > p { flex: 1 1 100%; }
.about-grids > br { display: none; }
center { display: block; text-align: center; }

/* Images inside content */
.about-grids img.img-responsive,
.about-grids img.circle {
  display: block; margin: 0 auto; border-radius: var(--radius);
  border: 1px solid var(--line); box-shadow: 0 12px 28px -20px rgba(0,0,0,.4);
  background: #eee;
}
.panel-body img { border: 0; box-shadow: none; vertical-align: middle; }

/* Panels / accordions */
.panel-group { margin: 0 0 14px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  margin: 0 0 12px; overflow: hidden;
}
.panel-heading { margin: 0; padding: 0; }
h4.panel-title { margin: 0; font-family: var(--sans); font-size: 18px; font-weight: 600; line-height: 1.4; }
h4.panel-title a {
  display: flex; align-items: baseline; gap: 10px; padding: 13px 18px;
  color: var(--accent); border: 0; cursor: pointer; font-style: normal;
}
h4.panel-title a:hover { background: var(--accent-soft); color: #5e1520; }
h4.panel-title a::before {
  content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-right: 2px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-2px) rotate(45deg); transition: transform .2s;
}
h4.panel-title a.collapsed::before { transform: translateY(0) rotate(-45deg); }
h4.panel-title a b { font-weight: 600; }
.glyphicon { display: none; }

.panel-collapse.collapse { display: none; }
.panel-collapse.collapse.in { display: block; }
.panel-heading + .panel-collapse > .panel-body { border-top: 1px solid var(--line-soft); }
.panel-body { padding: 16px 20px; overflow-x: auto; }
.panel-body > h3 { font-family: var(--serif); font-size: 25.5px; font-weight: 600; margin: 0; color: var(--accent); }

/* Nested accordions (e.g. year-wise / category-wise publication lists) */
.panel-body .panel-heading { border: 1px solid var(--line-soft); border-radius: 6px; margin: 0 0 8px; background: var(--paper); }
.panel-body .panel-heading h4.panel-title a { padding: 9px 14px; font-size: 17px; }
.panel-body .panel-collapse { margin: -4px 0 12px; padding: 6px 0 0 4px; }
.panel-body .panel-collapse > .panel-body { border-top: 0; padding: 4px 0 4px 6px; }

/* Text inside panels */
dd { margin: 0; }
.panel-body h4, .about-grids > h4 { font-family: var(--sans); font-size: 18px; font-weight: 600; line-height: 1.45; margin: 4px 0 6px; }
.panel-body ul { padding-left: 22px; margin: 6px 0; }
.panel-body li { margin: 0 0 4px; }
.panel-body li::marker { color: var(--accent); }
/* list items written without a surrounding <ul> (Services, Patents) */
.panel-body > li, .about-grids > li { margin-left: 22px; padding-left: 4px; }
.about-grids:has(> li) { display: block; }
.about-grids > li { list-style: disc; margin-bottom: 2px; }
.about-grids > li::marker, .panel-body > li::marker { color: var(--accent); }
font[color] { font-weight: 600; }

/* Tables (courses, talks, TA-ships) */
.panel-body table {
  width: 100%; border-collapse: collapse !important; border: 1px solid var(--line) !important;
  font-size: 16.5px; line-height: 1.45; margin: 6px 0 14px; background: var(--card);
}
.panel-body td, .panel-body th { border: 1px solid var(--line) !important; padding: 8px 12px; vertical-align: top; }
.panel-body td[bgcolor] { background: var(--accent-soft) !important; color: var(--accent); }
.panel-body tr:nth-child(even) td:not([bgcolor]) { background: #fcfbf9; }

/* Expand / collapse all (added by script) */
.section-tools { display: flex; gap: 8px; justify-content: flex-end; margin: 0 0 10px; }
.about-grids > .section-tools.row { flex: 1 1 100%; margin: 0 0 -16px; }
/* same look as the section chips under each page title */
.section-tools button {
  font: 500 15px var(--sans); color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.section-tools button:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- Home page ---------- */
main.home { padding: 48px 0 64px; }
.grid { display: grid; grid-template-columns: 350px 1fr; gap: 56px; align-items: start; }
aside.profile { position: sticky; top: 100px; }
.portrait {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block;
  border-radius: 6px; border: 1px solid var(--line);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.35); background: #eee;
}
.profile h2 { font-family: var(--serif); font-size: 27.5px; font-weight: 600; margin: 22px 0 2px; line-height: 1.2; }
.profile .role { color: var(--accent); font-weight: 600; font-size: 16px; letter-spacing: .3px; }
.profile .affil { color: var(--muted); font-size: 15.5px; line-height: 1.5; margin-top: 2px; white-space: nowrap; }
.interest-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.interest-list li {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 12px 16px; font-size: 18px; font-weight: 500;
}
.social { list-style: none; padding: 0; margin: 18px 0 0; display: flex; gap: 10px; }
.social a {
  display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--card);
}
.social a:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.social svg { width: 17px; height: 17px; fill: currentColor; }

.eyebrow { font-family: var(--serif); font-style: italic; font-size: 23.5px; color: var(--accent); margin: 0 0 6px; font-weight: 500; }
h1.page-title { font-family: var(--serif); font-size: 47px; font-weight: 600; line-height: 1.15; margin: 0 0 22px; }
.lead p { font-size: 19px; margin: 0 0 16px; }
.interests { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.interests li {
  font-size: 15px; font-weight: 500; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
}
section.block { margin-top: 52px; }
section.block h3 {
  font-family: var(--serif); font-size: 30px; font-weight: 600; margin: 0 0 18px;
  display: flex; align-items: center; gap: 16px;
}
section.block h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
blockquote.epigraph {
  margin: 0 0 22px; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent);
  font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--muted);
}
blockquote.epigraph cite { font-style: normal; font-family: var(--sans); font-size: 16px; display: block; margin-top: 4px; }
.bio p { text-align: justify; hyphens: auto; margin: 0 0 14px; }
.aside-note { font-style: italic; color: var(--muted); font-size: 17px; }

/* Contact card (home) and contact band (footer of inner pages) */
.contact-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px;
}
.contact-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; }
.contact-card dt { font-weight: 600; font-size: 14.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.contact-card dd { margin: 0; }
.contact-card .muted { color: var(--muted); font-size: 16px; }
.contact-card address { font-style: normal; line-height: 1.65; }
.contact-card .label { font-weight: 600; font-size: 14.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.contact-card .official { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; font-weight: 600; word-break: break-all; }
.contact-card .social { margin-top: 14px; }

.contact-band { background: #f4f1ec; border-top: 1px solid var(--line); padding: 40px 0; }
.contact-band h2 { font-family: var(--serif); font-size: 27.5px; font-weight: 600; margin: 0 0 16px; }

/* ---------- Footer ---------- */
/* Slim footer bar that stays pinned to the bottom, mirroring the header */
footer.site {
  position: sticky; bottom: 0; z-index: 20;
  background: #4a1a1f; border-top: 1px solid #3a1418;   /* dark brown bar */
  border-bottom: 4px solid var(--accent);
  padding: 12px 0;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.copyright { font-style: italic; font-weight: 600; color: #fff; font-size: 15px; }

.to-top {
  position: fixed; right: 20px; bottom: 72px; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 0; cursor: pointer; font-size: 19px;
  box-shadow: 0 8px 20px -10px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: .9; pointer-events: auto; }
.to-top:hover { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  nav.primary a { padding: 0 12px; font-size: 16.5px; }
}
@media (max-width: 920px) {
  .grid { grid-template-columns: 1fr; gap: 36px; }
  .about-grids > [class*="col-md"]:has(> img) { flex: 1 1 100% !important; }
  aside.profile { position: static; display: grid; grid-template-columns: 160px 1fr; gap: 22px; align-items: center; }
  .profile h2 { margin-top: 0; }
  .contact-card { grid-template-columns: 1fr; }
  .about-grids > [class*="col-md"] { flex: 1 1 100% !important; }
  .about-grids img.img-responsive, .about-grids img.circle { max-width: 420px; }
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  nav.primary { display: none; position: absolute; left: -24px; right: -24px; top: calc(100% + 4px); background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 12px 20px -16px rgba(0,0,0,.3); }
  nav.primary.open { display: block; }
  nav.primary ul { flex-direction: column; padding: 8px 24px 14px; gap: 0; }
  nav.primary a { padding: 0 12px; height: 44px; line-height: 44px; font-size: 18px; color: var(--muted); background: none; border-radius: 0; backdrop-filter: none; }
  nav.primary a:hover { color: var(--accent); background: var(--accent-soft); }
  nav.primary a.active { color: var(--accent); background: none; box-shadow: inset 3px 0 0 var(--accent); }
  .tabbar-inner { align-items: center; }
  .nav-toggle { margin-bottom: 0; }
}
@media (max-width: 560px) {
  .wrap, .container { padding: 0 16px; }
  nav.primary { left: -16px; right: -16px; }
  :root { --banner-h: 170px; }
  .brand { font-size: 32px; }
  .brand-sub { font-size: 16px; white-space: normal; }
  .banner-title { padding-top: 18px; }
  body { font-size: 17px; }
  h1.page-title, .page-head h1 { font-size: 36px; }
  main.content > div > .container > h3 { font-size: 27.5px; }
  p.qui { font-size: 18px; }
  aside.profile { grid-template-columns: 1fr; }
  .portrait { max-width: 240px; }
  .contact-card { padding: 20px; }
  .contact-card dl { grid-template-columns: 1fr; gap: 2px 0; }
  .contact-card dd { margin-bottom: 10px; }
  .panel-body { padding: 14px 14px; }
  h4.panel-title a { padding: 12px 14px; }
}
@media print {
  .banner::before, .tabbar, .nav-toggle, .social, .section-tools, .to-top, .page-toc { display: none !important; }
  aside.profile { position: static; }
  body { background: #fff; }
  .panel-collapse.collapse { display: block !important; }
}

/* ---------- Recognitions: compact list ---------- */
#recognitions-and-awards .about-grids { gap: 0; }
#recognitions-and-awards .about-grids > div:first-child img { max-width: 560px; max-height: 300px; width: auto; }
#recognitions-and-awards .about-grids > div:first-child br { display: none; }
#recognitions-and-awards .about-grids > div:first-child { margin-bottom: 24px; }
#recognitions-and-awards .panel-group { margin: 0; }
#recognitions-and-awards .panel {
  margin: 0; border-radius: 0; border-width: 0 0 1px; background: transparent;
}
#recognitions-and-awards .panel-group:first-of-type .panel { border-top: 1px solid var(--line); }
#recognitions-and-awards .panel-body { padding: 10px 6px; }
#recognitions-and-awards .panel-body h4 { margin: 0; font-size: 17.5px; font-weight: 400; line-height: 1.5; }
#recognitions-and-awards .panel-body h4 b { color: var(--accent); font-weight: 700; display: inline-block; min-width: 44px; }
#recognitions-and-awards .panel:hover { background: var(--accent-soft); }

/* ---------- Keep short lines on one line at full width ---------- */
@media (min-width: 1100px) {
  .panel-body td.nw { white-space: nowrap; }
}

@media print {
  header.site { position: static; border: 0; }
  .banner { height: auto; background: none; }
  .brand, .brand-sub { color: #000; text-shadow: none; }
}

/* ---------- Compact lists (all pages) ---------- */
.panel-body { line-height: 1.5; }
.panel-body h4 + br, .panel-body dd + br { display: none; }
.entry-gap { display: block; height: 0; margin: 8px 0; border-top: 1px dashed var(--line); }
.group-gap { display: block; height: 14px; }
.panel-body dd > .entry-gap:last-child, .panel-body dd > br + .entry-gap:last-child { display: none; }
/* list items written without a <ul> (e.g. Services): no bullets, thin dividers */
.panel-body > li { list-style: none; margin: 0; padding: 2px 0; }
.panel-body > li + li { border-top: 1px dashed var(--line-soft); }
.panel-body > h4 { margin: 2px 0 4px; }
.panel-body > h4:not(:first-child) { margin-top: 14px; }
/* short single-entry boxes (Experience, IIT-Madras semesters): tighter */
.about-grids .panel-group { margin-bottom: 10px; }
.about-grids .panel-group > .panel { margin-bottom: 0; }
.panel-collapse.in > .panel-body:only-child { padding: 12px 18px; }

/* Experience (Background) and IIT-Madras semesters (Teaching): stacked entries share one card */
:is(#experience, #all-courses-taught-cse-iit-madras) .panel-group:not(:has(h3)):has(+ .panel-group) { margin-bottom: 0; }
:is(#experience, #all-courses-taught-cse-iit-madras) .panel-group:not(:has(h3)):has(+ .panel-group) > .panel { border-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
:is(#experience, #all-courses-taught-cse-iit-madras) .panel-group:not(:has(h3)) + .panel-group:not(:has(h3)) > .panel { border-top: 1px dashed var(--line); border-top-left-radius: 0; border-top-right-radius: 0; }
:is(#experience, #all-courses-taught-cse-iit-madras) .panel-body h4 { margin: 0 0 2px; }
/* ---------- All h4 headings in brown (dropdown titles, entry titles, award lines) ---------- */
:root { --brown: #6b3e26; --brown-dark: #4e2c1a; }
h4, h4 a, h4 b, h4 i, h4 font,
h4.panel-title a { color: var(--brown); }
h4.panel-title a:hover { color: var(--brown-dark); }
/* ...except on the Recognitions page, which keeps its own colours: dark text, blue links, maroon years */
#recognitions-and-awards h4, #recognitions-and-awards h4 i, #recognitions-and-awards h4 font { color: var(--ink); }
#recognitions-and-awards h4 a { color: var(--link); }
#recognitions-and-awards .panel-body h4 b { color: var(--accent); }
