/* =====================================================
   domain.css  –  Shared styles for all domain pages
   MEMBER Lab, IIT Kharagpur
   ===================================================== */

/* ---------- Global reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1a2a4a;
  --navy-mid:    #1e3461;
  --accent:      #c97d2e;
  --accent-warm: #e09040;
  --accent-teal: #3ab5b0;
  --light-bg:    #f4f4f0;
  --card-bg:     #ffffff;
  --text:        #2c2c2c;
  --text-muted:  #666;
  --border:      #e2e2e2;
  --radius:      12px;
  --transition:  0.25s ease;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--light-bg);
  line-height: 1.65;
}

a { text-decoration: none; color: inherit; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- TOP BAR ---------- */
.topbar {
  background: var(--navy);
  color: #cdd8ea;
  font-size: 0.78rem;
  padding: 6px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar a { color: #cdd8ea; margin-left: 18px; transition: color var(--transition); }
.topbar a:hover { color: var(--accent-warm); }
.topbar i { margin-right: 5px; }

/* ---------- HEADER ---------- */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--border);
  padding: 12px 32px;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1140px;
  margin: 0 auto;
}
.header-left  { display: flex; align-items: center; gap: 14px; }
.header-right { display: flex; align-items: center; }
.inst-logo    { height: 60px; width: auto; }
.inst-text    { display: flex; flex-direction: column; gap: 2px; }
.inst-hindi   { font-size: 0.78rem; color: #888; }
.inst-text strong  { font-size: 1rem; color: var(--navy); font-family: 'DM Sans', sans-serif; font-weight: 600; }
.dept-label   { font-size: 0.7rem; color: var(--accent); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lab-logo     { height: 52px; width: auto; }

/* ---------- NAVIGATION ---------- */
.main-nav {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
}
.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}
.main-nav ul li a {
  display: block;
  padding: 14px 16px;
  color: #c8d4e8;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition), background var(--transition);
}
.main-nav ul li a:hover,
.main-nav ul li a.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* ---------- DOMAIN HERO ----------
   FIX: Changed fixed height:340px → min-height:360px so the hero never
   collapses when content is tall, and flex-end alignment always has room.
   Without a real background-image the hero was invisible against the nav
   (both navy). Each domain class now supplies a CSS gradient fallback so
   the section is always visually distinct even before photos are added.
------------------------------------------------- */
.domain-hero {
  position: relative;
  min-height: 360px;                       /* was: height:340px — caused collapse */
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--navy-mid) center/cover no-repeat;
}

/* Per-domain hero tint colour + CSS gradient fallback (used when image is missing) */
.batteries-hero {
  --hero-tint: #c97d2e;
  background-image: url('../images/batteries-hero.jpg'),
    linear-gradient(135deg, #2a1a0a 0%, #1e3461 40%, #3a2010 100%);
}
.fuel-hero {
  --hero-tint: #2e8bc9;
  background-image: url('../images/fuel-hero.jpg'),
    linear-gradient(135deg, #0a1a2a 0%, #1e3461 40%, #0a2a3a 100%);
}
.biomedical-hero {
  --hero-tint: #3ab5b0;
  background-image: url('../images/biomedical-hero.jpg'),
    linear-gradient(135deg, #0a2a2a 0%, #1e3461 40%, #103030 100%);
}
.energy-hero {
  --hero-tint: #5a9e4a;
  background-image: url('../images/energy-hero.jpg'),
    linear-gradient(135deg, #0a1f0a 0%, #1e3461 40%, #122a12 100%);
}

.domain-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(26,42,74,0.88) 0%,
    rgba(26,42,74,0.55) 60%,
    transparent 100%
  );
}

.domain-hero-content {
  position: relative;
  z-index: 2;
  padding: 40px 48px 52px;               /* extra bottom pad lifts content off edge */
  max-width: 640px;
  color: #fff;
}

.domain-tag {
  display: inline-block;
  background: var(--hero-tint, var(--accent));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.domain-hero-content h1 {
  font-family: 'Crimson Pro', serif;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
}

.domain-hero-content p {
  font-size: 1rem;
  color: rgba(255,255,255,0.82);
  max-width: 480px;
}

/* ---------- ABOUT SECTION ---------- */
.domain-about {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 48px;
  align-items: start;
  padding-top: 60px;
  padding-bottom: 60px;
}

.domain-about-text h2 {
  font-family: 'Crimson Pro', serif;
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 16px;
}

.domain-about-text p {
  color: var(--text-muted);
  font-size: 0.97rem;
  margin-bottom: 24px;
  max-width: 580px;
}

.domain-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.domain-highlights li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy);
}

.domain-highlights li i {
  color: var(--accent);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* Image / placeholder in about */
.domain-about-img { width: 100%; }

.img-placeholder {
  width: 100%;
  height: 260px;
  background: #e8eaed;
  border: 2px dashed #b8bcc4;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #999;
  font-size: 0.85rem;
}

.img-placeholder i {
  font-size: 2rem;
  opacity: 0.4;
}

.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---------- SECTION HEADING ---------- */
.section-heading {
  font-family: 'Crimson Pro', serif;
  font-size: 1.85rem;
  color: var(--navy);
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--accent);
  display: inline-block;
}

/* ---------- GALLERY ---------- */
.domain-gallery {
  padding-bottom: 60px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  height: 200px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

/* When gallery-item is also an img-placeholder (no real image yet) */
.gallery-item.img-placeholder {
  flex-direction: column;
  gap: 6px;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.4s ease;
}

.gallery-item:hover img { transform: scale(1.05); }

/* ---------- TEAM MEMBERS ---------- */
.domain-team {
  padding-bottom: 70px;
}

.team-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.team-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  border-left: 4px solid var(--accent);
}

.team-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.13);
  transform: translateY(-2px);
}

.team-card-img {
  flex-shrink: 0;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #f0f3f8;
  border-right: 1px solid var(--border);
}

.team-card-img img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}

.avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #dde3ed;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9aa5b8;
  font-size: 2.4rem;
}

.team-card-info {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.member-project {
  font-family: 'Crimson Pro', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 10px;
}

.team-card-info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.team-card-info p strong { color: var(--text); }

.member-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
}

.member-email {
  font-size: 0.82rem;
  color: var(--accent);
  transition: color var(--transition);
}

.member-email:hover { color: var(--navy); text-decoration: underline; }

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--navy);
  color: #c0cde0;
  padding-top: 48px;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

.footer-brand { display: flex; flex-direction: column; gap: 12px; }

.footer-logo-wrap { display: flex; align-items: center; gap: 12px; }
.footer-logo { height: 52px; width: auto; }

.footer-lab-name {
  font-family: 'Crimson Pro', serif;
  font-size: 1.25rem;
  color: #fff;
  font-weight: 600;
}

.footer-brand p { font-size: 0.82rem; color: #9aafcc; }

.footer-socials {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.footer-socials a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0cde0;
  font-size: 0.88rem;
  transition: background var(--transition), color var(--transition);
}

.footer-socials a:hover {
  background: var(--accent);
  color: #fff;
}

.footer-links h4,
.footer-contact h4 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 16px;
}

.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links ul li a {
  font-size: 0.88rem;
  color: #9aafcc;
  transition: color var(--transition);
}
.footer-links ul li a:hover { color: #fff; }

.footer-contact p {
  font-size: 0.86rem;
  color: #9aafcc;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.footer-contact p i {
  color: var(--accent-warm);
  margin-top: 3px;
  width: 14px;
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: #6a80a0;
}

.footer-bottom a { color: var(--accent-warm); transition: color var(--transition); }
.footer-bottom a:hover { color: #fff; }

/* ---------- DOMAIN CARDS on index (home) ---------- */
.domain-cards-section {
  padding: 70px 0;
  background: var(--light-bg);
}

.domain-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.domain-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.domain-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.13);
}

.domain-card.featured {
  border-top: 4px solid var(--accent);
}

.domain-card-img {
  height: 160px;
  background: #e0e4ea center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 0.8rem;
}

.domain-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.domain-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.domain-card-body h3 {
  font-family: 'Crimson Pro', serif;
  font-size: 1.15rem;
  color: var(--navy);
  font-weight: 700;
}

.domain-card-body p {
  font-size: 0.84rem;
  color: var(--text-muted);
  flex: 1;
}

.domain-card-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap var(--transition), color var(--transition);
  margin-top: 4px;
}

.domain-card:hover .domain-card-link {
  gap: 9px;
  color: var(--navy);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .domain-about        { grid-template-columns: 1fr; }
  .gallery-grid        { grid-template-columns: repeat(2, 1fr); }
  .footer-inner        { grid-template-columns: 1fr 1fr; }
  .domain-cards-grid   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .domain-hero-content h1  { font-size: 2rem; }
  .gallery-grid            { grid-template-columns: 1fr; }
  .footer-inner            { grid-template-columns: 1fr; }
  .team-card               { flex-direction: column; }
  .team-card-img           { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .domain-cards-grid       { grid-template-columns: 1fr; }
  .topbar                  { flex-direction: column; align-items: flex-start; gap: 4px; }
}